@amplitude/unified 1.0.0-beta.8 → 1.0.0-feat-zoning.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +3 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/unified-client-factory.d.ts.map +1 -1
- package/lib/cjs/unified-client-factory.js +1 -3
- package/lib/cjs/unified-client-factory.js.map +1 -1
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.d.ts.map +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/version.js.map +1 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/unified-client-factory.d.ts.map +1 -1
- package/lib/esm/unified-client-factory.js +1 -3
- package/lib/esm/unified-client-factory.js.map +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.d.ts.map +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/scripts/amplitude-min.umd.js +1 -1
- package/lib/scripts/amplitude-min.umd.js.gz +0 -0
- package/lib/scripts/index.d.ts +1 -1
- package/lib/scripts/index.d.ts.map +1 -1
- package/lib/scripts/unified-client-factory.d.ts.map +1 -1
- package/lib/scripts/version.d.ts +1 -1
- package/lib/scripts/version.d.ts.map +1 -1
- package/package.json +10 -5
|
@@ -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{!function(e){e.value instanceof d?Promise.resolve(e.value.v).then(l,u):c(o[0][2],e)}(i[e](t))}catch(e){c(o[0][3],e)}}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="$default_instance",b="https://api2.amplitude.com/2/httpapi",w="dclid",S="fbclid",C="gbraid",I="gclid",x="ko_click_id",k="li_fat_id",E="msclkid",O="rdt_cid",A="ttclid",T="twclid",R="wbraid",P={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,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},_=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],M=["authorization","cookie","set-cookie"],N=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var r=e[t];if(!D(t,r))return!1}return!0},D=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&&N(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 N(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},L=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||D(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 F,U=[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"}(F||(F={}));var j,B=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=F.Unknown),{event:e,code:t,message:r}},z=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},q=h([],c(Array(256).keys()),!1).map((function(e){return e.toString(16).padStart(2,"0")})),V=function(e){var t,r=z();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,V)}(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(q[n]):q[n]})).join("")},W=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}))?(this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2]):(void 0===e.name&&(e.name=V(),this.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],this.loggerProvider.log("Timeline.apply: Initial event",r),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 this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(m.name),"', event: ").concat(JSON.stringify(r))),i({event:r,code:0,message:""}),[2];r=v,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(m.name),"', event: ").concat(JSON.stringify(r))),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 this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(m.name),"', event: ").concat(JSON.stringify(r))),i({event:r,code:0,message:""}),[2];r=v,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(m.name),"', event: ").concat(JSON.stringify(r))),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})),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(r))),w=b.map((function(e){var t=o({},r);return e.execute(t).catch((function(e){return B(t,0,String(e))}))})),Promise.all(w).then((function(e){var t=c(e,1)[0]||B(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}(),K=function(e,t){return o(o({},t),{event_type:i.IDENTIFY,user_properties:e.getUserProperties()})},G=function(e){return{promise:e||Promise.resolve()}},J=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 W(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),this.timeline.loggerProvider=this.config.loggerProvider,[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 G(this.dispatch(n))},e.prototype.identify=function(e,t){var r=K(e,t);return G(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 G(this.dispatch(s))},e.prototype.setGroup=function(e,t,r){var n=function(e,t,r){var n,s=new L;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 G(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 G(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),G())},e.prototype._addPlugin=function(e){return G(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)),G())},e.prototype._removePlugin=function(e){return G(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(B(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])})),U.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,B(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=B(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 G(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}(),Y=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 N(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?o({},this.properties):{};return e[j.REVENUE_PRODUCT_ID]=this.productId,e[j.REVENUE_QUANTITY]=this.quantity,e[j.REVENUE_PRICE]=this.price,e[j.REVENUE_TYPE]=this.revenueType,e[j.REVENUE_CURRENCY]=this.currency,e[j.REVENUE]=this.revenue,e[j.RECEIPT]=this.receipt,e[j.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"}(j||(j={}));var Z;!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"}(Z||(Z={}));var H="Amplitude Logger ",$=function(){function e(){this.logLevel=Z.None}return e.prototype.disable=function(){this.logLevel=Z.None},e.prototype.enable=function(e){void 0===e&&(e=Z.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Z.Verbose||console.log("".concat(H,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Z.Warn||console.warn("".concat(H,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Z.Error||console.error("".concat(H,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Z.Debug||console.log("".concat(H,"[Debug]: ").concat(e.join(" ")))},e}(),X=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:y,logLevel:Z.Warn,loggerProvider:new $,offline:!1,optOut:!1,serverUrl:b,serverZone:"US",useBatch:!1}},Q=function(){function e(e){var t,r,n,i;this._optOut=!1;var o=X();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=te(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}(),ee=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":b},te=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=X().serverZone),void 0===r&&(r=X().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:X().serverZone;return{serverZone:n,serverUrl:ee(n,r)}},re=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function ne(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var ie=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=V()),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 re,l.label=1;case 1:return l.trys.push([1,3,,4]),n=te(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(ne(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:F.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 F.Success:this.handleSuccessResponse(e,t);break;case F.Invalid:this.handleInvalidResponse(e,t);break;case F.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case F.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(ne(e));var s=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(s)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(ne(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(ne(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(B(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}(),oe=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:se(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),se=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},ae=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}(),le=function(){return le=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},le.apply(this,arguments)};function ue(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 ce(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 he=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=ue(["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(!he(u,c))return!1;var h=!0;return Object.keys(e).forEach((function(r){he(e[r],t[r])||(h=!1)})),h}for(var d=0;d<e.length;d++)if(!he(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 de,pe=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=le({},this.identity.userProperties),r=le(le({},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=ue(Object.entries(e)),c=u.next();!c.done;c=u.next()){var h=ce(c.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(i=void 0,ue(Object.entries(p))),g=f.next();!g.done;g=f.next()){var m=ce(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,ue(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 le({},this.identity)},e.prototype.setIdentity=function(e){var t=le({},this.identity);this.identity=le({},e),he(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}(),fe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,ge=function(){function e(){this.identityStore=new pe,this.eventBridge=new ae,this.applicationContextProvider=new oe}return e.getInstance=function(t){return fe.analyticsConnectorInstances||(fe.analyticsConnectorInstances={}),fe.analyticsConnectorInstances[t]||(fe.analyticsConnectorInstances[t]=new e),fe.analyticsConnectorInstances[t]},e}(),me=function(e){return void 0===e&&(e=y),ge.getInstance(e)},ve=function(){function e(){this.name="identity",this.type="before",this.identityStore=me().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=me(e.instanceName).identityStore),[2]}))}))},e}(),ye=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},be=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[m,t,e.substring(0,r)].filter(Boolean).join("_")},we=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=z();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=Ce(r[0]),i=Ce(r[1]);return i?(e[n]=i,e):e}),{}):{}},Ce=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},Ie=function(e){return function(){var t=o({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},xe=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},ke=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]=xe(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}},Ee=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<Z.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}},Oe=function(e,t){return!t||!t.length||t.some((function(t){return"string"==typeof t?e===t:e.match(t)}))},Ae=function(e,t){var r=e;try{r=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return r},Te=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},Re=function(e,t){var r=Te(e.toString());return 31*Math.abs(r)%1e6/1e6<t},Pe=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}(),_e=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(!z())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=Me(r))&&void 0!==t?t:Ne(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=z(),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+"=")})),o?[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=z())&&(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}(),Me=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},Ne=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},De=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[m,t,e.substring(0,r)].filter(Boolean).join("_")},Le=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}(),Fe="tags",Ue="counters",je="histograms",Be="events",ze="internal",qe="last_flush_timestamp",Ve=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return void 0!==(null===(e=z())||void 0===e?void 0:e.indexedDB)},e.prototype.getDB=function(){return a(this,void 0,void 0,(function(){return l(this,(function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]}))}))},e.prototype.openDB=function(){var e=this;return new Promise((function(t,r){var n=indexedDB.open(e.dbName,1);n.onerror=function(){e.dbPromise=null,r(new Error("Failed to open IndexedDB"))},n.onsuccess=function(){var r=n.result;r.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},r.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),r.close()},t(r)},n.onupgradeneeded=function(t){var r=t.target.result;e.createTables(r)}}))},e.prototype.createTables=function(e){(e.objectStoreNames.contains(Fe)||e.createObjectStore(Fe,{keyPath:"key"}),e.objectStoreNames.contains(Ue)||e.createObjectStore(Ue,{keyPath:"key"}),e.objectStoreNames.contains(je)||e.createObjectStore(je,{keyPath:"key"}),e.objectStoreNames.contains(Be))||e.createObjectStore(Be,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1});e.objectStoreNames.contains(ze)||e.createObjectStore(ze,{keyPath:"key"})},e.prototype.setTags=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,o=this;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([Fe],"readwrite"),n=r.objectStore(Fe),[2,new Promise((function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tags",e),t()},i.forEach((function(e){var t=c(e,2),r=t[0],i=t[1];n.put({key:r,value:i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tag",r,i,e)}}))}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",i),[3,3];case 3:return[2]}}))}))},e.prototype.incrementCounters=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,o=this;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([Ue],"readwrite"),n=r.objectStore(Ue),[2,new Promise((function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to increment counters",e),t()},i.forEach((function(e){var t=c(e,2),r=t[0],i=t[1],s=n.get(r);s.onsuccess=function(){var e=s.result,t=e?e.value:0;n.put({key:r,value:t+i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to update counter",r,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing counter",r,e)}}))}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",i),[3,3];case 3:return[2]}}))}))},e.prototype.setHistogramStats=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,o=this;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([je],"readwrite"),n=r.objectStore(je),[2,new Promise((function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),t()},i.forEach((function(e){var t=c(e,2),r=t[0],i=t[1],s=n.get(r);s.onsuccess=function(){var e,t=s.result;e=t?{key:r,count:t.count+i.count,min:Math.min(t.min,i.min),max:Math.max(t.max,i.max),sum:t.sum+i.sum}:{key:r,count:i.count,min:i.min,max:i.max,sum:i.sum},n.put(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",r,e)}}))}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",i),[3,3];case 3:return[2]}}))}))},e.prototype.addEventRecords=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,o=this;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===e.length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([Be],"readwrite"),n=r.objectStore(Be),[2,new Promise((function(t){r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event records",e),t()};var i=n.count();i.onsuccess=function(){var t=i.result,r=Math.max(0,10-t);r<e.length&&o.logger.debug("DiagnosticsStorage: Only added ".concat(r," of ").concat(e.length," events due to storage limit")),e.slice(0,r).forEach((function(e){n.add(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event record",e)}}))},i.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",i),[3,3];case 3:return[2]}}))}))},e.prototype.setInternal=function(e,t){return a(this,void 0,void 0,(function(){var r,n,i,o;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([ze],"readwrite"),i=n.objectStore(ze),[2,new Promise((function(r,o){n.onabort=function(){return o(new Error("Failed to set internal value"))};var s=i.put({key:e,value:t});s.onsuccess=function(){return r()},s.onerror=function(){return o(new Error("Failed to set internal value"))}}))];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",o),[3,3];case 3:return[2]}}))}))},e.prototype.getInternal=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i;return l(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([ze],"readonly"),n=r.objectStore(ze),[2,new Promise((function(t,i){r.onabort=function(){return i(new Error("Failed to get internal value"))};var o=n.get(e);o.onsuccess=function(){return t(o.result)},o.onerror=function(){return i(new Error("Failed to get internal value"))}}))];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",i),[2,void 0];case 3:return[2]}}))}))},e.prototype.getLastFlushTimestamp=function(){return a(this,void 0,void 0,(function(){var e,t;return l(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getInternal(qe)];case 1:return[2,(e=r.sent())?parseInt(e.value,10):void 0];case 2:return t=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}}))}))},e.prototype.setLastFlushTimestamp=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.setInternal(qe,e.toString())];case 1:return r.sent(),[3,3];case 2:return t=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}}))}))},e.prototype.clearTable=function(e,t){return new Promise((function(r,n){var i=e.objectStore(t).clear();i.onsuccess=function(){return r()},i.onerror=function(){return n(new Error("Failed to clear table ".concat(t)))}}))},e.prototype.getAllAndClear=function(){return a(this,void 0,void 0,(function(){var e,t,r,n,i,o,s,a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=l.sent(),t=e.transaction([Fe,Ue,je,Be],"readwrite"),[4,Promise.all([this.getAllFromStore(t,Fe),this.getAllFromStore(t,Ue),this.getAllFromStore(t,je),this.getAllFromStore(t,Be)])];case 2:return r=c.apply(void 0,[l.sent(),4]),n=r[0],i=r[1],o=r[2],s=r[3],[4,Promise.all([this.clearTable(t,Ue),this.clearTable(t,je),this.clearTable(t,Be)])];case 3:return l.sent(),[2,{tags:n,counters:i,histogramStats:o,events:s}];case 4:return a=l.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",a),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}}))}))},e.prototype.getAllFromStore=function(e,t){return new Promise((function(r,n){var i=e.objectStore(t).getAll();i.onsuccess=function(){return r(i.result)},i.onerror=function(){return n(new Error("Failed to get all from ".concat(t)))}}))},e}(),We=3e5,Ke=1e4,Ge=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===r?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(n,null,2)),this.config=o({enabled:!0,sampleRate:0},n),this.startTimestamp=Date.now(),this.shouldTrack=Re(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Ve.isSupported()?this.storage=new Ve(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval()}return e.prototype.isStorageAndTrackEnabled=function(){return Boolean(this.storage)&&Boolean(this.shouldTrack)},e.prototype.setTag=function(e,t){this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryTags).length>=Ke?this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit"):(this.inMemoryTags[e]=t,this.startTimersIfNeeded()))},e.prototype.increment=function(e,t){void 0===t&&(t=1),this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryCounters).length>=Ke?this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit"):(this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()))},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled())if(Object.keys(this.inMemoryHistograms).length>=Ke)this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");else{var r=this.inMemoryHistograms[e];r?(r.count+=1,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){this.isStorageAndTrackEnabled()&&(this.inMemoryEvents.length>=10?this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit"):(this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()))},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout((function(){e.saveAllDataToStorage().catch((function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)})).finally((function(){e.saveTimer=null}))}),1e3)),this.flushTimer||(this.flushTimer=setTimeout((function(){e._flush().catch((function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)})).finally((function(){e.flushTimer=null}))}),We))},e.prototype.saveAllDataToStorage=function(){return a(this,void 0,void 0,(function(){var e,t,r,n;return l(this,(function(i){switch(i.label){case 0:return this.storage?(e=o({},this.inMemoryTags),t=o({},this.inMemoryCounters),r=o({},this.inMemoryHistograms),n=h([],c(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(r),this.storage.addEventRecords(n)])]):[2];case 1:return i.sent(),[2]}}))}))},e.prototype._flush=function(){return a(this,void 0,void 0,(function(){var e,t,r,n,i,o,s,a,u,c;return l(this,(function(l){switch(l.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return l.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return e=l.sent(),t=e.tags,r=e.counters,n=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach((function(e){o[e.key]=e.value})),s={},r.forEach((function(e){s[e.key]=e.value})),a={},n.forEach((function(e){a[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}})),u=i.map((function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}})),0===Object.keys(s).length&&0===Object.keys(a).length&&0===u.length?[2]:(c={tags:o,histogram:a,counters:s,events:u},this.fetch(c),[2])}}))}))},e.prototype.fetch=function(e){return a(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!z())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:return r.sent().ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return t=r.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}}))}))},e.prototype.initializeFlushInterval=function(){return a(this,void 0,void 0,(function(){var e,t,r;return l(this,(function(n){switch(n.label){case 0:return this.storage?(e=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return-1===(t=n.sent()||-1)?(this.storage.setLastFlushTimestamp(e),this._setFlushTimer(We),[2]):(r=e-t)>=We?(this._flush(),[2]):(this._setFlushTimer(We-r),[2])}}))}))},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout((function(){t._flush().catch((function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)})).finally((function(){t.flushTimer=null}))}),e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=Re(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),Je=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 F.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 F.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 F.PayloadTooLarge:return{status:x,statusCode:I,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case F.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 F.Timeout:default:return{status:x,statusCode:I}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?F.Success:429===e?F.RateLimit:413===e?F.PayloadTooLarge:408===e?F.Timeout:e>=400&&e<500?F.Invalid:e>=500?F.Failed:F.Unknown},e}(),Ye=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}(Je),Ze=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),He=function(){function e(e,t,r){void 0===r&&(r="US"),this.callbackInfos=[],this.apiKey=e,this.serverUrl="US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config",this.logger=t,this.storage=new Ze(e,t)}return e.prototype.subscribe=function(e,t,r){var n=V(),i={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),n},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex((function(t){return t.id===e}));return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return a(this,void 0,void 0,(function(){var e,t=this;return l(this,(function(r){switch(r.label){case 0:return[4,this.fetch()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach((function(r){t.sendCallback(r,e,"remote")})),[2]}}))}))},e.prototype.subscribeAll=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i=this;return l(this,(function(o){switch(o.label){case 0:return t=this.fetch().then((function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)})),r=this.storage.fetchConfig().then((function(e){return e})),[4,Promise.race([t,r])];case 1:return void 0!==(n=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),this.sendCallback(e,n,"cache")),[4,t];case 2:return o.sent(),[2]}}))}))},e.prototype.subscribeWaitForRemote=function(e,t){return a(this,void 0,void 0,(function(){var r,n;return l(this,(function(i){switch(i.label){case 0:r=new Promise((function(e,r){setTimeout((function(){r("Timeout exceeded")}),t)})),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.fetch(),r])];case 2:return n=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(n=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}}))}))},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=e.key?e.key.split(".").reduce((function(e,t){return null===e?e:t in e?e[t]:null}),t.remoteConfig):t.remoteConfig,e.callback(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),a(this,void 0,void 0,(function(){var r,n,i,o,s,a,u=this;return l(this,(function(c){switch(c.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},i=function(n){var i,s,a,c,h;return l(this,(function(l){switch(l.label){case 0:i=new AbortController,s=setTimeout((function(){return i.abort()}),t),l.label=1;case 1:return l.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:return(a=l.sent()).ok?[3,4]:[4,a.text()];case 3:return c=l.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(a.status,": ").concat(c)),[3,6];case 4:return[4,a.json()];case 5:return[2,{value:{remoteConfig:l.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(h=l.sent())instanceof Error&&"AbortError"===h.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),h),[3,9];case 8:return clearTimeout(s),[7];case 9:return n<e-1?[4,new Promise((function(e){return setTimeout(e,u.getJitterDelay(r))}))]:[3,11];case 10:l.sent(),l.label=11;case 11:return[2]}}))},o=this,s=0,c.label=1;case 1:return s<e?[5,i(s)]:[3,4];case 2:if("object"==typeof(a=c.sent()))return[2,a.value];c.label=3;case 3:return s++,[3,1];case 4:return[2,n]}}))}))},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}();!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(de||(de={}));var $e=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],Xe="data-amp-track-",Qe=["div","span","h1","h2","h3","h4","h5","h6"],et=h(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],c(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),tt=["*"];function rt(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function nt(e,t,r){e&&it({json:e,allowlist:t.map(ot),excludelist:r.map(ot),ancestors:[]})}function it(e){var t,r,n=e.json,i=e.targetObject,o=e.allowlist,s=e.excludelist,a=e.ancestors,l=e.parentObject,d=e.targetKey;i||(i=n);var p=Object.keys(i);try{for(var f=u(p),g=f.next();!g.done;g=f.next()){var m=g.value,v=h(h([],c(a),!1),[m],!1);rt(i[m])?at(v,o)&&!at(v,s)||delete i[m]:it({json:n,targetObject:i[m],allowlist:o,excludelist:s,ancestors:v,parentObject:i,targetKey:m})}}catch(e){t={error:e}}finally{try{g&&!g.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}0===Object.keys(i).length&&l&&d&&delete l[d]}function ot(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map((function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")}))}function st(e,t,r,n){if(void 0===r&&(r=0),void 0===n&&(n=0),n===t.length)return r===e.length;if(r===e.length){for(;n<t.length&&"**"===t[n];)n++;return n===t.length}var i=t[n];if("**"===i){if(n+1===t.length)return!0;for(var o=r;o<=e.length;o++)if(st(e,t,o,n+1))return!0;return!1}return("*"===i||i===e[r])&&st(e,t,r+1,n+1)}function at(e,t){return t.some((function(t){return st(e,t)}))}var lt=function(){function e(e){this.request=e}return e.prototype.headers=function(e){var t,r;void 0===e&&(e=[]);var n=this.request.headers,i={};if(Array.isArray(n))n.forEach((function(e){var t=c(e,2),r=t[0],n=t[1];i[r]=n}));else if(n instanceof Headers)n.forEach((function(e,t){i[t]=e}));else if("object"==typeof n&&null!==n)try{for(var o=u(Object.entries(n)),s=o.next();!s.done;s=o.next()){var a=c(s.value,2),l=a[0],h=a[1];i[l]=h}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return mt(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=z();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=ct(t,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),a(this,void 0,void 0,(function(){return l(this,(function(r){return 0===e.length?[2,null]:[2,ft(this.body,e,t)]}))}))},e}(),ut=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),mt(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return ct(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),a(this,void 0,void 0,(function(){return l(this,(function(r){return 0===e.length?[2,null]:[2,ft(this.body,e,t)]}))}))},e}();function ct(e,t){var r,n,i,o=z(),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 ht,dt=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var r=this.response.headers,n={};return null===(t=null==r?void 0:r.forEach)||void 0===t||t.call(r,(function(e,t){n[t]=e})),mt(n,{allow:e})}},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.prototype.text=function(){return a(this,void 0,void 0,(function(){var e,t;return l(this,(function(r){switch(r.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),r.label=1;case 1:return r.trys.push([1,3,,4]),e=this.clonedResponse.text(),t=new Promise((function(e){return setTimeout((function(){return e(null)}),500)})),[4,Promise.race([e,t])];case 2:return[2,r.sent()];case 3:return r.sent(),[2,null];case 4:return[2]}}))}))},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),a(this,void 0,void 0,(function(){return l(this,(function(r){switch(r.label){case 0:return 0===e.length?[2,null]:[4,this.text()];case 1:return[2,ft(r.sent(),e,t)]}}))}))},e}(),pt=function(){function e(e,t,r,n){this.statusCode=e,this.headersString=t,this.size=r,this.getJson=n}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}),e.prototype.headers=function(e){var t,r;if(void 0===e&&(e=[]),!this.headersString)return{};var n={},i=this.headersString.split("\r\n");try{for(var o=u(i),s=o.next();!s.done;s=o.next()){var a=c(s.value.split(": "),2),l=a[0],h=a[1];l&&h&&(n[l]=h)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return mt(n,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),a(this,void 0,void 0,(function(){var r;return l(this,(function(n){return 0===e.length?[2,null]:(r=this.getJson())?(nt(r,e,t),[2,r]):[2,null]}))}))},e}();function ft(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return nt(n,t,r),n}catch(e){return null}}!function(e){e.REDACT="redact",e.REMOVE="remove"}(ht||(ht={}));var gt="[REDACTED]",mt=function(e,t){var r,n,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?ht.REMOVE:s,l=h([],c(M),!1),d={},p=function(t){var r=t.toLowerCase();l.find((function(e){return e.toLowerCase()===r}))?a===ht.REDACT&&(d[t]=gt):o.find((function(e){return e.toLowerCase()===r}))?d[t]=e[t]:a===ht.REDACT&&(d[t]=gt)};try{for(var f=u(Object.keys(e)),g=f.next();!g.done;g=f.next()){p(g.value)}}catch(e){r={error:e}}finally{try{g&&!g.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}return d},vt=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(h([],c(_),!1)),requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(r=this.responseWrapper)||void 0===r?void 0:r.headers(h([],c(_),!1)),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 yt,bt,wt,St=function(e,t){void 0===t&&(t=V()),this.callback=e,this.id=t},Ct=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=z();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=z();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var r,n,i,o,s,a,l,u,c,h;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var d=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,p=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,f=null===(c=null===(u=null===(l=this.globalScope)||void 0===l?void 0:l.XMLHttpRequest)||void 0===u?void 0:u.prototype)||void 0===c?void 0:c.setRequestHeader;d&&p&&f&&this.observeXhr(d,p,f);var g=null===(h=this.globalScope)||void 0===h?void 0:h.fetch;g&&this.observeFetch(g),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";if(!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),l)try{var d=new URL(l);l="".concat(d.protocol,"//").concat(d.host).concat(d.pathname).concat(d.search).concat(d.hash)}catch(e){}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 p=Math.floor(performance.now()-s),f=Math.floor(o+p),g=new vt(e,h,o,o,l,r,u,p,n,c,f);this.triggerEventCallbacks(g)}},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 lt(n):void 0,i?new dt(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.createXhrJsonParser=function(e,t){return function(){var r,n;try{if("json"===e.responseType){if(null===(r=t.globalScope)||void 0===r?void 0:r.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(r){return r instanceof Error&&"InvalidStateError"===r.name&&(null===(n=t.logger)||void 0===n||n.error("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))),null}return null}},e.prototype.observeXhr=function(t,r,n){if(this.globalScope&&t&&r){var i=this.globalScope.XMLHttpRequest.prototype,s=this;i.open=function(){for(var e,r,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=c(n,2),l=a[0],u=a[1];try{this.$$AmplitudeAnalyticsEvent=o({method:l,url:null===(e=null==u?void 0:u.toString)||void 0===e?void 0:e.call(u),headers:{}},s.getTimestamps())}catch(e){null===(r=s.logger)||void 0===r||r.error("an unexpected error occurred while calling xhr open",e)}return t.apply(this,n)},i.send=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=this,o=e.createXhrJsonParser(this,s),a=t[0],l=i.$$AmplitudeAnalyticsEvent;return i.addEventListener("loadend",(function(){var e;try{var t=i.getAllResponseHeaders(),r=i.getResponseHeader("content-length"),n=new pt(i.status,t,r?parseInt(r,10):void 0,o),u=i.$$AmplitudeAnalyticsEvent.headers,c=new ut(a,u);l.status=i.status,s.handleNetworkRequestEvent("xhr",{url:l.url,method:l.method},c,n,void 0,l.startTime,l.durationStart)}catch(t){null===(e=s.logger)||void 0===e||e.error("an unexpected error occurred while handling xhr send",t)}})),r.apply(i,t)},i.setRequestHeader=function(e,t){var r;try{this.$$AmplitudeAnalyticsEvent.headers[e]=t}catch(e){null===(r=s.logger)||void 0===r||r.error("an unexpected error occurred while calling xhr setRequestHeader",e)}n.apply(this,[e,t])}}},e}(),It=new Ct,xt=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({},P),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={})[w]=t[w],e[S]=t[S],e[C]=t[C],e[I]=t[I],e[x]=t[x],e[k]=t[k],e[E]=t[E],e[O]=t[O],e[A]=t[A],e[T]=t[T],e[R]=t[R],e},e}(),kt=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},Et=function(e){return kt(e,"attribution")},Ot=function(e){return kt(e,"pageViews")},At=function(e){return kt(e,"sessions")},Tt=function(e){return"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},Rt=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},Pt=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},_t=function(e){if(Rt(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},Mt=function(e){if(Pt(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},Nt=function(e){var t;if(Tt(e.autocapture)){var r=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?r=e.autocapture.networkTracking:e.networkTrackingOptions&&(r=e.networkTrackingOptions),o(o({},r),{captureRules:null===(t=null==r?void 0:r.captureRules)||void 0===t?void 0:t.map((function(t){var r,n,i;if((null===(r=t.urls)||void 0===r?void 0:r.length)&&(null===(n=t.hosts)||void 0===n?void 0:n.length)){var s=JSON.stringify(t.hosts),a=JSON.stringify(t.urls);return null===(i=e.loggerProvider)||void 0===i||i.warn("Found network capture rule with both urls='".concat(a,"' and hosts='").concat(s,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),o(o({},t),{hosts:void 0})}return t}))})}},Dt=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return Ot(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}},Lt=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},Ft=function(e){return e&&void 0!==e._q},Ut="2.25.2",jt="amplitude-ts",Bt=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(jt,"/").concat(Ut),"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:we()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:V(),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}(),zt=1e3,qt=function(e){function t(t){var r,n,i,o=this;try{i=null===(r=z())||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>zt?(i=r.length-zt,[4,e.prototype.set.call(this,t,r.slice(0,zt))]):[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(zt,".")),[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}(Le),Vt=function(e){function t(){var t;return e.call(this,null===(t=z())||void 0===t?void 0:t.sessionStorage)||this}return r(t,e),t}(Le),Wt=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}(Je),Kt=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=z();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}(Je),Gt=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:Yt(a),sessionId:Jt(h),lastEventId:Jt(p),lastEventTime:Jt(d),optOut:Boolean(u)}]}}))}))},Jt=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Yt=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},Zt="[Amplitude]",Ht="".concat(Zt," Form Started"),$t="".concat(Zt," Form Submitted"),Xt="".concat(Zt," File Downloaded"),Qt="session_start",er="session_end",tr="".concat(Zt," File Extension"),rr="".concat(Zt," File Name"),nr="".concat(Zt," Link ID"),ir="".concat(Zt," Link Text"),or="".concat(Zt," Link URL"),sr="".concat(Zt," Form ID"),ar="".concat(Zt," Form Name"),lr="".concat(Zt," Form Destination"),ur="cookie",cr=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,T,R,P,_,M,N,D,L,F,U,j){void 0===n&&(n=new Pe),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=ur),void 0===m&&(m=new $),void 0===v&&(v=Z.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 qt({loggerProvider:m})),void 0===A&&(A={ipAddress:!0,language:!0,platform:!0}),void 0===T&&(T="fetch"),void 0===R&&(R=!1),void 0===P&&(P=!0),void 0===F&&(F=!0),void 0===U&&(U=0);var B=e.call(this,{apiKey:t,storageProvider:O,transportProvider:pr(T)})||this;return B.apiKey=t,B.appVersion=r,B.cookieOptions=i,B.defaultTracking=o,B.autocapture=s,B.flushIntervalMillis=l,B.flushMaxRetries=u,B.flushQueueSize=c,B.identityStorage=h,B.ingestionMetadata=d,B.instanceName=p,B.loggerProvider=m,B.logLevel=v,B.minIdLength=y,B.offline=b,B.partnerId=S,B.plan=C,B.serverUrl=I,B.serverZone=x,B.sessionTimeout=E,B.storageProvider=O,B.trackingOptions=A,B.transport=T,B.useBatch=R,B.fetchRemoteConfig=P,B.networkTrackingOptions=D,B.identify=L,B.enableDiagnostics=F,B.diagnosticsSampleRate=U,B.diagnosticsClient=j,B.version=Ut,B._optOut=!1,B._cookieStorage=n,B.deviceId=a,B.lastEventId=f,B.lastEventTime=g,B.optOut=w,B.sessionId=k,B.pageCounter=M,B.userId=_,B.debugLogsEnabled=N,B.loggerProvider.enable(N?Z.Debug:B.logLevel),B.networkTrackingOptions=D,B.identify=L,B.enableDiagnostics=F,B.diagnosticsSampleRate=U,B.diagnosticsClient=j,B}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(be(this.apiKey),e)},t}(Q),hr=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,A,T,R,P,_,M,N,D,L,F,U,j,B,z,q,W,K,G,J,Y,Z,H;return l(this,(function(l){switch(l.label){case 0:return n=t.identityStorage||ur,k={},n===ur?[3,1]:(s="",[3,5]);case 1:return null===(O=null===(E=t.cookieOptions)||void 0===E?void 0:E.domain)||void 0===O?[3,2]:(a=O,[3,4]);case 2:return[4,fr()];case 3:a=l.sent(),l.label=4;case 4:s=a,l.label=5;case 5:return i=o.apply(void 0,[(k.domain=s,k.expiration=365,k.sameSite="Lax",k.secure=!1,k.upgrade=!0,k),t.cookieOptions]),u=dr(t.identityStorage,i),[4,Gt(e,u,null===(T=null===(A=t.cookieOptions)||void 0===A?void 0:A.upgrade)||void 0===T||T)];case 6:return c=l.sent(),[4,u.get(be(e))];case 7:return h=l.sent(),d=Se(),p=d.ampTimestamp?Number(d.ampTimestamp):void 0,f=!p||Date.now()<p,g=null!==(N=null!==(M=null!==(_=null!==(R=t.deviceId)&&void 0!==R?R:f?null!==(P=d.ampDeviceId)&&void 0!==P?P:d.deviceId:void 0)&&void 0!==_?_:null==h?void 0:h.deviceId)&&void 0!==M?M:c.deviceId)&&void 0!==N?N:V(),m=null!==(D=null==h?void 0:h.lastEventId)&&void 0!==D?D:c.lastEventId,v=null!==(L=null==h?void 0:h.lastEventTime)&&void 0!==L?L:c.lastEventTime,y=null!==(U=null!==(F=t.optOut)&&void 0!==F?F:null==h?void 0:h.optOut)&&void 0!==U?U:c.optOut,b=null!==(j=null==h?void 0:h.sessionId)&&void 0!==j?j:c.sessionId,w=null!==(z=null!==(B=t.userId)&&void 0!==B?B:null==h?void 0:h.userId)&&void 0!==z?z:c.userId,r.previousSessionDeviceId=null!==(q=null==h?void 0:h.deviceId)&&void 0!==q?q:c.deviceId,r.previousSessionUserId=null!==(W=null==h?void 0:h.userId)&&void 0!==W?W:c.userId,S={ipAddress:null===(G=null===(K=t.trackingOptions)||void 0===K?void 0:K.ipAddress)||void 0===G||G,language:null===(Y=null===(J=t.trackingOptions)||void 0===J?void 0:J.language)||void 0===Y||Y,platform:null===(H=null===(Z=t.trackingOptions)||void 0===Z?void 0:Z.platform)||void 0===H||H},C=null==h?void 0:h.pageCounter,I=null==h?void 0:h.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(x=new cr(e,t.appVersion,u,i,t.defaultTracking,t.autocapture,g,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,n,t.ingestionMetadata,t.instanceName,m,v,t.loggerProvider,t.logLevel,t.minIdLength,t.offline,y,t.partnerId,t.plan,t.serverUrl,t.serverZone,b,t.sessionTimeout,t.storageProvider,S,t.transport,t.useBatch,t.fetchRemoteConfig,w,C,I,t.networkTrackingOptions,t.identify,t.enableDiagnostics)).storageProvider.isEnabled()];case 8:return l.sent()||(x.loggerProvider.warn("Storage provider ".concat(x.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),x.storageProvider=new Pe),[2,x]}}))}))},dr=function(e,t){switch(void 0===e&&(e=ur),void 0===t&&(t={}),e){case"localStorage":return new qt;case"sessionStorage":return new Vt;case"none":return new Pe;default:return new _e(o(o({},t),{expirationDays:t.expiration}))}},pr=function(e){return"xhr"===e?new Wt:"beacon"===e?new Kt:new Ye},fr=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 _e).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 _e({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,""]}}))}))},gr=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},mr=function(){var e,t=gr();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=vr(r[0]),i=vr(r[1]);return i?(e[n]=i,e):e}),{}):{}},vr=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},yr="dclid",br="fbclid",wr="gbraid",Sr="gclid",Cr="ko_click_id",Ir="li_fat_id",xr="msclkid",kr="rdt_cid",Er="ttclid",Or="twclid",Ar="wbraid",Tr={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,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Rr="data-amp-mask",Pr="*****",_r=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({},Tr),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=mr();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=mr();return(e={})[yr]=t[yr],e[br]=t[br],e[wr]=t[wr],e[Sr]=t[Sr],e[Cr]=t[Cr],e[Ir]=t[Ir],e[xr]=t[xr],e[kr]=t[kr],e[Er]=t[Er],e[Or]=t[Or],e[Ar]=t[Ar],e},e}(),Mr=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(Rr)?Pr:e?e(document.title):document.title};!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"}(yt||(yt={})),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"}(bt||(bt={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(wt||(wt={}));var Nr=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},Dr=function(e){var t;void 0===e&&(e={});var r,n=gr(),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,Lr()];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":Mr(),"[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=Ur(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&&Fr(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},Lr=function(){return a(void 0,void 0,void 0,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return e=Nr,[4,(new _r).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},Fr=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,r=t[yt.SET]||{},n=t[yt.UNSET]||{},i=h(h([],c(Object.keys(r)),!1),c(Object.keys(n)),!1);return Object.keys(Tr).every((function(e){return i.includes(e)}))}return!1},Ur=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},jr=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=zr(e);t||n.track(Ht,((r={})[sr]=Br(e.id),r[ar]=Br(e.name),r[lr]=i,r)),t=!0})),r(e,"submit",(function(){var r,i,o=zr(e);t||n.track(Ht,((r={})[sr]=Br(e.id),r[ar]=Br(e.name),r[lr]=o,r)),n.track($t,((i={})[sr]=Br(e.id),i[ar]=Br(e.name),i[lr]=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=z())?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]}))}))}}},Br=function(e){if("string"==typeof e)return e},zr=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},qr=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(Xt,((t={})[tr]=s,t[rr]=r.pathname,t[nr]=e.id,t[ir]=e.text,t[or]=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=z())?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]}))}))}}},Vr=!1,Wr=function(){var e=z(),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]}))}))}}};function Kr(e){var t,r,n,i,o,s,a,l,d,p;if("object"==typeof e&&null!==e&&!Array.isArray(e)){var f=Object.keys(e);try{for(var g=u(f),m=g.next();!m.done;m=g.next()){var v=m.value;try{var y=e[v];"boolean"==typeof(null==y?void 0:y.enabled)&&(y.enabled?(delete y.enabled,0===Object.keys(y).length&&(e[v]=!0)):e[v]=!1),Kr(y)}catch(e){}}}catch(e){t={error:e}}finally{try{m&&!m.done&&(r=g.return)&&r.call(g)}finally{if(t)throw t.error}}try{if(null===(d=null===(l=null===(a=e.autocapture)||void 0===a?void 0:a.networkTracking)||void 0===l?void 0:l.captureRules)||void 0===d?void 0:d.length)try{for(var b=u(e.autocapture.networkTracking.captureRules),w=b.next();!w.done;w=b.next()){var S=w.value;try{for(var C=(o=void 0,u(["responseHeaders","requestHeaders"])),I=C.next();!I.done;I=C.next()){var x=I.value,k=null!==(p=S[x])&&void 0!==p?p:{},E=k.captureSafeHeaders,O=k.allowlist;(E||O)&&(void 0===O||Array.isArray(O)?S[x]=h(h([],c(E?_:[]),!1),c(null!=O?O:[]),!1):delete S[x])}}catch(e){o={error:e}}finally{try{I&&!I.done&&(s=C.return)&&s.call(C)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{w&&!w.done&&(i=b.return)&&i.call(b)}finally{if(n)throw n.error}}}catch(e){}}}function Gr(e,t,r){var n,i,o=[];try{for(var s=u(null!=t?t:[]),a=s.next();!a.done;a=s.next()){var l=a.value;try{o.push(new RegExp(l))}catch(e){r.loggerProvider.warn("Invalid regex pattern: ".concat(l),e)}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return e.concat(o)}function Jr(e,t){var r,n,i,s,a,l,c;if(e){Kr(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var h=e;if(h&&"autocapture"in h){if("boolean"==typeof h.autocapture&&(t.autocapture=h.autocapture),"object"==typeof h.autocapture&&null!==h.autocapture){var d=o({},h.autocapture);if(void 0===t.autocapture&&(t.autocapture=h.autocapture),"object"==typeof h.autocapture.elementInteractions&&null!==h.autocapture.elementInteractions&&(null===(i=h.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===i?void 0:i.length)){d.elementInteractions=o({},h.autocapture.elementInteractions);var p=d.elementInteractions,f=null!==(s=p.pageUrlAllowlist)&&void 0!==s?s:[],g=h.autocapture.elementInteractions.pageUrlAllowlistRegex;p.pageUrlAllowlist=Gr(f,g,t),delete p.pageUrlAllowlistRegex}if("object"==typeof h.autocapture.networkTracking&&null!==h.autocapture.networkTracking&&(null===(a=h.autocapture.networkTracking.captureRules)||void 0===a?void 0:a.length)){d.networkTracking=o({},h.autocapture.networkTracking);var m=null!==(l=d.networkTracking.captureRules)&&void 0!==l?l:[];try{for(var v=u(m),y=v.next();!y.done;y=v.next()){var b=y.value;b.urls=Gr(null!==(c=b.urls)&&void 0!==c?c:[],b.urlsRegex,t),delete b.urlsRegex}}catch(e){r={error:e}}finally{try{y&&!y.done&&(n=v.return)&&n.call(v)}finally{if(r)throw r.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=o({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},d)),"object"==typeof t.autocapture&&(t.autocapture=o(o({},t.autocapture),d))}t.defaultTracking=t.autocapture}t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}var Yr="[Amplitude] Element Clicked",Zr="[Amplitude] Rage Click",Hr="[Amplitude] Element Tag",$r="[Amplitude] Element Text",Xr="[Amplitude] Page URL",Qr="https://app.amplitude.com",en={US:Qr,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},tn="data-amp-mask-attributes";function rn(e){return"function"==typeof e}function nn(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 on=nn((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 sn(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var an=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(rn(l))try{l()}catch(e){i=e instanceof on?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{cn(g)}catch(e){i=null!=i?i:[],e instanceof on?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 on(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)cn(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)&&sn(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&sn(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),ln=an.EMPTY;function un(e){return e instanceof an||e&&"closed"in e&&rn(e.remove)&&rn(e.add)&&rn(e.unsubscribe)}function cn(e){rn(e)?e():e.unsubscribe()}var hn={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},dn=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 pn(e){dn((function(){throw e}))}function fn(){}function gn(e){e()}var mn=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,un(t)&&t.add(r)):r.destination=Cn,r}return r(t,e),t.create=function(e,t,r){return new wn(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}(an),vn=Function.prototype.bind;function yn(e,t){return vn.call(e,t)}var bn=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){Sn(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Sn(e)}else Sn(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Sn(e)}},e}(),wn=function(e){function t(t,r,n){var i,o,s=e.call(this)||this;rn(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&hn.useDeprecatedNextContext?((o=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},i={next:t.next&&yn(t.next,o),error:t.error&&yn(t.error,o),complete:t.complete&&yn(t.complete,o)}):i=t;return s.destination=new bn(i),s}return r(t,e),t}(mn);function Sn(e){pn(e)}var Cn={closed:!0,next:fn,error:function(e){throw e},complete:fn},In="function"==typeof Symbol&&Symbol.observable||"@@observable";function xn(e){return e}var kn=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 mn||function(e){return e&&rn(e.next)&&rn(e.error)&&rn(e.complete)}(n)&&un(n)?e:new wn(e,t,r);return gn((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=En(t))((function(t,n){var i=new wn({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[In]=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?xn: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=En(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 En(e){var t;return null!==(t=null!=e?e:hn.Promise)&&void 0!==t?t:Promise}function On(e){return rn(null==e?void 0:e.lift)}function An(e){return function(t){if(On(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 Tn(e,t,r,n,i){return new Rn(e,t,r,n,i)}var Rn=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}(mn);!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,On(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 an;var r=this.getSubject();t.add(this.source.subscribe(Tn(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=an.EMPTY)}return t},t.prototype.refCount=function(){return An((function(e,t){var r=null;e._refCount++;var n=Tn(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)}}(kn);var Pn,_n={now:function(){return(_n.delegate||performance).now()},delegate:void 0},Mn={schedule:function(e){var t=requestAnimationFrame,r=cancelAnimationFrame,n=t((function(t){r=void 0,e(t)}));return new an((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=Mn.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 kn((function(e){var t=Pn||_n,r=t.now(),n=0,i=function(){e.closed||(n=Mn.requestAnimationFrame((function(o){n=0;var s=t.now();e.next({timestamp:Pn?s:o,elapsed:s-r}),i()})))};return i(),function(){n&&Mn.cancelAnimationFrame(n)}}));var Nn=nn((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Dn=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 Ln(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Nn},t.prototype.next=function(e){var t=this;gn((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;gn((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;gn((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?ln:(this.currentObservers=null,o.push(e),new an((function(){t.currentObservers=null,sn(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 kn;return e.source=this,e},t.create=function(e,t){return new Ln(e,t)},t}(kn),Ln=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:ln},t}(Dn);!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)}}(Dn);var Fn={now:function(){return(Fn.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=Fn);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)}}}(Dn),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))}}(Dn);var Un,jn=function(e){function t(t,r){return e.call(this)||this}return r(t,e),t.prototype.schedule=function(e,t){return this},t}(an),Bn=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)))},zn=function(e){return clearInterval(e)},qn=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),Bn(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&&zn(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,sn(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(jn),Vn=1,Wn={};function Kn(e){return e in Wn&&(delete Wn[e],!0)}var Gn=function(e){var t=Vn++;return Wn[t]=!0,Un||(Un=Promise.resolve()),Un.then((function(){return Kn(t)&&e()})),t},Jn=function(e){Kn(e)},Yn={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Yn.delegate;return((null==r?void 0:r.setImmediate)||Gn).apply(void 0,h([],c(e)))},clearImmediate:function(e){return Jn(e)},delegate:void 0},Zn=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=Yn.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&&(Yn.clearImmediate(r),t._scheduled===r&&(t._scheduled=void 0))},t}(qn),Hn=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=Fn.now,e}(),$n=function(e){function t(t,r){void 0===r&&(r=Hn.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}(Hn),Xn=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}($n);new Xn(Zn);var Qn=new $n(qn),ei=Qn,ti=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}(qn),ri=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}($n);new ri(ti);var ni=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=Mn.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&&(Mn.cancelAnimationFrame(r),t._scheduled=void 0)},t}(qn),ii=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}($n);new ii(ni),function(e){function t(t,r){void 0===t&&(t=oi),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}($n);var oi=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 an.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}(qn),si=new kn((function(e){return e.complete()}));function ai(e){return e&&rn(e.schedule)}function li(e){return e[e.length-1]}function ui(e){return ai(li(e))?e.pop():void 0}var ci=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function hi(e){return rn(null==e?void 0:e.then)}function di(e){return rn(e[In])}function pi(e){return Symbol.asyncIterator&&rn(null==e?void 0:e[Symbol.asyncIterator])}function fi(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 gi,mi="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function vi(e){return rn(null==e?void 0:e[mi])}function yi(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 bi(e){return rn(null==e?void 0:e.getReader)}function wi(e){if(e instanceof kn)return e;if(null!=e){if(di(e))return i=e,new kn((function(e){var t=i[In]();if(rn(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(ci(e))return n=e,new kn((function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()}));if(hi(e))return r=e,new kn((function(e){r.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,pn)}));if(pi(e))return Si(e);if(vi(e))return t=e,new kn((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(bi(e))return Si(yi(e))}var t,r,n,i;throw fi(e)}function Si(e){return new kn((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 Ci(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 Ii(e,t){return void 0===t&&(t=0),An((function(r,n){r.subscribe(Tn(n,(function(r){return Ci(n,e,(function(){return n.next(r)}),t)}),(function(){return Ci(n,e,(function(){return n.complete()}),t)}),(function(r){return Ci(n,e,(function(){return n.error(r)}),t)})))}))}function xi(e,t){return void 0===t&&(t=0),An((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}function ki(e,t){if(!e)throw new Error("Iterable cannot be null");return new kn((function(r){Ci(r,t,(function(){var n=e[Symbol.asyncIterator]();Ci(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}function Ei(e,t){if(null!=e){if(di(e))return function(e,t){return wi(e).pipe(xi(t),Ii(t))}(e,t);if(ci(e))return function(e,t){return new kn((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(hi(e))return function(e,t){return wi(e).pipe(xi(t),Ii(t))}(e,t);if(pi(e))return ki(e,t);if(vi(e))return function(e,t){return new kn((function(r){var n;return Ci(r,t,(function(){n=e[mi](),Ci(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 rn(null==n?void 0:n.return)&&n.return()}}))}(e,t);if(bi(e))return function(e,t){return ki(yi(e),t)}(e,t)}throw fi(e)}function Oi(e,t){return t?Ei(e,t):wi(e)}function Ai(e){return e instanceof Date&&!isNaN(e)}!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(gi||(gi={})),nn((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}})),nn((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),nn((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}})),nn((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}));var Ti=nn((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function Ri(e){throw new Ti(e)}function Pi(e,t){return An((function(r,n){var i=0;r.subscribe(Tn(n,(function(r){n.next(e.call(t,r,i++))})))}))}var _i=Array.isArray;function Mi(e){return Pi((function(t){return function(e,t){return _i(t)?e.apply(void 0,h([],c(t))):e(t)}(e,t)}))}function Ni(e,t,r){return void 0===r&&(r=1/0),rn(t)?Ni((function(r,n){return Pi((function(e,i){return t(r,e,n,i)}))(wi(e(r,n)))}),r):("number"==typeof t&&(r=t),An((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;wi(r(e,c++)).subscribe(Tn(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?Ci(t,s,(function(){return f(e)})):f(e)};l.length&&u<n;)e();d()}catch(e){t.error(e)}})))};return e.subscribe(Tn(t,p,(function(){h=!0,d()}))),function(){null==a||a()}}(t,n,e,r)})))}function Di(e){return void 0===e&&(e=1/0),Ni(xn,e)}function Li(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Di(1)(Oi(e,ui(e)))}var Fi=["addListener","removeListener"],Ui=["addEventListener","removeEventListener"],ji=["on","off"];function Bi(e,t,r,n){if(rn(r)&&(n=r,r=void 0),n)return Bi(e,t,r).pipe(Mi(n));var i=c(function(e){return rn(e.addEventListener)&&rn(e.removeEventListener)}(e)?Ui.map((function(n){return function(i){return e[n](t,i,r)}})):function(e){return rn(e.addListener)&&rn(e.removeListener)}(e)?Fi.map(zi(e,t)):function(e){return rn(e.on)&&rn(e.off)}(e)?ji.map(zi(e,t)):[],2),o=i[0],s=i[1];if(!o&&ci(e))return Ni((function(e){return Bi(e,t,r)}))(wi(e));if(!o)throw new TypeError("Invalid event target");return new kn((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 zi(e,t){return function(r){return function(n){return e[r](t,n)}}}function qi(e,t,r){void 0===e&&(e=0),void 0===r&&(r=ei);var n=-1;return null!=t&&(ai(t)?r=t:n=t),new kn((function(t){var i=Ai(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)}))}function Vi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=ui(e),n=function(e,t){return"number"==typeof li(e)?e.pop():t}(e,1/0),i=e;return i.length?1===i.length?wi(i[0]):Di(n)(Oi(i,r)):si}new kn(fn);var Wi=Array.isArray;function Ki(e,t){return An((function(r,n){var i=0;r.subscribe(Tn(n,(function(r){return e.call(t,r,i++)&&n.next(r)})))}))}function Gi(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 1===(t=1===(e=t).length&&Wi(e[0])?e[0]:e).length?wi(t[0]):new kn(function(e){return function(t){for(var r=[],n=function(n){r.push(wi(e[n]).subscribe(Tn(t,(function(e){if(r){for(var i=0;i<r.length;i++)i!==n&&r[i].unsubscribe();r=null}t.next(e)}))))},i=0;r&&!t.closed&&i<e.length;i++)n(i)}}(t))}function Ji(e){return e<=0?function(){return si}:An((function(t,r){var n=0;t.subscribe(Tn(r,(function(t){++n<=e&&(r.next(t),e<=n&&r.complete())})))}))}function Yi(e,t){return t?function(r){return Li(t.pipe(Ji(1),An((function(e,t){e.subscribe(Tn(t,fn))}))),r.pipe(Yi(e)))}:Ni((function(t,r){return wi(e(t,r)).pipe(Ji(1),function(e){return Pi((function(){return e}))}(t))}))}function Zi(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new Dn}: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 An((function(e,f){a++,c||u||h();var g=o=null!=o?o:r();f.add((function(){0!==--a||c||u||(n=Hi(p,l))})),g.subscribe(f),!t&&a>0&&(t=new wn({next:function(e){return g.next(e)},error:function(e){c=!0,h(),n=Hi(d,i,e),g.error(e)},complete:function(){u=!0,h(),n=Hi(d,s),g.complete()}}),wi(e).subscribe(t))}))(e)}}function Hi(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 wn({next:function(){i.unsubscribe(),e()}});return wi(t.apply(void 0,h([],c(r)))).subscribe(i)}}else e()}function $i(e,t,r){void 0===t&&(t=Qn);var n=qi(e,t);return function(e,t){return An((function(r,n){var i=null!=t?t:{},o=i.leading,s=void 0===o||o,a=i.trailing,l=void 0!==a&&a,u=!1,c=null,h=null,d=!1,p=function(){null==h||h.unsubscribe(),h=null,l&&(m(),d&&n.complete())},f=function(){h=null,d&&n.complete()},g=function(t){return h=wi(e(t)).subscribe(Tn(n,p,f))},m=function(){if(u){u=!1;var e=c;c=null,n.next(e),!d&&g(e)}};r.subscribe(Tn(n,(function(e){u=!0,c=e,(!h||h.closed)&&(s?m():g(e))}),(function(){d=!0,(!(l&&u&&h)||h.closed)&&n.complete()})))}))}((function(){return n}),r)}var Xi=["input","select","textarea"],Qi=function(e,t){var r,n=null===(r=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===r?void 0:r.call(window,e);return"pointer"===(null==n?void 0:n.getPropertyValue("cursor"))&&"click"===t},eo=function(e,t,r){return void 0===r&&(r=!1),function(n,i){var o,s,a=e.pageUrlAllowlist,l=e.pageUrlExcludelist,u=e.shouldTrackEventResolver,c=null===(s=null===(o=null==i?void 0:i.tagName)||void 0===o?void 0:o.toLowerCase)||void 0===s?void 0:s.call(o);if(!c)return!1;if(u)return u(n,i);if(!Oe(window.location.href,a))return!1;if(l&&l.length>0&&Oe(window.location.href,l))return!1;var h=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof h)switch(h.toLowerCase()){case"hidden":case"password":return!1}var d=Qi(i,n);if(r&&d)return!0;if(t){var p=t.some((function(e){var t;return!!(null===(t=null==i?void 0:i.matches)||void 0===t?void 0:t.call(i,e))}));if(!p)return!1}switch(c){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:return!!d||"click"===n}}},to=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}),{})},ro=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:ro(null==e?void 0:e.parentElement,t):null};var no=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};var io=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",tn,Rr]),oo=["type"],so=["svg","path","g"],ao=["password","hidden"];function lo(e,t){var r,n,i,o,s,a;if(null===e)return null;var l=String(e.tagName).toLowerCase(),c={tag:l},h=Array.from(null!==(o=null===(i=e.parentElement)||void 0===i?void 0:i.children)&&void 0!==o?o:[]);h.length&&(c.index=h.indexOf(e),c.indexOfType=h.filter((function(t){return t.tagName===e.tagName})).indexOf(e));var d=null===(a=null===(s=e.previousElementSibling)||void 0===s?void 0:s.tagName)||void 0===a?void 0:a.toLowerCase();d&&(c.prevSib=String(d));var p=e.getAttribute("id");p&&(c.id=String(p));var f=Array.from(e.classList);f.length&&(c.classes=f);var g={},m=Array.from(e.attributes).filter((function(e){return!io.has(e.name)})),v=!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!Xi.includes(i)&&!o}(e);if(!ao.includes(String(e.getAttribute("type")))&&!so.includes(l))try{for(var y=u(m),b=y.next();!b.done;b=y.next()){var w=b.value;v&&!oo.includes(w.name)||(t.has(w.name)?g[w.name]=Pr:g[w.name]=String(w.value).substring(0,128))}}catch(e){r={error:e}}finally{try{b&&!b.done&&(n=y.return)&&n.call(y)}finally{if(r)throw r.error}}return Object.keys(g).length&&(c.attrs=g),c}var uo=function(e,t,r){e.forEach((function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var n=r.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=n}}))},co=/\b(?:\d[ -]*?){13,16}\b/,ho=/(\d{3}-?\d{2}-?\d{4})/g,po=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,fo=function(e,t){var r,n,i,o=this;this.replaceSensitiveString=function(e){var t,r;if("string"!=typeof e)return"";var n=e;n=(n=(n=n.replace(co,Pr)).replace(ho,Pr)).replace(po,Pr);try{for(var i=u(o.additionalMaskTextPatterns),s=i.next();!s.done;s=i.next()){var a=s.value;try{n=n.replace(a,Pr)}catch(e){}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},this.getHierarchy=function(e){var t,r,n,i,s,a=performance.now();if(!e)return[];for(var l,d=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),p=new Map,f=d.length-1;f>=0;f--){var g=d[f];if(g){var m=(l=g.getAttribute(tn))?l.split(",").map((function(e){return e.trim()})).filter((function(e){return e.length>0&&"id"!==e&&"class"!==e})):[],v=f===d.length-1?[]:null!==(n=p.get(d[f+1]))&&void 0!==n?n:new Set,y=new Set(h(h([],c(v),!1),c(m),!1));p.set(g,y)}}s=d.map((function(e){var t;return lo(e,null!==(t=p.get(e))&&void 0!==t?t:new Set)}));var b=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach((function(t){var r=c(t,2),n=r[0],i=r[1];e.attrs&&(e.attrs[n]=o.replaceSensitiveString(i))}))};try{for(var w=u(s),S=w.next();!S.done;S=w.next())b(S.value)}catch(e){t={error:e}}finally{try{S&&!S.done&&(r=w.return)&&r.call(w)}finally{if(t)throw t.error}}var C=performance.now();return null===(i=o.diagnosticsClient)||void 0===i||i.recordHistogram("autocapturePlugin.getHierarchy",C-a),s},this.getNearestLabel=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}return t?o.getText(t):o.getNearestLabel(r)},this.getEventProperties=function(e,t,r){var n,i,s,a,l,u,h=null===(s=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===s?void 0:s.call(i),d="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},p=o.getHierarchy(t),f=null===(a=p[0])||void 0===a?void 0:a.attrs,g=o.getNearestLabel(t),m=(l=null!=f?f:{},u=r,Object.entries(l).reduce((function(e,t){var r=c(t,2),n=r[0],i=r[1];if(n.startsWith(u)){var o=n.replace(u,"");o&&(e[o]=i||"")}return e}),{})),v=((n={})["[Amplitude] Element Hierarchy"]=p,n[Hr]=h,n[$r]=o.getText(t),n["[Amplitude] Element Position Left"]=null==d.left?null:Math.round(d.left),n["[Amplitude] Element Position Top"]=null==d.top?null:Math.round(d.top),n["[Amplitude] Element Attributes"]=m,n["[Amplitude] Element Parent Label"]=g,n[Xr]=Ae(window.location.href.split("?")[0]),n["[Amplitude] Page Title"]=Mr(o.replaceSensitiveString),n["[Amplitude] Viewport Height"]=window.innerHeight,n["[Amplitude] Viewport Width"]=window.innerWidth,n);return v["[Amplitude] Element ID"]=t.getAttribute("id")||"",v["[Amplitude] Element Class"]=t.getAttribute("class"),v["[Amplitude] Element Aria Label"]=null==f?void 0:f["aria-label"],"a"===h&&"click"===e&&t instanceof HTMLAnchorElement&&(v["[Amplitude] Element Href"]=o.replaceSensitiveString(t.href)),to(v)},this.addAdditionalEventProperties=function(e,t,r,n,i){void 0===i&&(i=!1);var s={event:e,timestamp:Date.now(),type:t};if(function(e){return"click"===e.type||"change"===e.type}(s)&&null!==s.event.target){if(i&&Qi(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,n),s;var a=ro(s.event.target,r);return a&&(s.closestTrackedAncestor=a,s.targetElementProperties=o.getEventProperties(s.type,a,n)),s}return s},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=function(e,t){try{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}}catch(e){return}}(e,t);if(!r)return;return"TEXT"===e.elementExtractType?o.getText(r):"ATTRIBUTE"===e.elementExtractType&&e.attribute?r.getAttribute(e.attribute):void 0}},this.getText=function(e){if(null!==e.closest("[".concat(Rr,"]")))return Pr;var t="";if(e.querySelector("[".concat(Rr,"], [contenteditable]"))){var r=e.cloneNode(!0);r.querySelectorAll("[".concat(Rr,"], [contenteditable]")).forEach((function(e){e.innerText=Pr})),t=r.innerText||""}else t=e.innerText||"";return o.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=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),s=((t={})[Hr]=i,t[$r]=o.getText(e),t[Xr]=window.location.href.split("?")[0],t);return to(s)},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var s=null!==(i=e.maskTextRegex)&&void 0!==i?i:[],a=[];try{for(var l=u(s),d=l.next();!d.done;d=l.next()){var p=d.value;if(a.length>=25)break;if(p instanceof RegExp)a.push(p);else if("pattern"in p&&"string"==typeof p.pattern)try{a.push(new RegExp(p.pattern,"i"))}catch(e){}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}this.additionalMaskTextPatterns=a},go=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?Qr:t,n=this;this.endpoint=Qr,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?{dataExtractor:new fo({})}:e,n=r.logger,i=r.endpoint,o=r.isElementSelectable,s=r.cssSelectorAllowlist,a=r.actionClickAllowlist,l=r.dataExtractor;this.logger=n,i&&this.endpoint===Qr&&(this.endpoint=i);var u=null;window.addEventListener("message",(function(e){var r,n,i,c,h;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 d,p=null==e?void 0:e.data,f=null==p?void 0:p.action;if(f)if("id"in p)null===(c=null===(i=t.logger)||void 0===i?void 0:i.debug)||void 0===c||c.call(i,"Received Response to previous request: ",JSON.stringify(e)),t.handleResponse(p);else if("ping"===f)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===f){var g=null==p?void 0:p.data;(d="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=d,n.addEventListener("load",(function(){e({status:!0})}),{once:!0}),n.addEventListener("error",(function(){t({status:!1,message:"Failed to load the script ".concat(d)})})),null===(r=document.head)||void 0===r||r.appendChild(n)}catch(e){t(e)}}))).then((function(){var e;u=null===(e=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===e?void 0:e.call(window,{getEventTagProps:l.getEventTagProps,isElementSelectable:function(e){return!o||o((null==g?void 0:g.actionType)||"click",e)},onTrack:t.onTrack,onSelect:t.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:t,cssSelectorAllowlist:s,actionClickAllowlist:a,extractDataFromDataSource:l.extractDataFromDataSource,dataExtractor:l,diagnostics:{autocapture:{version:"1.14.3"}}}),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"===f&&(null===(h=null==u?void 0:u.close)||void 0===h||h.call(u))}})),this.notify({action:"page-loaded"})},e}();function mo(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(An((function(e,t){var r,n=!1;e.subscribe(Tn(t,(function(e){var i=r;r=e,n&&t.next([i,e]),n=!0})))})),Ki((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=Vi(d,h.pipe((t=s.debounceTime,void 0===r&&(r=Qn),An((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(Tn(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})))}))),Pi((function(){return"timeout"})))),f=h.pipe(function(e,t){void 0===t&&(t=Qn);var r=qi(e,t);return Yi((function(){return r}))}(0),Ki(no),Ki((function(e){return a("click",e.closestTrackedAncestor)})),Pi((function(e){return l(e)})),(n=p,An((function(e,t){var r=[];return e.subscribe(Tn(t,(function(e){return r.push(e)}),(function(){t.next(r),t.complete()}))),wi(n).subscribe(Tn(t,(function(){var e=r;r=[],t.next(e)}),fn)),function(){r=null}}))));return f.subscribe((function(e){var t,r,n=(e.length,Yr);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 vo(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(Ki((function(e){return!o("click",e.closestTrackedAncestor)})),Pi((function(e){var t=ro(e.event.target,n.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e})),Ki(no),Ki((function(e){return s("click",e.closestTrackedAncestor)}))),p=[l];u&&p.push(u);var f,g,m=Vi.apply(void 0,h([],c(p),!1)),v=d.pipe((f=function(e){return m.pipe(Ji(1),function(e,t){var r=Ai(e)?{first:e}:"number"==typeof e?{each:e}:e,n=r.first,i=r.each,o=r.with,s=void 0===o?Ri:o,a=r.scheduler,l=void 0===a?null!=t?t:Qn:a,u=r.meta,c=void 0===u?null:u;if(null==n&&null==i)throw new TypeError("No timeout provided.");return An((function(e,t){var r,o,a=null,u=0,h=function(e){o=Ci(t,l,(function(){try{r.unsubscribe(),wi(s({meta:c,lastValue:a,seen:u})).subscribe(t)}catch(e){t.error(e)}}),e)};r=e.subscribe(Tn(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 si}}),Pi((function(){return e})))},An((function(e,t){var r=null,n=0,i=!1,o=function(){return i&&!r&&t.complete()};e.subscribe(Tn(t,(function(e){null==r||r.unsubscribe();var i=0,s=n++;wi(f(e,s)).subscribe(r=Tn(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(Yr,i("click",e.closestTrackedAncestor))}))}var yo,bo=function(){return new kn((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()}}))},wo=function(e){return void 0===e&&(e="click"),Bi(document,e,{capture:!0})},So={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},Co=function(e){var t,r,n,i,o=Object.values(So).reduce((function(e,t){return e[t]=new Set,e}),{});if(!e)return o;try{for(var s=u(e),a=s.next();!a.done;a=s.next()){var l=a.value;try{try{for(var c=(n=void 0,u(l.definition)),h=c.next();!h.done;h=c.next()){var d=h.value,p=So[d.event_type];p&&o[p].add(l.id)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==l?void 0:l.id,e)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return o},Io=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},xo=function(e,t){return t.filter((function(t){return t.definition.some((function(t){return So[t.event_type]===e.type&&t.filters.every((function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===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)}))}))}))},ko=function(){function e(e,t,r,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=r,this.options=n}return e.prototype.evaluate=function(e){var t,r,n=this.options.pageActions;if(!n)return e;var i=xo(e,Array.from(this.groupedLabeledEvents[e.type]).map((function(e){return n.labeledEvents[e]}))),o=function(e,t){var r,n,i,o,s=new Set;try{for(var a=u(e),l=a.next();!l.done;l=a.next()){var c=l.value,h=t.get(c.id);if(h)try{for(var d=(i=void 0,u(h)),p=d.next();!p.done;p=d.next()){var f=p.value;s.add(f)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return Array.from(s)}(i,this.labeledEventToTriggerMap);try{for(var s=u(o),a=s.next();!a.done;a=s.next()){var l=a.value;uo(l.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=r},e}();!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable"}(yo||(yo={}));var Eo=function(e,t){var r,n,i,s,d,p,f,g;void 0===e&&(e={});var m=e.dataAttributePrefix,v=void 0===m?Xe:m,y=e.visualTaggingOptions,b=void 0===y?{enabled:!0,messenger:new go}:y;e.cssSelectorAllowlist=null!==(r=e.cssSelectorAllowlist)&&void 0!==r?r:$e,e.actionClickAllowlist=null!==(n=e.actionClickAllowlist)&&void 0!==n?n:Qe,e.debounceTime=null!==(i=e.debounceTime)&&void 0!==i?i:0,e.pageUrlExcludelist=null===(s=e.pageUrlExcludelist)||void 0===s?void 0:s.reduce((function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(r){return console.warn("Invalid regex pattern: ".concat(t.pattern),r),e}return e}),[]);var w="@amplitude/plugin-autocapture-browser",S=[],C=new fo(e,t),I=Co(Object.values(null!==(p=null===(d=e.pageActions)||void 0===d?void 0:d.labeledEvents)&&void 0!==p?p:{})),x=Io(null!==(g=null===(f=e.pageActions)||void 0===f?void 0:f.triggers)&&void 0!==g?g:[]),k=function(e,t,r,n){return new ko(e,t,r,n)}(I,x,C,e);return{name:w,type:"enrichment",setup:function(t,r){return a(void 0,void 0,void 0,(function(){var n,i,s,a,u,d,p,f,g,m;return l(this,(function(l){return"undefined"==typeof document||(t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("analyticsSDK.pageActions","all",(function(t){!function(t){var r,n;t&&(e.pageActions=o(o({},e.pageActions),t),I=Co(Object.values(null!==(r=e.pageActions.labeledEvents)&&void 0!==r?r:{})),x=Io(null!==(n=e.pageActions.triggers)&&void 0!==n?n:[]),k.update(I,x,e))}(t)})):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),n=eo(e,e.cssSelectorAllowlist),i=eo(e,e.actionClickAllowlist),s=function(){var t,r,n=wo().pipe(Pi((function(t){return C.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,v)})),Zi()),i=Bi(document,"change",{capture:!0}).pipe(Pi((function(t){return C.addAdditionalEventProperties(t,"change",e.cssSelectorAllowlist,v)})),Zi());window.navigation&&(r=Bi(window.navigation,"navigate").pipe(Pi((function(t){return C.addAdditionalEventProperties(t,"navigate",e.cssSelectorAllowlist,v)})),Zi()));var o=bo().pipe(Pi((function(t){return C.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,v)})),Zi());return(t={})[yo.ClickObservable]=n,t[yo.ChangeObservable]=i,t[yo.NavigateObservable]=r,t[yo.MutationObservable]=o,t}(),a=mo({allObservables:s,options:e,amplitude:r,shouldTrackEvent:n,evaluateTriggers:k.evaluate.bind(k)}),S.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(Ki(no),Ki((function(e){return i("change",e.closestTrackedAncestor)})),Pi((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 C.getEventProperties.apply(C,h(h([],c(e),!1),[v],!1))},amplitude:r,shouldTrackEvent:n,evaluateTriggers:k.evaluate.bind(k)}),S.push(u),d=vo({allObservables:s,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return C.getEventProperties.apply(C,h(h([],c(e),!1),[v],!1))},amplitude:r,shouldTrackEvent:n,shouldTrackActionClick:i}),S.push(d),null===(g=null==t?void 0:t.loggerProvider)||void 0===g||g.log("".concat(w," has been successfully added.")),window.opener&&b.enabled&&(p=e.cssSelectorAllowlist,f=e.actionClickAllowlist,null===(m=b.messenger)||void 0===m||m.setup(o(o({dataExtractor:C,logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:en[t.serverZone]}),{isElementSelectable:eo(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(S),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]}))}))}}};function Oo(e,t){var r,n,i,o,s=t.event,a=s.clientX,l=s.clientY;e.yMin=Math.min(null!==(r=e.yMin)&&void 0!==r?r:l,l),e.yMax=Math.max(null!==(n=e.yMax)&&void 0!==n?n:l,l),e.xMin=Math.min(null!==(i=e.xMin)&&void 0!==i?i:a,a),e.xMax=Math.max(null!==(o=e.xMax)&&void 0!==o?o:a,a),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function Ao(e){var t=e[0],r=e[e.length-1];return{rageClickEvent:o({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(r.timestamp).toISOString(),"[Amplitude] Duration":r.timestamp-t.timestamp,"[Amplitude] Clicks":e.map((function(e){return{X:e.event.clientX,Y:e.event.clientY,Time:e.timestamp}})),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}function To(e){var t,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,o=n.clickObservable,s=[],a={};function l(e){s=[],a={},e&&(Oo(a,e),s.push(e))}return o.pipe(Ki(no),Ki((function(e){return i("click",e.closestTrackedAncestor)})),Pi((function(e){if(t&&clearTimeout(t),Oo(a,e),0===s.length)return s.push(e),null;if(function(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}(s,e)||function(e,t){var r=e[Math.max(0,e.length-4+1)];return t.timestamp-r.timestamp>=1e3}(s,e)||a.isOutOfBounds){var n=s.length>=4?Ao(s):null;return l(e),n}return s.push(e),s.length>=4&&(t=setTimeout((function(){var e=Ao(s),t=e.rageClickEvent,n=e.time;r.track(Zr,t,{time:n}),l()}),1e3)),null})),Ki((function(e){return null!==e}))).subscribe((function(e){null!==e&&r.track(Zr,e.rageClickEvent,{time:e.time})}))}var Ro,Po=function(e){var t,r,n,i,s;void 0===e&&(e={});var d="@amplitude/plugin-frustration-browser",p=[],f=null!==(r=null===(t=e.rageClicks)||void 0===t?void 0:t.cssSelectorAllowlist)&&void 0!==r?r:tt,g=null!==(i=null===(n=e.deadClicks)||void 0===n?void 0:n.cssSelectorAllowlist)&&void 0!==i?i:et,m=null!==(s=e.dataAttributePrefix)&&void 0!==s?s:Xe,v=new fo(e),y=h([],c(new Set(h(h([],c(f),!1),c(g),!1))),!1);return{name:d,type:"enrichment",setup:function(t,r){return a(void 0,void 0,void 0,(function(){var n,i,s,a,u,b;return l(this,(function(l){return"undefined"==typeof document||(n=eo(e,f),i=eo(e,g),s=function(){var e,t,r=wo("pointerdown").pipe(Pi((function(e){return v.addAdditionalEventProperties(e,"click",y,m,!0)})),Zi());window.navigation&&(t=Bi(window.navigation,"navigate").pipe(Pi((function(e){return v.addAdditionalEventProperties(e,"navigate",y,m)})),Zi()));var n=bo().pipe(Pi((function(e){return v.addAdditionalEventProperties(e,"mutation",y,m)})),Zi());return(e={})[yo.ClickObservable]=r,e[yo.ChangeObservable]=new kn,e[yo.NavigateObservable]=t,e[yo.MutationObservable]=n,e}(),a=To({allObservables:s,amplitude:r,shouldTrackRageClick:n}),p.push(a),u=function(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackDeadClick,s=r.clickObservable,a=r.mutationObservable,l=r.navigateObservable,u=s.pipe(Ki(no),Ki((function(e){return i("click",e.closestTrackedAncestor)})),Ki((function(e){return null===e.event.target.closest('a[target="_blank"]')}))),d=[a];l&&d.push(l);var p=Vi.apply(void 0,h([],c(d),!1));return u.pipe(Ni((function(e){var t;return Gi(new kn((function(r){return t=setTimeout((function(){return r.next(e)}),3e3),function(){clearTimeout(t)}})),p.pipe(Ji(1),Pi((function(){return null})))).pipe(Ki((function(e){return null!==e})))})),$i(3e3)).subscribe((function(e){var r={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};t.track("[Amplitude] Dead Click",o(o({},n("click",e.closestTrackedAncestor)),r),{time:e.timestamp})}))}({amplitude:r,allObservables:s,getEventProperties:function(e,t){return v.getEventProperties(e,t,m)},shouldTrackDeadClick:i}),p.push(u),null===(b=null==t?void 0:t.loggerProvider)||void 0===b||b.log("".concat(d," 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,n;return l(this,(function(i){try{for(e=u(p),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]}))}))}}},_o="[Amplitude] Network Request",Mo="500-599";function No(e,t){var r="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(r).test(e)}function Do(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 Lo(e){var t;if(e)try{var r=null===(t=z())||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 Fo(e){if("object"==typeof e&&null!==e){if(0!==e.length)return e}else{if(e)return h([],c(_),!1);if(void 0===e){return}}}function Uo(e){var t,r;return!(null===(t=null==e?void 0:e.allowlist)||void 0===t?void 0:t.length)&&!(null===(r=null==e?void 0:e.blocklist)||void 0===r?void 0:r.length)}function jo(e,t){var r;void 0===t&&(t={});var n=Lo(e.url);if(!n)return!1;var i,o=n.host;if(!1!==t.ignoreAmplitudeRequests&&(No(o,"*.amplitude.com")||No(o,"amplitude.com")))return!1;if(null===(r=t.ignoreHosts)||void 0===r?void 0:r.find((function(e){return No(o,e)})))return!1;if(!t.captureRules&&void 0!==e.status&&!Do(e.status,Mo))return!1;if(t.captureRules&&(h([],c(t.captureRules),!1).reverse().find((function(t){if(i=function(e,t,r,n,i){if((!e.hosts||e.hosts.find((function(e){return No(t,e)})))&&(!n||!e.urls||Oe(n,e.urls))&&(!i||!e.methods||e.methods.find((function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e}))))return!((r||0===r)&&!Do(r,e.statusCodeRange||Mo))}(t,o,e.status,e.url,e.method),i){var r=Fo(t.responseHeaders);if(e.responseWrapper&&r){var n=e.responseWrapper.headers(r);n&&(e.responseHeaders=n)}var s=Fo(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}e.responseWrapper&&t.responseBody&&!Uo(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!Uo(t.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,t.requestBody.blocklist))}return void 0!==i})),!i))return!1;return!e.requestWrapper||!function(e,t){if(e.includes("amplitude.com"))try{var r=t.body;if("string"!=typeof r)return!1;if(JSON.parse(r).events.find((function(e){return e.event_type===_o})))return!0}catch(e){}return!1}(o,e.requestWrapper)}function Bo(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude,i=e.loggerProvider;return t.networkObservable.pipe(Ki((function(e){return jo(e.event,r)}))).subscribe((function(e){var t,r,o,s=e.event,u=Lo(s.url);if(u){var h=null===(r=s.responseWrapper)||void 0===r?void 0:r.bodySize,d=null===(o=s.requestWrapper)||void 0===o?void 0:o.bodySize;!function(e,t,r,n){a(this,void 0,void 0,(function(){var i,o,s;return l(this,(function(a){switch(a.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(i=c.apply(void 0,[a.sent(),2]),o=i[0],s=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==n||n.debug("Failed to stringify request body",e)}if(s)try{e["[Amplitude] Response Body"]=JSON.stringify(s)}catch(e){null==n||n.debug("Failed to stringify response body")}a.label=2;case 2:return null==r||r.track(_o,e),[2]}}))}))}(((t={})["[Amplitude] URL"]=u.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=u.query,t["[Amplitude] URL Fragment"]=u.fragment,t["[Amplitude] Request Method"]=s.method,t["[Amplitude] Status Code"]=s.status,t["[Amplitude] Start Time"]=s.startTime,t["[Amplitude] Completion Time"]=s.endTime,t["[Amplitude] Duration"]=s.duration,t["[Amplitude] Request Body Size"]=d,t["[Amplitude] Response Body Size"]=h,t["[Amplitude] Request Type"]=s.type,t["[Amplitude] Request Headers"]=s.requestHeaders,t["[Amplitude] Response Headers"]=s.responseHeaders,t),s,n,i)}}))}!function(e){e.NetworkObservable="networkObservable"}(Ro||(Ro={}));var zo=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=[],i=function(){var e,r=new kn((function(e){var r=new St((function(t){var r=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(r)}));return It.subscribe(r,t),function(){It.unsubscribe(r)}}));return(e={})[Ro.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(),t=null==o?void 0:o.loggerProvider,u=Bo({allObservables:a,networkTrackingOptions:e,amplitude:s,loggerProvider:t}),n.push(u),null==t||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]}))}))}}};let qo=-1;const Vo=e=>{addEventListener("pageshow",(t=>{t.persisted&&(qo=t.timeStamp,e(t))}),!0)},Wo=(e,t,r,n)=>{let i,o;return s=>{t.value>=0&&(s||n)&&(o=t.value-(i??0),(o||void 0===i)&&(i=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t)))}},Ko=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},Go=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Jo=()=>{const e=Go();return e?.activationStart??0},Yo=(e,t=-1)=>{const r=Go();let n="navigate";return qo>=0?n="back-forward-cache":r&&(document.prerendering||Jo()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},Zo=new WeakMap;function Ho(e,t){return Zo.get(e)||Zo.set(e,new t),Zo.get(e)}class $o{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],r=this.o.at(-1);this.i&&t&&r&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const Xo=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return n.observe({type:e,buffered:!0,...r}),n}}catch{}},Qo=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let es=-1;const ts=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,rs=e=>{"hidden"===document.visibilityState&&es>-1&&(es="visibilitychange"===e.type?e.timeStamp:0,is())},ns=()=>{addEventListener("visibilitychange",rs,!0),addEventListener("prerenderingchange",rs,!0)},is=()=>{removeEventListener("visibilitychange",rs,!0),removeEventListener("prerenderingchange",rs,!0)},os=()=>{if(es<0){const e=Jo(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0]?.startTime;es=t??ts(),ns(),Vo((()=>{setTimeout((()=>{es=ts(),ns()}))}))}return{get firstHiddenTime(){return es}}},ss=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},as=[1800,3e3],ls=(e,t={})=>{ss((()=>{const r=os();let n,i=Yo("FCP");const o=Xo("paint",(e=>{for(const t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-Jo(),0),i.entries.push(t),n(!0)))}));o&&(n=Wo(e,i,as,t.reportAllChanges),Vo((r=>{i=Yo("FCP"),n=Wo(e,i,as,t.reportAllChanges),Ko((()=>{i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},us=[.1,.25];let cs=0,hs=1/0,ds=0;const ps=e=>{for(const t of e)t.interactionId&&(hs=Math.min(hs,t.interactionId),ds=Math.max(ds,t.interactionId),cs=ds?(ds-hs)/7+1:0)};let fs;const gs=()=>fs?cs:performance.interactionCount??0;let ms=0;class vs{u=[];l=new Map;m;p;v(){ms=gs(),this.u.length=0,this.l.clear()}P(){const e=Math.min(this.u.length-1,Math.floor((gs()-ms)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let r=this.l.get(e.interactionId);if(r||this.u.length<10||e.duration>t.T){if(r?e.duration>r.T?(r.entries=[e],r.T=e.duration):e.duration===r.T&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],T:e.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort(((e,t)=>t.T-e.T)),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(r)}}}const ys=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(t(e=Qo(e)),document.addEventListener("visibilitychange",e,{once:!0}))},bs=[200,500],ws=(e,t={})=>{globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype&&ss((()=>{"interactionCount"in performance||fs||(fs=Xo("event",ps,{type:"event",buffered:!0,durationThreshold:0}));let r,n=Yo("INP");const i=Ho(t,vs),o=e=>{ys((()=>{for(const t of e)i.h(t);const t=i.P();t&&t.T!==n.value&&(n.value=t.T,n.entries=t.entries,r())}))},s=Xo("event",o,{durationThreshold:t.durationThreshold??40});r=Wo(e,n,bs,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&(o(s.takeRecords()),r(!0))})),Vo((()=>{i.v(),n=Yo("INP"),r=Wo(e,n,bs,t.reportAllChanges)})))}))};class Ss{m;h(e){this.m?.(e)}}const Cs=[2500,4e3],Is=[800,1800],xs=e=>{document.prerendering?ss((()=>xs(e))):"complete"!==document.readyState?addEventListener("load",(()=>xs(e)),!0):setTimeout(e)};function ks(e){var t,r=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+r}function Es(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(ks(e)),navigationStart:Math.floor(performance.timeOrigin)}}var Os,As=function(){var e=null,t=z(),r=null==t?void 0:t.document,n=null==t?void 0:t.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(t,i){return a(void 0,void 0,void 0,(function(){var o,s;return l(this,(function(a){return void 0===r||(o=Ae((null==n?void 0:n.href)||"",t.loggerProvider),s={"[Amplitude] Page Domain":(null==n?void 0:n.hostname)||"","[Amplitude] Page Location":o,"[Amplitude] Page Path":Ae((null==n?void 0:n.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":Ae(o.split("?")[0],t.loggerProvider)},((e,t={})=>{ss((()=>{const r=os();let n,i=Yo("LCP");const o=Ho(t,Ss),s=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)o.h(t),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-Jo(),0),i.entries=[t],n())},a=Xo("largest-contentful-paint",s);if(a){n=Wo(e,i,Cs,t.reportAllChanges);const r=Qo((()=>{s(a.takeRecords()),a.disconnect(),n(!0)}));for(const e of["keydown","click","visibilitychange"])addEventListener(e,(()=>ys(r)),{capture:!0,once:!0});Vo((r=>{i=Yo("LCP"),n=Wo(e,i,Cs,t.reportAllChanges),Ko((()=>{i.value=performance.now()-r.timeStamp,n(!0)}))}))}}))})((function(e){s["[Amplitude] LCP"]=Es(e)})),ls((function(e){s["[Amplitude] FCP"]=Es(e)})),ws((function(e){s["[Amplitude] INP"]=Es(e)})),((e,t={})=>{ls(Qo((()=>{let r,n=Yo("CLS",0);const i=Ho(t,$o),o=e=>{for(const t of e)i.h(t);i.i>n.value&&(n.value=i.i,n.entries=i.o,r())},s=Xo("layout-shift",o);s&&(r=Wo(e,n,us,t.reportAllChanges),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&(o(s.takeRecords()),r(!0))})),Vo((()=>{i.i=0,n=Yo("CLS",0),r=Wo(e,n,us,t.reportAllChanges),Ko((()=>r()))})),setTimeout(r))})))})((function(e){s["[Amplitude] CLS"]=Es(e)})),((e,t={})=>{let r=Yo("TTFB"),n=Wo(e,r,Is,t.reportAllChanges);xs((()=>{const i=Go();i&&(r.value=Math.max(i.responseStart-Jo(),0),r.entries=[i],n(!0),Vo((()=>{r=Yo("TTFB",0),n=Wo(e,r,Is,t.reportAllChanges),n(!0)})))}))})((function(e){s["[Amplitude] TTFB"]=Es(e)})),e=function(){"hidden"===r.visibilityState&&e&&(i.track("[Amplitude] Web Vitals",s),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e)),[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(t){return e&&(null==r||r.removeEventListener("visibilitychange",e)),[2]}))}))}}},Ts=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},Rs=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(Ps(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=Ts(o||"")!==Ts(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},Ps=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}))},_s=function(){function e(e,t){var r,n,i;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=De(t.apiKey,"MKTG"),this.webExpStorageKey=De(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=P,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||ye(this.sessionTimeout,this.lastEventTime),Rs(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(){var e;return l(this,(function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return(e=t.sent())?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||(new xt).parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}}))}))},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,r,n,i,s=(t=this.currentCampaign,r=this.options,n=o(o({},P),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 L),K(i));return e&&(s.event_id=e),s},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),Ms=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}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),G(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,a,u,c,h,d,p,f,g,m=this;return l(this,(function(l){switch(l.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,hr(t.apiKey,t,this)]);case 1:return(s=l.sent()).fetchRemoteConfig?(a=new He(s.apiKey,s.loggerProvider,s.serverZone),[4,new Promise((function(e){null==a||a.subscribe("configs.analyticsSDK.browserSDK","all",(function(t,r,n){s.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t&&Jr(t,s),e()}))}))]):[3,3];case 2:l.sent(),l.label=3;case 3:return(u=new Ge(s.apiKey,s.loggerProvider,s.serverZone,{enabled:s.enableDiagnostics,sampleRate:s.diagnosticsSampleRate||this._diagnosticsSampleRate})).setTag("library","".concat(jt,"/").concat(Ut)),[4,e.prototype._init.call(this,s)];case 4:return l.sent(),this.logBrowserOptions(s),this.config.diagnosticsClient=u,this.config.remoteConfigClient=a,Et(this.config.defaultTracking)?(c=function(e){return Et(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 _s(c,this.config),[4,this.webAttribution.init()]):[3,6];case 5:l.sent(),l.label=6;case 6:return h=Se(),d=h.ampTimestamp?Number(h.ampTimestamp):void 0,p=!d||Date.now()<d,this.config.identify&&this.identify(this.config.identify),f=p&&!Number.isNaN(Number(h.ampSessionId))?Number(h.ampSessionId):void 0,this.setSessionId(null!==(i=null!==(n=null!==(r=t.sessionId)&&void 0!==r?r:f)&&void 0!==n?n:this.config.sessionId)&&void 0!==i?i:Date.now()),(g=me(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline?[3,8]:[4,this.add(Wr()).promise];case 7:l.sent(),l.label=8;case 8:return[4,this.add(new ie).promise];case 9:return l.sent(),[4,this.add(new Bt).promise];case 10:return l.sent(),[4,this.add(new ve).promise];case 11:return l.sent(),function(e){Vr||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."),Vr=!0)}(this.config),v=this.config.defaultTracking,kt(v,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(qr()).promise]):[3,13];case 12:l.sent(),l.label=13;case 13:return function(e){return kt(e,"formInteractions")}(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(jr()).promise]):[3,15];case 14:l.sent(),l.label=15;case 15:return Ot(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Dr(Dt(this.config))).promise]):[3,17];case 16:l.sent(),l.label=17;case 17:return Rt(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Eo(_t(this.config),{diagnosticsClient:u})).promise]):[3,19];case 18:l.sent(),l.label=19;case 19:return Pt(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(Po(Mt(this.config))).promise]):[3,21];case 20:l.sent(),l.label=21;case 21:return Tt(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(zo(Nt(this.config))).promise]):[3,23];case 22:l.sent(),l.label=23;case 23:return function(e){return"object"==typeof e&&!0===e.webVitals}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(As()).promise]):[3,25];case 24:l.sent(),l.label=25;case 25:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 26:return l.sent(),g.eventBridge.setEventReceiver((function(e){m.track(e.eventType,e.eventProperties)})),[2]}var v}))}))},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){me(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){me(t).identityStore.editIdentity().setDeviceId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(V()),this.setUserId(void 0)},t.prototype.getIdentity=function(){var e,t;return{deviceId:null===(e=this.config)||void 0===e?void 0:e.deviceId,userId:null===(t=this.config)||void 0===t?void 0:t.userId,userProperties:this.userProperties}},t.prototype.getOptOut=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.optOut},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)),G(Promise.resolve());if(e===this.config.sessionId)return G(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,At(this.config.defaultTracking)&&(n&&i&&r.push(this.track(er,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 At(this.config.defaultTracking)&&r.push(this.track(Qt,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,G(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=pr(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,r){if(Ft(t)){var n=t._q;t._q=[],t=Lt(new L,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(Ft(n)){var o=n._q;n._q=[],n=Lt(new L,o)}return e.prototype.groupIdentify.call(this,t,r,n,i)},t.prototype.revenue=function(t,r){if(Ft(t)){var n=t._q;t._q=[],t=Lt(new Y,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,o;return l(this,(function(s){return r=Date.now(),n=ye(this.config.sessionTimeout,this.config.lastEventTime),o=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===Qt||t.event_type===er||t.session_id&&t.session_id!==this.getSessionId()||(n||o?(this.setSessionId(r),o&&this.config.loggerProvider.log("Created a new session for new campaign.")):n||this.trackCampaignEventIfNeeded()),t.event_type===i.IDENTIFY&&t.user_properties&&(this.userProperties=this.getOperationAppliedUserProperties(t.user_properties)),[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.prototype._setDiagnosticsSampleRate=function(e){e>1||e<0||this.config||(this._diagnosticsSampleRate=e)},t}(J),Ns=Object.freeze({__proto__:null,get IdentifyOperation(){return n},get SpecialEventType(){return i},get RevenueProperty(){return j},get LogLevel(){return Z},get ServerZone(){return de},OfflineDisabled:null,DEFAULT_CSS_SELECTOR_ALLOWLIST:$e,DEFAULT_DATA_ATTRIBUTE_PREFIX:Xe,DEFAULT_ACTION_CLICK_ALLOWLIST:Qe}),Ds="[Amplitude]",Ls="".concat(Ds," Session Replay ID"),Fs=de.US,Us={enabled:!0},js="".concat(Ds," Session Replay Debug"),Bs="amp-mask";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision"}(Os||(Os={}));var zs=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}(),qs="medium";var Vs,Ws,Ks=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 Ks(e,qs,r)}},Gs=function(e,t){return function(r,n){return function(e,t,r){var n,i,o;if(void 0===t&&(t={defaultMaskLevel:qs}),r){if(r.closest("."+Bs))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 Ks(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:qs,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},Js=function(e,t){return t||(e===de.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===de.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},Ys=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},Zs=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=z())?[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:""}]}}))}))},Hs=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},$s=function(){return{flushMaxRetries:2,logLevel:Z.Warn,loggerProvider:new $,transportProvider:new Ye}},Xs=function(e){function t(t,r){var n,i,s,a,l,u=this,c=$s();return(u=e.call(this,o(o({transportProvider:c.transportProvider,loggerProvider:new zs(r.loggerProvider||c.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=c.flushMaxRetries?r.flushMaxRetries:c.flushMaxRetries,u.apiKey=t,u.sampleRate=r.sampleRate||0,u.serverZone=r.serverZone||Fs,u.configServerUrl=r.configServerUrl,u.trackServerUrl=r.trackServerUrl,u.shouldInlineStylesheet=r.shouldInlineStylesheet,u.version=r.version,u.performanceConfig=r.performanceConfig||Us,u.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",u.applyBackgroundColorToBlockedElements=null!==(i=r.applyBackgroundColorToBlockedElements)&&void 0!==i&&i,u.enableUrlChangePolling=null!==(s=r.enableUrlChangePolling)&&void 0!==s&&s,u.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:1e3,u.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,r.privacyConfig&&(u.privacyConfig=r.privacyConfig),r.interactionConfig&&(u.interactionConfig=r.interactionConfig,u.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")}(u.interactionConfig.ugcFilterRules)),r.debugMode&&(u.debugMode=r.debugMode),r.experimental&&(u.experimental=r.experimental),r.omitElementTags&&(u.omitElementTags=r.omitElementTags),u}return r(t,e),t}(Q),Qs=(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))(Qs||{}),ea=(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))(ea||{});!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(Vs||(Vs={})),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"}(Ws||(Ws={}));var ta=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 Ws.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 Ws.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 Ws.PayloadTooLarge:return{status:x,statusCode:I,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case Ws.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 Ws.Timeout:default:return{status:x,statusCode:I}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?Ws.Success:429===e?Ws.RateLimit:413===e?Ws.PayloadTooLarge:408===e?Ws.Timeout:e>=400&&e<500?Ws.Invalid:e>=500?Ws.Failed:Ws.Unknown},e}(),ra="Remote config fetch rejected due to timeout after 5 seconds",na="Unexpected error occurred",ia=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.getRemoteNamespaceConfig=function(e,t){return a(n,void 0,void 0,(function(){var r,n,i;return l(this,(function(o){switch(o.label){case 0:return r=Date.now(),[4,this.fetchWithTimeout(t)];case 1:return(n=o.sent())&&(i=n.configs&&n.configs[e])?(this.metrics.fetchTimeAPISuccess=Date.now()-r,[2,i]):(this.metrics.fetchTimeAPIFail=Date.now()-r,[2,void 0])}}))}))},this.getRemoteConfig=function(e,t,r){return a(n,void 0,void 0,(function(){var n;return l(this,(function(i){switch(i.label){case 0:return[4,this.getRemoteNamespaceConfig(e,r)];case 1:return[2,null==(n=i.sent())?void 0:n[t]]}}))}))},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:ra})];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:na})];switch((new ta).buildStatus(h.status)){case Ws.Success:return this.attempts=0,[2,this.parseAndStoreConfig(h)];case Ws.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:ra})]:[2,this.completeRequest({err:null!==(m=p.message)&&void 0!==m?m:na})];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===Vs.STAGING?"https://sr-client-cfg.stag2.amplitude.com/config":this.localConfig.serverZone===Vs.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}(),oa=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 ia({localConfig:t,configKeys:r})]}))}))},sa=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,T,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,3,,4]),[4,this.remoteConfigFetch.getRemoteNamespaceConfig("sessionReplay",e)];case 2:return(h=l.sent())&&(d=h.sr_sampling_config,p=h.sr_privacy_config,f=h.sr_targeting_config,g=null===(t=s.interactionConfig)||void 0===t?void 0:t.ugcFilterRules,s.interactionConfig=h.sr_interaction_config,s.interactionConfig&&g&&(s.interactionConfig.ugcFilterRules=g),s.loggingConfig=h.sr_logging_config,(d||p||f)&&(a={},d&&(a.sr_sampling_config=d),p&&(a.sr_privacy_config=p),f&&(a.sr_targeting_config=f))),[3,4];case 3:return m=l.sent(),v=m,this.localConfig.loggerProvider.warn(v.message),s.captureEnabled=!1,[3,4];case 4:if(!a)return[2,{localConfig:this.localConfig,joinedConfig:s,remoteConfig:a}];if(y=a.sr_sampling_config,b=a.sr_privacy_config,w=a.sr_targeting_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){S=null!==(r=s.privacyConfig)&&void 0!==r?r:{},C={defaultMaskLevel:null!==(i=null!==(n=b.defaultMaskLevel)&&void 0!==n?n:S.defaultMaskLevel)&&void 0!==i?i:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},I=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},x=o(o({},I(S)),I(b));try{for(k=u(Object.entries(x)),E=k.next();!E.done;E=k.next())O=c(E.value,2),A=O[0],"mask"===(T=O[1])?C.maskSelector.push(A):"block"===T?C.blockSelector.push(A):"unmask"===T&&C.unmaskSelector.push(A)}catch(e){R={error:e}}finally{try{E&&!E.done&&(P=k.return)&&P.call(k)}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}(C,this.localConfig.loggerProvider)}return w&&Object.keys(w).length>0&&(s.targetingConfig=w),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:Hs(s)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:s,remoteConfig:a}]}}))}))},e}(),aa=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 Xs(e,t),[4,oa({localConfig:r,configKeys:["sessionReplay"]})];case 1:return n=i.sent(),[2,new sa(n,r)]}}))}))},la=Uint8Array,ua=Uint16Array,ca=Uint32Array,ha=new la([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]),da=new la([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]),pa=new la([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fa=function(e,t){for(var r=new ua(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new ca(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]},ga=fa(ha,2),ma=ga[0],va=ga[1];ma[28]=258,va[258]=28;for(var ya=fa(da,0)[1],ba=new ua(32768),wa=0;wa<32768;++wa){var Sa=(43690&wa)>>>1|(21845&wa)<<1;Sa=(61680&(Sa=(52428&Sa)>>>2|(13107&Sa)<<2))>>>4|(3855&Sa)<<4,ba[wa]=((65280&Sa)>>>8|(255&Sa)<<8)>>>1}var Ca=function(e,t,r){for(var n=e.length,i=0,o=new ua(t);i<n;++i)++o[e[i]-1];var s,a=new ua(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new ua(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[ba[h]>>>l]=u}else for(s=new ua(n),i=0;i<n;++i)s[i]=ba[a[e[i]-1]++]>>>15-e[i];return s},Ia=new la(288);for(wa=0;wa<144;++wa)Ia[wa]=8;for(wa=144;wa<256;++wa)Ia[wa]=9;for(wa=256;wa<280;++wa)Ia[wa]=7;for(wa=280;wa<288;++wa)Ia[wa]=8;var xa=new la(32);for(wa=0;wa<32;++wa)xa[wa]=5;var ka=Ca(Ia,9,0),Ea=Ca(xa,5,0),Oa=function(e){return(e/8|0)+(7&e&&1)},Aa=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof ua?ua:e instanceof ca?ca:la)(r-t);return n.set(e.subarray(t,r)),n},Ta=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},Ra=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},Pa=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 la(0),0];if(1==i){var s=new la(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 ua(d+1),f=_a(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 la(p),f]},_a=function(e,t,r){return-1==e.s?Math.max(_a(e.l,t,r+1),_a(e.r,t,r+1)):t[e.s]=r},Ma=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ua(++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]},Na=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},Da=function(e,t,r){var n=r.length,i=Oa(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)},La=function(e,t,r,n,i,o,s,a,l,u,c){Ta(t,c++,r),++i[256];for(var h=Pa(i,15),d=h[0],p=h[1],f=Pa(o,15),g=f[0],m=f[1],v=Ma(d),y=v[0],b=v[1],w=Ma(g),S=w[0],C=w[1],I=new ua(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=Pa(I,7),E=k[0],O=k[1],A=19;A>4&&!E[pa[A-1]];--A);var T,R,P,_,M=u+5<<3,N=Na(i,Ia)+Na(o,xa)+s,D=Na(i,d)+Na(o,g)+s+14+3*A+Na(I,E)+(2*I[16]+3*I[17]+7*I[18]);if(M<=N&&M<=D)return Da(t,c,e.subarray(l,l+u));if(Ta(t,c,1+(D<N)),c+=2,D<N){T=Ca(d,p,0),R=d,P=Ca(g,m,0),_=g;var L=Ca(E,O,0);Ta(t,c,b-257),Ta(t,c+5,C-1),Ta(t,c+10,A-4),c+=14;for(x=0;x<A;++x)Ta(t,c+3*x,E[pa[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];Ta(t,c,L[B]),c+=E[B],B>15&&(Ta(t,c,j[x]>>>5&127),c+=j[x]>>>12)}}}else T=ka,R=Ia,P=Ea,_=xa;for(x=0;x<a;++x)if(n[x]>255){B=n[x]>>>18&31;Ra(t,c,T[B+257]),c+=R[B+257],B>7&&(Ta(t,c,n[x]>>>23&31),c+=ha[B]);var z=31&n[x];Ra(t,c,P[z]),c+=_[z],z>3&&(Ra(t,c,n[x]>>>5&8191),c+=da[z])}else Ra(t,c,T[n[x]]),c+=R[n[x]];return Ra(t,c,T[256]),c+R[256]},Fa=new ca([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ua=function(e,t,r,n,i){return function(e,t,r,n,i,o){var s=e.length,a=new la(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=Da(l,u,e.subarray(c,h)):(l[c]=o,u=Da(l,u,e.subarray(c,s)))}else{for(var d=Fa[t-1],p=d>>>13,f=8191&d,g=(1<<r)-1,m=new ua(32768),v=new ua(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 ca(25e3),C=new ua(288),I=new ua(32),x=0,k=0,E=(c=0,0),O=0,A=0;c<s;++c){var T=w(c),R=32767&c,P=v[T];if(m[R]=P,v[T]=R,O<=c){var _=s-c;if((x>7e3||E>24576)&&_>423){u=La(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,D=0,L=f,F=R-P&32767;if(_>2&&T==w(c-F))for(var U=Math.min(p,_)-1,j=Math.min(32767,c),B=Math.min(258,_);F<=j&&--L&&R!=P;){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,D=F,z>U)break;var q=Math.min(F,z-2),V=0;for(M=0;M<q;++M){var W=c-F+M+32768&32767,K=W-m[W]+32768&32767;K>V&&(V=K,P=W)}}}F+=(R=P)-(P=m[R])+32768&32767}if(D){S[E++]=268435456|va[N]<<18|ya[D];var G=31&va[N],J=31&ya[D];k+=ha[G]+da[J],++C[257+G],++I[J],O=c+N,++x}else S[E++]=e[c],++C[e[c]]}}u=La(e,l,o,S,C,I,k,E,A,c-A,u)}return Aa(a,0,n+Oa(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 ja(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=Ua(e,t,2,4);return function(e,t){var r=t.level,n=0==r?0:r<6?1:9==r?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)}(n,t),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(n,n.length-4,r.d()),n}const Ba=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}(ja(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new la(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 la(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 Aa(n,0,i)}(JSON.stringify(t))),!0)};var za=function(){function e(e,t,r,n){var i,o=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=Ba(e);return JSON.stringify(t)},this.addCompressedEventToManager=function(e,t){o.eventsManager&&o.deviceId&&o.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:o.deviceId})},this.addCompressedEvent=function(e,t){if(o.worker)try{o.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?o.worker.postMessage(JSON.stringify({event:e,sessionId:t})):o.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{var r=o.compressEvent(e);o.addCompressedEventToManager(r,t)}},this.terminate=function(){var e;null===(e=o.worker)||void 0===e||e.terminate()};var s=z();if(this.canUseIdleCallback=s&&"requestIdleCallback"in s,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(i=t.performanceConfig)||void 0===i?void 0:i.timeout)||2e3,n){t.loggerProvider.log("[Experimental] Enabling web worker for compression");var a=new Worker(URL.createObjectURL(new Blob([n],{type:"application/javascript"})));a.onerror=function(e){t.loggerProvider.error(e)},a.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;o.addCompressedEventToManager(r,n)},this.worker=a}}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}(),qa="Failed to store session replay events in IndexedDB",Va="1.28.16",Wa=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=z(),s=(null==y?void 0:y.location)?y.location.href:"",a=Va,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(Js(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 Je).buildStatus(e)){case F.Success:this.handleSuccessResponse(t);break;case F.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 Ka=(e,t)=>t.some((t=>e instanceof t));let Ga,Ja;const Ya=new WeakMap,Za=new WeakMap,Ha=new WeakMap;let $a={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return Ya.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return tl(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Xa(e){$a=e($a)}function Qa(e){return(Ja||(Ja=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(rl(this),t),tl(this.request)}:function(...t){return tl(e.apply(rl(this),t))}}function el(e){return"function"==typeof e?Qa(e):(e instanceof IDBTransaction&&function(e){if(Ya.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)}));Ya.set(e,t)}(e),Ka(e,Ga||(Ga=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,$a):e)}function tl(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(tl(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",o)}));return Ha.set(t,e),t}(e);if(Za.has(e))return Za.get(e);const t=el(e);return t!==e&&(Za.set(e,t),Ha.set(t,e)),t}const rl=e=>Ha.get(e);function nl(e,t,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=tl(s);return n&&s.addEventListener("upgradeneeded",(e=>{n(tl(s.result),e.oldVersion,e.newVersion,tl(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 il=["get","getKey","getAll","getAllKeys","count"],ol=["put","add","delete","clear"],sl=new Map;function al(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(sl.get(t))return sl.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,i=ol.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!il.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 sl.set(t,o),o}Xa((e=>({...e,get:(t,r,n)=>al(t,r)||e.get(t,r,n),has:(t,r)=>!!al(t,r)||e.has(t,r)})));const ll=["continue","continuePrimaryKey","advance"],ul={},cl=new WeakMap,hl=new WeakMap,dl={get(e,t){if(!ll.includes(t))return e[t];let r=ul[t];return r||(r=ul[t]=function(...e){cl.set(this,hl.get(this)[t](...e))}),r}};async function*pl(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,dl);for(hl.set(r,t),Ha.set(r,rl(t));t;)yield r,t=await(cl.get(r)||t.continue()),cl.delete(r)}function fl(e,t){return t===Symbol.asyncIterator&&Ka(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Ka(e,[IDBIndex,IDBObjectStore])}Xa((e=>({...e,get:(t,r,n)=>fl(t,r)?pl:e.get(t,r,n),has:(t,r)=>fl(t,r)||e.has(t,r)})));var gl,ml=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=i.getStringSize(t);return i.getEventsArraySize(e)+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.prototype.getStringSize=function(e){return e.length},e.prototype.getEventsArraySize=function(e){var t,r,n=0;try{for(var i=u(e),o=i.next();!o.done;o=i.next()){var s=o.value;n+=this.getStringSize(s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n+(2+Math.max(0,e.length-1)+2*e.length)},e}();!function(e){e.RECORDING="recording",e.SENT="sent"}(gl||(gl={}));var vl="sessionCurrentSequence",yl="sequencesToSend",bl=function(){var e=z();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)}}))},wl=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]}}))}))},Sl=function(e){var t,r;return e.objectStoreNames.contains(vl)||(r=e.createObjectStore(vl,{keyPath:"sessionId"})),e.objectStoreNames.contains(yl)||(t=e.createObjectStore(yl,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},Cl=function(e){return a(void 0,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,nl(e,1,{upgrade:Sl})];case 1:return[2,t.sent()]}}))}))},Il=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(qa,": ").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(vl,e)];case 1:return(t=i.sent())?[4,this.db.put(yl,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=i.sent(),[4,this.db.put(vl,{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(qa,": ").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(vl,"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(qa,": ").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(yl,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(qa,": ").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(yl,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(qa,": ").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,bl()];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!==gl.SENT&&n.push(i.storeSendingEvents(e,u.events))})),[4,wl(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!==gl.SENT&&s.push(a.storeSendingEvents(n,l[t].events))}))}})),[4,wl(s)]):[3,2];case 1:l.sent(),l.label=2;case 2:return t(),[2]}}))}))}})),[4,o];case 3:return f.sent(),(s=z())&&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,Cl(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(qa,": ").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}(ml),xl=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}(ml),kl=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 Wa(o(o({},t),{loggerProvider:t.loggerProvider,payloadBatcher:u})),d=function(){return new xl({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,Il.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&&Zs().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}]}}))}))},El=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 Ol={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Al={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Tl={};function Rl(e){if(Tl[e])return Tl[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in Ol?Ol[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 Al?Al[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)return Tl[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?Tl[e]=o:r}catch{return r}}const Pl={};function _l(e,t,r){var n;const i=`${e}.${String(r)}`;if(Pl[i])return Pl[i].call(t);const o=Rl(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Pl[i]=s,s.call(t)):t[r]}const Ml={};function Nl(e,t,r){const n=`${e}.${String(r)}`;if(Ml[n])return Ml[n].bind(t);const i=Rl(e)[r];return"function"!=typeof i?t[r]:(Ml[n]=i,i.bind(t))}const Dl={childNodes:function(e){return _l("Node",e,"childNodes")},parentNode:function(e){return _l("Node",e,"parentNode")},parentElement:function(e){return _l("Node",e,"parentElement")},textContent:function(e){return _l("Node",e,"textContent")},contains:function(e,t){return Nl("Node",e,"contains")(t)},getRootNode:function(e){return Nl("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?_l("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?_l("Element",e,"shadowRoot"):null},querySelector:function(e,t){return _l("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return _l("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Rl("MutationObserver").constructor}};function Ll(){var e=z();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function Fl(){var e=z();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}var Ul,jl,Bl;function zl(e,t){if(Bl=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};Ul=o(o({},r),t),jl=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Ul.root,r);var n=ql(e,"all",(function(){return ql(e,"two",(function(){return ql(e,"one",(function(){return ql(e,"none")}))}))}));if(n){var i=Xl(Ql(n,e));return i.length>0&&(n=i[0]),Wl(n)}throw new Error("Selector was not found.")}function ql(e,t,r){for(var n=null,i=[],o=e,s=0,a=function(){var e,a,l=(new Date).getTime()-Bl.getTime();if(void 0!==Ul.timeoutMs&&l>Ul.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var d=Zl(function(e){var t=e.getAttribute("id");if(t&&Ul.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||Zl.apply(void 0,h([],c(function(e){var t=Array.from(e.attributes).filter((function(e){return Ul.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))||Zl.apply(void 0,h([],c(function(e){var t=Array.from(e.classList).filter(Ul.className);return t.map((function(e){return{name:"."+CSS.escape(e),penalty:1}}))}(o)),!1))||Zl(function(e){var t=e.tagName.toLowerCase();if(Ul.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(Yl).map((function(e){return Jl(e,p)}))));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(Yl).map((function(e){return Jl(e,p)}))));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&Yl(f)&&(d=[Jl(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[Jl(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>=Ul.seedMinLength&&(n=Vl(i,r)))return"break";o=o.parentElement,s++};o;){if("break"===a())break}return n||(n=Vl(i,r)),!n&&r?r():n}function Vl(e,t){var r,n,i=Xl($l(e));if(i.length>Ul.threshold)return t?t():null;try{for(var o=u(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(Gl(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 Wl(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 Kl(e){return e.map((function(e){return e.penalty})).reduce((function(e,t){return e+t}),0)}function Gl(e){var t=Wl(e);switch(jl.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 Jl(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Yl(e){return"html"!==e.name&&!e.name.startsWith("#")}function Zl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(Hl);return r.length>0?r:null}function Hl(e){return null!=e}function $l(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($l(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 Xl(e){return h([],c(e),!1).sort((function(e,t){return Kl(e)-Kl(t)}))}function Ql(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>Ul.optimizedMinLength))return[3,5];n=1,s.label=1;case 1:return n<e.length-1?r.counter>Ul.maxNumberOfTries?[2]:(r.counter+=1,(i=h([],c(e),!1)).splice(n,1),o=Wl(i),r.visited.has(o)?[2]:Gl(i)&&function(e,t){return jl.querySelector(Wl(e))===t}(i,t)?[4,i]:[3,4]):[3,5];case 2:return s.sent(),r.visited.set(o,!0),[5,u(Ql(i,t,r))];case 3:s.sent(),s.label=4;case 4:return n++,[3,1];case 5:return[2]}}))}var eu=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}},tu=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)}},ru=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===ea.Click){var a=z();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=zl(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=Dl.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=Dl.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:Ys(l.href,s),timestamp:Date.now(),type:"click"},v=i();v&&r.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(m)},deviceId:v})}}}}}},nu=function(){function e(e,t){var r=z();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=Js(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}(),iu=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=z();s&&o&&r.transport.send(o,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:Ll(),viewportWidth:Fl(),pageUrl:Ys(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=Fl(),this._maxScrollHeight=Ll(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new nu(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=Fl();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=Ll();this._maxScrollY=e.y;var o=e.y+i;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),ou=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))},su=function(){var e=this;this.dbs={},this.createStore=function(t){return a(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,nl(t,1,{upgrade:function(e){e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}}))}))},this.openOrCreateDB=function(t){return a(e,void 0,void 0,(function(){var e,r;return l(this,(function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}}))}))},this.getTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,i=t.sessionId;return a(e,void 0,void 0,(function(){var e,t,o,s;return l(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(i),[4,e.get("sessionTargetingMatch",t)];case 2:return[2,null==(o=a.sent())?void 0:o.targetingMatch];case 3:return s=a.sent(),r.warn("Failed to get targeting match for session id ".concat(i,": ").concat(s)),[3,4];case 4:return[2,void 0]}}))}))},this.storeTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,i=t.sessionId,o=t.targetingMatch;return a(e,void 0,void 0,(function(){var e,t,s;return l(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(i),[4,e.put("sessionTargetingMatch",{targetingMatch:o,sessionId:t,lastUpdated:Date.now()})];case 2:return[2,a.sent()];case 3:return s=a.sent(),r.warn("Failed to store targeting match for session id ".concat(i,": ").concat(s)),[3,4];case 4:return[2,void 0]}}))}))},this.clearStoreOfOldSessions=function(t){var r=t.loggerProvider,n=t.apiKey,i=t.currentSessionId;return a(e,void 0,void 0,(function(){var e,t,o,s,a,u,c,h;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,8,,9]),[4,this.openOrCreateDB(n)];case 1:return e=l.sent(),t=String(i),[4,(o=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:s=l.sent(),a=0,l.label=3;case 3:return a<s.length?(u=s[a],c=Date.now()-u.lastUpdated,u.sessionId!==t&&c>1728e5?[4,o.store.delete(u.sessionId)]:[3,5]):[3,6];case 4:l.sent(),l.label=5;case 5:return a++,[3,3];case 6:return[4,o.done];case 7:return l.sent(),[3,9];case 8:return h=l.sent(),r.warn("Failed to clear old targeting matches for sessions: ".concat(h)),[3,9];case 9:return[2]}}))}))}},au=new su,lu=function(e){var t=e.sessionId,r=e.targetingConfig,n=e.loggerProvider,i=e.apiKey,s=e.targetingParams;return a(void 0,void 0,void 0,(function(){var e,a,u,c;return l(this,(function(l){switch(l.label){case 0:return[4,au.clearStoreOfOldSessions({loggerProvider:n,apiKey:i,currentSessionId:t})];case 1:return l.sent(),[4,au.getTargetingMatchForSession({loggerProvider:n,apiKey:i,sessionId:t})];case 2:if(!0===l.sent())return[2,!0];e=!0,l.label=3;case 3:return l.trys.push([3,6,,7]),[4,Promise.resolve().then((function(){return Yd}))];case 4:return[4,(0,l.sent().evaluateTargeting)(o(o({},s),{flag:r,sessionId:t,apiKey:i,loggerProvider:n}))];case 5:return(a=l.sent())&&a.sr_targeting_config&&(e="on"===a.sr_targeting_config.key),au.storeTargetingMatchForSession({loggerProvider:n,apiKey:i,sessionId:t,targetingMatch:e}),[3,7];case 6:return u=l.sent(),c=u,n.warn(c.message),[3,7];case 7:return[2,e]}}))}))};function uu(e){return void 0===e&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,r,n){var i,s,a,l=o(o({},e),n),u=l.ugcFilterRules||[],c=null!==(i=l.enablePolling)&&void 0!==i&&i,h=null!==(s=l.pollingInterval)&&void 0!==s?s:1e3,d=null!==(a=l.captureDocumentTitle)&&void 0!==a&&a;if(!r)return function(){};var p=void 0,f=function(){return r.location&&r.location.href||""},g=function(){var e=f();if(void 0===p||e!==p){p=e;var n=function(){var e=r.innerHeight,t=r.innerWidth,n=r.document,i=f(),o="";return d&&(o=(null==n?void 0:n.title)||""),{href:u.length>0?Ys(i,u):i,title:o,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();t(n)}},m=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=e.apply(this,t);return g(),n}},v=function(){g()};if(c){var y=r.setInterval((function(){g()}),h);return g(),function(){y&&r.clearInterval(y)}}if(r.history){var b=r.history.pushState.bind(r.history),w=r.history.replaceState.bind(r.history);return r.history.pushState=m(b),r.history.replaceState=m(w),r.addEventListener("popstate",g),r.addEventListener("hashchange",v),g(),function(){r.history.pushState=b,r.history.replaceState=w,r.removeEventListener("popstate",g),r.removeEventListener("hashchange",v)}}return r.addEventListener("hashchange",v),g(),function(){r.removeEventListener("hashchange",v)}},options:e}}uu();var cu=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,this.teardownEventListeners=function(t){var r=z();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.evaluateTargetingAndCapture=function(t,r){return void 0===r&&(r=!1),a(e,void 0,void 0,(function(){var e,n;return l(this,(function(o){switch(o.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig){if(!r)return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.")}return this.lastTargetingParams=t,!this.config.targetingConfig||this.sessionTargetingMatch?[3,2]:((e=t.event)&&Object.values(i).includes(e.event_type)&&(e=void 0),n=this,[4,lu({sessionId:this.identifiers.sessionId,targetingConfig:this.config.targetingConfig,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:e}})]);case 1:n.sessionTargetingMatch=o.sent(),this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:e,targetingParams:t},null,2)),o.label=2;case 2:return r?(this.initialize(!0),[3,5]):[3,3];case 3:return[4,this.recordEvents()];case 4:o.sent(),o.label=5;case 5:return[2]}}))}))},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!==Os.METADATA?(e={config:Hs(i),version:Va},n?[4,Zs()]:[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 zs(new $)}return e.prototype.init=function(e,t){return G(this._init(e,t))},e.prototype._init=function(e,t){var r,n,i,o,s,u,d;return a(this,void 0,void 0,(function(){var a,p,f,g,m,v,y,b,w,S,C,I,x,k,E,O,A;return l(this,(function(l){switch(l.label){case 0:return this.loggerProvider=new zs(t.loggerProvider||new $),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new ou({sessionId:t.sessionId,deviceId:t.deviceId}),a=this,[4,aa(e,t)];case 1:return a.joinedConfigGenerator=l.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)];case 2:p=l.sent(),f=p.joinedConfig,g=p.localConfig,m=p.remoteConfig,this.config=f,this.setMetadata(t.sessionId,f,g,m,null===(r=t.version)||void 0===r?void 0:r.version,Va,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)&&(v=iu.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[v.send(this.getDeviceId.bind(this)).bind(v)],this.scrollHook=v.hook.bind(v)),y=[],"idb"!==(b=this.config.storeType)||(null===(o=z())||void 0===o?void 0:o.indexedDB)||(b="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(b," for event storage.")),l.label=3;case 3:return l.trys.push([3,5,,6]),[4,kl({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:b})];case 4:return w=l.sent(),y.push({name:"replay",manager:w}),[3,6];case 5:return S=l.sent(),k=S,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(k.toString())),[3,6];case 6:if(!(null===(s=this.config.interactionConfig)||void 0===s?void 0:s.enabled))return[3,10];C=this.config.interactionConfig.batch?tu:eu,l.label=7;case 7:return l.trys.push([7,9,,10]),[4,kl({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!==(u=this.config.interactionConfig.trackEveryNms)&&void 0!==u?u:3e4,maxInterval:6e4,payloadBatcher:C,storeType:b})];case 8:return I=l.sent(),y.push({name:"interaction",manager:I}),[3,10];case 9:return x=l.sent(),k=x,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(k.toString())),[3,10];case 10:return this.eventsManager=new(El.bind.apply(El,h([void 0],c(y),!1))),this.eventCompressor&&this.eventCompressor.terminate(),E=void 0,O=z(),(null===(d=this.config.experimental)||void 0===d?void 0:d.useWebWorker)&&O&&O.Worker?[4,Promise.resolve().then((function(){return Zd}))]:[3,12];case 11:A=l.sent().compressionScript,E=A,l.label=12;case 12:return this.eventCompressor=new za(this.eventsManager,this.config,this.getDeviceId(),E),[4,this.initializeNetworkObservers()];case 13:return l.sent(),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:t.userProperties},!0)];case 14:return l.sent(),[2]}}))}))},e.prototype.setSessionId=function(e,t){return G(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n;return a(this,void 0,void 0,(function(){var i,o,s;return l(this,(function(a){switch(a.label){case 0:return this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(i=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(i),o=t||this.getDeviceId(),this.identifiers=new ou({sessionId:e,deviceId:o}),this.joinedConfigGenerator&&i?[4,this.joinedConfigGenerator.generateJoinedConfig(this.identifiers.sessionId)]:[3,2];case 1:s=a.sent().joinedConfig,this.config=s,a.label=2;case 2:return(null===(n=this.config)||void 0===n?void 0:n.targetingConfig)?[4,this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties})]:[3,4];case 3:return a.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:a.sent(),a.label=6;case 6:return[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={})[Ls]=r.sessionReplayId?r.sessionReplayId:null,i=e,t.debugMode&&(i[js]=JSON.stringify({appHash:Te(t.apiKey).toString()}))),this.addCustomRRWebEvent(Os.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=me(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=!1,t="",r=!1;this.config.targetingConfig?this.sessionTargetingMatch?(t="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(t),e=!0,r=!0):(t="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(t),e=!1,r=!1):Re(this.identifiers.sessionId,this.config.sampleRate)?(e=!0,r=!0):(t="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(t),e=!1,r=!1);return this.lastShouldRecordDecision!==e&&this.config.targetingConfig&&(this.addCustomRRWebEvent(Os.TARGETING_DECISION,{message:t,sessionId:this.identifiers.sessionId,matched:r,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=e),e},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,r,n,i,o,s;return a(this,void 0,void 0,(function(){var a,u,c,h;return l(this,(function(l){switch(l.label){case 0:a=[];try{u=uu({ugcFilterRules:(null===(r=null===(t=this.config)||void 0===t?void 0:t.interactionConfig)||void 0===r?void 0:r.ugcFilterRules)||[],enablePolling:(null===(n=this.config)||void 0===n?void 0:n.enableUrlChangePolling)||!1,pollingInterval:null===(i=this.config)||void 0===i?void 0:i.urlChangePollingInterval,captureDocumentTitle:null===(o=this.config)||void 0===o?void 0:o.captureDocumentTitle}),a.push(u)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null===(s=null==e?void 0:e.console)||void 0===s?void 0:s.enabled))return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,Promise.resolve().then((function(){return PS}))];case 2:return c=l.sent().getRecordConsolePlugin,a.push(c({level:e.console.levels})),[3,4];case 3:return h=l.sent(),this.loggerProvider.warn("Failed to load console plugin:",h),[3,4];case 4:return[2,a.length>0?a: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 KP}))];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,i,o;return void 0===e&&(e=!0),a(this,void 0,void 0,(function(){var s,a,u,c,h,d,p,f,g,m,v,y,b,w=this;return l(this,(function(l){switch(l.label){case 0:return s=this.config,a=this.getShouldRecord(),u=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,a&&u&&s?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(c=l.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:l.sent(),null===(r=this.networkObservers)||void 0===r||r.start((function(e){w.addCustomRRWebEvent(Os.FETCH_REQUEST,e)})),h=s.privacyConfig,d=s.interactionConfig,p=s.loggingConfig,f=(null==d?void 0:d.enabled)?{mouseInteraction:this.eventsManager&&ru(this.loggerProvider,{eventsManager:this.eventsManager,sessionId:u,deviceIdFn:this.getDeviceId.bind(this),mirror:c.mirror,ugcFilterRules:null!==(n=d.ugcFilterRules)&&void 0!==n?n:[]}),scroll:this.scrollHook}:{},g=(null==d?void 0:d.enabled)&&d.ugcFilterRules?d.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(u,".")),l.label=3;case 3:return l.trys.push([3,5,,6]),m=this,v=c,b={emit:function(e){if(w.shouldOptOut())return w.loggerProvider.log("Opting session ".concat(u," out of recording due to optOut config.")),w.stopRecordingEvents(),void w.sendEvents();e.type===Qs.Meta&&(e.data.href=Ys(e.data.href,g)),w.eventCompressor&&w.eventCompressor.enqueueEvent(e,u)},inlineStylesheet:s.shouldInlineStylesheet,hooks:f,maskAllInputs:!0,maskTextClass:Bs,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:s.applyBackgroundColorToBlockedElements,maskInputFn:Gs("input",h),maskTextFn:Gs("text",h),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:null===(i=s.omitElementTags)||void 0===i?void 0:i.script,comment:null===(o=s.omitElementTags)||void 0===o?void 0:o.comment},errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return w.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(p)];case 4:return m.recordCancelCallback=v.apply(void 0,[(b.plugins=l.sent(),b)]),this.addCustomRRWebEvent(Os.DEBUG_INFO),e&&this.addCustomRRWebEvent(Os.METADATA,this.metadata),[3,6];case 5:return y=l.sent(),this.loggerProvider.warn("Failed to initialize session replay:",y),[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())?Te(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 JP}))];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}(),hu=function(e){return function(){var t=e.config||$s();return{logger:t.loggerProvider,logLevel:t.logLevel}}},du=function(){var e=new cu;return{init:Ee(e.init.bind(e),"init",hu(e)),evaluateTargetingAndCapture:Ee(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",hu(e)),setSessionId:Ee(e.setSessionId.bind(e),"setSessionId",hu(e)),getSessionId:Ee(e.getSessionId.bind(e),"getSessionId",hu(e)),getSessionReplayProperties:Ee(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",hu(e)),flush:Ee(e.flush.bind(e),"flush",hu(e)),shutdown:Ee(e.shutdown.bind(e),"shutdown",hu(e))}}(),pu=du.init,fu=du.setSessionId,gu=du.getSessionId,mu=du.getSessionReplayProperties,vu=du.flush,yu=du.shutdown,bu=du.evaluateTargetingAndCapture,wu=[yt.SET,yt.SET_ONCE,yt.ADD,yt.APPEND,yt.PREPEND,yt.POSTINSERT],Su="1.22.19",Cu=function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.sessionReplay={flush:vu,getSessionId:gu,getSessionReplayProperties:mu,init:pu,setSessionId:fu,shutdown:yu,evaluateTargetingAndCapture:bu},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,a,c;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),null==e||e.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(Su,".")),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})),t=(h=this.config.instanceName,void 0===h&&(h="$default_instance"),ge.getInstance(h)).identityStore,a=t.getIdentity().userProperties,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:Su},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,experimental:this.options.experimental,userProperties:a,omitElementTags:this.options.omitElementTags,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval},[4,this.sessionReplay.init(e.apiKey,this.srInitOptions).promise];case 1:return l.sent(),[3,3];case 2:return c=l.sent(),null==e||e.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(c.message)),[3,3];case 3:return[2]}var h}))}))},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,s,a;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,9,,10]),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:l.sent(),l.label=2;case 2:s=this.sessionReplay.getSessionReplayProperties(),e.event_properties=o(o({},e.event_properties),s),l.label=3;case 3:return[3,8];case 4:return(r=this.config.sessionId)&&r!==this.sessionReplay.getSessionId()?[4,this.sessionReplay.setSessionId(r).promise]:[3,6];case 5:l.sent(),l.label=6;case 6:return r&&r===e.session_id?(n=void 0,e.event_type===i.IDENTIFY&&(n=function(e){if(e.user_properties){var t={};return Object.keys(e.user_properties).forEach((function(r){if(wu.includes(r)){var n=e.user_properties&&e.user_properties[r];t=o(o({},t),n)}})),t}}(e)),[4,this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:n})]):[3,8];case 7:l.sent(),s=this.sessionReplay.getSessionReplayProperties(),e.event_properties=o(o({},e.event_properties),s),l.label=8;case 8:return[2,Promise.resolve(e)];case 9:return a=l.sent(),null===(t=this.config)||void 0===t||t.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(a.message)),[2,Promise.resolve(e)];case 10: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}(),Iu=function(e,t){return Iu=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])},Iu(e,t)};function xu(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}Iu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var ku=function(){return ku=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},ku.apply(this,arguments)};function Eu(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 Ou(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 Au(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 Tu(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 Ru(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 Pu="is",_u="is not",Mu="contains",Nu="does not contain",Du="less",Lu="less or equal",Fu="greater",Uu="greater or equal",ju="version less",Bu="version less or equal",zu="version greater",qu="version greater or equal",Vu="set is",Wu="set is not",Ku="set contains",Gu="set does not contain",Ju="set contains any",Yu="set does not contain any",Zu="regex match",Hu="regex does not match",$u=-862048943,Xu=461845907,Qu=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=nc(r,s<<2);o=ec(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,$u),u=rc(u,15),o^=u=Math.imul(u,Xu);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,$u),u=rc(u,15),o^=u=Math.imul(u,Xu);break;case 1:u^=r[l],u=Math.imul(u,$u),u=rc(u,15),o^=u=Math.imul(u,Xu)}return tc(o^=n)>>>0},ec=function(e,t){var r=e,n=t;return r=Math.imul(r,$u),r=rc(r,15),r=Math.imul(r,Xu),n=rc(n^=r,13),(n=Math.imul(n,5))+-430675100|0},tc=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},rc=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},nc=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 ic(r)},ic=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},oc=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=Au(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}},sc="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),ac=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(sc).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}(),lc=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=Au(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=Au(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=ku(ku(ku({},t.metadata),a.metadata),i.metadata);i=ku(ku({},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=Au(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=!0;try{for(var c=(i=void 0,Au(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=oc(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 Qu(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(oc(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=Au(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,Au(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 Pu:case Mu:case Du:case Lu:case Fu:case Uu:case ju:case Bu:case zu:case qu:case Vu:case Ku:case Ju:return r;case _u:case Nu:case Gu:case Yu:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Vu:return this.setEquals(e,r);case Wu:return!this.setEquals(e,r);case Ku:return this.matchesSetContainsAll(e,r);case Gu:return!this.matchesSetContainsAll(e,r);case Ju:return this.matchesSetContainsAny(e,r);case Yu:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Pu:return this.matchesIs(e,r);case _u:return!this.matchesIs(e,r);case Mu:return this.matchesContains(e,r);case Nu:return!this.matchesContains(e,r);case Du:case Lu:case Fu:case Uu:return this.matchesComparable(e,t,r,(function(e){return n.parseNumber(e)}),this.comparator);case ju:case Bu:case zu:case qu:return this.matchesComparable(e,t,r,(function(e){return ac.parse(e)}),this.versionComparator);case Zu:return this.matchesRegex(e,r);case Hu: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=Au(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 Du:case ju:return e<r;case Lu:case Bu:return e<=r;case Fu:case zu:return e>r;case Uu:case qu:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Du:case ju:return n<0;case Lu:case Bu:return n<=0;case Fu:case zu:return n>0;case Uu:case qu: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 Vu:case Wu:case Ku:case Gu:case Ju:case Yu: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&&Ru([],Tu(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=Au(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=Au(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}(),uc=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=uc(e,t,r);n&&s.push.apply(s,Ru([],Tu(n),!1))};try{for(var l=Au(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 cc="function"==typeof btoa,hc="function"==typeof Buffer,dc=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),pc=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),fc=((e=>{let t={};e.forEach(((e,r)=>t[e]=r))})(pc),String.fromCharCode.bind(String)),gc=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),mc=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+=pc[t>>18&63]+pc[t>>12&63]+pc[t>>6&63]+pc[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},vc=cc?e=>btoa(e):hc?e=>Buffer.from(e,"binary").toString("base64"):mc,yc=hc?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(fc.apply(null,e.subarray(r,r+4096)));return vc(t.join(""))},bc=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?fc(192|t>>>6)+fc(128|63&t):fc(224|t>>>12&15)+fc(128|t>>>6&63)+fc(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return fc(240|t>>>18&7)+fc(128|t>>>12&63)+fc(128|t>>>6&63)+fc(128|63&t)},wc=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Sc=e=>e.replace(wc,bc),Cc=hc?e=>Buffer.from(e,"utf8").toString("base64"):dc?e=>yc(dc.encode(e)):e=>vc(Sc(e)),Ic=(e,t=!1)=>t?gc(Cc(e)):Cc(e),xc=e=>Ic(e,!0),kc=xc;var Ec=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return xu(t,e),t}(Error),Oc=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return xu(t,e),t}(Error),Ac=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return Eu(this,void 0,void 0,(function(){var r,n,i,o;return Ou(this,(function(s){switch(s.label){case 0:return r=kc(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"]=kc(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 Ec(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}}))}))},e}(),Tc=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return Eu(this,void 0,void 0,(function(){var t,r;return Ou(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"]=kc(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}(),Rc="undefined"!=typeof globalThis?globalThis:global||self,Pc=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},_c=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=Rc.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(Rc.clearInterval(this.poller),this.poller=void 0)},e}(),Mc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Nc={},Dc={get exports(){return Nc},set exports(e){Nc=e}};!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",T="LG",R="Microsoft",P="Motorola",_="Opera",M="Samsung",N="Sharp",D="Sony",L="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()},q=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},V=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}},W=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,W,{"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,L],[c,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[h,L],[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,P],[c,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[h,P],[c,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[h,T],[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,T],[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,D],[c,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[h,D],[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,R],[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,R],[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,D],[c,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[h,R],[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,T],[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,D],[c,v]],[/(mitv-\w{5}) bui/i],[l,[h,L],[c,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,q],[l,q],[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,W,K]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[d,W,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]]},J=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof J))return new J(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,V.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,V.call(e,i,f.cpu),e},this.getDevice=function(){var e={};return e[h]=n,e[l]=n,e[c]=n,V.call(e,i,f.device),e},this.getEngine=function(){var e={};return e[u]=n,e[d]=n,V.call(e,i,f.engine),e},this.getOS=function(){var e={};return e[u]=n,e[d]=n,V.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?q(e,350):e,this},this.setUA(i),this};J.VERSION="0.7.33",J.BROWSER=j([u,d,"major"]),J.CPU=j([p]),J.DEVICE=j([l,h,c,f,g,v,m,y,b]),J.ENGINE=J.OS=j([u,d]),e.exports&&(t=e.exports=J),t.UAParser=J;var Y=typeof r!==o&&(r.jQuery||r.Zepto);if(Y&&!Y.ua){var Z=new J;Y.ua=Z.getResult(),Y.ua.get=function(){return Z.getUA()},Y.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var r in t)Y.ua[r]=t[r]}}}("object"==typeof window?window:Mc)}(Dc,Nc);var Lc=function(){return Lc=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},Lc.apply(this,arguments)};function Fc(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 Uc(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 jc(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 Bc(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 zc(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 qc=function(e,t){var r,n;void 0===t&&(t=!1);var i=Vc(e,t),o=void 0,s=Rc.document.cookie.split("; ");try{for(var a=jc(s),l=a.next();!l.done;l=a.next()){var u=Bc(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}},Vc=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))},Wc=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 Fc(this,void 0,void 0,(function(){return Uc(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=qc(this.apiKey,!0);return(e||(e=qc(this.apiKey,!1))||(e=function(e){var t=Vc(e,!0);try{var r=Rc.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=Vc(e,!0);try{var r=Rc.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 Fc(this,void 0,void 0,(function(){var t,r=this;return Uc(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){Rc.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")}))])]}))}))},e}();var Kc,Gc,Jc=Rc.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)}))},Yc=function(){function e(e){this.client=e}return e.prototype.request=function(e){return Fc(this,void 0,void 0,(function(){return Uc(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}(),Zc={request:function(e,t,r,n,i){return function(e,t){return null==t||t<=0?e:new Promise((function(r,n){Rc.setTimeout((function(){n(new Oc("Request timeout after "+t+" milliseconds"))}),t),e.then(r,n)}))}(Fc(void 0,void 0,void 0,(function(){var i,o;return Uc(this,(function(s){switch(s.label){case 0:return[4,Jc(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"}(Kc||(Kc={})),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"}(Gc||(Gc={}));var Hc=function(e){return!e||e===Gc.FallbackInline||e===Gc.FallbackConfig||e===Gc.SecondaryInitialVariants},$c={debug:!1,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:Kc.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:Zc},Xc="1.15.5",Qc=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:$c.instanceName;this.queue=new th(i),this.cache=new eh(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}(),eh=function(){function e(e){this.isSessionStorageAvailable=rh(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&Rc.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=Rc.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&Rc.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),th=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=function(){var e=Pc();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=Rc.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=jc(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&&(Rc.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=Rc.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)),Rc.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),rh=function(){var e=Pc();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},nh=function(){function e(){this.globalScope=Pc()}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}(),ih=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 Lc({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=jc(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=jc(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}(),oh=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}},sh=function(){function e(){this.globalScope=Pc()}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}(),ah=function(e){return null==e},lh=function(e){return!!ah(e)||e&&0===Object.keys(e).length},uh=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},ch=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 Fc(this,void 0,void 0,(function(){return Uc(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 Fc(this,void 0,void 0,(function(){var n=this;return Uc(this,(function(i){return this.done||(this.timeoutHandle=Rc.setTimeout((function(){return Fc(n,void 0,void 0,(function(){var n,i;return Uc(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}(),hh=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},dh=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},ph=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}(),fh=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}(),gh=function(){function e(e,t){var r,n,i,o,s=this;this.engine=new lc,this.isRunning=!1,this.apiKey=e,this.config=Lc(Lc(Lc({},$c),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":$c.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":$c.flagsServerUrl),flagConfigPollingIntervalMillis:t.flagConfigPollingIntervalMillis<6e4?6e4:null!==(i=t.flagConfigPollingIntervalMillis)&&void 0!==i?i:$c.flagConfigPollingIntervalMillis});var a=null===(o=this.config)||void 0===o?void 0:o.internalInstanceNameSuffix;if(this.isWebExperiment="web"===a,this.poller=new _c((function(){return s.doFlags()}),this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var l in this.config.initialVariants)this.config.initialVariants[l]=oh(this.config.initialVariants[l]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new ph(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.exposureTrackingProvider=new fh(this.config.exposureTrackingProvider)),this.integrationManager=new Qc(this.config,this);var u,c=new Yc(this.config.httpClient||Zc);this.flagApi=new Tc(this.apiKey,this.config.flagsServerUrl,c),this.evaluationApi=new Ac(this.apiKey,this.config.serverUrl,c);var h=a?"".concat(this.config.instanceName,"-").concat(a):this.config.instanceName;u=this.isWebExperiment?new sh:new nh,this.variants=function(e,t,r){var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n);return new ih(i,r,oh)}(this.apiKey,h,u),this.flags=function(e,t,r){void 0===r&&(r=new nh);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-flags");return new ih(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 Fc(this,void 0,void 0,(function(){var r;return Uc(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),Fc(this,void 0,void 0,(function(){var r;return Uc(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 Oc?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);uh(r)||delete e[t]}return Lc(Lc(Lc({},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=Lc({},this.user.user_properties);return Lc(Lc({},this.user),{user_properties:t})}return Lc({},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=Lc({},e.user_properties);this.user=Lc(Lc({},e),{user_properties:r})}else this.user=Lc({},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=ku({},e),o=[],s=t||Object.keys(i);try{for(var a=Au(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=uc(u,i);c&&o.push.apply(o,Ru([],Tu(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=Pc();s&&(o.page={url:s.location.href});var a={};if(!e.groups)return o;try{for(var l=jc(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=jc(Object.keys(s)),u=l.next();!u.done;u=l.next()){var c=u.value;a[c]=dh(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===Kc.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===Kc.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var n=this.flags.get(e);return(uh(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=Gc.LocalEvaluation,a=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!ah(o)&&!a)return{variant:hh(o),source:s,hasDefaultVariant:!1};if(a&&(i={variant:hh(o),source:s,hasDefaultVariant:!0}),!ah(r))return{variant:hh(r),source:Gc.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!ah(l))return{variant:hh(l),source:Gc.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=hh(this.config.fallbackVariant),c={variant:u,source:Gc.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return lh(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(!ah(i)&&!o)return{variant:hh(i),source:Gc.LocalStorage,hasDefaultVariant:!1};if(o&&(n={variant:hh(i),source:Gc.LocalStorage,hasDefaultVariant:!0}),!ah(t))return{variant:hh(t),source:Gc.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=this.config.initialVariants[e];if(!ah(s))return{variant:hh(s),source:Gc.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var a=hh(this.config.fallbackVariant),l={variant:a,source:Gc.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return lh(a)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!ah(i))return{variant:hh(i),source:Gc.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(!ah(o)&&!s)return{variant:hh(o),source:Gc.LocalStorage,hasDefaultVariant:!1};if(s&&(n={variant:hh(o),source:Gc.LocalStorage,hasDefaultVariant:!0}),!ah(t))return{variant:hh(t),source:Gc.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var a=hh(this.config.fallbackVariant),l={variant:a,source:Gc.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return lh(a)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return Fc(this,void 0,void 0,(function(){var i,o;return Uc(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=Lc({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return Fc(this,void 0,void 0,(function(){var n,i,o,s,a,l,u;return Uc(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,Lc({timeoutMillis:t},r))];case 2:n=c.sent(),i={};try{for(o=jc(Object.keys(n)),s=o.next();!s.done;s=o.next())a=s.value,i[a]=dh(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 Fc(this,void 0,void 0,(function(){var e,t,r;return Uc(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:Xc,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 Oc))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 Fc(this,void 0,void 0,(function(){var r,n,i,o;return Uc(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 Fc(this,void 0,void 0,(function(){var r=this;return Uc(this,(function(n){return this.debug("[Experiment] Retry fetch"),this.retriesBackoff=new ch(8,500,1e4,1.5),this.retriesBackoff.start((function(){return Fc(r,void 0,void 0,(function(){return Uc(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=Lc(Lc(Lc({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return Lc(Lc(Lc(Lc({library:"experiment-js-client/".concat(Xc)},r),n),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return Fc(this,void 0,void 0,(function(){return Uc(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==Kc.LocalStorage?this.variants.getAll():this.config.source==Kc.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==Kc.LocalStorage?this.config.initialVariants:this.config.source==Kc.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=Hc(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);Hc(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,zc([e],Bc(t),!1))},e.prototype.shouldRetryFetch=function(e){return!(e instanceof Ec)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),mh=function(){function e(e,t){var r,n,i;this.globalScope=Pc(),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 Nc.UAParser(this.userAgent).getResult(),this.localStorage=new nh,this.sessionStorage=new sh,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 Lc({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=jc(i.searchParams),s=o.next();!s.done;s=o.next()){var a=Bc(s.value,2),l=a[0],u=a[1];n[l]=zc(zc([],Bc(null!==(r=n[l])&&void 0!==r?r:[]),!1),Bc(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=Bc(t,2),n=r[0],i=r[1];return e[n]=1==i.length?i[0]:i,e}),{})}},e}();Rc.experimentInstances={};var vh=Rc.experimentInstances,yh=function(e){return(null==e?void 0:e.instanceName)||$c.instanceName},bh=function(e,t,r){var n=function(e,t){var r=yh(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)}(e,t),i=vh[n];return i||(i=function(e,t){return new gh(e,Lc(Lc({},t),{userProvider:new mh(null==t?void 0:t.userProvider,e)}))}(e,t),r&&i.addPlugin(r()),vh[n]=i,i)},wh=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 bh(e,t,(function(){return new Wc(e,ge.getInstance(yh(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}(),Sh=function(e){return new wh(e)},Ch=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Ih(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),Ih=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},xh=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}(),kh=function(){return kh=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},kh.apply(this,arguments)};function Eh(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 Oh(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}var Ah=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=Eh(["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||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(!Ah(u,c))return!1;var h=!0;return Object.keys(e).forEach((function(r){Ah(e[r],t[r])||(h=!1)})),h}for(var d=0;d<e.length;d++)if(!Ah(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 Th=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=kh({},this.identity.userProperties),r=kh(kh({},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=Eh(Object.entries(e)),c=u.next();!c.done;c=u.next()){var h=Oh(c.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(i=void 0,Eh(Object.entries(p))),g=f.next();!g.done;g=f.next()){var m=Oh(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,Eh(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 kh({},this.identity)},e.prototype.setIdentity=function(e){var t=kh({},this.identity);this.identity=kh({},e),Ah(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}(),Rh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:self,Ph=function(){function e(){this.identityStore=new Th,this.eventBridge=new xh,this.applicationContextProvider=new Ch}return e.getInstance=function(t){return Rh.analyticsConnectorInstances||(Rh.analyticsConnectorInstances={}),Rh.analyticsConnectorInstances[t]||(Rh.analyticsConnectorInstances[t]=new e),Rh.analyticsConnectorInstances[t]},e}(),_h=["boot"];var Mh=(e=>(e.Local="https://local.amplitude.com:3010/",e.Staging="https://apps.stag2.amplitude.com/",e.Production="https://app.amplitude.com/",e.ProductionEU="https://app.eu.amplitude.com/",e))(Mh||{});var Nh=((e=>{if(window.opener)for(let t of Object.values(Mh))window.opener.postMessage({message:e},t)})("ENGAGEMENT_SNIPPET"),function(e){var t,r,n,i,o,s,a,l;let u=window.engagement,c={_q:null!=(t=null==u?void 0:u._q)?t:[],_configuration:{apiKey:null!=(n=null==(r=null==u?void 0:u._configuration)?void 0:r.apiKey)?n:"",serverUrl:null==(i=null==u?void 0:u._configuration)?void 0:i.serverUrl,chatUrl:null==(o=null==u?void 0:u._configuration)?void 0:o.chatUrl,serverZone:null!=(a=null==(s=null==u?void 0:u._configuration)?void 0:s.serverZone)?a:"US",options:{...null==(l=null==u?void 0:u._configuration)?void 0:l.options}},_sentry:void 0,init(t,r){var n,i,o;if(c._configuration.apiKey)return void console.log("Engagement SDK has already been initialized. Ignoring additional init call.");let s;if(c._configuration={...c._configuration,...r,apiKey:t,options:{splitting:!0,...c._configuration.options,...null==r?void 0:r.options}},null!=(i=null==(n=c._configuration)?void 0:n.options)&&i.logger&&c._configuration.options.logger.enable(null!=(o=c._configuration.options.logLevel)?o:2),null!=r&&r.cdnUrl)s=c._configuration.options.splitting?`${r.cdnUrl}/engagement-browser/prod/split/index.js`:r.cdnUrl+"/engagement-browser/prod/index.min.js.gz";else{let e="EU"===c._configuration.serverZone?"https://cdn.eu.amplitude.com":"https://cdn.amplitude.com";s=c._configuration.options.splitting?`${e}/engagement-browser/prod/split/index.js`:`${e}/engagement-browser/prod/index.min.js.gz`}let a=null,l=()=>{if(a&&(clearTimeout(a),a=null),c._q&&c._q.length>0)for(console.warn(`Engagement SDK failed to load within ${u}ms. Resolving pending calls gracefully.`);c._q.length>0;){let e=c._q.shift();if(!e)continue;let t=e[0];if(_h.includes(t)&&e[1]instanceof Function&&e[2]instanceof Function){let r=e[1];console.warn(`Engagement SDK method '${t}' resolved as no-op due to script loading failure`),r(void 0)}}};e(s,c._configuration.options.splitting?"module":void 0,null==r?void 0:r.nonce,l);let u=1e4;a=setTimeout((()=>{l()}),u)},plugin(e){let t=c.init;return{name:"@amplitude/engagement-browser",type:"enrichment",async setup(r,n){var i,o;let s=null!=(i=r.instanceName)?i:"$default_instance",a=Ph.getInstance(s).identityStore;t(r.apiKey,{serverZone:r.serverZone,serverUrl:null!=(o=r.serverUrl)&&o.includes("amplitude.com")?void 0:r.serverUrl,...e,options:{logLevel:r.logLevel,logger:r.loggerProvider,...null==e?void 0:e.options}});let l=[{track:e=>{n.track(e)}}];await window.engagement.boot({user:()=>{let e=a.getIdentity();return{user_id:n.getUserId(),device_id:n.getDeviceId(),user_properties:e.userProperties,getSessionId:n.getSessionId}},integrations:l}),a.addIdentityListener((e=>{var t,r,i,o;((null==(r=null==(t=window.engagement)?void 0:t._.user)?void 0:r.user_id)!==e.userId||(null==(o=null==(i=window.engagement)?void 0:i._.user)?void 0:o.device_id)!==e.deviceId)&&window.engagement.boot({user:()=>{let e=a.getIdentity();return{user_id:n.getUserId(),device_id:n.getDeviceId(),user_properties:e.userProperties,getSessionId:n.getSessionId}},integrations:l}),window.engagement._setUserProperties(e.userProperties)}))},execute:async e=>(window.engagement.forwardEvent(e),e)}}},h=c;return new Proxy(c,{get:function(e,t){return t in h?h[t]:"then"!==t?"gs"===t||"rc"===t?new Proxy({},{get:function(e,r){return function(){let e=Array.from(arguments),n=`${t}.${r}`;e.unshift(n),c._q.push(e)}}}):_h.includes(t)?function(){let e=Array.prototype.slice.call(arguments);return new Promise(((r,n)=>{e.unshift(t,r,n),c._q.push(e)}))}:function(){let e=Array.prototype.slice.call(arguments);e.unshift(t),c._q.push(e)}:void 0}})}(((e,t,r,n)=>function(e,t,r,n){for(let i of e){let e=document.createElement("script");e.src=i,e.id="engagement-sdk-bundle",r&&e.setAttribute("nonce",r),t&&e.setAttribute("type",t),n&&(e.onerror=n),document.getElementsByTagName("head")[0].appendChild(e)}}([e||"https://cdn.amplitude.com/engagement-browser/prod/index.min.js.gz"],t,r,n)))),Dh=e=>(typeof window<"u"&&!window.engagement&&(window.engagement=Nh),Nh.plugin(e)),Lh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.sessionReplay=function(){return this._sessionReplay},t.prototype.experiment=function(){if(void 0!==this.config){var e=this.plugins(wh);return 0===e.length?void this.config.loggerProvider.debug("".concat(wh.pluginName," plugin is not found.")):1===e.length?e[0].experiment:void this.config.loggerProvider.debug("Multiple instances of ".concat(wh.pluginName," are found."))}},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.8","-").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 Cu(u))).promise];case 2:return s.sent(),[4,e.prototype.add.call(this,Sh(o(o({},null==r?void 0:r.experiment),n))).promise];case 3:return s.sent(),void 0===(i=this.plugin(Cu.pluginName))?this.config.loggerProvider.debug("".concat(Cu.pluginName," plugin is not found.")):this._sessionReplay=i.sessionReplay,[4,e.prototype.add.call(this,Dh(o(o({},null==r?void 0:r.engagement),n))).promise];case 4:return s.sent(),[2]}var u}))}))},t.prototype.init=function(t,r,n){return void 0===t&&(t=""),e.prototype.init.call(this,t,r,n)},t}(Ms),Fh=function(){var e=new Lh;return{_setDiagnosticsSampleRate:function(){},experiment:Ee(e.experiment.bind(e),"experiment",Ie(e),ke(e,["config"])),sessionReplay:Ee(e.sessionReplay.bind(e),"sessionReplay",Ie(e),ke(e,["config"])),initAll:Ee(e.initAll.bind(e),"initAll",Ie(e),ke(e,["config"])),init:Ee(e.init.bind(e),"init",Ie(e),ke(e,["config"])),add:Ee(e.add.bind(e),"add",Ie(e),ke(e,["config.apiKey","timeline.plugins"])),remove:Ee(e.remove.bind(e),"remove",Ie(e),ke(e,["config.apiKey","timeline.plugins"])),track:Ee(e.track.bind(e),"track",Ie(e),ke(e,["config.apiKey","timeline.queue.length"])),logEvent:Ee(e.logEvent.bind(e),"logEvent",Ie(e),ke(e,["config.apiKey","timeline.queue.length"])),identify:Ee(e.identify.bind(e),"identify",Ie(e),ke(e,["config.apiKey","timeline.queue.length"])),groupIdentify:Ee(e.groupIdentify.bind(e),"groupIdentify",Ie(e),ke(e,["config.apiKey","timeline.queue.length"])),setGroup:Ee(e.setGroup.bind(e),"setGroup",Ie(e),ke(e,["config.apiKey","timeline.queue.length"])),revenue:Ee(e.revenue.bind(e),"revenue",Ie(e),ke(e,["config.apiKey","timeline.queue.length"])),flush:Ee(e.flush.bind(e),"flush",Ie(e),ke(e,["config.apiKey","timeline.queue.length"])),getUserId:Ee(e.getUserId.bind(e),"getUserId",Ie(e),ke(e,["config","config.userId"])),setUserId:Ee(e.setUserId.bind(e),"setUserId",Ie(e),ke(e,["config","config.userId"])),getDeviceId:Ee(e.getDeviceId.bind(e),"getDeviceId",Ie(e),ke(e,["config","config.deviceId"])),setDeviceId:Ee(e.setDeviceId.bind(e),"setDeviceId",Ie(e),ke(e,["config","config.deviceId"])),reset:Ee(e.reset.bind(e),"reset",Ie(e),ke(e,["config","config.userId","config.deviceId"])),getSessionId:Ee(e.getSessionId.bind(e),"getSessionId",Ie(e),ke(e,["config"])),setSessionId:Ee(e.setSessionId.bind(e),"setSessionId",Ie(e),ke(e,["config"])),extendSession:Ee(e.extendSession.bind(e),"extendSession",Ie(e),ke(e,["config"])),setOptOut:Ee(e.setOptOut.bind(e),"setOptOut",Ie(e),ke(e,["config"])),getOptOut:Ee(e.getOptOut.bind(e),"getOptOut",Ie(e),ke(e,["config"])),setTransport:Ee(e.setTransport.bind(e),"setTransport",Ie(e),ke(e,["config"])),getIdentity:Ee(e.getIdentity.bind(e),"getIdentity",Ie(e),ke(e,["config"]))}},Uh=Fh(),jh=Uh._setDiagnosticsSampleRate,Bh=Uh.initAll,zh=Uh.experiment,qh=Uh.sessionReplay,Vh=Uh.add,Wh=Uh.extendSession,Kh=Uh.flush,Gh=Uh.getDeviceId,Jh=Uh.getSessionId,Yh=Uh.getUserId,Zh=Uh.groupIdentify,Hh=Uh.identify,$h=Uh.logEvent,Xh=Uh.remove,Qh=Uh.reset,ed=Uh.revenue,td=Uh.setDeviceId,rd=Uh.setGroup,nd=Uh.setOptOut,id=Uh.setSessionId,od=Uh.setTransport,sd=Uh.setUserId,ad=Uh.track,ld=function(e,t){return ld=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])},ld(e,t)};var ud=function(){return ud=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},ud.apply(this,arguments)};function cd(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"==typeof SuppressedError&&SuppressedError;var hd="is",dd="is not",pd="contains",fd="does not contain",gd="less",md="less or equal",vd="greater",yd="greater or equal",bd="version less",wd="version less or equal",Sd="version greater",Cd="version greater or equal",Id="set is",xd="set is not",kd="set contains",Ed="set does not contain",Od="set contains any",Ad="set does not contain any",Td="regex match",Rd="regex does not match",Pd=-862048943,_d=461845907,Md=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=Fd(r,s<<2);o=Nd(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,Pd),u=Ld(u,15),o^=u=Math.imul(u,_d);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,Pd),u=Ld(u,15),o^=u=Math.imul(u,_d);break;case 1:u^=r[l],u=Math.imul(u,Pd),u=Ld(u,15),o^=u=Math.imul(u,_d)}return Dd(o^=n)>>>0},Nd=function(e,t){var r=e,n=t;return r=Math.imul(r,Pd),r=Ld(r,15),r=Math.imul(r,_d),n=Ld(n^=r,13),(n=Math.imul(n,5))+-430675100|0},Dd=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},Ld=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},Fd=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 Ud(r)},Ud=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},jd=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=cd(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}},Bd="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),zd=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(Bd).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}(),qd=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=cd(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=cd(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=ud(ud(ud({},t.metadata),a.metadata),i.metadata);i=ud(ud({},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,i,o,s;if(!r.conditions)return void 0!==(u=this.bucket(e,r))?t.variants[u]:void 0;try{for(var a=cd(r.conditions),l=a.next();!l.done;l=a.next()){var u,c=l.value,h=!0;try{for(var d=(o=void 0,cd(c)),p=d.next();!p.done;p=d.next()){var f=p.value;if(!(h=this.matchCondition(e,f)))break}}catch(e){o={error:e}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}if(h)return void 0!==(u=this.bucket(e,r))?t.variants[u]:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}},e.prototype.matchCondition=function(e,t){var r=jd(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 Md(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(jd(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=cd(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,cd(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 hd:case pd:case gd:case md:case vd:case yd:case bd:case wd:case Sd:case Cd:case Id:case kd:case Od:return r;case dd:case fd:case Ed:case Ad:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Id:return this.setEquals(e,r);case xd:return!this.setEquals(e,r);case kd:return this.matchesSetContainsAll(e,r);case Ed:return!this.matchesSetContainsAll(e,r);case Od:return this.matchesSetContainsAny(e,r);case Ad:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case hd:return this.matchesIs(e,r);case dd:return!this.matchesIs(e,r);case pd:return this.matchesContains(e,r);case fd:return!this.matchesContains(e,r);case gd:case md:case vd:case yd:return this.matchesComparable(e,t,r,(function(e){return n.parseNumber(e)}),this.comparator);case bd:case wd:case Sd:case Cd:return this.matchesComparable(e,t,r,(function(e){return zd.parse(e)}),this.versionComparator);case Td:return this.matchesRegex(e,r);case Rd: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=cd(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 gd:case bd:return e<r;case md:case wd:return e<=r;case vd:case Sd:return e>r;case yd:case Cd:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case gd:case bd:return n<0;case md:case wd:return n<=0;case vd:case Sd:return n>0;case yd:case Cd: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(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):void 0}catch(e){return}},e.prototype.isSetOperator=function(e){switch(e){case Id:case xd:case kd:case Ed:case Od:case Ad: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&&function(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(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}(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=cd(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=cd(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}();"function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder&&new TextEncoder;(e=>{let t={};e.forEach(((e,r)=>t[e]=r))})(Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=")),String.fromCharCode.bind(String),"function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}(function(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}ld(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var Vd,Wd=function(){var e=this;this.dbs={},this.createStore=function(t){return a(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return[4,nl(t,1,{upgrade:function(e){e.objectStoreNames.contains("eventTypesForSession")||e.createObjectStore("eventTypesForSession",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}}))}))},this.openOrCreateDB=function(t){return a(e,void 0,void 0,(function(){var e,r;return l(this,(function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}}))}))},this.updateEventListForSession=function(t){var r=t.sessionId,n=t.eventType,i=t.eventTime,s=t.loggerProvider,u=t.tx;return a(e,void 0,void 0,(function(){var e,t,a,c,h,d,p,f,g;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=String(r),[4,u.store.get(e)];case 1:return t=l.sent(),a=t?t.eventTypes:{},c=a[n]||{},h=o(o({},a),((f={})[n]=o(o({},c),((g={})[i]={event_type:n},g)),f)),d={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,u.store.put(d)];case 2:return l.sent(),[2,h];case 3:return p=l.sent(),s.warn("Failed to store events for targeting ".concat(r,": ").concat(p)),[3,4];case 4:return[2,void 0]}}))}))},this.deleteOldSessionEventTypes=function(t){var r=t.currentSessionId,n=t.loggerProvider,i=t.tx;return a(e,void 0,void 0,(function(){var e,t,o,s,a,u;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),e=String(r),[4,i.store.getAll()];case 1:t=l.sent(),o=0,l.label=2;case 2:return o<t.length?(s=t[o],a=Date.now()-s.lastUpdated,s.sessionId!==e&&a>1728e5?[4,i.store.delete(s.sessionId)]:[3,4]):[3,5];case 3:l.sent(),l.label=4;case 4:return o++,[3,2];case 5:return[3,7];case 6:return u=l.sent(),n.warn("Failed to clear old session event types for targeting: ".concat(u)),[3,7];case 7:return[2]}}))}))},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,i=t.eventType,o=t.eventTime,s=t.apiKey;return a(e,void 0,void 0,(function(){var e,t,a,u;return l(this,(function(l){switch(l.label){case 0:return l.trys.push([0,5,,6]),[4,this.openOrCreateDB(s)];case 1:return e=l.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:i,eventTime:o})]:[2];case 2:return a=l.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return l.sent(),[4,t.done];case 4:return l.sent(),[2,a];case 5:return u=l.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(u)),[3,6];case 6:return[2,void 0]}}))}))}},Kd=new Wd,Gd=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,i=t.event,o=t.sessionId,s=t.userProperties,u=t.deviceId,c=t.flag;return a(e,void 0,void 0,(function(){var e,t,a,h;return l(this,(function(l){switch(l.label){case 0:return i&&i.time?[4,Kd.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:o,eventType:i.event_type,eventTime:i.time})]:[3,2];case 1:return t=l.sent(),[3,3];case 2:t=void 0,l.label=3;case 3:return a=(e=t)&&new Set(Object.keys(e)),h={session_id:o,event:i,event_types:a&&Array.from(a),user:{device_id:u,user_properties:s}},[2,this.evaluationEngine.evaluate(h,[c])]}}))}))},this.evaluationEngine=new qd},Jd=function(){var e=new Gd;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,Yd=Object.freeze({__proto__:null,evaluateTargeting:Jd}),Zd=Object.freeze({__proto__:null,compressionScript:'var WebWorker=function(r){"use strict";var n=Uint8Array,e=Uint16Array,f=Uint32Array,t=new n([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]),a=new n([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]),o=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i=function(r,n){for(var t=new e(31),a=0;a<31;++a)t[a]=n+=1<<r[a-1];var o=new f(t[30]);for(a=1;a<30;++a)for(var i=t[a];i<t[a+1];++i)o[i]=i-t[a]<<5|a;return[t,o]},v=i(t,2),u=v[0],s=v[1];u[28]=258,s[258]=28;for(var l=i(a,0)[1],c=new e(32768),h=0;h<32768;++h){var g=(43690&h)>>>1|(21845&h)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,c[h]=((65280&g)>>>8|(255&g)<<8)>>>1}var w=function(r,n,f){for(var t=r.length,a=0,o=new e(n);a<t;++a)++o[r[a]-1];var i,v=new e(n);for(a=0;a<n;++a)v[a]=v[a-1]+o[a-1]<<1;if(f){i=new e(1<<n);var u=15-n;for(a=0;a<t;++a)if(r[a])for(var s=a<<4|r[a],l=n-r[a],h=v[r[a]-1]++<<l,g=h|(1<<l)-1;h<=g;++h)i[c[h]>>>u]=s}else for(i=new e(t),a=0;a<t;++a)i[a]=c[v[r[a]-1]++]>>>15-r[a];return i},d=new n(288);for(h=0;h<144;++h)d[h]=8;for(h=144;h<256;++h)d[h]=9;for(h=256;h<280;++h)d[h]=7;for(h=280;h<288;++h)d[h]=8;var m=new n(32);for(h=0;h<32;++h)m[h]=5;var y=w(d,9,0),M=w(m,5,0),p=function(r){return(r/8|0)+(7&r&&1)},b=function(r,t,a){(null==a||a>r.length)&&(a=r.length);var o=new(r instanceof e?e:r instanceof f?f:n)(a-t);return o.set(r.subarray(t,a)),o},C=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8},S=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8,r[f+2]|=e>>>16},x=function(r,f){for(var t=[],a=0;a<r.length;++a)r[a]&&t.push({s:a,f:r[a]});var o=t.length,i=t.slice();if(!o)return[new n(0),0];if(1==o){var v=new n(t[0].s+1);return v[t[0].s]=1,[v,1]}t.sort((function(r,n){return r.f-n.f})),t.push({s:-1,f:25001});var u=t[0],s=t[1],l=0,c=1,h=2;for(t[0]={s:-1,f:u.f+s.f,l:u,r:s};c!=o-1;)u=t[t[l].f<t[h].f?l++:h++],s=t[l!=c&&t[l].f<t[h].f?l++:h++],t[c++]={s:-1,f:u.f+s.f,l:u,r:s};var g=i[0].s;for(a=1;a<o;++a)i[a].s>g&&(g=i[a].s);var w=new e(g+1),d=A(t[c-1],w,0);if(d>f){a=0;var m=0,y=d-f,M=1<<y;for(i.sort((function(r,n){return w[n.s]-w[r.s]||r.f-n.f}));a<o;++a){var p=i[a].s;if(!(w[p]>f))break;m+=M-(1<<d-w[p]),w[p]=f}for(m>>>=y;m>0;){var b=i[a].s;w[b]<f?m-=1<<f-w[b]++-1:++a}for(;a>=0&&m;--a){var C=i[a].s;w[C]==f&&(--w[C],++m)}d=f}return[new n(w),d]},A=function(r,n,e){return-1==r.s?Math.max(A(r.l,n,e+1),A(r.r,n,e+1)):n[r.s]=e},O=function(r){for(var n=r.length;n&&!r[--n];);for(var f=new e(++n),t=0,a=r[0],o=1,i=function(r){f[t++]=r},v=1;v<=n;++v)if(r[v]==a&&v!=n)++o;else{if(!a&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(a),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(a);o=1,a=r[v]}return[f.subarray(0,t),n]},T=function(r,n){for(var e=0,f=0;f<n.length;++f)e+=r[f]*n[f];return e},k=function(r,n,e){var f=e.length,t=p(n+2);r[t]=255&f,r[t+1]=f>>>8,r[t+2]=255^r[t],r[t+3]=255^r[t+1];for(var a=0;a<f;++a)r[t+a+4]=e[a];return 8*(t+4+f)},E=function(r,n,f,i,v,u,s,l,c,h,g){C(n,g++,f),++v[256];for(var p=x(v,15),b=p[0],A=p[1],E=x(u,15),J=E[0],N=E[1],U=O(b),D=U[0],I=U[1],W=O(J),_=W[0],j=W[1],P=new e(19),q=0;q<D.length;++q)P[31&D[q]]++;for(q=0;q<_.length;++q)P[31&_[q]]++;for(var z=x(P,7),B=z[0],F=z[1],G=19;G>4&&!B[o[G-1]];--G);var H,K,L,Q,R=h+5<<3,V=T(v,d)+T(u,m)+s,X=T(v,b)+T(u,J)+s+14+3*G+T(P,B)+(2*P[16]+3*P[17]+7*P[18]);if(R<=V&&R<=X)return k(n,g,r.subarray(c,c+h));if(C(n,g,1+(X<V)),g+=2,X<V){H=w(b,A,0),K=b,L=w(J,N,0),Q=J;var Y=w(B,F,0);C(n,g,I-257),C(n,g+5,j-1),C(n,g+10,G-4),g+=14;for(q=0;q<G;++q)C(n,g+3*q,B[o[q]]);g+=3*G;for(var Z=[D,_],$=0;$<2;++$){var rr=Z[$];for(q=0;q<rr.length;++q){var nr=31&rr[q];C(n,g,Y[nr]),g+=B[nr],nr>15&&(C(n,g,rr[q]>>>5&127),g+=rr[q]>>>12)}}}else H=y,K=d,L=M,Q=m;for(q=0;q<l;++q)if(i[q]>255){nr=i[q]>>>18&31;S(n,g,H[nr+257]),g+=K[nr+257],nr>7&&(C(n,g,i[q]>>>23&31),g+=t[nr]);var er=31&i[q];S(n,g,L[er]),g+=Q[er],er>3&&(S(n,g,i[q]>>>5&8191),g+=a[er])}else S(n,g,H[i[q]]),g+=K[i[q]];return S(n,g,H[256]),g+K[256]},J=new f([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),N=function(r,o,i,v,u){return function(r,o,i,v,u,c){var h=r.length,g=new n(v+h+5*(1+Math.floor(h/7e3))+u),w=g.subarray(v,g.length-u),d=0;if(!o||h<8)for(var m=0;m<=h;m+=65535){var y=m+65535;y<h?d=k(w,d,r.subarray(m,y)):(w[m]=c,d=k(w,d,r.subarray(m,h)))}else{for(var M=J[o-1],C=M>>>13,S=8191&M,x=(1<<i)-1,A=new e(32768),O=new e(x+1),T=Math.ceil(i/3),N=2*T,U=function(n){return(r[n]^r[n+1]<<T^r[n+2]<<N)&x},D=new f(25e3),I=new e(288),W=new e(32),_=0,j=0,P=(m=0,0),q=0,z=0;m<h;++m){var B=U(m),F=32767&m,G=O[B];if(A[F]=G,O[B]=F,q<=m){var H=h-m;if((_>7e3||P>24576)&&H>423){d=E(r,w,0,D,I,W,j,P,z,m-z,d),P=_=j=0,z=m;for(var K=0;K<286;++K)I[K]=0;for(K=0;K<30;++K)W[K]=0}var L=2,Q=0,R=S,V=F-G&32767;if(H>2&&B==U(m-V))for(var X=Math.min(C,H)-1,Y=Math.min(32767,m),Z=Math.min(258,H);V<=Y&&--R&&F!=G;){if(r[m+L]==r[m+L-V]){for(var $=0;$<Z&&r[m+$]==r[m+$-V];++$);if($>L){if(L=$,Q=V,$>X)break;var rr=Math.min(V,$-2),nr=0;for(K=0;K<rr;++K){var er=m-V+K+32768&32767,fr=er-A[er]+32768&32767;fr>nr&&(nr=fr,G=er)}}}V+=(F=G)-(G=A[F])+32768&32767}if(Q){D[P++]=268435456|s[L]<<18|l[Q];var tr=31&s[L],ar=31&l[Q];j+=t[tr]+a[ar],++I[257+tr],++W[ar],q=m+L,++_}else D[P++]=r[m],++I[r[m]]}}d=E(r,w,c,D,I,W,j,P,z,m-z,d)}return b(g,0,v+p(d)+u)}(r,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,i,v,!u)};function U(r,n){void 0===n&&(n={});var e=function(){var r=1,n=0;return{p:function(e){for(var f=r,t=n,a=e.length,o=0;o!=a;){for(var i=Math.min(o+5552,a);o<i;++o)t+=f+=e[o];f%=65521,t%=65521}r=f,n=t},d:function(){return(r>>>8<<16|(255&n)<<8|n>>>8)+2*((255&r)<<23)}}}();e.p(r);var f,t,a,o=N(r,n,2,4);return f=o,t=n.level,a=0==t?0:t<6?1:9==t?3:2,f[0]=120,f[1]=a<<6|(a?32-2*a:1),function(r,n,e){for(;e;++n)r[n]=e,e>>>=8}(o,o.length-4,e.d()),o}const D=r=>{const e={...r,v:"v1"};return function(r,n){var e="";if(!n&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(r);for(var f=0;f<r.length;){var t=r[f++];t<128||n?e+=String.fromCharCode(t):t<224?e+=String.fromCharCode((31&t)<<6|63&r[f++]):t<240?e+=String.fromCharCode((15&t)<<12|(63&r[f++])<<6|63&r[f++]):(t=((15&t)<<18|(63&r[f++])<<12|(63&r[f++])<<6|63&r[f++])-65536,e+=String.fromCharCode(55296|t>>10,56320|1023&t))}return e}(U(function(r,e){var f=r.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(r);for(var t=new n(r.length+(r.length>>>1)),a=0,o=function(r){t[a++]=r},i=0;i<f;++i){if(a+5>t.length){var v=new n(a+8+(f-i<<1));v.set(t),t=v}var u=r.charCodeAt(i);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&r.charCodeAt(++i))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return b(t,0,a)}(JSON.stringify(e))),!0)};onmessage=r=>{const{event:n,sessionId:e}="string"==typeof r.data?JSON.parse(r.data):r.data,f=JSON.stringify(D(n));postMessage({compressedEvent:f,sessionId:e})};const I=onmessage;return r.compressionOnMessage=I,Object.defineProperty(r,"__esModule",{value:!0}),r}({});\n'}),Hd=Object.defineProperty,$d=(e,t,r)=>((e,t,r)=>t in e?Hd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Xd=Object.defineProperty,Qd=(e,t,r)=>((e,t,r)=>t in e?Xd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),ep=Object.defineProperty,tp=(e,t,r)=>((e,t,r)=>t in e?ep(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const rp={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},np={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ip={};function op(e){if(ip[e])return ip[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in rp?rp[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 np?np[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)return ip[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?ip[e]=o:r}catch{return r}}const sp={};function ap(e,t,r){var n;const i=`${e}.${String(r)}`;if(sp[i])return sp[i].call(t);const o=op(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(sp[i]=s,s.call(t)):t[r]}const lp={};function up(e,t,r){const n=`${e}.${String(r)}`;if(lp[n])return lp[n].bind(t);const i=op(e)[r];return"function"!=typeof i?t[r]:(lp[n]=i,i.bind(t))}const cp={childNodes:function(e){return ap("Node",e,"childNodes")},parentNode:function(e){return ap("Node",e,"parentNode")},parentElement:function(e){return ap("Node",e,"parentElement")},textContent:function(e){return ap("Node",e,"textContent")},contains:function(e,t){return up("Node",e,"contains")(t)},getRootNode:function(e){return up("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ap("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ap("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ap("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ap("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return op("MutationObserver").constructor}};class hp{constructor(){tp(this,"idNodeMap",new Map),tp(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 dp(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&dp(cp.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&dp(cp.parentNode(e),t,r)}function pp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function fp(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 gp={exports:{}},mp=String,vp=function(){return{isColorSupported:!1,reset:mp,bold:mp,dim:mp,italic:mp,underline:mp,inverse:mp,hidden:mp,strikethrough:mp,black:mp,red:mp,green:mp,yellow:mp,blue:mp,magenta:mp,cyan:mp,white:mp,gray:mp,bgBlack:mp,bgRed:mp,bgGreen:mp,bgYellow:mp,bgBlue:mp,bgMagenta:mp,bgCyan:mp,bgWhite:mp}};gp.exports=vp(),gp.exports.createColors=vp;var yp=gp.exports;const bp=fp(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let wp=yp,Sp=bp,Cp=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=wp.isColorSupported),Sp&&e&&(t=Sp(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}=wp.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 Ip=Cp;Cp.default=Cp;var xp={};xp.isClean=Symbol("isClean"),xp.my=Symbol("my");const kp={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Ep=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 kp[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=kp[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 Op=Ep;Ep.default=Ep;let Ap=Op;function Tp(e,t){new Ap(t).stringify(e)}var Rp=Tp;Tp.default=Tp;let{isClean:Pp,my:_p}=xp,Mp=Ip,Np=Op,Dp=Rp;function Lp(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=>Lp(e,r))):("object"===o&&null!==i&&(i=Lp(i)),r[n]=i)}return r}let Fp=class{constructor(e={}){this.raws={},this[Pp]=!1,this[_p]=!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=Lp(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 Mp(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[Pp]){this[Pp]=!1;let e=this;for(;e=e.parent;)e[Pp]=!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 Np).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=Dp){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 Up=Fp;Fp.default=Fp;let jp=Up,Bp=class extends jp{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 zp=Bp;Bp.default=Bp;var qp={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:Vp,SourceMapGenerator:Wp}=bp,{existsSync:Kp,readFileSync:Gp}=bp,{dirname:Jp,join:Yp}=bp;let Zp=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=Jp(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Vp(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=Jp(e),Kp(e))return this.mapFile=e,Gp(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 Vp)return Wp.fromSourceMap(t).toString();if(t instanceof Wp)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=Yp(Jp(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 Hp=Zp;Zp.default=Zp;let{SourceMapConsumer:$p,SourceMapGenerator:Xp}=bp,{fileURLToPath:Qp,pathToFileURL:ef}=bp,{isAbsolute:tf,resolve:rf}=bp,{nanoid:nf}=qp,of=bp,sf=Ip,af=Hp,lf=Symbol("fromOffsetCache"),uf=Boolean($p&&Xp),cf=Boolean(rf&&tf),hf=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&&(!cf||/^\w+:\/\//.test(t.from)||tf(t.from)?this.file=t.from:this.file=rf(t.from)),cf&&uf){let e=new af(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 "+nf(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 sf(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 sf(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&&(ef&&(i.input.url=ef(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[lf])r=this[lf];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[lf]=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:rf(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=tf(a.source)?ef(a.source):new URL(a.source,this.map.consumer().sourceRoot||ef(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(!Qp)throw new Error("file: protocol is not available in this PostCSS build");l.file=Qp(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 df=hf;hf.default=hf,of&&of.registerInput&&of.registerInput(hf);let{SourceMapConsumer:pf,SourceMapGenerator:ff}=bp,{dirname:gf,relative:mf,resolve:vf,sep:yf}=bp,{pathToFileURL:bf}=bp,wf=df,Sf=Boolean(pf&&ff),Cf=Boolean(gf&&vf&&mf&&yf);var If=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||gf(e.file);!1===this.mapOpts.sourcesContent?(t=new pf(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(),Cf&&Sf&&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=ff.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ff({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 ff({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?gf(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=gf(vf(r,this.mapOpts.annotation)));let n=mf(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 wf(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(bf){let t=bf(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;"\\"===yf&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let xf=Up,kf=class extends xf{constructor(e){super(e),this.type="comment"}};var Ef=kf;kf.default=kf;let Of,Af,Tf,Rf,{isClean:Pf,my:_f}=xp,Mf=zp,Nf=Ef,Df=Up;function Lf(e){return e.map((e=>(e.nodes&&(e.nodes=Lf(e.nodes)),delete e.source,e)))}function Ff(e){if(e[Pf]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ff(t)}let Uf=class e extends Df{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=Lf(Of(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 Mf(t)]}else if(t.selector)t=[new Af(t)];else if(t.name)t=[new Tf(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Nf(t)]}return t.map((t=>(t[_f]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Pf]&&Ff(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]}};Uf.registerParse=e=>{Of=e},Uf.registerRule=e=>{Af=e},Uf.registerAtRule=e=>{Tf=e},Uf.registerRoot=e=>{Rf=e};var jf=Uf;Uf.default=Uf,Uf.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Tf.prototype):"rule"===e.type?Object.setPrototypeOf(e,Af.prototype):"decl"===e.type?Object.setPrototypeOf(e,Mf.prototype):"comment"===e.type?Object.setPrototypeOf(e,Nf.prototype):"root"===e.type&&Object.setPrototypeOf(e,Rf.prototype),e[_f]=!0,e.nodes&&e.nodes.forEach((e=>{Uf.rebuild(e)}))};let Bf,zf,qf=jf,Vf=class extends qf{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Bf(new zf,this,e).stringify()}};Vf.registerLazyResult=e=>{Bf=e},Vf.registerProcessor=e=>{zf=e};var Wf=Vf;Vf.default=Vf;let Kf={};var Gf=function(e){Kf[e]||(Kf[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Jf=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 Yf=Jf;Jf.default=Jf;let Zf=Yf,Hf=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 Zf(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var $f=Hf;Hf.default=Hf;const Xf="'".charCodeAt(0),Qf='"'.charCodeAt(0),eg="\\".charCodeAt(0),tg="/".charCodeAt(0),rg="\n".charCodeAt(0),ng=" ".charCodeAt(0),ig="\f".charCodeAt(0),og="\t".charCodeAt(0),sg="\r".charCodeAt(0),ag="[".charCodeAt(0),lg="]".charCodeAt(0),ug="(".charCodeAt(0),cg=")".charCodeAt(0),hg="{".charCodeAt(0),dg="}".charCodeAt(0),pg=";".charCodeAt(0),fg="*".charCodeAt(0),gg=":".charCodeAt(0),mg="@".charCodeAt(0),vg=/[\t\n\f\r "#'()/;[\\\]{}]/g,yg=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,bg=/.[\r\n"'(/\\]/,wg=/[\da-f]/i;let Sg=jf,Cg=class extends Sg{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 Ig=Cg;Cg.default=Cg,Sg.registerAtRule(Cg);let xg,kg,Eg=jf,Og=class extends Eg{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 xg(new kg,this,e).stringify()}};Og.registerLazyResult=e=>{xg=e},Og.registerProcessor=e=>{kg=e};var Ag=Og;Og.default=Og,Eg.registerRoot(Og);let Tg={comma:e=>Tg.split(e,[","],!0),space:e=>Tg.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 Rg=Tg;Tg.default=Tg;let Pg=jf,_g=Rg,Mg=class extends Pg{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return _g.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 Ng=Mg;Mg.default=Mg,Pg.registerRule(Mg);let Dg=zp,Lg=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 rg:case ng:case og:case sg:case ig:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===ng||r===rg||r===og||r===sg||r===ig);h=["space",d.slice(g,n)],g=n-1;break;case ag:case lg:case hg:case dg:case gg:case pg:case cg:{let e=String.fromCharCode(r);h=[e,e,g];break}case ug:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==Xf&&c!==Qf&&c!==ng&&c!==rg&&c!==og&&c!==ig&&c!==sg){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)===eg;)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||bg.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case Xf:case Qf:i=r===Xf?"'":'"',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)===eg;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case mg:vg.lastIndex=g+1,vg.test(d),n=0===vg.lastIndex?d.length-1:vg.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case eg:for(n=g,s=!0;d.charCodeAt(n+1)===eg;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==tg&&r!==ng&&r!==rg&&r!==og&&r!==sg&&r!==ig&&(n+=1,wg.test(d.charAt(n)))){for(;wg.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===ng&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===tg&&d.charCodeAt(g+1)===fg?(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):(yg.lastIndex=g+1,yg.test(d),n=0===yg.lastIndex?d.length-1:yg.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},Fg=Ef,Ug=Ig,jg=Ag,Bg=Ng;const zg={empty:!0,space:!0};var qg=class{constructor(e){this.input=e,this.root=new jg,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 Ug;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 Fg;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=Lg(this.input)}decl(e,t){let r=new Dg;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 Bg;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",zg[a]||zg[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 Bg;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 Vg=jf,Wg=qg,Kg=df;function Gg(e,t){let r=new Kg(e,t),n=new Wg(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 Jg=Gg;Gg.default=Gg,Vg.registerParse(Gg);let{isClean:Yg,my:Zg}=xp,Hg=If,$g=Rp,Xg=jf,Qg=Wf,em=Gf,tm=$f,rm=Jg,nm=Ag;const im={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},om={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},sm={Once:!0,postcssPlugin:!0,prepare:!0};function am(e){return"object"==typeof e&&"function"==typeof e.then}function lm(e){let t=!1,r=im[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 um(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:lm(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function cm(e){return e[Yg]=!1,e.nodes&&e.nodes.forEach((e=>cm(e))),e}let hm={},dm=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 tm)i=cm(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=rm;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[Zg]&&Xg.rebuild(i)}else i=cm(r);this.result=new tm(t,i,n),this.helpers={...hm,postcss:hm,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(!om[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!sm[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(am(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Yg];){e[Yg]=!0;let t=[um(e)];for(;t.length>0;){let e=this.visitTick(t);if(am(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 am(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=$g;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Hg(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(am(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Yg];)e[Yg]=!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||em("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(am(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[Yg])return n[Yg]=!0,void e.push(um(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[Yg]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Yg]=!0;let t=lm(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[Yg]||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"}};dm.registerPostcss=e=>{hm=e};var pm=dm;dm.default=dm,nm.registerLazyResult(dm),Qg.registerLazyResult(dm);let fm=If,gm=Rp,mm=Gf,vm=Jg;const ym=$f;let bm=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=gm;this.result=new ym(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new fm(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||mm("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=vm;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 wm=bm;bm.default=bm;let Sm=wm,Cm=pm,Im=Wf,xm=Ag,km=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 Cm(this,e,t):new Sm(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Em=km;km.default=km,xm.registerProcessor(km),Im.registerProcessor(km);let Om=zp,Am=Hp,Tm=Ef,Rm=Ig,Pm=df,_m=Ag,Mm=Ng;function Nm(e,t){if(Array.isArray(e))return e.map((e=>Nm(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Pm.prototype};r.map&&(r.map={...r.map,__proto__:Am.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>Nm(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 _m(n);if("decl"===n.type)return new Om(n);if("rule"===n.type)return new Mm(n);if("comment"===n.type)return new Tm(n);if("atrule"===n.type)return new Rm(n);throw new Error("Unknown node type: "+e.type)}var Dm=Nm;Nm.default=Nm;let Lm=Ip,Fm=zp,Um=pm,jm=jf,Bm=Em,zm=Rp,qm=Dm,Vm=Wf,Wm=Yf,Km=Ef,Gm=Ig,Jm=$f,Ym=df,Zm=Jg,Hm=Rg,$m=Ng,Xm=Ag,Qm=Up;function ev(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Bm(e)}ev.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 Bm).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return ev([i(r)]).process(e,t)},i},ev.stringify=zm,ev.parse=Zm,ev.fromJSON=qm,ev.list=Hm,ev.comment=e=>new Km(e),ev.atRule=e=>new Gm(e),ev.decl=e=>new Fm(e),ev.rule=e=>new $m(e),ev.root=e=>new Xm(e),ev.document=e=>new Vm(e),ev.CssSyntaxError=Lm,ev.Declaration=Fm,ev.Container=jm,ev.Processor=Bm,ev.Document=Vm,ev.Comment=Km,ev.Warning=Wm,ev.AtRule=Gm,ev.Result=Jm,ev.Input=Ym,ev.Rule=$m,ev.Root=Xm,ev.Node=Qm,Um.registerPostcss(ev);var tv=ev;ev.default=ev;const rv=pp(tv);rv.stringify,rv.fromJSON,rv.plugin,rv.parse,rv.list,rv.document,rv.comment,rv.atRule,rv.rule,rv.decl,rv.root,rv.CssSyntaxError,rv.Declaration,rv.Container,rv.Processor,rv.Document,rv.Comment,rv.Warning,rv.AtRule,rv.Result,rv.Input,rv.Rule,rv.Root,rv.Node;var nv=Object.defineProperty,iv=(e,t,r)=>((e,t,r)=>t in e?nv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function ov(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sv(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 av={exports:{}},lv=String,uv=function(){return{isColorSupported:!1,reset:lv,bold:lv,dim:lv,italic:lv,underline:lv,inverse:lv,hidden:lv,strikethrough:lv,black:lv,red:lv,green:lv,yellow:lv,blue:lv,magenta:lv,cyan:lv,white:lv,gray:lv,bgBlack:lv,bgRed:lv,bgGreen:lv,bgYellow:lv,bgBlue:lv,bgMagenta:lv,bgCyan:lv,bgWhite:lv}};av.exports=uv(),av.exports.createColors=uv;var cv=av.exports;const hv=sv(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let dv=cv,pv=hv,fv=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=dv.isColorSupported),pv&&e&&(t=pv(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}=dv.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 gv=fv;fv.default=fv;var mv={};mv.isClean=Symbol("isClean"),mv.my=Symbol("my");const vv={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let yv=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 vv[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=vv[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 bv=yv;yv.default=yv;let wv=bv;function Sv(e,t){new wv(t).stringify(e)}var Cv=Sv;Sv.default=Sv;let{isClean:Iv,my:xv}=mv,kv=gv,Ev=bv,Ov=Cv;function Av(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=>Av(e,r))):("object"===o&&null!==i&&(i=Av(i)),r[n]=i)}return r}let Tv=class{constructor(e={}){this.raws={},this[Iv]=!1,this[xv]=!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=Av(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 kv(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[Iv]){this[Iv]=!1;let e=this;for(;e=e.parent;)e[Iv]=!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 Ev).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=Ov){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 Rv=Tv;Tv.default=Tv;let Pv=Rv,_v=class extends Pv{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 Mv=_v;_v.default=_v;var Nv={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:Dv,SourceMapGenerator:Lv}=hv,{existsSync:Fv,readFileSync:Uv}=hv,{dirname:jv,join:Bv}=hv;let zv=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=jv(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Dv(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=jv(e),Fv(e))return this.mapFile=e,Uv(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 Dv)return Lv.fromSourceMap(t).toString();if(t instanceof Lv)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=Bv(jv(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 qv=zv;zv.default=zv;let{SourceMapConsumer:Vv,SourceMapGenerator:Wv}=hv,{fileURLToPath:Kv,pathToFileURL:Gv}=hv,{isAbsolute:Jv,resolve:Yv}=hv,{nanoid:Zv}=Nv,Hv=hv,$v=gv,Xv=qv,Qv=Symbol("fromOffsetCache"),ey=Boolean(Vv&&Wv),ty=Boolean(Yv&&Jv),ry=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&&(!ty||/^\w+:\/\//.test(t.from)||Jv(t.from)?this.file=t.from:this.file=Yv(t.from)),ty&&ey){let e=new Xv(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 "+Zv(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 $v(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 $v(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&&(Gv&&(i.input.url=Gv(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[Qv])r=this[Qv];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[Qv]=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:Yv(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=Jv(a.source)?Gv(a.source):new URL(a.source,this.map.consumer().sourceRoot||Gv(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(!Kv)throw new Error("file: protocol is not available in this PostCSS build");l.file=Kv(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 ny=ry;ry.default=ry,Hv&&Hv.registerInput&&Hv.registerInput(ry);let{SourceMapConsumer:iy,SourceMapGenerator:oy}=hv,{dirname:sy,relative:ay,resolve:ly,sep:uy}=hv,{pathToFileURL:cy}=hv,hy=ny,dy=Boolean(iy&&oy),py=Boolean(sy&&ly&&ay&&uy);var fy=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||sy(e.file);!1===this.mapOpts.sourcesContent?(t=new iy(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(),py&&dy&&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=oy.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new oy({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 oy({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?sy(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=sy(ly(r,this.mapOpts.annotation)));let n=ay(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 hy(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(cy){let t=cy(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;"\\"===uy&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let gy=Rv,my=class extends gy{constructor(e){super(e),this.type="comment"}};var vy=my;my.default=my;let yy,by,wy,Sy,{isClean:Cy,my:Iy}=mv,xy=Mv,ky=vy,Ey=Rv;function Oy(e){return e.map((e=>(e.nodes&&(e.nodes=Oy(e.nodes)),delete e.source,e)))}function Ay(e){if(e[Cy]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ay(t)}let Ty=class e extends Ey{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=Oy(yy(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 xy(t)]}else if(t.selector)t=[new by(t)];else if(t.name)t=[new wy(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new ky(t)]}return t.map((t=>(t[Iy]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Cy]&&Ay(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]}};Ty.registerParse=e=>{yy=e},Ty.registerRule=e=>{by=e},Ty.registerAtRule=e=>{wy=e},Ty.registerRoot=e=>{Sy=e};var Ry=Ty;Ty.default=Ty,Ty.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,wy.prototype):"rule"===e.type?Object.setPrototypeOf(e,by.prototype):"decl"===e.type?Object.setPrototypeOf(e,xy.prototype):"comment"===e.type?Object.setPrototypeOf(e,ky.prototype):"root"===e.type&&Object.setPrototypeOf(e,Sy.prototype),e[Iy]=!0,e.nodes&&e.nodes.forEach((e=>{Ty.rebuild(e)}))};let Py,_y,My=Ry,Ny=class extends My{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Py(new _y,this,e).stringify()}};Ny.registerLazyResult=e=>{Py=e},Ny.registerProcessor=e=>{_y=e};var Dy=Ny;Ny.default=Ny;let Ly={};var Fy=function(e){Ly[e]||(Ly[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Uy=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 jy=Uy;Uy.default=Uy;let By=jy,zy=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 By(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var qy=zy;zy.default=zy;const Vy="'".charCodeAt(0),Wy='"'.charCodeAt(0),Ky="\\".charCodeAt(0),Gy="/".charCodeAt(0),Jy="\n".charCodeAt(0),Yy=" ".charCodeAt(0),Zy="\f".charCodeAt(0),Hy="\t".charCodeAt(0),$y="\r".charCodeAt(0),Xy="[".charCodeAt(0),Qy="]".charCodeAt(0),eb="(".charCodeAt(0),tb=")".charCodeAt(0),rb="{".charCodeAt(0),nb="}".charCodeAt(0),ib=";".charCodeAt(0),ob="*".charCodeAt(0),sb=":".charCodeAt(0),ab="@".charCodeAt(0),lb=/[\t\n\f\r "#'()/;[\\\]{}]/g,ub=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,cb=/.[\r\n"'(/\\]/,hb=/[\da-f]/i;let db=Ry,pb=class extends db{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 fb=pb;pb.default=pb,db.registerAtRule(pb);let gb,mb,vb=Ry,yb=class extends vb{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 gb(new mb,this,e).stringify()}};yb.registerLazyResult=e=>{gb=e},yb.registerProcessor=e=>{mb=e};var bb=yb;yb.default=yb,vb.registerRoot(yb);let wb={comma:e=>wb.split(e,[","],!0),space:e=>wb.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 Sb=wb;wb.default=wb;let Cb=Ry,Ib=Sb,xb=class extends Cb{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Ib.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 kb=xb;xb.default=xb,Cb.registerRule(xb);let Eb=Mv,Ob=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 Jy:case Yy:case Hy:case $y:case Zy:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===Yy||r===Jy||r===Hy||r===$y||r===Zy);h=["space",d.slice(g,n)],g=n-1;break;case Xy:case Qy:case rb:case nb:case sb:case ib:case tb:{let e=String.fromCharCode(r);h=[e,e,g];break}case eb:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==Vy&&c!==Wy&&c!==Yy&&c!==Jy&&c!==Hy&&c!==Zy&&c!==$y){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)===Ky;)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||cb.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case Vy:case Wy:i=r===Vy?"'":'"',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)===Ky;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case ab:lb.lastIndex=g+1,lb.test(d),n=0===lb.lastIndex?d.length-1:lb.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case Ky:for(n=g,s=!0;d.charCodeAt(n+1)===Ky;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==Gy&&r!==Yy&&r!==Jy&&r!==Hy&&r!==$y&&r!==Zy&&(n+=1,hb.test(d.charAt(n)))){for(;hb.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Yy&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===Gy&&d.charCodeAt(g+1)===ob?(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):(ub.lastIndex=g+1,ub.test(d),n=0===ub.lastIndex?d.length-1:ub.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},Ab=vy,Tb=fb,Rb=bb,Pb=kb;const _b={empty:!0,space:!0};var Mb=class{constructor(e){this.input=e,this.root=new Rb,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 Tb;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 Ab;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=Ob(this.input)}decl(e,t){let r=new Eb;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 Pb;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",_b[a]||_b[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 Pb;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 Nb=Ry,Db=Mb,Lb=ny;function Fb(e,t){let r=new Lb(e,t),n=new Db(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 Ub=Fb;Fb.default=Fb,Nb.registerParse(Fb);let{isClean:jb,my:Bb}=mv,zb=fy,qb=Cv,Vb=Ry,Wb=Dy,Kb=Fy,Gb=qy,Jb=Ub,Yb=bb;const Zb={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Hb={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},$b={Once:!0,postcssPlugin:!0,prepare:!0};function Xb(e){return"object"==typeof e&&"function"==typeof e.then}function Qb(e){let t=!1,r=Zb[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 ew(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Qb(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function tw(e){return e[jb]=!1,e.nodes&&e.nodes.forEach((e=>tw(e))),e}let rw={},nw=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 Gb)i=tw(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=Jb;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[Bb]&&Vb.rebuild(i)}else i=tw(r);this.result=new Gb(t,i,n),this.helpers={...rw,postcss:rw,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(!Hb[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!$b[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(Xb(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[jb];){e[jb]=!0;let t=[ew(e)];for(;t.length>0;){let e=this.visitTick(t);if(Xb(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 Xb(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=qb;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new zb(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(Xb(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[jb];)e[jb]=!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||Kb("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(Xb(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[jb])return n[jb]=!0,void e.push(ew(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[jb]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[jb]=!0;let t=Qb(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[jb]||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"}};nw.registerPostcss=e=>{rw=e};var iw=nw;nw.default=nw,Yb.registerLazyResult(nw),Wb.registerLazyResult(nw);let ow=fy,sw=Cv,aw=Fy,lw=Ub;const uw=qy;let cw=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=sw;this.result=new uw(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new ow(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||aw("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=lw;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 hw=cw;cw.default=cw;let dw=hw,pw=iw,fw=Dy,gw=bb,mw=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 pw(this,e,t):new dw(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var vw=mw;mw.default=mw,gw.registerProcessor(mw),fw.registerProcessor(mw);let yw=Mv,bw=qv,ww=vy,Sw=fb,Cw=ny,Iw=bb,xw=kb;function kw(e,t){if(Array.isArray(e))return e.map((e=>kw(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Cw.prototype};r.map&&(r.map={...r.map,__proto__:bw.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>kw(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 Iw(n);if("decl"===n.type)return new yw(n);if("rule"===n.type)return new xw(n);if("comment"===n.type)return new ww(n);if("atrule"===n.type)return new Sw(n);throw new Error("Unknown node type: "+e.type)}var Ew=kw;kw.default=kw;let Ow=gv,Aw=Mv,Tw=iw,Rw=Ry,Pw=vw,_w=Cv,Mw=Ew,Nw=Dy,Dw=jy,Lw=vy,Fw=fb,Uw=qy,jw=ny,Bw=Ub,zw=Sb,qw=kb,Vw=bb,Ww=Rv;function Kw(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Pw(e)}Kw.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 Pw).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return Kw([i(r)]).process(e,t)},i},Kw.stringify=_w,Kw.parse=Bw,Kw.fromJSON=Mw,Kw.list=zw,Kw.comment=e=>new Lw(e),Kw.atRule=e=>new Fw(e),Kw.decl=e=>new Aw(e),Kw.rule=e=>new qw(e),Kw.root=e=>new Vw(e),Kw.document=e=>new Nw(e),Kw.CssSyntaxError=Ow,Kw.Declaration=Aw,Kw.Container=Rw,Kw.Processor=Pw,Kw.Document=Nw,Kw.Comment=Lw,Kw.Warning=Dw,Kw.AtRule=Fw,Kw.Result=Uw,Kw.Input=jw,Kw.Rule=qw,Kw.Root=Vw,Kw.Node=Ww,Tw.registerPostcss(Kw);var Gw=Kw;Kw.default=Kw;const Jw=ov(Gw);Jw.stringify,Jw.fromJSON,Jw.plugin,Jw.parse,Jw.list,Jw.document,Jw.comment,Jw.atRule,Jw.rule,Jw.decl,Jw.root,Jw.CssSyntaxError,Jw.Declaration,Jw.Container,Jw.Processor,Jw.Document,Jw.Comment,Jw.Warning,Jw.AtRule,Jw.Result,Jw.Input,Jw.Rule,Jw.Root,Jw.Node;class Yw{constructor(...e){iv(this,"parentElement",null),iv(this,"parentNode",null),iv(this,"ownerDocument"),iv(this,"firstChild",null),iv(this,"lastChild",null),iv(this,"previousSibling",null),iv(this,"nextSibling",null),iv(this,"ELEMENT_NODE",1),iv(this,"TEXT_NODE",3),iv(this,"nodeType"),iv(this,"nodeName"),iv(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 Yw))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 Zw={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Hw={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},$w={};function Xw(e){if($w[e])return $w[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in Zw?Zw[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 Hw?Hw[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)return $w[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?$w[e]=o:r}catch{return r}}const Qw={};function eS(e,t,r){var n;const i=`${e}.${String(r)}`;if(Qw[i])return Qw[i].call(t);const o=Xw(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Qw[i]=s,s.call(t)):t[r]}const tS={};function rS(e,t,r){const n=`${e}.${String(r)}`;if(tS[n])return tS[n].bind(t);const i=Xw(e)[r];return"function"!=typeof i?t[r]:(tS[n]=i,i.bind(t))}const nS={childNodes:function(e){return eS("Node",e,"childNodes")},parentNode:function(e){return eS("Node",e,"parentNode")},parentElement:function(e){return eS("Node",e,"parentElement")},textContent:function(e){return eS("Node",e,"textContent")},contains:function(e,t){return rS("Node",e,"contains")(t)},getRootNode:function(e){return rS("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?eS("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?eS("Element",e,"shadowRoot"):null},querySelector:function(e,t){return eS("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return eS("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Xw("MutationObserver").constructor}};const iS="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 oS={map:{},getId:()=>(console.error(iS),-1),getNode:()=>(console.error(iS),null),removeNodeFromMap(){console.error(iS)},has:()=>(console.error(iS),!1),reset(){console.error(iS)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(oS=new Proxy(oS,{get:(e,t,r)=>("map"===t&&console.error(iS),Reflect.get(e,t,r))}));let sS=Date.now;function aS(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:nS.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(sS=()=>(new Date).getTime());function lS(e){var t;let r=null;return"getRootNode"in e&&(null==(t=nS.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&nS.host(nS.getRootNode(e))&&(r=nS.host(nS.getRootNode(e))),r}function uS(e){let t,r=e;for(;t=lS(r);)r=t;return r}function cS(e){const t=e.ownerDocument;if(!t)return!1;const r=uS(e);return nS.contains(t,r)}const hS=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Qd(this,"id",1),Qd(this,"styleIDMap",new WeakMap),Qd(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 oS},closestElementOfNode:aS,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:uS,getShadowHost:lS,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=nS.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=nS.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 Yw&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(nS.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&&(nS.contains(t,e)||cS(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&cp.host(e)||null;return Boolean(t&&"shadowRoot"in t&&cp.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const i=nS.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=aS(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(dp(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 sS},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:cS,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 dS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pS="undefined"==typeof Uint8Array?[]:new Uint8Array(256),fS=0;fS<64;fS++)pS[dS.charCodeAt(fS)]=fS;var gS,mS,vS;"undefined"!=typeof window&&window.Blob&&new Blob([(gS="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Uint8Array.from(atob(gS),(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==(Vd=e.contentWindow)?void 0:Vd.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}new hp,(vS=mS||(mS={}))[vS.NotStarted=0]="NotStarted",vS[vS.Running=1]="Running",vS[vS.Stopped=2]="Stopped";class yS{constructor(e){$d(this,"fileName"),$d(this,"functionName"),$d(this,"lineNumber"),$d(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 bS=/(^|@)\S+:\d+/,wS=/^\s*at .*(\S+:\d+|\(native\))/m,SS=/^(eval@)?(\[native code])?$/,CS={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(wS)?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(wS)}),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 yS({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(SS)}),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 yS({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new yS({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 yS({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 yS({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(bS)&&!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 yS({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function IS(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 xS(e){return"[object Object]"===Object.prototype.toString.call(e)}function kS(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(xS(e[n])&&kS(e[n],t-1))return!0;return!1}function ES(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(xS(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(xS(e)&&kS(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]=IS(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 OS={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 AS(e,t,r){const n=r?Object.assign({},OS,r):OS,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=CS.parse(i).map((e=>e.toString())),s=[ES(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=[ES(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,i=[ES("Uncaught (in promise)",n.stringifyOptions),ES(t.reason,n.stringifyOptions)]);const o=CS.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]?hS.patch(t,r,(t=>(...i)=>{if(t.apply(this,i),!("assert"===r&&i[0]||a)){a=!0;try{const t=CS.parse(new Error).map((e=>e.toString())).splice(1),o=("assert"===r?i.slice(1):i).map((e=>ES(e,n.stringifyOptions)));s++,s<n.lengthThreshold?e({level:r,trace:t,payload:o}):s===n.lengthThreshold&&e({level:"warn",trace:[],payload:[ES("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...i)}finally{a=!1}}})):()=>{}}}const TS="rrweb/console@1";var RS,PS=Object.freeze({__proto__:null,PLUGIN_NAME:TS,getRecordConsolePlugin:e=>({name:TS,observer:AS,options:e})}),_S=Object.defineProperty,MS=(e,t,r)=>((e,t,r)=>t in e?_S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),NS=Object.defineProperty,DS=(e,t,r)=>((e,t,r)=>t in e?NS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),LS=(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))(LS||{});const FS={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},US={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},jS={};function BS(e){if(jS[e])return jS[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in FS?FS[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 US?US[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)return jS[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?jS[e]=o:r}catch{return r}}const zS={};function qS(e,t,r){var n;const i=`${e}.${String(r)}`;if(zS[i])return zS[i].call(t);const o=BS(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(zS[i]=s,s.call(t)):t[r]}const VS={};function WS(e,t,r){const n=`${e}.${String(r)}`;if(VS[n])return VS[n].bind(t);const i=BS(e)[r];return"function"!=typeof i?t[r]:(VS[n]=i,i.bind(t))}const KS={childNodes:function(e){return qS("Node",e,"childNodes")},parentNode:function(e){return qS("Node",e,"parentNode")},parentElement:function(e){return qS("Node",e,"parentElement")},textContent:function(e){return qS("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?qS("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?qS("Element",e,"shadowRoot"):null},querySelector:function(e,t){return qS("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return qS("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return BS("MutationObserver").constructor}};function GS(e){return e.nodeType===e.ELEMENT_NODE}function JS(e){const t=e&&"host"in e&&"mode"in e&&KS.host(e)||null;return Boolean(t&&"shadowRoot"in t&&KS.shadowRoot(t)===e)}function YS(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function ZS(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=>HS(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 HS(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=ZS(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?aC(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?aC(r,t):r}}class $S{constructor(){DS(this,"idNodeMap",new Map),DS(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 XS({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"";const a=n&&QS(n);return(t[r.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function QS(e){return e.toLowerCase()}const eC="__rrweb_original__";function tC(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?QS(t):null}function rC(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 nC=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,iC=/^(?:[a-z+]+:)?\/\//i,oC=/^www\..*/i,sC=/^(data:)([^,]*),(.*)/i;function aC(e,t){return(e||"").replace(nC,((e,r,n,i,o,s)=>{const a=n||o||s,l=r||i||"";if(!a)return e;if(iC.test(a)||oC.test(a))return`url(${l}${a}${l})`;if(sC.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 lC(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function uC(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=lC(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=lC(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=lC(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=lC(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 cC="lightgrey";let hC=1;const dC=new RegExp("[^a-z0-9-_:]");function pC(){return hC++}let fC,gC;const mC=/^[^ \t\n\r\u000c]+/,vC=/^[, \t\n\r\u000c]+/;const yC=new WeakMap;function bC(e,t){return t&&""!==t.trim()?SC(e,t):t}function wC(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function SC(e,t){let r=yC.get(e);if(r||(r=e.createElement("a"),yC.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function CC(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?bC(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(vC),!(r>=t.length);){let o=n(mC);if(","===o.slice(-1))o=bC(e,o.substring(0,o.length-1)),i.push(o);else{let n="";o=bC(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?aC(n,SC(e)):"object"===t&&"data"===r?bC(e,n):n:bC(e,n):n}function IC(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function xC(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&xC(KS.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&xC(KS.parentNode(e),t,r)}function kC(e,t,r,n){let i;if(GS(e)){if(i=e,!KS.childNodes(i).length)return!1}else{if(null===KS.parentElement(e))return!1;i=KS.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(xC(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 EC(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:LS.Document,childNodes:[],compatMode:e.compatMode}:{type:LS.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:LS.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=QS(e.tagName);return dC.test(t)?"div":t}(e);let v={};const y=e.attributes.length;for(let t=0;t<y;t++){const n=e.attributes[t];IC(m,n.name,n.value)||(v[n.name]=CC(r,m,QS(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=ZS(t)),n&&(delete v.rel,delete v.href,v._cssText=n)}if("style"===m&&e.sheet){let t=ZS(e.sheet);t&&(e.childNodes.length>1&&(t=uC(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=XS({element:e,type:tC(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=eC in i?i[eC]: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){fC||(fC=r.createElement("canvas"),gC=fC.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",i=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{fC.width=t.naturalWidth,fC.height=t.naturalHeight,gC.drawImage(t,0,0),v.rr_dataURL=fC.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:cC}:{}}}"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:LS.Element,tagName:m,attributes:v,childNodes:[],isSVG:wC(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=KS.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=KS.textContent(e),u&&l&&(l=aC(l,SC(t.doc))));!u&&!c&&l&&r&&(l=n?n(l,KS.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:LS.Text,textContent:l||"",rootId:i}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:y,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:LS.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:LS.Comment,textContent:KS.textContent(e)||"",rootId:y};default:return!1}}function OC(e){return null==e?"":e.toLowerCase()}function AC(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=kC(e,s,a,void 0===E)}const A=EC(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 T;T=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===LS.Comment)return!0;if(e.type===LS.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"===rC(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(OC(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===OC(e.attributes.name)||"icon"===OC(e.attributes.rel)||"apple-touch-icon"===OC(e.attributes.rel)||"shortcut icon"===OC(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&OC(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(OC(e.attributes.property).match(/^(og|twitter|fb):/)||OC(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===OC(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===OC(e.attributes.name)||"googlebot"===OC(e.attributes.name)||"bingbot"===OC(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===OC(e.attributes.name)||"generator"===OC(e.attributes.name)||"framework"===OC(e.attributes.name)||"publisher"===OC(e.attributes.name)||"progid"===OC(e.attributes.name)||OC(e.attributes.property).match(/^article:/)||OC(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===OC(e.attributes.name)||"yandex-verification"===OC(e.attributes.name)||"csrf-token"===OC(e.attributes.name)||"p:domain_verify"===OC(e.attributes.name)||"verify-v1"===OC(e.attributes.name)||"verification"===OC(e.attributes.name)||"shopify-checkout-api-token"===OC(e.attributes.name)))return!0}}return!1}(A,p)||!O&&A.type===LS.Text&&!A.textContent.replace(/^\s+|\s+$/gm,"").length?-2:pC();const R=Object.assign(A,{id:T});if(n.add(e,R),-2===T)return null;v&&v(e);let P=!l;if(R.type===LS.Element){P=P&&!R.needBlock,delete R.needBlock;const t=KS.shadowRoot(e);t&&YS(t)&&(R.isShadowHost=!0)}if((R.type===LS.Document||R.type===LS.Element)&&P){p.headWhitespace&&R.type===LS.Element&&"head"===R.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(R.type===LS.Element&&"textarea"===R.tagName&&void 0!==R.attributes.value);else{R.type===LS.Element&&void 0!==R.attributes._cssText&&"string"==typeof R.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(KS.childNodes(e))){const e=AC(r,t);e&&R.childNodes.push(e)}}let I=null;if(GS(e)&&(I=KS.shadowRoot(e)))for(const e of Array.from(KS.childNodes(I))){const r=AC(e,t);r&&(YS(I)&&(r.isShadow=!0),R.childNodes.push(r))}}const _=KS.parentNode(e);return _&&JS(_)&&YS(_)&&(R.isShadow=!0),R.type===LS.Element&&"iframe"===R.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=AC(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),R.type===LS.Element&&"link"===R.tagName&&"string"==typeof R.attributes.rel&&("stylesheet"===R.attributes.rel||"preload"===R.attributes.rel&&"string"==typeof R.attributes.href&&"css"===rC(R.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=AC(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),R}function TC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function RC(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 PC={exports:{}},_C=String,MC=function(){return{isColorSupported:!1,reset:_C,bold:_C,dim:_C,italic:_C,underline:_C,inverse:_C,hidden:_C,strikethrough:_C,black:_C,red:_C,green:_C,yellow:_C,blue:_C,magenta:_C,cyan:_C,white:_C,gray:_C,bgBlack:_C,bgRed:_C,bgGreen:_C,bgYellow:_C,bgBlue:_C,bgMagenta:_C,bgCyan:_C,bgWhite:_C}};PC.exports=MC(),PC.exports.createColors=MC;var NC=PC.exports;const DC=RC(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let LC=NC,FC=DC,UC=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=LC.isColorSupported),FC&&e&&(t=FC(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}=LC.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 jC=UC;UC.default=UC;var BC={};BC.isClean=Symbol("isClean"),BC.my=Symbol("my");const zC={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let qC=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 zC[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=zC[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 VC=qC;qC.default=qC;let WC=VC;function KC(e,t){new WC(t).stringify(e)}var GC=KC;KC.default=KC;let{isClean:JC,my:YC}=BC,ZC=jC,HC=VC,$C=GC;function XC(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=>XC(e,r))):("object"===o&&null!==i&&(i=XC(i)),r[n]=i)}return r}let QC=class{constructor(e={}){this.raws={},this[JC]=!1,this[YC]=!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=XC(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 ZC(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[JC]){this[JC]=!1;let e=this;for(;e=e.parent;)e[JC]=!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 HC).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=$C){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 eI=QC;QC.default=QC;let tI=eI,rI=class extends tI{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 nI=rI;rI.default=rI;var iI={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:oI,SourceMapGenerator:sI}=DC,{existsSync:aI,readFileSync:lI}=DC,{dirname:uI,join:cI}=DC;let hI=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=uI(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new oI(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=uI(e),aI(e))return this.mapFile=e,lI(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 oI)return sI.fromSourceMap(t).toString();if(t instanceof sI)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=cI(uI(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 dI=hI;hI.default=hI;let{SourceMapConsumer:pI,SourceMapGenerator:fI}=DC,{fileURLToPath:gI,pathToFileURL:mI}=DC,{isAbsolute:vI,resolve:yI}=DC,{nanoid:bI}=iI,wI=DC,SI=jC,CI=dI,II=Symbol("fromOffsetCache"),xI=Boolean(pI&&fI),kI=Boolean(yI&&vI),EI=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&&(!kI||/^\w+:\/\//.test(t.from)||vI(t.from)?this.file=t.from:this.file=yI(t.from)),kI&&xI){let e=new CI(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 "+bI(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 SI(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 SI(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&&(mI&&(i.input.url=mI(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[II])r=this[II];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[II]=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:yI(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=vI(a.source)?mI(a.source):new URL(a.source,this.map.consumer().sourceRoot||mI(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(!gI)throw new Error("file: protocol is not available in this PostCSS build");l.file=gI(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 OI=EI;EI.default=EI,wI&&wI.registerInput&&wI.registerInput(EI);let{SourceMapConsumer:AI,SourceMapGenerator:TI}=DC,{dirname:RI,relative:PI,resolve:_I,sep:MI}=DC,{pathToFileURL:NI}=DC,DI=OI,LI=Boolean(AI&&TI),FI=Boolean(RI&&_I&&PI&&MI);var UI=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||RI(e.file);!1===this.mapOpts.sourcesContent?(t=new AI(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(),FI&&LI&&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=TI.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new TI({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 TI({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?RI(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=RI(_I(r,this.mapOpts.annotation)));let n=PI(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 DI(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(NI){let t=NI(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;"\\"===MI&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let jI=eI,BI=class extends jI{constructor(e){super(e),this.type="comment"}};var zI=BI;BI.default=BI;let qI,VI,WI,KI,{isClean:GI,my:JI}=BC,YI=nI,ZI=zI,HI=eI;function $I(e){return e.map((e=>(e.nodes&&(e.nodes=$I(e.nodes)),delete e.source,e)))}function XI(e){if(e[GI]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)XI(t)}let QI=class e extends HI{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=$I(qI(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 YI(t)]}else if(t.selector)t=[new VI(t)];else if(t.name)t=[new WI(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new ZI(t)]}return t.map((t=>(t[JI]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[GI]&&XI(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]}};QI.registerParse=e=>{qI=e},QI.registerRule=e=>{VI=e},QI.registerAtRule=e=>{WI=e},QI.registerRoot=e=>{KI=e};var ex=QI;QI.default=QI,QI.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,WI.prototype):"rule"===e.type?Object.setPrototypeOf(e,VI.prototype):"decl"===e.type?Object.setPrototypeOf(e,YI.prototype):"comment"===e.type?Object.setPrototypeOf(e,ZI.prototype):"root"===e.type&&Object.setPrototypeOf(e,KI.prototype),e[JI]=!0,e.nodes&&e.nodes.forEach((e=>{QI.rebuild(e)}))};let tx,rx,nx=ex,ix=class extends nx{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new tx(new rx,this,e).stringify()}};ix.registerLazyResult=e=>{tx=e},ix.registerProcessor=e=>{rx=e};var ox=ix;ix.default=ix;let sx={};var ax=function(e){sx[e]||(sx[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let lx=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 ux=lx;lx.default=lx;let cx=ux,hx=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 cx(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var dx=hx;hx.default=hx;const px="'".charCodeAt(0),fx='"'.charCodeAt(0),gx="\\".charCodeAt(0),mx="/".charCodeAt(0),vx="\n".charCodeAt(0),yx=" ".charCodeAt(0),bx="\f".charCodeAt(0),wx="\t".charCodeAt(0),Sx="\r".charCodeAt(0),Cx="[".charCodeAt(0),Ix="]".charCodeAt(0),xx="(".charCodeAt(0),kx=")".charCodeAt(0),Ex="{".charCodeAt(0),Ox="}".charCodeAt(0),Ax=";".charCodeAt(0),Tx="*".charCodeAt(0),Rx=":".charCodeAt(0),Px="@".charCodeAt(0),_x=/[\t\n\f\r "#'()/;[\\\]{}]/g,Mx=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Nx=/.[\r\n"'(/\\]/,Dx=/[\da-f]/i;let Lx=ex,Fx=class extends Lx{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 Ux=Fx;Fx.default=Fx,Lx.registerAtRule(Fx);let jx,Bx,zx=ex,qx=class extends zx{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 jx(new Bx,this,e).stringify()}};qx.registerLazyResult=e=>{jx=e},qx.registerProcessor=e=>{Bx=e};var Vx=qx;qx.default=qx,zx.registerRoot(qx);let Wx={comma:e=>Wx.split(e,[","],!0),space:e=>Wx.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 Kx=Wx;Wx.default=Wx;let Gx=ex,Jx=Kx,Yx=class extends Gx{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Jx.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 Zx=Yx;Yx.default=Yx,Gx.registerRule(Yx);let Hx=nI,$x=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 vx:case yx:case wx:case Sx:case bx:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===yx||r===vx||r===wx||r===Sx||r===bx);h=["space",d.slice(g,n)],g=n-1;break;case Cx:case Ix:case Ex:case Ox:case Rx:case Ax:case kx:{let e=String.fromCharCode(r);h=[e,e,g];break}case xx:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==px&&c!==fx&&c!==yx&&c!==vx&&c!==wx&&c!==bx&&c!==Sx){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)===gx;)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||Nx.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case px:case fx:i=r===px?"'":'"',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)===gx;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case Px:_x.lastIndex=g+1,_x.test(d),n=0===_x.lastIndex?d.length-1:_x.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case gx:for(n=g,s=!0;d.charCodeAt(n+1)===gx;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==mx&&r!==yx&&r!==vx&&r!==wx&&r!==Sx&&r!==bx&&(n+=1,Dx.test(d.charAt(n)))){for(;Dx.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===yx&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===mx&&d.charCodeAt(g+1)===Tx?(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):(Mx.lastIndex=g+1,Mx.test(d),n=0===Mx.lastIndex?d.length-1:Mx.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},Xx=zI,Qx=Ux,ek=Vx,tk=Zx;const rk={empty:!0,space:!0};var nk=class{constructor(e){this.input=e,this.root=new ek,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 Qx;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 Xx;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=$x(this.input)}decl(e,t){let r=new Hx;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 tk;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",rk[a]||rk[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 tk;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 ik=ex,ok=nk,sk=OI;function ak(e,t){let r=new sk(e,t),n=new ok(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 lk=ak;ak.default=ak,ik.registerParse(ak);let{isClean:uk,my:ck}=BC,hk=UI,dk=GC,pk=ex,fk=ox,gk=ax,mk=dx,vk=lk,yk=Vx;const bk={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},wk={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},Sk={Once:!0,postcssPlugin:!0,prepare:!0};function Ck(e){return"object"==typeof e&&"function"==typeof e.then}function Ik(e){let t=!1,r=bk[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 xk(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Ik(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function kk(e){return e[uk]=!1,e.nodes&&e.nodes.forEach((e=>kk(e))),e}let Ek={},Ok=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 mk)i=kk(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=vk;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[ck]&&pk.rebuild(i)}else i=kk(r);this.result=new mk(t,i,n),this.helpers={...Ek,postcss:Ek,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(!wk[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Sk[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(Ck(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[uk];){e[uk]=!0;let t=[xk(e)];for(;t.length>0;){let e=this.visitTick(t);if(Ck(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 Ck(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=dk;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new hk(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(Ck(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[uk];)e[uk]=!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||gk("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(Ck(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[uk])return n[uk]=!0,void e.push(xk(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[uk]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[uk]=!0;let t=Ik(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[uk]||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"}};Ok.registerPostcss=e=>{Ek=e};var Ak=Ok;Ok.default=Ok,yk.registerLazyResult(Ok),fk.registerLazyResult(Ok);let Tk=UI,Rk=GC,Pk=ax,_k=lk;const Mk=dx;let Nk=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=Rk;this.result=new Mk(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new Tk(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||Pk("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=_k;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 Dk=Nk;Nk.default=Nk;let Lk=Dk,Fk=Ak,Uk=ox,jk=Vx,Bk=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 Fk(this,e,t):new Lk(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var zk=Bk;Bk.default=Bk,jk.registerProcessor(Bk),Uk.registerProcessor(Bk);let qk=nI,Vk=dI,Wk=zI,Kk=Ux,Gk=OI,Jk=Vx,Yk=Zx;function Zk(e,t){if(Array.isArray(e))return e.map((e=>Zk(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Gk.prototype};r.map&&(r.map={...r.map,__proto__:Vk.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>Zk(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 Jk(n);if("decl"===n.type)return new qk(n);if("rule"===n.type)return new Yk(n);if("comment"===n.type)return new Wk(n);if("atrule"===n.type)return new Kk(n);throw new Error("Unknown node type: "+e.type)}var Hk=Zk;Zk.default=Zk;let $k=jC,Xk=nI,Qk=Ak,eE=ex,tE=zk,rE=GC,nE=Hk,iE=ox,oE=ux,sE=zI,aE=Ux,lE=dx,uE=OI,cE=lk,hE=Kx,dE=Zx,pE=Vx,fE=eI;function gE(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new tE(e)}gE.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 tE).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return gE([i(r)]).process(e,t)},i},gE.stringify=rE,gE.parse=cE,gE.fromJSON=nE,gE.list=hE,gE.comment=e=>new sE(e),gE.atRule=e=>new aE(e),gE.decl=e=>new Xk(e),gE.rule=e=>new dE(e),gE.root=e=>new pE(e),gE.document=e=>new iE(e),gE.CssSyntaxError=$k,gE.Declaration=Xk,gE.Container=eE,gE.Processor=tE,gE.Document=iE,gE.Comment=sE,gE.Warning=oE,gE.AtRule=aE,gE.Result=lE,gE.Input=uE,gE.Rule=dE,gE.Root=pE,gE.Node=fE,Qk.registerPostcss(gE);var mE=gE;gE.default=gE;const vE=TC(mE);vE.stringify,vE.fromJSON,vE.plugin,vE.parse,vE.list,vE.document,vE.comment,vE.atRule,vE.rule,vE.decl,vE.root,vE.CssSyntaxError,vE.Declaration,vE.Container,vE.Processor,vE.Document,vE.Comment,vE.Warning,vE.AtRule,vE.Result,vE.Input,vE.Rule,vE.Root,vE.Node;var yE=Object.defineProperty,bE=(e,t,r)=>((e,t,r)=>t in e?yE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function wE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function SE(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 CE={exports:{}},IE=String,xE=function(){return{isColorSupported:!1,reset:IE,bold:IE,dim:IE,italic:IE,underline:IE,inverse:IE,hidden:IE,strikethrough:IE,black:IE,red:IE,green:IE,yellow:IE,blue:IE,magenta:IE,cyan:IE,white:IE,gray:IE,bgBlack:IE,bgRed:IE,bgGreen:IE,bgYellow:IE,bgBlue:IE,bgMagenta:IE,bgCyan:IE,bgWhite:IE}};CE.exports=xE(),CE.exports.createColors=xE;var kE=CE.exports;const EE=SE(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let OE=kE,AE=EE,TE=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=OE.isColorSupported),AE&&e&&(t=AE(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}=OE.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 RE=TE;TE.default=TE;var PE={};PE.isClean=Symbol("isClean"),PE.my=Symbol("my");const _E={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let ME=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 _E[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=_E[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 NE=ME;ME.default=ME;let DE=NE;function LE(e,t){new DE(t).stringify(e)}var FE=LE;LE.default=LE;let{isClean:UE,my:jE}=PE,BE=RE,zE=NE,qE=FE;function VE(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=>VE(e,r))):("object"===o&&null!==i&&(i=VE(i)),r[n]=i)}return r}let WE=class{constructor(e={}){this.raws={},this[UE]=!1,this[jE]=!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=VE(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 BE(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[UE]){this[UE]=!1;let e=this;for(;e=e.parent;)e[UE]=!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 zE).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=qE){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 KE=WE;WE.default=WE;let GE=KE,JE=class extends GE{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 YE=JE;JE.default=JE;var ZE={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:HE,SourceMapGenerator:$E}=EE,{existsSync:XE,readFileSync:QE}=EE,{dirname:eO,join:tO}=EE;let rO=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=eO(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new HE(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=eO(e),XE(e))return this.mapFile=e,QE(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 HE)return $E.fromSourceMap(t).toString();if(t instanceof $E)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=tO(eO(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 nO=rO;rO.default=rO;let{SourceMapConsumer:iO,SourceMapGenerator:oO}=EE,{fileURLToPath:sO,pathToFileURL:aO}=EE,{isAbsolute:lO,resolve:uO}=EE,{nanoid:cO}=ZE,hO=EE,dO=RE,pO=nO,fO=Symbol("fromOffsetCache"),gO=Boolean(iO&&oO),mO=Boolean(uO&&lO),vO=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&&(!mO||/^\w+:\/\//.test(t.from)||lO(t.from)?this.file=t.from:this.file=uO(t.from)),mO&&gO){let e=new pO(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 "+cO(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 dO(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 dO(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&&(aO&&(i.input.url=aO(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[fO])r=this[fO];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[fO]=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:uO(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=lO(a.source)?aO(a.source):new URL(a.source,this.map.consumer().sourceRoot||aO(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(!sO)throw new Error("file: protocol is not available in this PostCSS build");l.file=sO(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 yO=vO;vO.default=vO,hO&&hO.registerInput&&hO.registerInput(vO);let{SourceMapConsumer:bO,SourceMapGenerator:wO}=EE,{dirname:SO,relative:CO,resolve:IO,sep:xO}=EE,{pathToFileURL:kO}=EE,EO=yO,OO=Boolean(bO&&wO),AO=Boolean(SO&&IO&&CO&&xO);var TO=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||SO(e.file);!1===this.mapOpts.sourcesContent?(t=new bO(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(),AO&&OO&&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=wO.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new wO({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 wO({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?SO(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=SO(IO(r,this.mapOpts.annotation)));let n=CO(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 EO(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(kO){let t=kO(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;"\\"===xO&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let RO=KE,PO=class extends RO{constructor(e){super(e),this.type="comment"}};var _O=PO;PO.default=PO;let MO,NO,DO,LO,{isClean:FO,my:UO}=PE,jO=YE,BO=_O,zO=KE;function qO(e){return e.map((e=>(e.nodes&&(e.nodes=qO(e.nodes)),delete e.source,e)))}function VO(e){if(e[FO]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)VO(t)}let WO=class e extends zO{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=qO(MO(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 jO(t)]}else if(t.selector)t=[new NO(t)];else if(t.name)t=[new DO(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new BO(t)]}return t.map((t=>(t[UO]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[FO]&&VO(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]}};WO.registerParse=e=>{MO=e},WO.registerRule=e=>{NO=e},WO.registerAtRule=e=>{DO=e},WO.registerRoot=e=>{LO=e};var KO=WO;WO.default=WO,WO.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,DO.prototype):"rule"===e.type?Object.setPrototypeOf(e,NO.prototype):"decl"===e.type?Object.setPrototypeOf(e,jO.prototype):"comment"===e.type?Object.setPrototypeOf(e,BO.prototype):"root"===e.type&&Object.setPrototypeOf(e,LO.prototype),e[UO]=!0,e.nodes&&e.nodes.forEach((e=>{WO.rebuild(e)}))};let GO,JO,YO=KO,ZO=class extends YO{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new GO(new JO,this,e).stringify()}};ZO.registerLazyResult=e=>{GO=e},ZO.registerProcessor=e=>{JO=e};var HO=ZO;ZO.default=ZO;let $O={};var XO=function(e){$O[e]||($O[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let QO=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 eA=QO;QO.default=QO;let tA=eA,rA=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 tA(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var nA=rA;rA.default=rA;const iA="'".charCodeAt(0),oA='"'.charCodeAt(0),sA="\\".charCodeAt(0),aA="/".charCodeAt(0),lA="\n".charCodeAt(0),uA=" ".charCodeAt(0),cA="\f".charCodeAt(0),hA="\t".charCodeAt(0),dA="\r".charCodeAt(0),pA="[".charCodeAt(0),fA="]".charCodeAt(0),gA="(".charCodeAt(0),mA=")".charCodeAt(0),vA="{".charCodeAt(0),yA="}".charCodeAt(0),bA=";".charCodeAt(0),wA="*".charCodeAt(0),SA=":".charCodeAt(0),CA="@".charCodeAt(0),IA=/[\t\n\f\r "#'()/;[\\\]{}]/g,xA=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,kA=/.[\r\n"'(/\\]/,EA=/[\da-f]/i;let OA=KO,AA=class extends OA{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 TA=AA;AA.default=AA,OA.registerAtRule(AA);let RA,PA,_A=KO,MA=class extends _A{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 RA(new PA,this,e).stringify()}};MA.registerLazyResult=e=>{RA=e},MA.registerProcessor=e=>{PA=e};var NA=MA;MA.default=MA,_A.registerRoot(MA);let DA={comma:e=>DA.split(e,[","],!0),space:e=>DA.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 LA=DA;DA.default=DA;let FA=KO,UA=LA,jA=class extends FA{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return UA.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 BA=jA;jA.default=jA,FA.registerRule(jA);let zA=YE,qA=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 lA:case uA:case hA:case dA:case cA:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===uA||r===lA||r===hA||r===dA||r===cA);h=["space",d.slice(g,n)],g=n-1;break;case pA:case fA:case vA:case yA:case SA:case bA:case mA:{let e=String.fromCharCode(r);h=[e,e,g];break}case gA:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==iA&&c!==oA&&c!==uA&&c!==lA&&c!==hA&&c!==cA&&c!==dA){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)===sA;)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||kA.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case iA:case oA:i=r===iA?"'":'"',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)===sA;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case CA:IA.lastIndex=g+1,IA.test(d),n=0===IA.lastIndex?d.length-1:IA.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case sA:for(n=g,s=!0;d.charCodeAt(n+1)===sA;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==aA&&r!==uA&&r!==lA&&r!==hA&&r!==dA&&r!==cA&&(n+=1,EA.test(d.charAt(n)))){for(;EA.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===uA&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===aA&&d.charCodeAt(g+1)===wA?(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):(xA.lastIndex=g+1,xA.test(d),n=0===xA.lastIndex?d.length-1:xA.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},VA=_O,WA=TA,KA=NA,GA=BA;const JA={empty:!0,space:!0};var YA=class{constructor(e){this.input=e,this.root=new KA,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 WA;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 VA;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=qA(this.input)}decl(e,t){let r=new zA;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 GA;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",JA[a]||JA[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 GA;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 ZA=KO,HA=YA,$A=yO;function XA(e,t){let r=new $A(e,t),n=new HA(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 QA=XA;XA.default=XA,ZA.registerParse(XA);let{isClean:eT,my:tT}=PE,rT=TO,nT=FE,iT=KO,oT=HO,sT=XO,aT=nA,lT=QA,uT=NA;const cT={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},hT={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},dT={Once:!0,postcssPlugin:!0,prepare:!0};function pT(e){return"object"==typeof e&&"function"==typeof e.then}function fT(e){let t=!1,r=cT[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 gT(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:fT(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function mT(e){return e[eT]=!1,e.nodes&&e.nodes.forEach((e=>mT(e))),e}let vT={},yT=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 aT)i=mT(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=lT;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[tT]&&iT.rebuild(i)}else i=mT(r);this.result=new aT(t,i,n),this.helpers={...vT,postcss:vT,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(!hT[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!dT[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(pT(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[eT];){e[eT]=!0;let t=[gT(e)];for(;t.length>0;){let e=this.visitTick(t);if(pT(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 pT(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=nT;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new rT(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(pT(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[eT];)e[eT]=!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||sT("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(pT(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[eT])return n[eT]=!0,void e.push(gT(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[eT]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[eT]=!0;let t=fT(e);for(let r of t)if(0===r)e.nodes&&e.each((e=>{e[eT]||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"}};yT.registerPostcss=e=>{vT=e};var bT=yT;yT.default=yT,uT.registerLazyResult(yT),oT.registerLazyResult(yT);let wT=TO,ST=FE,CT=XO,IT=QA;const xT=nA;let kT=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=ST;this.result=new xT(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new wT(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||CT("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=IT;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 ET=kT;kT.default=kT;let OT=ET,AT=bT,TT=HO,RT=NA,PT=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 AT(this,e,t):new OT(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var _T=PT;PT.default=PT,RT.registerProcessor(PT),TT.registerProcessor(PT);let MT=YE,NT=nO,DT=_O,LT=TA,FT=yO,UT=NA,jT=BA;function BT(e,t){if(Array.isArray(e))return e.map((e=>BT(e)));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:FT.prototype};r.map&&(r.map={...r.map,__proto__:NT.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map((e=>BT(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 UT(n);if("decl"===n.type)return new MT(n);if("rule"===n.type)return new jT(n);if("comment"===n.type)return new DT(n);if("atrule"===n.type)return new LT(n);throw new Error("Unknown node type: "+e.type)}var zT=BT;BT.default=BT;let qT=RE,VT=YE,WT=bT,KT=KO,GT=_T,JT=FE,YT=zT,ZT=HO,HT=eA,$T=_O,XT=TA,QT=nA,eR=yO,tR=QA,rR=LA,nR=BA,iR=NA,oR=KE;function sR(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new GT(e)}sR.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 GT).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return sR([i(r)]).process(e,t)},i},sR.stringify=JT,sR.parse=tR,sR.fromJSON=YT,sR.list=rR,sR.comment=e=>new $T(e),sR.atRule=e=>new XT(e),sR.decl=e=>new VT(e),sR.rule=e=>new nR(e),sR.root=e=>new iR(e),sR.document=e=>new ZT(e),sR.CssSyntaxError=qT,sR.Declaration=VT,sR.Container=KT,sR.Processor=GT,sR.Document=ZT,sR.Comment=$T,sR.Warning=HT,sR.AtRule=XT,sR.Result=QT,sR.Input=eR,sR.Rule=nR,sR.Root=iR,sR.Node=oR,WT.registerPostcss(sR);var aR=sR;sR.default=sR;const lR=wE(aR);lR.stringify,lR.fromJSON,lR.plugin,lR.parse,lR.list,lR.document,lR.comment,lR.atRule,lR.rule,lR.decl,lR.root,lR.CssSyntaxError,lR.Declaration,lR.Container,lR.Processor,lR.Document,lR.Comment,lR.Warning,lR.AtRule,lR.Result,lR.Input,lR.Rule,lR.Root,lR.Node;class uR{constructor(...e){bE(this,"parentElement",null),bE(this,"parentNode",null),bE(this,"ownerDocument"),bE(this,"firstChild",null),bE(this,"lastChild",null),bE(this,"previousSibling",null),bE(this,"nextSibling",null),bE(this,"ELEMENT_NODE",1),bE(this,"TEXT_NODE",3),bE(this,"nodeType"),bE(this,"nodeName"),bE(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 uR))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 cR={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},hR={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},dR={};function pR(e){if(dR[e])return dR[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in cR?cR[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 hR?hR[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)return dR[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?dR[e]=o:r}catch{return r}}const fR={};function gR(e,t,r){var n;const i=`${e}.${String(r)}`;if(fR[i])return fR[i].call(t);const o=pR(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(fR[i]=s,s.call(t)):t[r]}const mR={};function vR(e,t,r){const n=`${e}.${String(r)}`;if(mR[n])return mR[n].bind(t);const i=pR(e)[r];return"function"!=typeof i?t[r]:(mR[n]=i,i.bind(t))}function yR(){return pR("MutationObserver").constructor}const bR={childNodes:function(e){return gR("Node",e,"childNodes")},parentNode:function(e){return gR("Node",e,"parentNode")},parentElement:function(e){return gR("Node",e,"parentElement")},textContent:function(e){return gR("Node",e,"textContent")},contains:function(e,t){return vR("Node",e,"contains")(t)},getRootNode:function(e){return vR("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?gR("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?gR("Element",e,"shadowRoot"):null},querySelector:function(e,t){return gR("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return gR("Element",e,"querySelectorAll")(t)},mutationObserver:yR};function wR(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const SR="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 CR={map:{},getId:()=>(console.error(SR),-1),getNode:()=>(console.error(SR),null),removeNodeFromMap(){console.error(SR)},has:()=>(console.error(SR),!1),reset(){console.error(SR)}};function IR(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 xR(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)}}),()=>xR(e,t,o||{},!0)}function kR(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&&(CR=new Proxy(CR,{get:(e,t,r)=>("map"===t&&console.error(SR),Reflect.get(e,t,r))}));let ER=Date.now;function OR(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=bR.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=bR.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function AR(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function TR(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function RR(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:bR.parentElement(e)}function PR(e,t,r,n){if(!e)return!1;const i=RR(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(xC(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 _R(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function MR(e,t){if(JS(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=bR.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||MR(n,t))}function NR(e){return Boolean(e.changedTouches)}function DR(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function LR(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function FR(e){return!!e&&(e instanceof uR&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(bR.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ER=()=>(new Date).getTime());class UR{constructor(){MS(this,"id",1),MS(this,"styleIDMap",new WeakMap),MS(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 jR(e){var t;let r=null;return"getRootNode"in e&&(null==(t=bR.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&bR.host(bR.getRootNode(e))&&(r=bR.host(bR.getRootNode(e))),r}function BR(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=jR(r);)r=t;return r}(e);return bR.contains(t,r)}function zR(e){const t=e.ownerDocument;return!!t&&(bR.contains(t,e)||BR(e))}var qR=(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))(qR||{}),VR=(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))(VR||{}),WR=(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))(WR||{}),KR=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(KR||{}),GR=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(GR||{}),JR=(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))(JR||{}),YR=(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))(YR||{});function ZR(e){return"__ln"in e}class HR{constructor(){MS(this,"length",0),MS(this,"head",null),MS(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&&ZR(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&&ZR(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 $R=(e,t)=>`${e}@${t}`;class XR{constructor(){MS(this,"frozen",!1),MS(this,"locked",!1),MS(this,"texts",[]),MS(this,"attributes",[]),MS(this,"attributeMap",new WeakMap),MS(this,"removes",[]),MS(this,"mapRemoves",[]),MS(this,"movedMap",{}),MS(this,"addedSet",new Set),MS(this,"movedSet",new Set),MS(this,"droppedSet",new Set),MS(this,"removesSubTreeCache",new Set),MS(this,"mutationCb"),MS(this,"blockClass"),MS(this,"blockSelector"),MS(this,"maskTextClass"),MS(this,"maskTextSelector"),MS(this,"inlineStylesheet"),MS(this,"maskInputOptions"),MS(this,"maskTextFn"),MS(this,"maskInputFn"),MS(this,"keepIframeSrcFn"),MS(this,"recordCanvas"),MS(this,"inlineImages"),MS(this,"slimDOMOptions"),MS(this,"dataURLOptions"),MS(this,"doc"),MS(this,"mirror"),MS(this,"iframeManager"),MS(this,"stylesheetManager"),MS(this,"shadowDomManager"),MS(this,"canvasManager"),MS(this,"processedNodeManager"),MS(this,"unattachedDoc"),MS(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),MS(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new HR,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=bR.parentNode(i);if(!o||!zR(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=JS(o)?this.mirror.getId(jR(i)):this.mirror.getId(o),l=n(i);if(-1===a||-1===l)return r.addNode(i);const u=AC(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=>{DR(e,this.mirror)&&this.iframeManager.addIframe(e),LR(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),FR(i)&&this.shadowDomManager.addShadowRoot(bR.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)eP(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(bR.parentNode(e))||i(e);for(const e of this.addedSet)tP(this.droppedSet,e)||eP(this.removesSubTreeCache,e,this.mirror)?tP(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(bR.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(bR.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=bR.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=bR.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=bR.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))})),MS(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(bR.childNodes(e),(e=>bR.textContent(e)||"")).join("");t.attributes.value=XS({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:tC(e),value:r,maskInputFn:this.maskInputFn})})),MS(this,"processMutation",(e=>{if(!_R(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=bR.textContent(e.target);PR(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:kC(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,RR(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=tC(t);n=XS({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(PR(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"),!IC(t.tagName,r))if(i.attributes[r]=CC(this.doc,QS(t.tagName),QS(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(PR(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=JS(e.target)?this.mirror.getId(bR.host(e.target)):this.mirror.getId(e.target);PR(e.target,this.blockClass,this.blockSelector,!1)||_R(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(QR(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||MR(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[$R(r,n)]?QR(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!JS(e.target)||!YS(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),bR.childNodes(e).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),MS(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(_R(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[$R(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);PR(e,this.blockClass,this.blockSelector,!1)||(bR.childNodes(e).forEach((e=>this.genAdds(e))),FR(e)&&bR.childNodes(bR.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 QR(e,t){e.delete(t),bR.childNodes(t).forEach((t=>QR(e,t)))}function eP(e,t,r){return 0!==e.size&&function(e,t){const r=bR.parentNode(t);return!!r&&e.has(r)}(e,t)}function tP(e,t){return 0!==e.size&&rP(e,t)}function rP(e,t){const r=bR.parentNode(t);return!!r&&(!!e.has(r)||rP(e,r))}let nP;const iP=e=>{if(!nP)return e;return(...t)=>{try{return e(...t)}catch(e){if(nP&&!0===nP(e))return;throw e}}};function oP(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const sP=[];function aP(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 lP(e,t){const r=new XR;sP.push(r),r.init(e);const n=new(yR())(iP(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function uP({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(WR).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e])).forEach((o=>{let s=QS(o);const u=(t=>o=>{const s=aP(o);if(PR(s,n,i,!0))return;let a=null,u=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=KR.Mouse;break;case"touch":a=KR.Touch;break;case"pen":a=KR.Pen}a===KR.Touch?WR[t]===WR.MouseDown?u="TouchStart":WR[t]===WR.MouseUp&&(u="TouchEnd"):KR.Pen}else NR(o)&&(a=KR.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===KR.Touch||u.startsWith("Mouse")&&a===KR.Mouse)&&(a=null)):WR[t]===WR.Click&&(a=l,l=null);const c=NR(o)?o.changedTouches[0]:o;if(!c)return;const h=r.getId(s),{clientX:d,clientY:p}=c;iP(e)({type:WR[u],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(WR[o]){case WR.MouseDown:case WR.MouseUp:s=s.replace("mouse","pointer");break;case WR.TouchStart:case WR.TouchEnd:return}a.push(wR(s,u,t))})),iP((()=>{a.forEach((e=>e()))}))}function cP({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const s=iP(IR(iP((o=>{const s=aP(o);if(!s||PR(s,n,i,!0))return;const a=r.getId(s);if(s===t&&t.defaultView){const r=OR(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 wR("scroll",s,t)}const hP=["INPUT","TEXTAREA","SELECT"],dP=new WeakMap;function pP(e){return function(e,t){if(vP("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||vP("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||vP("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||vP("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 fP(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function gP({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(bR.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}}),iP((()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function mP(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=lP(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=IR(iP((t=>{const r=Date.now()-s;e(a.map((e=>(e.timeOffset-=r,e))),t),a=[],s=null})),o),u=iP(IR(iP((e=>{const t=aP(e),{clientX:r,clientY:i}=NR(e)?e.changedTouches[0]:e;s||(s=ER()),a.push({x:r,y:i,id:n.getId(t),timeOffset:ER()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?VR.Drag:e instanceof MouseEvent?VR.MouseMove:VR.TouchMove)})),i,{trailing:!1})),c=[wR("mousemove",u,r),wR("touchmove",u,r),wR("drag",u,r)];return iP((()=>{c.forEach((e=>e()))}))}(e),o=uP(e),s=cP(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return wR("resize",iP(IR(iP((()=>{const t=AR(),i=TR();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=aP(e);const u=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=bR.parentElement(r)),!r||!h||hP.indexOf(h)<0||PR(r,n,i,!0))return;if(r.classList.contains(o)||s&&r.matches(s))return;let p=r.value,f=!1;const g=tC(r)||"";"radio"===g||"checkbox"===g?f=r.checked:(a[h.toLowerCase()]||a[g])&&(p=XS({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=dP.get(t);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){dP.set(t,n);const i=r.getId(t);iP(e)({...n,id:i})}}const p=("last"===u.input?["change"]:["input","change"]).map((e=>wR(e,iP(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=>xR(e[0],e[1],{set(){iP(h)({target:this,isTrusted:!1})}},!1,f)))),iP((()=>{p.forEach((e=>e()))}))}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const s=iP((o=>IR(iP((i=>{const s=aP(i);if(!s||PR(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=[wR("play",s(JR.Play),o),wR("pause",s(JR.Pause),o),wR("seeked",s(JR.Seeked),o),wR("volumechange",s(JR.VolumeChange),o),wR("ratechange",s(JR.RateChange),o)];return iP((()=>{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:iP(((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=fP(i,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:a}]}),oP((()=>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:iP(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=fP(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),oP((()=>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:iP(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=fP(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:iP(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=fP(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),n.apply(i,o)}))}));const l={};yP("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(yP("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),yP("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),yP("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:iP(((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=fP(i.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:[...pP(i),a||0]}]}),n.apply(i,o)}))}),i.prototype.deleteRule=new Proxy(u[n].deleteRule,{apply:iP(((n,i,o)=>{const[s]=o,{id:a,styleId:l}=fP(i.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...pP(i),s]}]}),n.apply(i,o)}))})})),iP((()=>{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=gP(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:iP(((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}=fP(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:pP(s.parentRule)}),i.apply(s,a)}))});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:iP(((i,o,a)=>{var l;const[u]=a;if(r.has(u))return s.apply(o,[u]);const{id:c,styleId:h}=fP(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:pP(o.parentRule)}),i.apply(o,a)}))}),iP((()=>{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=kR(t.fonts,"add",(function(t){return function(r){return setTimeout(iP((()=>{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),iP((()=>{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=iP((()=>{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;PR(s,n,i,!0)||PR(u,n,i,!0)||a.push({start:r.getId(s),startOffset:l,end:r.getId(u),endOffset:c})}o({ranges:a})}));return a(),wR("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?kR(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 iP((()=>{sP.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 vP(e){return void 0!==window[e]}function yP(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class bP{constructor(e){MS(this,"iframeIdToRemoteIdMap",new WeakMap),MS(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 wP{constructor(e){MS(this,"iframes",new WeakMap),MS(this,"crossOriginIframeMap",new WeakMap),MS(this,"crossOriginIframeMirror",new bP(pC)),MS(this,"crossOriginIframeStyleMirror"),MS(this,"crossOriginIframeRootIdMap",new WeakMap),MS(this,"mirror"),MS(this,"mutationCb"),MS(this,"wrappedEmit"),MS(this,"loadListener"),MS(this,"stylesheetManager"),MS(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new bP(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 qR.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:qR.IncrementalSnapshot,data:{source:VR.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case qR.Meta:case qR.Load:case qR.DomContentLoaded:return!1;case qR.Plugin:return t;case qR.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case qR.IncrementalSnapshot:switch(t.data.source){case VR.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 VR.Drag:case VR.TouchMove:case VR.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case VR.ViewportResize:return!1;case VR.MediaInteraction:case VR.MouseInteraction:case VR.Scroll:case VR.CanvasMutation:case VR.Input:return this.replaceIds(t.data,e,["id"]),t;case VR.StyleSheetRule:case VR.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case VR.Font:return t;case VR.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case VR.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===YR.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class SP{constructor(e){MS(this,"shadowDoms",new WeakSet),MS(this,"mutationCb"),MS(this,"scrollCb"),MS(this,"bypassOptions"),MS(this,"mirror"),MS(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(!YS(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=lP({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(cP({...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(bR.host(e))),this.restoreHandlers.push(gP({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(kR(e.prototype,"attachShadow",(function(e){return function(n){const i=e.call(this,n),o=bR.shadowRoot(this);return o&&zR(this)&&r.addShadowRoot(o,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var CP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",IP="undefined"==typeof Uint8Array?[]:new Uint8Array(256),xP=0;xP<64;xP++)IP[CP.charCodeAt(xP)]=xP;const kP=new Map;const EP=(e,t,r)=>{if(!e||!TP(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=kP.get(e);return r||(r=new Map,kP.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 OP(e,t,r){if(e instanceof Array)return e.map((e=>OP(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+=CP[r[t]>>2],i+=CP[(3&r[t])<<4|r[t+1]>>4],i+=CP[(15&r[t+1])<<2|r[t+2]>>6],i+=CP[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:[OP(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:[OP(e.data,t,r),e.width,e.height]}}if(TP(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:EP(e,t,r)}}return e}const AP=(e,t,r)=>e.map((e=>OP(e,t,r))),TP=(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 RP(e,t,r,n){const i=[];try{const o=kR(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i,...o){if(!PR(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 PP(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=kR(e,l,(function(e){return function(...s){const a=e.apply(this,s);if(EP(a,o,this),"tagName"in this.canvas&&!PR(this.canvas,n,i,!0)){const e=AP(s,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}}));s.push(a)}catch{const n=xR(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(n)}return s}const _P="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",MP="undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))(_P)],{type:"text/javascript;charset=utf-8"});function NP(e){let t;try{if(t=MP&&(window.URL||window.webkitURL).createObjectURL(MP),!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,"+_P,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class DP{constructor(e){MS(this,"pendingCanvasMutations",new Map),MS(this,"rafStamps",{latestId:0,invokeId:null}),MS(this,"mirror"),MS(this,"mutationCb"),MS(this,"resetObservers"),MS(this,"frozen",!1),MS(this,"locked",!1),MS(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=RP(t,r,n,!0),s=new Map,a=new NP;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:GR["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=>{PR(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=RP(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=kR(t.CanvasRenderingContext2D.prototype,s,(function(i){return function(...o){return PR(this.canvas,r,n,!0)||setTimeout((()=>{const r=AP(o,t,this);e(this.canvas,{type:GR["2D"],property:s,args:r})}),0),i.apply(this,o)}}));i.push(o)}catch{const r=xR(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:GR["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(...PP(t.WebGLRenderingContext.prototype,GR.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...PP(t.WebGL2RenderingContext.prototype,GR.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 LP{constructor(e){MS(this,"trackedLinkElements",new WeakSet),MS(this,"mutationCb"),MS(this,"adoptedStyleSheetCb"),MS(this,"styleMirror",new UR),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:HS(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 FP{constructor(){MS(this,"nodeMap",new WeakMap),MS(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 UP,jP,BP,zP=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(RS=e.contentWindow)?void 0:RS.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const qP=new $S;function VP(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:T=()=>!1,ignoreCSSAttributes:R=new Set([]),errorHandler:P,applyBackgroundColorToBlockedElements:_=!1}=e;nP=P;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),qP.reset();const D=!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},L=!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};UP=(e,i)=>{var o;const s=e;if(s.timestamp=ER(),!(null==(o=sP[0])?void 0:o.isFrozen())||s.type===qR.FullSnapshot||s.type===qR.IncrementalSnapshot&&s.data.source===VR.Mutation||sP.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===qR.FullSnapshot)F=s,U=0;else if(s.type===qR.IncrementalSnapshot){if(s.data.source===VR.Mutation&&s.data.isAttachIframe)return;U++;const e=n&&U>=n,t=r&&s.timestamp-F.timestamp>r;(e||t)&&jP(!0)}};const B=e=>{UP({type:qR.IncrementalSnapshot,data:{source:VR.Mutation,...e}})},z=e=>UP({type:qR.IncrementalSnapshot,data:{source:VR.Scroll,...e}}),q=e=>UP({type:qR.IncrementalSnapshot,data:{source:VR.CanvasMutation,...e}}),V=new LP({mutationCb:B,adoptedStyleSheetCb:e=>UP({type:qR.IncrementalSnapshot,data:{source:VR.AdoptedStyleSheet,...e}})}),W=new wP({mirror:qP,mutationCb:B,stylesheetManager:V,recordCrossOriginIframes:I,wrappedEmit:UP});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:qP,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});const K=new FP;BP=new DP({recordCanvas:C,mutationCb:q,win:window,blockClass:i,blockSelector:o,mirror:qP,sampling:y.canvas,dataURLOptions:b});const G=new SP({mutationCb:B,scrollCb:z,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:b,maskTextFn:g,maskInputFn:f,recordCanvas:C,inlineImages:O,sampling:y,slimDOMOptions:L,iframeManager:W,stylesheetManager:V,canvasManager:BP,keepIframeSrcFn:T,processedNodeManager:K},mirror:qP});jP=(e=!1)=>{if(!S)return;UP({type:qR.Meta,data:{href:window.location.href,width:TR(),height:AR()}},e),V.reset(),G.init(),sP.forEach((e=>e.lock()));const t=function(e,t){const{mirror:r=new $S,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 AC(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:qP,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:f,slimDOM:L,dataURLOptions:b,recordCanvas:C,inlineImages:O,applyBackgroundColorToBlockedElements:_,onSerialize:e=>{DR(e,qP)&&W.addIframe(e),LR(e,qP)&&V.trackLinkElement(e),FR(e)&&G.addShadowRoot(bR.shadowRoot(e),document)},onIframeLoad:(e,t)=>{W.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!t)return console.warn("Failed to snapshot the document");UP({type:qR.FullSnapshot,data:{node:t,initialOffset:OR(window)}},e),sP.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,qP.getId(document))};try{const e=[],t=e=>{var t;return iP(mP)({mutationCb:B,mousemoveCb:(e,t)=>UP({type:qR.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>UP({type:qR.IncrementalSnapshot,data:{source:VR.MouseInteraction,...e}}),scrollCb:z,viewportResizeCb:e=>UP({type:qR.IncrementalSnapshot,data:{source:VR.ViewportResize,...e}}),inputCb:e=>UP({type:qR.IncrementalSnapshot,data:{source:VR.Input,...e}}),mediaInteractionCb:e=>UP({type:qR.IncrementalSnapshot,data:{source:VR.MediaInteraction,...e}}),styleSheetRuleCb:e=>UP({type:qR.IncrementalSnapshot,data:{source:VR.StyleSheetRule,...e}}),styleDeclarationCb:e=>UP({type:qR.IncrementalSnapshot,data:{source:VR.StyleDeclaration,...e}}),canvasMutationCb:q,fontCb:e=>UP({type:qR.IncrementalSnapshot,data:{source:VR.Font,...e}}),selectionCb:e=>{UP({type:qR.IncrementalSnapshot,data:{source:VR.Selection,...e}})},customElementCb:e=>{UP({type:qR.IncrementalSnapshot,data:{source:VR.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:D,inlineStylesheet:c,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:O,userTriggeredOnInput:k,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:T,blockSelector:o,slimDOMOptions:L,dataURLOptions:b,mirror:qP,iframeManager:W,stylesheetManager:V,shadowDomManager:G,processedNodeManager:K,canvasManager:BP,ignoreCSSAttributes:R,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=>UP({type:qR.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};W.addLoadListener((r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}}));const r=()=>{jP(),e.push(t(document)),zP=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(wR("DOMContentLoaded",(()=>{UP({type:qR.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&r()}))),e.push(wR("load",(()=>{UP({type:qR.Load,data:{}}),"load"===x&&r()}),window))),()=>{e.forEach((e=>e())),K.destroy(),zP=!1,nP=void 0}}catch(e){console.warn(e)}}var WP;VP.addCustomEvent=(e,t)=>{if(!zP)throw new Error("please add custom event after start recording");UP({type:qR.Custom,data:{tag:e,payload:t}})},VP.freezePage=()=>{sP.forEach((e=>e.freeze()))},VP.takeFullSnapshot=e=>{if(!zP)throw new Error("please take full snapshot after start recording");jP(e)},VP.mirror=qP,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(WP||(WP={}));var KP=Object.freeze({__proto__:null,record:VP}),GP=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=z();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}(),JP=Object.freeze({__proto__:null,NetworkObservers:GP});e.Types=Ns,e._setDiagnosticsSampleRate=jh,e.add=Vh,e.createInstance=Fh,e.experiment=zh,e.extendSession=Wh,e.flush=Kh,e.getDeviceId=Gh,e.getSessionId=Jh,e.getUserId=Yh,e.groupIdentify=Zh,e.identify=Hh,e.initAll=Bh,e.logEvent=$h,e.remove=Xh,e.reset=Qh,e.revenue=ed,e.sessionReplay=qh,e.setDeviceId=td,e.setGroup=rd,e.setOptOut=nd,e.setSessionId=id,e.setTransport=od,e.setUserId=sd,e.track=ad,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"==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 d,p="AMP",f="".concat(p,"_unsent"),g="$default_instance",m="https://api2.amplitude.com/2/httpapi",v="dclid",y="fbclid",b="gbraid",w="gclid",S="ko_click_id",C="li_fat_id",I="msclkid",x="rdt_cid",k="ttclid",E="twclid",O="wbraid",A={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,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},P=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],T=["authorization","cookie","set-cookie"],R=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var r=e[t];if(!M(t,r))return!1}return!0},M=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&&R(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 R(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},N=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(d.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(d.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(d.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(d.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(d.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(d.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(d.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(d.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(d.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[d.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[d.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===d.ADD?"number"==typeof r:e===d.UNSET||e===d.REMOVE||M(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"}(d||(d={}));var _,D=[d.CLEAR_ALL,d.UNSET,d.SET,d.SET_ONCE,d.ADD,d.APPEND,d.PREPEND,d.PREINSERT,d.POSTINSERT,d.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"}(_||(_={}));var L,F=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=_.Unknown),{event:e,code:t,message:r}},U=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},j=h([],c(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),B=function(e){var t,r=U();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,B)}(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(j[n]):j[n]}).join("")},z=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})?(this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2]):(void 0===e.name&&(e.name=B(),this.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],this.loggerProvider.log("Timeline.apply: Initial event",r),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 this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(m.name),"', event: ").concat(JSON.stringify(r))),i({event:r,code:0,message:""}),[2];r=v,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(m.name),"', event: ").concat(JSON.stringify(r))),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 this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(m.name),"', event: ").concat(JSON.stringify(r))),i({event:r,code:0,message:""}),[2];r=v,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(m.name),"', event: ").concat(JSON.stringify(r))),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}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(r))),w=b.map(function(e){var t=o({},r);return e.execute(t).catch(function(e){return F(t,0,String(e))})}),Promise.all(w).then(function(e){var t=c(e,1)[0]||F(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.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null===(t=e.onReset)||void 0===t||t.call(e)})},e}(),V=function(e,t){return o(o({},t),{event_type:i.IDENTIFY,user_properties:e.getUserProperties()})},q=function(e){return{promise:e||Promise.resolve()}},W=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 z(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),this.timeline.loggerProvider=this.config.loggerProvider,[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 q(this.dispatch(n))},e.prototype.identify=function(e,t){var r=V(e,t);return q(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 q(this.dispatch(s))},e.prototype.setGroup=function(e,t,r){var n=function(e,t,r){var n,s=new N;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 q(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 q(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),q())},e.prototype._addPlugin=function(e){return q(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)),q())},e.prototype._removePlugin=function(e){return q(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(F(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])}),D.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,F(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=F(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 q(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}(),K=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 R(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?o({},this.properties):{};return e[L.REVENUE_PRODUCT_ID]=this.productId,e[L.REVENUE_QUANTITY]=this.quantity,e[L.REVENUE_PRICE]=this.price,e[L.REVENUE_TYPE]=this.revenueType,e[L.REVENUE_CURRENCY]=this.currency,e[L.REVENUE]=this.revenue,e[L.RECEIPT]=this.receipt,e[L.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"}(L||(L={}));var G;!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"}(G||(G={}));var J="Amplitude Logger ",Y=function(){function e(){this.logLevel=G.None}return e.prototype.disable=function(){this.logLevel=G.None},e.prototype.enable=function(e){void 0===e&&(e=G.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<G.Verbose||console.log("".concat(J,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<G.Warn||console.warn("".concat(J,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<G.Error||console.error("".concat(J,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<G.Debug||console.log("".concat(J,"[Debug]: ").concat(e.join(" ")))},e}(),Z=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:g,logLevel:G.Warn,loggerProvider:new Y,offline:!1,optOut:!1,serverUrl:m,serverZone:"US",useBatch:!1}},H=function(){function e(e){var t,r,n,i;this._optOut=!1;var o=Z();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=X(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}(),$=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":m},X=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=Z().serverZone),void 0===r&&(r=Z().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:Z().serverZone;return{serverZone:n,serverUrl:$(n,r)}},Q=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function ee(e){return e>=200&&e<300}var te=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map(function(e){return e.trim()})},re=function(e){return function(){var t=o({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},ne=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},ie=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]=ne(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}},oe=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<G.Debug||!u||!l)return e.apply(i,o);var c={type:"invoke public method",name:t,args:o,stacktrace:te(1),time:{start:(new Date).toISOString()},states:{}};n&&c.states&&(c.states.before=n());var h=e.apply(i,o);return h&&h.promise?h.promise.then(function(){n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))}):(n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))),h}};function se(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var ae=function(){function e(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=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}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(f,"_").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=B()),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){var r;return void 0===t&&(t=!0),a(this,void 0,void 0,function(){var n,i,o,a,u;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")];n={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 Q,l.label=1;case 1:return l.trys.push([1,3,,4]),i=X(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,n)];case 2:return null===(o=l.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleResponse(o,e),[3,4]):("body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(se(o))):this.fulfillRequest(e,o.statusCode,o.status),[2]);case 3:return a=l.sent(),u=(c=a)instanceof Error?c.message:String(c),this.config.loggerProvider.error(u),null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:u,stack_trace:te()}),this.handleResponse({status:_.Failed,statusCode:0},e),[3,4];case 4:return[2]}var c})})},e.prototype.handleResponse=function(e,t){var r;ee(e.statusCode)||null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:se(e),stack_trace:te()});var n=e.status;switch(n){case _.Success:this.handleSuccessResponse(e,t);break;case _.Invalid:this.handleInvalidResponse(e,t);break;case _.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case _.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(n,"' 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(se(e));var s=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(s)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(se(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(se(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){var n,i,o;ee(t)?null===(o=this.diagnosticsClient)||void 0===o||o.increment("analytics.events.sent",e.length):(null===(n=this.diagnosticsClient)||void 0===n||n.increment("analytics.events.dropped",e.length),null===(i=this.diagnosticsClient)||void 0===i||i.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:t,message:r,stack_trace:te()})),this.removeEvents(e),e.forEach(function(e){return e.callback(F(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}(),le=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:ue(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),ue=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},ce=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}(),he=function(){return he=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},he.apply(this,arguments)};function de(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 pe(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 fe=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=de(["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(!fe(u,c))return!1;var h=!0;return Object.keys(e).forEach(function(r){fe(e[r],t[r])||(h=!1)}),h}for(var d=0;d<e.length;d++)if(!fe(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 ge,me=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=he({},this.identity.userProperties),r=he(he({},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=de(Object.entries(e)),c=u.next();!c.done;c=u.next()){var h=pe(c.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(i=void 0,de(Object.entries(p))),g=f.next();!g.done;g=f.next()){var m=pe(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,de(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 he({},this.identity)},e.prototype.setIdentity=function(e){var t=he({},this.identity);this.identity=he({},e),fe(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}(),ve="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,ye=function(){function e(){this.identityStore=new me,this.eventBridge=new ce,this.applicationContextProvider=new le}return e.getInstance=function(t){return ve.analyticsConnectorInstances||(ve.analyticsConnectorInstances={}),ve.analyticsConnectorInstances[t]||(ve.analyticsConnectorInstances[t]=new e),ve.analyticsConnectorInstances[t]},e}(),be=function(e){return void 0===e&&(e=g),ye.getInstance(e)},we=function(){function e(){this.name="identity",this.type="before",this.identityStore=be().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=be(e.instanceName).identityStore),[2]})})},e}(),Se=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},Ce=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[p,t,e.substring(0,r)].filter(Boolean).join("_")},Ie=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:""},xe=function(){var e,t=U();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=ke(r[0]),i=ke(r[1]);return i?(e[n]=i,e):e},{}):{}},ke=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},Ee=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},Oe=function(e,t){var r=e;try{r=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return r},Ae=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},Pe=function(e,t){var r=Ae(e.toString());return 31*Math.abs(r)%1e5/1e5<t},Te=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}(),Re=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(!U())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=Me(r))&&void 0!==t?t:Ne(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=U(),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+"=")}),o?[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=U())&&(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}(),Me=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},Ne=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},_e=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[p,t,e.substring(0,r)].filter(Boolean).join("_")},De=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}(),Le="tags",Fe="counters",Ue="histograms",je="events",Be="internal",ze="last_flush_timestamp",Ve=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return void 0!==(null===(e=U())||void 0===e?void 0:e.indexedDB)},e.prototype.getDB=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var e=this;return new Promise(function(t,r){var n=indexedDB.open(e.dbName,1);n.onerror=function(){e.dbPromise=null,r(new Error("Failed to open IndexedDB"))},n.onsuccess=function(){var r=n.result;r.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},r.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),r.close()},t(r)},n.onupgradeneeded=function(t){var r=t.target.result;e.createTables(r)}})},e.prototype.createTables=function(e){(e.objectStoreNames.contains(Le)||e.createObjectStore(Le,{keyPath:"key"}),e.objectStoreNames.contains(Fe)||e.createObjectStore(Fe,{keyPath:"key"}),e.objectStoreNames.contains(Ue)||e.createObjectStore(Ue,{keyPath:"key"}),e.objectStoreNames.contains(je))||e.createObjectStore(je,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1});e.objectStoreNames.contains(Be)||e.createObjectStore(Be,{keyPath:"key"})},e.prototype.setTags=function(e){return a(this,void 0,void 0,function(){var t,r,n,i,o=this;return l(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([Le],"readwrite"),n=r.objectStore(Le),[2,new Promise(function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tags",e),t()},i.forEach(function(e){var t=c(e,2),r=t[0],i=t[1];n.put({key:r,value:i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tag",r,i,e)}})})];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",i),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return a(this,void 0,void 0,function(){var t,r,n,i,o=this;return l(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([Fe],"readwrite"),n=r.objectStore(Fe),[2,new Promise(function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to increment counters",e),t()},i.forEach(function(e){var t=c(e,2),r=t[0],i=t[1],s=n.get(r);s.onsuccess=function(){var e=s.result,t=e?e.value:0;n.put({key:r,value:t+i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to update counter",r,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing counter",r,e)}})})];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",i),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return a(this,void 0,void 0,function(){var t,r,n,i,o=this;return l(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([Ue],"readwrite"),n=r.objectStore(Ue),[2,new Promise(function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),t()},i.forEach(function(e){var t=c(e,2),r=t[0],i=t[1],s=n.get(r);s.onsuccess=function(){var e,t=s.result;e=t?{key:r,count:t.count+i.count,min:Math.min(t.min,i.min),max:Math.max(t.max,i.max),sum:t.sum+i.sum}:{key:r,count:i.count,min:i.min,max:i.max,sum:i.sum},n.put(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",r,e)}})})];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",i),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return a(this,void 0,void 0,function(){var t,r,n,i,o=this;return l(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===e.length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([je],"readwrite"),n=r.objectStore(je),[2,new Promise(function(t){r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event records",e),t()};var i=n.count();i.onsuccess=function(){var t=i.result,r=Math.max(0,10-t);r<e.length&&o.logger.debug("DiagnosticsStorage: Only added ".concat(r," of ").concat(e.length," events due to storage limit")),e.slice(0,r).forEach(function(e){n.add(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},i.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",i),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return a(this,void 0,void 0,function(){var r,n,i,o;return l(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([Be],"readwrite"),i=n.objectStore(Be),[2,new Promise(function(r,o){n.onabort=function(){return o(new Error("Failed to set internal value"))};var s=i.put({key:e,value:t});s.onsuccess=function(){return r()},s.onerror=function(){return o(new Error("Failed to set internal value"))}})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",o),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(e){return a(this,void 0,void 0,function(){var t,r,n,i;return l(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([Be],"readonly"),n=r.objectStore(Be),[2,new Promise(function(t,i){r.onabort=function(){return i(new Error("Failed to get internal value"))};var o=n.get(e);o.onsuccess=function(){return t(o.result)},o.onerror=function(){return i(new Error("Failed to get internal value"))}})];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",i),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return a(this,void 0,void 0,function(){var e,t;return l(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getInternal(ze)];case 1:return[2,(e=r.sent())?parseInt(e.value,10):void 0];case 2:return t=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=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.setInternal(ze,e.toString())];case 1:return r.sent(),[3,3];case 2:return t=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(e,t){return new Promise(function(r,n){var i=e.objectStore(t).clear();i.onsuccess=function(){return r()},i.onerror=function(){return n(new Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return a(this,void 0,void 0,function(){var e,t,r,n,i,o,s,a;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=l.sent(),t=e.transaction([Le,Fe,Ue,je],"readwrite"),[4,Promise.all([this.getAllFromStore(t,Le),this.getAllFromStore(t,Fe),this.getAllFromStore(t,Ue),this.getAllFromStore(t,je)])];case 2:return r=c.apply(void 0,[l.sent(),4]),n=r[0],i=r[1],o=r[2],s=r[3],[4,Promise.all([this.clearTable(t,Fe),this.clearTable(t,Ue),this.clearTable(t,je)])];case 3:return l.sent(),[2,{tags:n,counters:i,histogramStats:o,events:s}];case 4:return a=l.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",a),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(e,t){return new Promise(function(r,n){var i=e.objectStore(t).getAll();i.onsuccess=function(){return r(i.result)},i.onerror=function(){return n(new Error("Failed to get all from ".concat(t)))}})},e}(),qe=3e5,We=1e4,Ke=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===r?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(n,null,2)),this.config=o({enabled:!0,sampleRate:0},n),this.startTimestamp=Date.now(),this.shouldTrack=Pe(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Ve.isSupported()?this.storage=new Ve(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&this.increment("sdk.diagnostics.sampled.in.and.enabled")}return e.prototype.isStorageAndTrackEnabled=function(){return Boolean(this.storage)&&Boolean(this.shouldTrack)},e.prototype.setTag=function(e,t){this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryTags).length>=We?this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit"):(this.inMemoryTags[e]=t,this.startTimersIfNeeded()))},e.prototype.increment=function(e,t){void 0===t&&(t=1),this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryCounters).length>=We?this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit"):(this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()))},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled())if(Object.keys(this.inMemoryHistograms).length>=We)this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");else{var r=this.inMemoryHistograms[e];r?(r.count+=1,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){this.isStorageAndTrackEnabled()&&(this.inMemoryEvents.length>=10?this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit"):(this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()))},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)}).finally(function(){e.saveTimer=null})},1e3)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)}).finally(function(){e.flushTimer=null})},qe))},e.prototype.saveAllDataToStorage=function(){return a(this,void 0,void 0,function(){var e,t,r,n;return l(this,function(i){switch(i.label){case 0:return this.storage?(e=o({},this.inMemoryTags),t=o({},this.inMemoryCounters),r=o({},this.inMemoryHistograms),n=h([],c(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(r),this.storage.addEventRecords(n)])]):[2];case 1:return i.sent(),[2]}})})},e.prototype._flush=function(){return a(this,void 0,void 0,function(){var e,t,r,n,i,o,s,a,u,c;return l(this,function(l){switch(l.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return l.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return e=l.sent(),t=e.tags,r=e.counters,n=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach(function(e){o[e.key]=e.value}),s={},r.forEach(function(e){s[e.key]=e.value}),a={},n.forEach(function(e){a[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),u=i.map(function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}}),0===Object.keys(s).length&&0===Object.keys(a).length&&0===u.length?[2]:(c={tags:o,histogram:a,counters:s,events:u},this.fetch(c),[2])}})})},e.prototype.fetch=function(e){return a(this,void 0,void 0,function(){var t;return l(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!U())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:return r.sent().ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return t=r.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return a(this,void 0,void 0,function(){var e,t,r;return l(this,function(n){switch(n.label){case 0:return this.storage?(e=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return-1===(t=n.sent()||-1)?(this.storage.setLastFlushTimestamp(e),this._setFlushTimer(qe),[2]):(r=e-t)>=qe?(this._flush(),[2]):(this._setFlushTimer(qe-r),[2])}})})},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout(function(){t._flush().catch(function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)}).finally(function(){t.flushTimer=null})},e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=Pe(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),Ge=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 _.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 _.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 _.PayloadTooLarge:return{status:x,statusCode:I,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case _.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 _.Timeout:default:return{status:x,statusCode:I}}},e.prototype.buildStatus=function(e){return ee(e)?_.Success:429===e?_.RateLimit:413===e?_.PayloadTooLarge:408===e?_.Timeout:e>=400&&e<500?_.Invalid:e>=500?_.Failed:_.Unknown},e}(),Je=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}(Ge),Ye=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),Ze=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new Ye(e,t)}return e.prototype.subscribe=function(e,t,r){var n=B(),i={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),n},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return a(this,void 0,void 0,function(){var e,t=this;return l(this,function(r){switch(r.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise||(this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null})),this.fetchPromise},e.prototype.subscribeAll=function(e){return a(this,void 0,void 0,function(){var t,r,n,i=this;return l(this,function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return a(this,void 0,void 0,function(){var r,n;return l(this,function(i){switch(i.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(n=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),a(this,void 0,void 0,function(){var r,n,i,o,s,a,u=this;return l(this,function(c){switch(c.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},i=function(n){var i,s,a,c,h;return l(this,function(l){switch(l.label){case 0:i=new AbortController,s=setTimeout(function(){return i.abort()},t),l.label=1;case 1:return l.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:return(a=l.sent()).ok?[3,4]:[4,a.text()];case 3:return c=l.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(a.status,": ").concat(c)),[3,6];case 4:return[4,a.json()];case 5:return[2,{value:{remoteConfig:l.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(h=l.sent())instanceof Error&&"AbortError"===h.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),h),[3,9];case 8:return clearTimeout(s),[7];case 9:return n<e-1?[4,new Promise(function(e){return setTimeout(e,u.getJitterDelay(r))})]:[3,11];case 10:l.sent(),l.label=11;case 11:return[2]}})},o=this,s=0,c.label=1;case 1:return s<e?[5,i(s)]:[3,4];case 2:if("object"==typeof(a=c.sent()))return[2,a.value];c.label=3;case 3:return s++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}();!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(ge||(ge={}));var He=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],$e="data-amp-track-",Xe=["div","span","h1","h2","h3","h4","h5","h6"],Qe=h(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],c(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),et=["*"];function tt(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function rt(e,t,r){e&&nt({json:e,allowlist:t.map(it),excludelist:r.map(it),ancestors:[]})}function nt(e){var t,r,n=e.json,i=e.targetObject,o=e.allowlist,s=e.excludelist,a=e.ancestors,l=e.parentObject,d=e.targetKey;i||(i=n);var p=Object.keys(i);try{for(var f=u(p),g=f.next();!g.done;g=f.next()){var m=g.value,v=h(h([],c(a),!1),[m],!1);tt(i[m])?st(v,o)&&!st(v,s)||delete i[m]:nt({json:n,targetObject:i[m],allowlist:o,excludelist:s,ancestors:v,parentObject:i,targetKey:m})}}catch(e){t={error:e}}finally{try{g&&!g.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}0===Object.keys(i).length&&l&&d&&delete l[d]}function it(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function ot(e,t,r,n){if(void 0===r&&(r=0),void 0===n&&(n=0),n===t.length)return r===e.length;if(r===e.length){for(;n<t.length&&"**"===t[n];)n++;return n===t.length}var i=t[n];if("**"===i){if(n+1===t.length)return!0;for(var o=r;o<=e.length;o++)if(ot(e,t,o,n+1))return!0;return!1}return("*"===i||i===e[r])&&ot(e,t,r+1,n+1)}function st(e,t){return t.some(function(t){return ot(e,t)})}var at=function(){function e(e){this.request=e}return e.prototype.headers=function(e){var t,r;void 0===e&&(e=[]);var n=this.request.headers,i={};if(Array.isArray(n))n.forEach(function(e){var t=c(e,2),r=t[0],n=t[1];i[r]=n});else if(n instanceof Headers)n.forEach(function(e,t){i[t]=e});else if("object"==typeof n&&null!==n)try{for(var o=u(Object.entries(n)),s=o.next();!s.done;s=o.next()){var a=c(s.value,2),l=a[0],h=a[1];i[l]=h}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return gt(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=U();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=ut(t,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),a(this,void 0,void 0,function(){return l(this,function(r){return 0===e.length?[2,null]:[2,pt(this.body,e,t)]})})},e}(),lt=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),gt(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return ut(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),a(this,void 0,void 0,function(){return l(this,function(r){return 0===e.length?[2,null]:[2,pt(this.body,e,t)]})})},e}();function ut(e,t){var r,n,i,o=U(),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 ct,ht=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var r=this.response.headers,n={};return null===(t=null==r?void 0:r.forEach)||void 0===t||t.call(r,function(e,t){n[t]=e}),gt(n,{allow:e})}},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.prototype.text=function(){return a(this,void 0,void 0,function(){var e,t;return l(this,function(r){switch(r.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),r.label=1;case 1:return r.trys.push([1,3,,4]),e=this.clonedResponse.text(),t=new Promise(function(e){return setTimeout(function(){return e(null)},500)}),[4,Promise.race([e,t])];case 2:return[2,r.sent()];case 3:return r.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),a(this,void 0,void 0,function(){return l(this,function(r){switch(r.label){case 0:return 0===e.length?[2,null]:[4,this.text()];case 1:return[2,pt(r.sent(),e,t)]}})})},e}(),dt=function(){function e(e,t,r,n){this.statusCode=e,this.headersString=t,this.size=r,this.getJson=n}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}),e.prototype.headers=function(e){var t,r;if(void 0===e&&(e=[]),!this.headersString)return{};var n={},i=this.headersString.split("\r\n");try{for(var o=u(i),s=o.next();!s.done;s=o.next()){var a=c(s.value.split(": "),2),l=a[0],h=a[1];l&&h&&(n[l]=h)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return gt(n,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),a(this,void 0,void 0,function(){var r;return l(this,function(n){return 0===e.length?[2,null]:(r=this.getJson())?(rt(r,e,t),[2,r]):[2,null]})})},e}();function pt(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return rt(n,t,r),n}catch(e){return null}}!function(e){e.REDACT="redact",e.REMOVE="remove"}(ct||(ct={}));var ft="[REDACTED]",gt=function(e,t){var r,n,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?ct.REMOVE:s,l=h([],c(T),!1),d={},p=function(t){var r=t.toLowerCase();l.find(function(e){return e.toLowerCase()===r})?a===ct.REDACT&&(d[t]=ft):o.find(function(e){return e.toLowerCase()===r})?d[t]=e[t]:a===ct.REDACT&&(d[t]=ft)};try{for(var f=u(Object.keys(e)),g=f.next();!g.done;g=f.next()){p(g.value)}}catch(e){r={error:e}}finally{try{g&&!g.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}return d},mt=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(h([],c(P),!1)),requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(r=this.responseWrapper)||void 0===r?void 0:r.headers(h([],c(P),!1)),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 vt=function(e,t){void 0===t&&(t=B()),this.callback=e,this.id=t},yt=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=U();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=U();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var r,n,i,o,s,a,l,u,c,h;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var d=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,p=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,f=null===(c=null===(u=null===(l=this.globalScope)||void 0===l?void 0:l.XMLHttpRequest)||void 0===u?void 0:u.prototype)||void 0===c?void 0:c.setRequestHeader;d&&p&&f&&this.observeXhr(d,p,f);var g=null===(h=this.globalScope)||void 0===h?void 0:h.fetch;g&&this.observeFetch(g),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";if(!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),l)try{var d=new URL(l);l="".concat(d.protocol,"//").concat(d.host).concat(d.pathname).concat(d.search).concat(d.hash)}catch(e){}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 p=Math.floor(performance.now()-s),f=Math.floor(o+p),g=new mt(e,h,o,o,l,r,u,p,n,c,f);this.triggerEventCallbacks(g)}},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 at(n):void 0,i?new ht(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.createXhrJsonParser=function(e,t){return function(){var r,n;try{if("json"===e.responseType){if(null===(r=t.globalScope)||void 0===r?void 0:r.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(r){return r instanceof Error&&"InvalidStateError"===r.name&&(null===(n=t.logger)||void 0===n||n.error("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))),null}return null}},e.prototype.observeXhr=function(t,r,n){if(this.globalScope&&t&&r){var i=this.globalScope.XMLHttpRequest.prototype,s=this;i.open=function(){for(var e,r,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=c(n,2),l=a[0],u=a[1];try{this.$$AmplitudeAnalyticsEvent=o({method:l,url:null===(e=null==u?void 0:u.toString)||void 0===e?void 0:e.call(u),headers:{}},s.getTimestamps())}catch(e){null===(r=s.logger)||void 0===r||r.error("an unexpected error occurred while calling xhr open",e)}return t.apply(this,n)},i.send=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=this,o=e.createXhrJsonParser(this,s),a=t[0],l=i.$$AmplitudeAnalyticsEvent;return i.addEventListener("loadend",function(){var e;try{var t=i.getAllResponseHeaders(),r=i.getResponseHeader("content-length"),n=new dt(i.status,t,r?parseInt(r,10):void 0,o),u=i.$$AmplitudeAnalyticsEvent.headers,c=new lt(a,u);l.status=i.status,s.handleNetworkRequestEvent("xhr",{url:l.url,method:l.method},c,n,void 0,l.startTime,l.durationStart)}catch(t){null===(e=s.logger)||void 0===e||e.error("an unexpected error occurred while handling xhr send",t)}}),r.apply(i,t)},i.setRequestHeader=function(e,t){var r;try{this.$$AmplitudeAnalyticsEvent.headers[e]=t}catch(e){null===(r=s.logger)||void 0===r||r.error("an unexpected error occurred while calling xhr setRequestHeader",e)}n.apply(this,[e,t])}}},e}(),bt=new yt,wt=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({},A),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=xe();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=xe();return(e={})[v]=t[v],e[y]=t[y],e[b]=t[b],e[w]=t[w],e[S]=t[S],e[C]=t[C],e[I]=t[I],e[x]=t[x],e[k]=t[k],e[E]=t[E],e[O]=t[O],e},e}(),St="data-amp-mask",Ct="*****",It=/\b(?:\d[ -]*?){13,16}\b/,xt=/(\d{3}-?\d{2}-?\d{4})/g,kt=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Et=function(e,t){var r,n;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var i=e;i=(i=(i=i.replace(It,Ct)).replace(xt,Ct)).replace(kt,Ct);try{for(var o=u(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,Ct)}catch(e){}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},Ot=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(St)?Ct:e?e(document.title):document.title};function At(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Pt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pt(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Tt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Rt(e,t,r){return t&&Tt(e.prototype,t),r&&Tt(e,r),e}var Mt=function(){return"function"==typeof Symbol},Nt=function(e){return Mt()&&Boolean(Symbol[e])},_t=function(e){return Nt(e)?Symbol[e]:"@@"+e};Mt()&&!Nt("observable")&&(Symbol.observable=Symbol("observable"));var Dt=_t("iterator"),Lt=_t("observable"),Ft=_t("species");function Ut(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function jt(e){var t=e.constructor;return void 0!==t&&null===(t=t[Ft])&&(t=void 0),void 0!==t?t:Zt}function Bt(e){return e instanceof Zt}function zt(e){zt.log?zt.log(e):setTimeout(function(){throw e})}function Vt(e){Promise.resolve().then(function(){try{e()}catch(e){zt(e)}})}function qt(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=Ut(t,"unsubscribe");r&&r.call(t)}}catch(e){zt(e)}}function Wt(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Kt(e,t,r){e._state="running";var n=e._observer;try{var i=Ut(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(Wt(e),!i)throw r;i.call(n,r);break;case"complete":Wt(e),i&&i.call(n)}}catch(e){zt(e)}"closed"===e._state?qt(e):"running"===e._state&&(e._state="ready")}function Gt(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void Vt(function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(Kt(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)})):void Kt(e,t,r);e._queue.push({type:t,value:r})}}var Jt=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var r=new Yt(this);try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(Wt(this),qt(this))},Rt(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),Yt=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){Gt(this._subscription,"next",e)},t.error=function(e){Gt(this._subscription,"error",e)},t.complete=function(){Gt(this._subscription,"complete")},Rt(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),Zt=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new Jt(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise(function(r,n){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){n(e),i.unsubscribe()}},error:n,complete:r});else n(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),r()}})},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(jt(this))(function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})})},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(jt(this))(function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})})},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=jt(this),n=arguments.length>1,i=!1,o=arguments[1];return new r(function(r){return t.subscribe({next:function(t){var s=!i;if(i=!0,!s||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})})},t.concat=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=jt(this);return new i(function(t){var n,o=0;return function e(s){n=s.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===r.length?(n=void 0,t.complete()):e(i.from(r[o++]))}})}(e),function(){n&&(n.unsubscribe(),n=void 0)}})},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=jt(this);return new r(function(n){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var o=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),s()}});i.push(o)},error:function(e){n.error(e)},complete:function(){s()}});function s(){o.closed&&0===i.length&&n.complete()}return function(){i.forEach(function(e){return e.unsubscribe()}),o.unsubscribe()}})},t[Lt]=function(){return this},e.from=function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=Ut(t,Lt);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return Bt(i)&&i.constructor===r?i:new r(function(e){return i.subscribe(e)})}if(Nt("iterator")&&(n=Ut(t,Dt)))return new r(function(e){Vt(function(){if(!e.closed){for(var r,i=At(n.call(t));!(r=i()).done;){var o=r.value;if(e.next(o),e.closed)return}e.complete()}})});if(Array.isArray(t))return new r(function(e){Vt(function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}})});throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return new("function"==typeof this?this:e)(function(e){Vt(function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}})})},Rt(e,null,[{key:Ft,get:function(){return this}}]),e}();function Ht(e,t){return new Zt(function(r){e.subscribe({next:function(e){t(e).then(function(e){return r.next(e)}).catch(function(e){return r.error(e)})},error:function(e){r.error(e)},complete:function(){r.complete()}})})}function $t(e,t){return new Zt(function(r){var n=!1,i=new Set,o=function(){var e,t;n=!0;try{for(var r=u(i),o=r.next();!o.done;o=r.next()){var s=o.value;try{s.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.clear()},s=function(e){var t=e.subscribe({next:function(e){n||r.next(e)},error:function(e){n||(n=!0,r.error(e),o())},complete:function(){i.delete(t),n||0!==i.size||(r.complete(),o(),n=!0)}});i.add(t)};return s(e),s(t),o})}function Xt(e){var t=new Set,r=null;function n(){null==r||r.unsubscribe(),r=null,t.clear()}return new Zt(function(i){return t.add(i),null===r&&(r=e.subscribe({next:function(e){var r,n,i;try{for(var o=u(t),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=a.next)||void 0===i||i.call(a,e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},error:function(e){var r,i,o;try{for(var s=u(t),a=s.next();!a.done;a=s.next()){var l=a.value;null===(o=l.error)||void 0===o||o.call(l,e)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}n()},complete:function(){var e,r,i;try{for(var o=u(t),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=a.complete)||void 0===i||i.call(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}n()}})),function(){t.delete(i),0===t.size&&r&&(r.unsubscribe(),r=null)}})}Mt()&&Object.defineProperty(Zt,Symbol("extensions"),{value:{symbol:Lt,hostReportError:zt},configurable:!0});var Qt=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},er=function(e){return Qt(e,"attribution")},tr=function(e){return Qt(e,"pageViews")},rr=function(e){return Qt(e,"sessions")},nr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},ir=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},or=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},sr=function(e){if(ir(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},ar=function(e){if(or(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},lr=function(e){var t;if(nr(e.autocapture)){var r=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?r=e.autocapture.networkTracking:e.networkTrackingOptions&&(r=e.networkTrackingOptions),o(o({},r),{captureRules:null===(t=null==r?void 0:r.captureRules)||void 0===t?void 0:t.map(function(t){var r,n,i;if((null===(r=t.urls)||void 0===r?void 0:r.length)&&(null===(n=t.hosts)||void 0===n?void 0:n.length)){var s=JSON.stringify(t.hosts),a=JSON.stringify(t.urls);return null===(i=e.loggerProvider)||void 0===i||i.warn("Found network capture rule with both urls='".concat(a,"' and hosts='").concat(s,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),o(o({},t),{hosts:void 0})}return t})})}},ur=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return tr(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}},cr=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},hr=function(e){return e&&void 0!==e._q},dr="2.31.4-feat-zoning.0",pr="amplitude-ts",fr=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(pr,"/").concat(dr),"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:Ie()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:B(),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}(),gr=1e3,mr=function(e){function t(t){var r,n,i,o=this;try{i=null===(r=U())||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>gr?(i=r.length-gr,[4,e.prototype.set.call(this,t,r.slice(0,gr))]):[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(gr,".")),[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}(De),vr=function(e){function t(){var t;return e.call(this,null===(t=U())||void 0===t?void 0:t.sessionStorage)||this}return r(t,e),t}(De),yr=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}(Ge),br=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=U();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}(Ge),wr=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,f;return l(this,function(l){switch(l.label){case 0:return n=function(e){return"".concat(p.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],f=o[5],[2,{deviceId:s,userId:Cr(a),sessionId:Sr(h),lastEventId:Sr(f),lastEventTime:Sr(d),optOut:Boolean(u)}]}})})},Sr=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Cr=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},Ir="[Amplitude]",xr="".concat(Ir," Form Started"),kr="".concat(Ir," Form Submitted"),Er="".concat(Ir," File Downloaded"),Or="session_start",Ar="session_end",Pr="".concat(Ir," File Extension"),Tr="".concat(Ir," File Name"),Rr="".concat(Ir," Link ID"),Mr="".concat(Ir," Link Text"),Nr="".concat(Ir," Link URL"),_r="".concat(Ir," Form ID"),Dr="".concat(Ir," Form Name"),Lr="".concat(Ir," Form Destination"),Fr="cookie",Ur=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,P,T,R,M,N,_,D,L,F,U,j,B){void 0===n&&(n=new Te),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=Fr),void 0===m&&(m=new Y),void 0===v&&(v=G.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 mr({loggerProvider:m})),void 0===A&&(A={ipAddress:!0,language:!0,platform:!0}),void 0===P&&(P="fetch"),void 0===T&&(T=!1),void 0===R&&(R=!0),void 0===F&&(F=!0),void 0===U&&(U=0);var z=e.call(this,{apiKey:t,storageProvider:O,transportProvider:zr(P)})||this;return z.apiKey=t,z.appVersion=r,z.cookieOptions=i,z.defaultTracking=o,z.autocapture=s,z.flushIntervalMillis=l,z.flushMaxRetries=u,z.flushQueueSize=c,z.identityStorage=h,z.ingestionMetadata=d,z.instanceName=p,z.loggerProvider=m,z.logLevel=v,z.minIdLength=y,z.offline=b,z.partnerId=S,z.plan=C,z.serverUrl=I,z.serverZone=x,z.sessionTimeout=E,z.storageProvider=O,z.trackingOptions=A,z.transport=P,z.useBatch=T,z.fetchRemoteConfig=R,z.networkTrackingOptions=D,z.identify=L,z.enableDiagnostics=F,z.diagnosticsSampleRate=U,z.diagnosticsClient=j,z.remoteConfig=B,z.version=dr,z._optOut=!1,z._cookieStorage=n,z.deviceId=a,z.lastEventId=f,z.lastEventTime=g,z.optOut=w,z.sessionId=k,z.pageCounter=N,z.userId=M,z.debugLogsEnabled=_,z.loggerProvider.enable(_?G.Debug:z.logLevel),z.networkTrackingOptions=D,z.identify=L,z.enableDiagnostics=F,z.diagnosticsSampleRate=U,z.diagnosticsClient=j,R&&(z.remoteConfig||(z.remoteConfig={fetchRemoteConfig:R}),z.remoteConfig.fetchRemoteConfig||(z.remoteConfig.fetchRemoteConfig=R)),z}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(Ce(this.apiKey),e)},t}(H),jr=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,A,P,T,R,M,N,_,D,L,F,U,j,z,V,q,W,K,G,J,Y,Z,H;return l(this,function(l){switch(l.label){case 0:return n=t.identityStorage||Fr,k={},n===Fr?[3,1]:(s="",[3,5]);case 1:return null===(O=null===(E=t.cookieOptions)||void 0===E?void 0:E.domain)||void 0===O?[3,2]:(a=O,[3,4]);case 2:return[4,Vr()];case 3:a=l.sent(),l.label=4;case 4:s=a,l.label=5;case 5:return i=o.apply(void 0,[(k.domain=s,k.expiration=365,k.sameSite="Lax",k.secure=!1,k.upgrade=!0,k),t.cookieOptions]),u=Br(t.identityStorage,i),[4,wr(e,u,null===(P=null===(A=t.cookieOptions)||void 0===A?void 0:A.upgrade)||void 0===P||P)];case 6:return c=l.sent(),[4,u.get(Ce(e))];case 7:return h=l.sent(),d=xe(),p=d.ampTimestamp?Number(d.ampTimestamp):void 0,f=!p||Date.now()<p,g=null!==(_=null!==(N=null!==(M=null!==(T=t.deviceId)&&void 0!==T?T:f?null!==(R=d.ampDeviceId)&&void 0!==R?R:d.deviceId:void 0)&&void 0!==M?M:null==h?void 0:h.deviceId)&&void 0!==N?N:c.deviceId)&&void 0!==_?_:B(),m=null!==(D=null==h?void 0:h.lastEventId)&&void 0!==D?D:c.lastEventId,v=null!==(L=null==h?void 0:h.lastEventTime)&&void 0!==L?L:c.lastEventTime,y=null!==(U=null!==(F=t.optOut)&&void 0!==F?F:null==h?void 0:h.optOut)&&void 0!==U?U:c.optOut,b=null!==(j=null==h?void 0:h.sessionId)&&void 0!==j?j:c.sessionId,w=null!==(V=null!==(z=t.userId)&&void 0!==z?z:null==h?void 0:h.userId)&&void 0!==V?V:c.userId,r.previousSessionDeviceId=null!==(q=null==h?void 0:h.deviceId)&&void 0!==q?q:c.deviceId,r.previousSessionUserId=null!==(W=null==h?void 0:h.userId)&&void 0!==W?W:c.userId,S={ipAddress:null===(G=null===(K=t.trackingOptions)||void 0===K?void 0:K.ipAddress)||void 0===G||G,language:null===(Y=null===(J=t.trackingOptions)||void 0===J?void 0:J.language)||void 0===Y||Y,platform:null===(H=null===(Z=t.trackingOptions)||void 0===Z?void 0:Z.platform)||void 0===H||H},C=null==h?void 0:h.pageCounter,I=null==h?void 0:h.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(x=new Ur(e,t.appVersion,u,i,t.defaultTracking,t.autocapture,g,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,n,t.ingestionMetadata,t.instanceName,m,v,t.loggerProvider,t.logLevel,t.minIdLength,t.offline,y,t.partnerId,t.plan,t.serverUrl,t.serverZone,b,t.sessionTimeout,t.storageProvider,S,t.transport,t.useBatch,t.fetchRemoteConfig,w,C,I,t.networkTrackingOptions,t.identify,t.enableDiagnostics,r._diagnosticsSampleRate,void 0,t.remoteConfig)).storageProvider.isEnabled()];case 8:return l.sent()||(x.loggerProvider.warn("Storage provider ".concat(x.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),x.storageProvider=new Te),[2,x]}})})},Br=function(e,t){switch(void 0===e&&(e=Fr),void 0===t&&(t={}),e){case"localStorage":return new mr;case"sessionStorage":return new vr;case"none":return new Te;default:return new Re(o(o({},t),{expirationDays:t.expiration}))}},zr=function(e){return"xhr"===e?new yr:"beacon"===e?new br:new Je},Vr=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 Re).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 Re({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,""]}})})},qr=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},Wr="AMP_PAGE_VIEW",Kr=function(e){var t;void 0===e&&(e={});var r,n,i=U(),s=void 0,u=!1,h=e.trackOn,d=e.trackHistoryChanges,p=e.eventType,f=void 0===p?"[Amplitude] Page Viewed":p,g=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==s||s.error("Malformed URI sequence: ",e)}return t},m=function(e){return a(void 0,void 0,void 0,function(){var t,r,n;return l(this,function(i){switch(i.label){case 0:return t=g("undefined"!=typeof location&&location.href||""),n={event_type:f},r=[{}],[4,Gr()];case 1:return[2,(n.event_properties=o.apply(void 0,[o.apply(void 0,r.concat([i.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":t,"[Amplitude] Page Path":"undefined"!=typeof location&&g(location.pathname)||"","[Amplitude] Page Title":Ot(Et),"[Amplitude] Page URL":t.split("?")[0],"[Amplitude] Page View ID":e}]),n)]}})})},v=function(){return void 0===h||"function"==typeof h&&h()},y="undefined"!=typeof location?location.href:null,b=function(){a(void 0,void 0,void 0,function(){var e,r,i,o,a;return l(this,function(l){switch(l.label){case 0:return e=location.href,r=Yr(d,e,y||"")&&v(),y=e,r?(i=void 0,n&&(i=B(),n.set(Wr,{pageViewId:i})),null==s||s.log("Tracking page view event"),null!=t?[3,1]:[3,3]):[3,4];case 1:return a=(o=t).track,[4,m(i)];case 2:a.apply(o,[l.sent()]),l.label=3;case 3:l.label=4;case 4:return[2]}})})},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,h,d;return l(this,function(l){switch(l.label){case 0:return t=o,r=e,(s=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),u=!0,i&&(n=new De(i.sessionStorage),i.addEventListener("popstate",b),i.history.pushState=new Proxy(i.history.pushState,{apply:function(e,t,r){var n=c(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),u&&b()}})),v()?(s.log("Tracking page view event"),a=void 0,n&&(a=B(),n.set(Wr,{pageViewId:a})),d=(h=t).track,[4,m(a)]):[3,2];case 1:d.apply(h,[l.sent()]),l.label=2;case 2:return[2]}})})},execute:function(e){return a(void 0,void 0,void 0,function(){var t,i,a;return l(this,function(l){switch(l.label){case 0:return"attribution"===h&&Jr(e)?(null==s||s.log("Enriching campaign event to page view event with campaign parameters"),t=void 0,n?[4,n.get(Wr)]:[3,2]):[3,4];case 1:i=l.sent(),t=null==i?void 0:i.pageViewId,l.label=2;case 2:return[4,m(t)];case 3:a=l.sent(),e.event_type=a.event_type,e.event_properties=o(o({},e.event_properties),a.event_properties),l.label=4;case 4:return r&&e.event_type===f&&(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 i&&(i.removeEventListener("popstate",b),u=!1),[2]})})}};return w},Gr=function(){return a(void 0,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return e=qr,[4,(new wt).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},Jr=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,r=t[n.SET]||{},i=t[n.UNSET]||{},o=h(h([],c(Object.keys(r)),!1),c(Object.keys(i)),!1);return Object.keys(A).every(function(e){return o.includes(e)})}return!1},Yr=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},Zr=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=$r(e);t||n.track(xr,((r={})[_r]=Hr(e.id),r[Dr]=Hr(e.name),r[Lr]=i,r)),t=!0}),r(e,"submit",function(){var r,i,o=$r(e);t||n.track(xr,((r={})[_r]=Hr(e.id),r[Dr]=Hr(e.name),r[Lr]=o,r)),n.track(kr,((i={})[_r]=Hr(e.id),i[Dr]=Hr(e.name),i[Lr]=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=U())?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]})})}}},Hr=function(e){if("string"==typeof e)return e},$r=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},Xr=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(Er,((t={})[Pr]=s,t[Tr]=r.pathname,t[Rr]=e.id,t[Mr]=e.text,t[Nr]=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=U())?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]})})}}},Qr=!1,en=function(){var e=U(),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]})})}}};function tn(e){var t,r,n,i,o,s,a,l,d,p,f;if("object"==typeof e&&null!==e&&!Array.isArray(e)){var g=Object.keys(e);try{for(var m=u(g),v=m.next();!v.done;v=m.next()){var y=v.value;try{var b=e[y];"boolean"==typeof(null==b?void 0:b.enabled)&&(b.enabled?(delete b.enabled,0===Object.keys(b).length&&(e[y]=!0)):e[y]=!1),tn(b)}catch(e){}}}catch(e){t={error:e}}finally{try{v&&!v.done&&(r=m.return)&&r.call(m)}finally{if(t)throw t.error}}try{if(null===(d=null===(l=null===(a=e.autocapture)||void 0===a?void 0:a.networkTracking)||void 0===l?void 0:l.captureRules)||void 0===d?void 0:d.length)try{for(var w=u(e.autocapture.networkTracking.captureRules),S=w.next();!S.done;S=w.next()){var C=S.value;try{for(var I=(o=void 0,u(["responseHeaders","requestHeaders"])),x=I.next();!x.done;x=I.next()){var k=x.value,E=null!==(p=C[k])&&void 0!==p?p:{},O=E.captureSafeHeaders,A=E.allowlist;(O||A)&&(void 0===A||Array.isArray(A)?C[k]=h(h([],c(O?P:[]),!1),c(null!=A?A:[]),!1):delete C[k])}}catch(e){o={error:e}}finally{try{x&&!x.done&&(s=I.return)&&s.call(I)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{S&&!S.done&&(i=w.return)&&i.call(w)}finally{if(n)throw n.error}}}catch(e){}var T=null===(f=e.autocapture)||void 0===f?void 0:f.frustrationInteractions;T&&(T.rageClick&&(T.rageClicks=T.rageClick,delete T.rageClick),T.deadClick&&(T.deadClicks=T.deadClick,delete T.deadClick))}}function rn(e,t,r){var n,i,o=[];try{for(var s=u(null!=t?t:[]),a=s.next();!a.done;a=s.next()){var l=a.value;try{o.push(new RegExp(l))}catch(e){r.loggerProvider.warn("Invalid regex pattern: ".concat(l),e)}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return e.concat(o)}function nn(e,t){var r,n,i,s,a,l,c;if(e){tn(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var h=e;if(h&&"autocapture"in h){if("boolean"==typeof h.autocapture&&(t.autocapture=h.autocapture),"object"==typeof h.autocapture&&null!==h.autocapture){var d=o({},h.autocapture);if(void 0===t.autocapture&&(t.autocapture=h.autocapture),"object"==typeof h.autocapture.elementInteractions&&null!==h.autocapture.elementInteractions&&(null===(i=h.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===i?void 0:i.length)){d.elementInteractions=o({},h.autocapture.elementInteractions);var p=d.elementInteractions,f=null!==(s=p.pageUrlAllowlist)&&void 0!==s?s:[],g=h.autocapture.elementInteractions.pageUrlAllowlistRegex;p.pageUrlAllowlist=rn(f,g,t),delete p.pageUrlAllowlistRegex}if("object"==typeof h.autocapture.networkTracking&&null!==h.autocapture.networkTracking&&(null===(a=h.autocapture.networkTracking.captureRules)||void 0===a?void 0:a.length)){d.networkTracking=o({},h.autocapture.networkTracking);var m=null!==(l=d.networkTracking.captureRules)&&void 0!==l?l:[];try{for(var v=u(m),y=v.next();!y.done;y=v.next()){var b=y.value;b.urls=rn(null!==(c=b.urls)&&void 0!==c?c:[],b.urlsRegex,t),delete b.urlsRegex}}catch(e){r={error:e}}finally{try{y&&!y.done&&(n=v.return)&&n.call(v)}finally{if(r)throw r.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=o({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},d)),"object"==typeof t.autocapture&&(t.autocapture=o(o({},t.autocapture),d))}t.defaultTracking=t.autocapture}t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}var on="1.19.0-feat-zoning.0",sn="[Amplitude] Element Clicked",an="[Amplitude] Element Tag",ln="[Amplitude] Element Text",un="[Amplitude] Page URL",cn="[Amplitude] Viewport Height",hn="[Amplitude] Viewport Width",dn="[Amplitude] Page View ID",pn="https://app.amplitude.com",fn={US:pn,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},gn="data-amp-mask-attributes",mn=["input","select","textarea"],vn=function(e,t){var r,n=null===(r=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===r?void 0:r.call(window,e);return"pointer"===(null==n?void 0:n.getPropertyValue("cursor"))&&"click"===t},yn=function(e,t,r){return void 0===r&&(r=!1),function(n,i){var o,s,a=e.pageUrlAllowlist,l=e.pageUrlExcludelist,u=e.shouldTrackEventResolver,c=null===(s=null===(o=null==i?void 0:i.tagName)||void 0===o?void 0:o.toLowerCase)||void 0===s?void 0:s.call(o);if(!c)return!1;if(u)return u(n,i);if(!Ee(window.location.href,a))return!1;if(l&&l.length>0&&Ee(window.location.href,l))return!1;var h=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof h)switch(h.toLowerCase()){case"hidden":case"password":return!1}var d=vn(i,n);if(r&&d)return!0;if(t){var p=t.some(function(e){var t;return!!(null===(t=null==i?void 0:i.matches)||void 0===t?void 0:t.call(i,e))});if(!p)return!1}switch(c){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:return!!d||"click"===n}}},bn=function(e){return e?e.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[]},wn=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},{})},Sn=function(){var e;try{var t=U(),r=null===(e=null==t?void 0:t.sessionStorage)||void 0===e?void 0:e.getItem("AMP_PAGE_VIEW");if(!r)return;var n=JSON.parse(r);if("string"==typeof n.pageViewId)return n.pageViewId}catch(e){}},Cn=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:Cn(null==e?void 0:e.parentElement,t):null};var In=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};var xn=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",gn,St]),kn=["type"],En=["svg","path","g"],On=["password","hidden"];function An(e,t){var r,n,i,o,s,a;if(null===e)return null;var l=String(e.tagName).toLowerCase(),c={tag:l},h=Array.from(null!==(o=null===(i=e.parentElement)||void 0===i?void 0:i.children)&&void 0!==o?o:[]);h.length&&(c.index=h.indexOf(e),c.indexOfType=h.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var d=null===(a=null===(s=e.previousElementSibling)||void 0===s?void 0:s.tagName)||void 0===a?void 0:a.toLowerCase();d&&(c.prevSib=String(d));var p=e.getAttribute("id");p&&(c.id=String(p));var f=Array.from(e.classList);f.length&&(c.classes=f);var g={},m=Array.from(e.attributes).filter(function(e){return!xn.has(e.name)}),v=!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!mn.includes(i)&&!o}(e);if(!On.includes(String(e.getAttribute("type")))&&!En.includes(l))try{for(var y=u(m),b=y.next();!b.done;b=y.next()){var w=b.value;v&&!kn.includes(w.name)||(t.has(w.name)?g[w.name]=Ct:g[w.name]=String(w.value).substring(0,128))}}catch(e){r={error:e}}finally{try{b&&!b.done&&(n=y.return)&&n.call(y)}finally{if(r)throw r.error}}return Object.keys(g).length&&(c.attrs=g),c}var Pn=function(e,t,r){e.forEach(function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var n=r.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=n}})},Tn=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),Rn=function(e,t,r){var n,i;if(e.nodeType!==Node.ELEMENT_NODE)return null;var o=e.getAttribute("id");if(t){if(o)return new Tn(h(o),!0);var s=e.tagName.toLowerCase();if("body"===s||"head"===s||"html"===s)return new Tn(s,!0)}var a=e.tagName.toLowerCase();if(o)return new Tn(a+h(o),!0);var l=e.parentNode;if(!l||l.nodeType===Node.DOCUMENT_NODE)return new Tn(a,!0);function c(e){var t=e.getAttribute("class");return t?t.split(/\s+/g).filter(Boolean).map(function(e){return"$"+e}):[]}function h(e){return"#"+CSS.escape(e)}for(var d=c(e),p=!1,f=!1,g=-1,m=-1,v=l.children,y=0;v&&(-1===g||!f)&&y<v.length;++y){var b=v[y];if(b.nodeType===Node.ELEMENT_NODE)if(m+=1,b!==e){if(!f&&b.tagName.toLowerCase()===a){p=!0;var w=new Set(d);if(w.size)for(var S=c(b),C=0;C<S.length;++C){var I=S[C];if(w.has(I)&&(w.delete(I),!w.size)){f=!0;break}}else f=!0}}else g=m}var x=a;if(r&&"input"===a.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(x+="[type="+CSS.escape(e.getAttribute("type")||"")+"]"),f)x+=":nth-child("+String(g+1)+")";else if(p)try{for(var k=u(d),E=k.next();!E.done;E=k.next()){var O=E.value;x+="."+CSS.escape(O.slice(1))}}catch(e){n={error:e}}finally{try{E&&!E.done&&(i=k.return)&&i.call(k)}finally{if(n)throw n.error}}return new Tn(x,!1)},Mn=function(e,t){var r,n,i,o=this;this.replaceSensitiveString=function(e){return Et(e,o.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,r,n,i,s,a=performance.now();if(!e)return[];for(var l=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),d=new Map,p=l.length-1;p>=0;p--){var f=l[p];if(f){var g=bn(f.getAttribute(gn)),m=p===l.length-1?[]:null!==(n=d.get(l[p+1]))&&void 0!==n?n:new Set,v=new Set(h(h([],c(m),!1),c(g),!1));d.set(f,v)}}s=l.map(function(e){var t;return An(e,null!==(t=d.get(e))&&void 0!==t?t:new Set)});var y=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var r=c(t,2),n=r[0],i=r[1];e.attrs&&(e.attrs[n]=o.replaceSensitiveString(i))})};try{for(var b=u(s),w=b.next();!w.done;w=b.next())y(w.value)}catch(e){t={error:e}}finally{try{w&&!w.done&&(r=b.return)&&r.call(b)}finally{if(t)throw t.error}}var S=performance.now();return null===(i=o.diagnosticsClient)||void 0===i||i.recordHistogram("autocapturePlugin.getHierarchy",S-a),s},this.getNearestLabel=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}return t?o.getText(t):o.getNearestLabel(r)},this.getElementPath=function(e){var t;if(!e)return"";var r=performance.now(),n=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var r=[],n=e;n;){var i=Rn(n,Boolean(t),n===e);if(!i)break;if(r.push(i),i.optimized)break;n=n.parentElement}return r.reverse(),r.join(" > ")}(e),i=performance.now();return null===(t=o.diagnosticsClient)||void 0===t||t.recordHistogram("autocapturePlugin.getElementPath",i-r),n},this.getEventProperties=function(e,t,r){var n,i,s,a,l,u,h=null===(s=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===s?void 0:s.call(i),d="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},p=o.getHierarchy(t),f=null===(a=p[0])||void 0===a?void 0:a.attrs,g=o.getNearestLabel(t),m=(l=null!=f?f:{},u=r,Object.entries(l).reduce(function(e,t){var r=c(t,2),n=r[0],i=r[1];if(n.startsWith(u)){var o=n.replace(u,"");o&&(e[o]=i||"")}return e},{})),v=((n={})["[Amplitude] Element Hierarchy"]=p,n[an]=h,n[ln]=o.getText(t),n["[Amplitude] Element Position Left"]=null==d.left?null:Math.round(d.left),n["[Amplitude] Element Position Top"]=null==d.top?null:Math.round(d.top),n["[Amplitude] Element Attributes"]=m,n["[Amplitude] Element Path"]=o.getElementPath(t),n["[Amplitude] Element Parent Label"]=g,n[un]=Oe(window.location.href.split("?")[0]),n["[Amplitude] Page Title"]=Ot(o.replaceSensitiveString),n[cn]=window.innerHeight,n[hn]=window.innerWidth,n),y=Sn();return y&&(v[dn]=y),v["[Amplitude] Element ID"]=t.getAttribute("id")||"",v["[Amplitude] Element Class"]=t.getAttribute("class"),v["[Amplitude] Element Aria Label"]=null==f?void 0:f["aria-label"],"a"===h&&"click"===e&&t instanceof HTMLAnchorElement&&(v["[Amplitude] Element Href"]=o.replaceSensitiveString(t.href)),wn(v)},this.addAdditionalEventProperties=function(e,t,r,n,i){void 0===i&&(i=!1);var s={event:e,timestamp:Date.now(),type:t};if(function(e){return"click"===e.type||"change"===e.type}(s)&&null!==s.event.target){if(i&&vn(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,n),s;var a=Cn(s.event.target,r);return a&&(s.closestTrackedAncestor=a,s.targetElementProperties=o.getEventProperties(s.type,a,n)),s}return s},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=function(e,t){try{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}}catch(e){return}}(e,t);if(!r)return;return"TEXT"===e.elementExtractType?o.getText(r):"ATTRIBUTE"===e.elementExtractType&&e.attribute?r.getAttribute(e.attribute):void 0}},this.getText=function(e){if(null!==e.closest("[".concat(St,"]")))return Ct;var t="";if(e.querySelector("[".concat(St,"], [contenteditable]"))){var r=e.cloneNode(!0);r.querySelectorAll("[".concat(St,"], [contenteditable]")).forEach(function(e){e.innerText=Ct}),t=r.innerText||""}else t=e.innerText||"";return o.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=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),s=((t={})[an]=i,t[ln]=o.getText(e),t[un]=window.location.href.split("?")[0],t);return wn(s)},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var s=null!==(i=e.maskTextRegex)&&void 0!==i?i:[],a=[];try{for(var l=u(s),d=l.next();!d.done;d=l.next()){var p=d.value;if(a.length>=25)break;if(p instanceof RegExp)a.push(p);else if("pattern"in p&&"string"==typeof p.pattern)try{a.push(new RegExp(p.pattern,"i"))}catch(e){}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}this.additionalMaskTextPatterns=a},Nn=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?pn:t,n=this;this.endpoint=pn,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?{dataExtractor:new Mn({})}:e,n=r.logger,i=r.endpoint,o=r.isElementSelectable,s=r.cssSelectorAllowlist,a=r.actionClickAllowlist,l=r.dataExtractor;this.logger=n,i&&this.endpoint===pn&&(this.endpoint=i);var u=null;window.addEventListener("message",function(e){var r,n,i,c,h;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 d,p=null==e?void 0:e.data,f=null==p?void 0:p.action;if(f)if("id"in p)null===(c=null===(i=t.logger)||void 0===i?void 0:i.debug)||void 0===c||c.call(i,"Received Response to previous request: ",JSON.stringify(e)),t.handleResponse(p);else if("ping"===f)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===f){var g=null==p?void 0:p.data;(d="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=d,n.addEventListener("load",function(){e({status:!0})},{once:!0}),n.addEventListener("error",function(){t({status:!1,message:"Failed to load the script ".concat(d)})}),null===(r=document.head)||void 0===r||r.appendChild(n)}catch(e){t(e)}})).then(function(){var e;u=null===(e=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===e?void 0:e.call(window,{getEventTagProps:l.getEventTagProps,isElementSelectable:function(e){return!o||o((null==g?void 0:g.actionType)||"click",e)},onTrack:t.onTrack,onSelect:t.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:t,cssSelectorAllowlist:s,actionClickAllowlist:a,extractDataFromDataSource:l.extractDataFromDataSource,dataExtractor:l,diagnostics:{autocapture:{version:on}}}),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"===f&&(null===(h=null==u?void 0:u.close)||void 0===h||h.call(u))}}),this.notify({action:"page-loaded"})},e}();var _n,Dn=function(){return new Zt(function(e){var t=new MutationObserver(function(t){e.next(t)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},Ln=function(e){return void 0===e&&(e="click"),new Zt(function(t){var r,n=function(e){t.next(e)};return null===(r=U())||void 0===r||r.document.addEventListener(e,n,{capture:!0}),function(){var t;null===(t=U())||void 0===t||t.document.removeEventListener(e,n,{capture:!0})}})},Fn={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},Un=function(e){var t,r,n,i,o=Object.values(Fn).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return o;try{for(var s=u(e),a=s.next();!a.done;a=s.next()){var l=a.value;try{try{for(var c=(n=void 0,u(l.definition)),h=c.next();!h.done;h=c.next()){var d=h.value,p=Fn[d.event_type];p&&o[p].add(l.id)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==l?void 0:l.id,e)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return o},jn=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},Bn=function(e,t){return t.filter(function(t){return t.definition.some(function(t){return Fn[t.event_type]===e.type&&t.filters.every(function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===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)})})})},zn=function(){function e(e,t,r,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=r,this.options=n}return e.prototype.evaluate=function(e){var t,r,n=this.options.pageActions;if(!n)return e;var i=Bn(e,Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return n.labeledEvents[e]})),o=function(e,t){var r,n,i,o,s=new Set;try{for(var a=u(e),l=a.next();!l.done;l=a.next()){var c=l.value,h=t.get(c.id);if(h)try{for(var d=(i=void 0,u(h)),p=d.next();!p.done;p=d.next()){var f=p.value;s.add(f)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return Array.from(s)}(i,this.labeledEventToTriggerMap);try{for(var s=u(o),a=s.next();!a.done;a=s.next()){var l=a.value;Pn(l.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=r},e}();!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.ScrollObservable="scrollObservable",e.ExposureObservable="exposureObservable"}(_n||(_n={}));var Vn=function(e,t){var r,n,i,s,d,p,f,g;void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",on);var m=e.dataAttributePrefix,v=void 0===m?$e:m,y=e.visualTaggingOptions,b=void 0===y?{enabled:!0,messenger:new Nn}:y;e.cssSelectorAllowlist=null!==(r=e.cssSelectorAllowlist)&&void 0!==r?r:He,e.actionClickAllowlist=null!==(n=e.actionClickAllowlist)&&void 0!==n?n:Xe,e.debounceTime=null!==(i=e.debounceTime)&&void 0!==i?i:0,e.pageUrlExcludelist=null===(s=e.pageUrlExcludelist)||void 0===s?void 0:s.reduce(function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(r){return console.warn("Invalid regex pattern: ".concat(t.pattern),r),e}return e},[]);var w,S="@amplitude/plugin-autocapture-browser",C=[],I=new Mn(e,t),x=new Set,k=new Set,E=function(){var t,r,n=Xt(Ln().map(function(t){return I.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,v)})),i=Xt(new Zt(function(t){var r,n=function(r){var n=I.addAdditionalEventProperties(r,"change",e.cssSelectorAllowlist,v);t.next(n)};return null===(r=U())||void 0===r||r.document.addEventListener("change",n,{capture:!0}),function(){var e;return null===(e=U())||void 0===e?void 0:e.document.removeEventListener("change",n)}}));window.navigation&&(r=Xt(new Zt(function(t){var r=function(r){var n=I.addAdditionalEventProperties(r,"navigate",e.cssSelectorAllowlist,v);t.next(n)};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}})));var o=Xt(Dn().map(function(t){return I.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,v)})),s=new Zt(function(e){var t,r=function(t){e.next(t)};return null===(t=U())||void 0===t||t.window.addEventListener("scroll",r),function(){var e;null===(e=U())||void 0===e||e.window.removeEventListener("scroll",r)}}),a=function(e,t){return new Zt(function(r){var n,i=U();if(!(null==i?void 0:i.IntersectionObserver))return console.log("IntersectionObserver not supported"),function(){};var o=new IntersectionObserver(function(e){e.forEach(function(e){r.next(e)})},{root:null,rootMargin:"0px",threshold:1}),s=t.join(",");return(null!==(n=null==i?void 0:i.document.querySelectorAll(s))&&void 0!==n?n:[]).forEach(function(e){o.observe(e)}),e.subscribe(function(e){return e.event.forEach(function(e){return e.addedNodes.forEach(function(e){return e instanceof Element&&o.observe(e)})})}),function(){o.disconnect()}})}(o,e.cssSelectorAllowlist);return(t={})[_n.ChangeObservable]=i,t[_n.ClickObservable]=n,t[_n.MutationObservable]=o,t[_n.NavigateObservable]=r,t[_n.ScrollObservable]=s,t[_n.ExposureObservable]=a,t},O=Un(Object.values(null!==(p=null===(d=e.pageActions)||void 0===d?void 0:d.labeledEvents)&&void 0!==p?p:{})),A=jn(null!==(g=null===(f=e.pageActions)||void 0===f?void 0:f.triggers)&&void 0!==g?g:[]),P=function(e,t,r,n){return new zn(e,t,r,n)}(O,A,I,e);return{name:S,type:"enrichment",setup:function(t,r){return a(void 0,void 0,void 0,function(){var n,i,s,a,u,d,p,f,g,m,y,T,R,M,N,_,D,L,F,j,B;return l(this,function(l){return"undefined"==typeof document||(n=!1,i={maxX:void 0,maxY:void 0},t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("analyticsSDK.pageActions","all",function(t){!function(t){var r,n;t&&(e.pageActions=o(o({},e.pageActions),t),O=Un(Object.values(null!==(r=e.pageActions.labeledEvents)&&void 0!==r?r:{})),A=jn(null!==(n=e.pageActions.triggers)&&void 0!==n?n:[]),P.update(O,A,e))}(t)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),s=yn(e,e.cssSelectorAllowlist),a=yn(e,e.actionClickAllowlist),u=E(),d=function(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackEvent,i=e.evaluateTriggers;return r.clickObservable.filter(In).filter(function(e){return n("click",e.closestTrackedAncestor)}).map(function(e){return i(e)}).subscribe(function(e){null==t||t.track(sn,e.targetElementProperties)})}({allObservables:u,amplitude:r,shouldTrackEvent:s,evaluateTriggers:P.evaluate.bind(P)}),C.push(d),p=function(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return r.changeObservable.filter(In).filter(function(e){return i("change",e.closestTrackedAncestor)}).map(function(e){return o(e)}).subscribe(function(e){null==t||t.track("[Amplitude] Element Changed",n("change",e.closestTrackedAncestor))})}({allObservables:u,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return I.getEventProperties.apply(I,h(h([],c(e),!1),[v],!1))},amplitude:r,shouldTrackEvent:s,evaluateTriggers:P.evaluate.bind(P)}),C.push(p),f=function(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,c=a.filter(function(e){return!o("click",e.closestTrackedAncestor)}).map(function(e){var t=Cn(e.event.target,n.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e}).filter(In).filter(function(e){return s("click",e.closestTrackedAncestor)}),h=u?$t(l,u):l,d=$t(c,h),p=null,f=null;return Ht(d,function(e){if(p&&(clearTimeout(p),p=null),"click"===e.type)return f=e,p=setTimeout(function(){p=null,f=null},500),Promise.resolve(null);if(f){var t=f;return f=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==t||t.track(sn,i("click",e.closestTrackedAncestor)))})}({allObservables:u,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return I.getEventProperties.apply(I,h(h([],c(e),!1),[v],!1))},amplitude:r,shouldTrackEvent:s,shouldTrackActionClick:a}),f&&C.push(f),g=function(e){e.amplitude;var t=e.allObservables.scrollObservable,r={maxX:0,maxY:0},n=t.subscribe(function(){var e,t,n,i,o=U(),s=Math.floor(null!==(t=null!==(e=null==o?void 0:o.scrollX)&&void 0!==e?e:null==o?void 0:o.pageXOffset)&&void 0!==t?t:0),a=Math.floor(null!==(i=null!==(n=null==o?void 0:o.scrollY)&&void 0!==n?n:null==o?void 0:o.pageYOffset)&&void 0!==i?i:0);r.maxX=Math.max(r.maxX,s),r.maxY=Math.max(r.maxY,a)});return{unsubscribe:function(){n.unsubscribe()},getState:function(){return r},reset:function(){r.maxX=0,r.maxY=0}}}({allObservables:u,amplitude:r}),C.push(g),m={},y=U(),T=function(e){e&&n||(setTimeout(function(){n=!1},100),n=!0,function(e){var t,r,n=e.amplitude,i=e.scrollTracker,o=e.currentElementExposed,s=e.elementExposedForPage,a=e.exposureTracker,l=e.isPageEnd,u=e.lastScroll,c=i.getState(),h=U(),d=((t={})[un]=null===(r=null==h?void 0:h.location)||void 0===r?void 0:r.href,t["[Amplitude] Max Page X"]=c.maxX,t["[Amplitude] Max Page Y"]=c.maxY,t[cn]=null==h?void 0:h.innerHeight,t[hn]=null==h?void 0:h.innerWidth,t["[Amplitude] Element Exposed"]=Array.from(o),t),p=Sn();p&&(d[dn]=p),0===o.size&&c.maxX===u.maxX&&c.maxY===u.maxY||(null==n||n.track("[Amplitude] Viewport Content Updated",d),u={maxX:c.maxX,maxY:c.maxY},o.clear(),l&&(i.reset(),s.clear(),null==a||a.reset()))}({amplitude:r,scrollTracker:g,currentElementExposed:k,elementExposedForPage:x,exposureTracker:m.exposure,isPageEnd:e,lastScroll:i}))},R=function(e){!function(e,t,r,n){if(!t.has(e)){t.add(e),r.add(e);var i=Array.from(r);JSON.stringify(i).length>=18e3&&n(!1)}}(e,x,k,T)},m.exposure=function(e){var t=e.allObservables,r=e.onExposure,n=e.dataExtractor,i=new Map,o=new Map,s=t.exposureObservable.subscribe(function(e){var t=e,s=t.target;if(t.isIntersecting){if(!i.get(s)){var a=setTimeout(function(){i.set(s,!0);var e=n.getElementPath(s);r(e),o.set(s,null)},2e3);o.set(s,a)}}else!t.isIntersecting&&t.intersectionRatio<1&&(a=o.get(s))&&(clearTimeout(a),o.set(s,null))});return{unsubscribe:function(){s.unsubscribe()},reset:function(){o.forEach(function(e){e&&clearTimeout(e)}),o.clear(),i.clear()}}}({allObservables:u,onExposure:R,dataExtractor:I}),m.exposure&&C.push(m.exposure),M=function(){console.log("amp: beforeUnload"),T(!0)},null==y||y.addEventListener("beforeunload",M),w=function(){null==y||y.removeEventListener("beforeunload",M)},C.push({unsubscribe:function(){return w()}}),(N=u[_n.NavigateObservable])?C.push(N.subscribe(function(){console.log("amp: navigate"),T(!0)})):y&&(_=function(){console.log("amp: popstate"),T(!0)},y.addEventListener("popstate",_),D=y.history.pushState,y.history&&D&&(y.history.pushState=new Proxy(D,{apply:function(e,t,r){var n=c(r,3),i=n[0],o=n[1],s=n[2];console.log("amp: pushState"),e.apply(t,[i,o,s]),T(!0)}})),C.push({unsubscribe:function(){y.removeEventListener("popstate",_),y.history&&D&&(y.history.pushState=D)}})),null===(j=null==t?void 0:t.loggerProvider)||void 0===j||j.log("".concat(S," has been successfully added.")),window.opener&&b.enabled&&(L=e.cssSelectorAllowlist,F=e.actionClickAllowlist,null===(B=b.messenger)||void 0===B||B.setup(o(o({dataExtractor:I,logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:fn[t.serverZone]}),{isElementSelectable:yn(e,h(h([],c(L),!1),c(F),!1)),cssSelectorAllowlist:L,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(C),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]})})}}},qn=["mutation","navigate"];function Wn(e,t){var r,n,i,o,s=t.event,a=s.clientX,l=s.clientY;e.yMin=Math.min(null!==(r=e.yMin)&&void 0!==r?r:l,l),e.yMax=Math.max(null!==(n=e.yMax)&&void 0!==n?n:l,l),e.xMin=Math.min(null!==(i=e.xMin)&&void 0!==i?i:a,a),e.xMax=Math.max(null!==(o=e.xMax)&&void 0!==o?o:a,a),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function Kn(e){if(0===e.length)return null;var t=e[0],r=e[e.length-1];return{rageClickEvent:o({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(r.timestamp).toISOString(),"[Amplitude] Duration":r.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.clientX,Y:e.event.clientY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}function Gn(e){var t=this,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,o=n.clickObservable,s=[],u={},c=null;var h=Ht(o.filter(function(e){return i("click",e.closestTrackedAncestor)}),function(e){return a(t,void 0,void 0,function(){var t;return l(this,function(r){return Wn(u,e),t=null,0===s.length||function(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}(s,e)||function(e,t){var r=e[Math.max(0,e.length-4+1)];return t.timestamp-r.timestamp>=1e3}(s,e)||u.isOutOfBounds?(c&&(t=Kn(s)),function(e){s=[],u={},e&&(Wn(u,e),s.push(e))}(e)):s.push(e),c&&(clearTimeout(c.timerId),c.resolve(t),c=null),s.length>=4?[2,new Promise(function(e){c={resolve:e,timerId:setTimeout(function(){e(Kn(s))},1e3)}})]:[2,null]})})});return h.subscribe(function(e){null!==e&&r.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})})}var Jn,Yn,Zn=function(e){var t,r,n,i,s;void 0===e&&(e={});var d="@amplitude/plugin-frustration-browser",p=[],f=null!==(r=null===(t=e.rageClicks)||void 0===t?void 0:t.cssSelectorAllowlist)&&void 0!==r?r:et,g=null!==(i=null===(n=e.deadClicks)||void 0===n?void 0:n.cssSelectorAllowlist)&&void 0!==i?i:Qe,m=null!==(s=e.dataAttributePrefix)&&void 0!==s?s:$e,v=new Mn(e),y=h([],c(new Set(h(h([],c(f),!1),c(g),!1))),!1);return{name:d,type:"enrichment",setup:function(t,r){return a(void 0,void 0,void 0,function(){var n,i,s,a,u,c;return l(this,function(l){return"undefined"==typeof document||(n=yn(e,f),i=yn(e,g),s=function(){var e,t,r=Xt(Ln("pointerdown").map(function(e){return v.addAdditionalEventProperties(e,"click",y,m,!0)})),n=Xt(Dn().map(function(e){return v.addAdditionalEventProperties(e,"mutation",y,m)}));return window.navigation&&(t=Xt(new Zt(function(e){var t=function(t){e.next(o(o({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}}).map(function(e){return v.addAdditionalEventProperties(e,"navigate",y,m)}))),(e={})[_n.ClickObservable]=r,e[_n.MutationObservable]=n,e[_n.NavigateObservable]=t,e}(),a=Gn({allObservables:s,amplitude:r,shouldTrackRageClick:n}),p.push(a),u=function(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackDeadClick,s=r.clickObservable,a=r.mutationObservable,l=r.navigateObservable,u=s.filter(function(e){return In(e)&&i("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')}),c=l?$t(a,l):a,h=$t(u,c),d=null,p=Ht(h,function(e){return d&&qn.includes(e.type)?(clearTimeout(d),d=null,Promise.resolve(null)):"click"===e.type?d?Promise.resolve(null):new Promise(function(t){d=setTimeout(function(){t(e),d=null},3e3)}):Promise.resolve(null)});return p.subscribe(function(e){if(e){var r={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};t.track("[Amplitude] Dead Click",o(o({},n("click",e.closestTrackedAncestor)),r),{time:e.timestamp})}})}({amplitude:r,allObservables:s,getEventProperties:function(e,t){return v.getEventProperties(e,t,m)},shouldTrackDeadClick:i}),p.push(u),null===(c=null==t?void 0:t.loggerProvider)||void 0===c||c.log("".concat(d," 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,n;return l(this,function(i){try{for(e=u(p),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]})})}}},Hn="[Amplitude] Network Request",$n="500-599";function Xn(e,t){var r="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(r).test(e)}function Qn(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 ei(e){var t;if(e)try{var r=null===(t=U())||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 ti(e){if("object"==typeof e&&null!==e){if(0!==e.length)return e}else{if(e)return h([],c(P),!1);if(void 0===e){return}}}function ri(e){var t,r;return!(null===(t=null==e?void 0:e.allowlist)||void 0===t?void 0:t.length)&&!(null===(r=null==e?void 0:e.blocklist)||void 0===r?void 0:r.length)}function ni(e,t){var r;void 0===t&&(t={});var n=ei(e.url);if(!n)return!1;var i,o=n.host;if(!1!==t.ignoreAmplitudeRequests&&(Xn(o,"*.amplitude.com")||Xn(o,"amplitude.com")))return!1;if(null===(r=t.ignoreHosts)||void 0===r?void 0:r.find(function(e){return Xn(o,e)}))return!1;if(!t.captureRules&&void 0!==e.status&&!Qn(e.status,$n))return!1;if(t.captureRules&&(h([],c(t.captureRules),!1).reverse().find(function(t){if(i=function(e,t,r,n,i){if((!e.hosts||e.hosts.find(function(e){return Xn(t,e)}))&&(!n||!e.urls||Ee(n,e.urls))&&(!i||!e.methods||e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))return!((r||0===r)&&!Qn(r,e.statusCodeRange||$n))}(t,o,e.status,e.url,e.method),i){var r=ti(t.responseHeaders);if(e.responseWrapper&&r){var n=e.responseWrapper.headers(r);n&&(e.responseHeaders=n)}var s=ti(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}e.responseWrapper&&t.responseBody&&!ri(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!ri(t.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,t.requestBody.blocklist))}return void 0!==i}),!i))return!1;return!e.requestWrapper||!function(e,t){if(e.includes("amplitude.com"))try{var r=t.body;if("string"!=typeof r)return!1;if(JSON.parse(r).events.find(function(e){return e.event_type===Hn}))return!0}catch(e){}return!1}(o,e.requestWrapper)}function ii(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude,i=e.loggerProvider;return t.networkObservable.filter(function(e){return ni(e.event,r)}).subscribe(function(e){var t,r,o,s=e.event,u=ei(s.url);if(u){var h=null===(r=s.responseWrapper)||void 0===r?void 0:r.bodySize,d=null===(o=s.requestWrapper)||void 0===o?void 0:o.bodySize;!function(e,t,r,n){a(this,void 0,void 0,function(){var i,o,s;return l(this,function(a){switch(a.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(i=c.apply(void 0,[a.sent(),2]),o=i[0],s=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==n||n.debug("Failed to stringify request body",e)}if(s)try{e["[Amplitude] Response Body"]=JSON.stringify(s)}catch(e){null==n||n.debug("Failed to stringify response body")}a.label=2;case 2:return null==r||r.track(Hn,e),[2]}})})}(((t={})["[Amplitude] URL"]=u.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=u.query,t["[Amplitude] URL Fragment"]=u.fragment,t["[Amplitude] Request Method"]=s.method,t["[Amplitude] Status Code"]=s.status,t["[Amplitude] Start Time"]=s.startTime,t["[Amplitude] Completion Time"]=s.endTime,t["[Amplitude] Duration"]=s.duration,t["[Amplitude] Request Body Size"]=d,t["[Amplitude] Response Body Size"]=h,t["[Amplitude] Request Type"]=s.type,t["[Amplitude] Request Headers"]=s.requestHeaders,t["[Amplitude] Response Headers"]=s.responseHeaders,t),s,n,i)}})}!function(e){e.NetworkObservable="networkObservable"}(Jn||(Jn={}));var oi=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=function(){var e,r=new Zt(function(e){var r=new vt(function(t){var r=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(r)});return bt.subscribe(r,t),function(){bt.unsubscribe(r)}});return(e={})[Jn.NetworkObservable]=r,e};return{name:r,type:"enrichment",setup:function(i,o){return a(void 0,void 0,void 0,function(){var s;return l(this,function(a){return"undefined"==typeof document||(s=n(),t=null==i?void 0:i.loggerProvider,Yn=ii({allObservables:s,networkTrackingOptions:e,amplitude:o,loggerProvider:t}),null==t||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(){return l(this,function(e){return Yn.unsubscribe(),[2]})})}}};let si=-1;const ai=e=>{addEventListener("pageshow",t=>{t.persisted&&(si=t.timeStamp,e(t))},!0)},li=(e,t,r,n)=>{let i,o;return s=>{t.value>=0&&(s||n)&&(o=t.value-(i??0),(o||void 0===i)&&(i=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t)))}},ui=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},ci=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},hi=()=>{const e=ci();return e?.activationStart??0},di=(e,t=-1)=>{const r=ci();let n="navigate";return si>=0?n="back-forward-cache":r&&(document.prerendering||hi()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},pi=new WeakMap;function fi(e,t){return pi.get(e)||pi.set(e,new t),pi.get(e)}class gi{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],r=this.o.at(-1);this.i&&t&&r&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const mi=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return n.observe({type:e,buffered:!0,...r}),n}}catch{}},vi=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let yi=-1;const bi=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,wi=e=>{"hidden"===document.visibilityState&&yi>-1&&(yi="visibilitychange"===e.type?e.timeStamp:0,Ci())},Si=()=>{addEventListener("visibilitychange",wi,!0),addEventListener("prerenderingchange",wi,!0)},Ci=()=>{removeEventListener("visibilitychange",wi,!0),removeEventListener("prerenderingchange",wi,!0)},Ii=()=>{if(yi<0){const e=hi(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;yi=t??bi(),Si(),ai(()=>{setTimeout(()=>{yi=bi(),Si()})})}return{get firstHiddenTime(){return yi}}},xi=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},ki=[1800,3e3],Ei=(e,t={})=>{xi(()=>{const r=Ii();let n,i=di("FCP");const o=mi("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-hi(),0),i.entries.push(t),n(!0)))});o&&(n=li(e,i,ki,t.reportAllChanges),ai(r=>{i=di("FCP"),n=li(e,i,ki,t.reportAllChanges),ui(()=>{i.value=performance.now()-r.timeStamp,n(!0)})}))})},Oi=[.1,.25];let Ai=0,Pi=1/0,Ti=0;const Ri=e=>{for(const t of e)t.interactionId&&(Pi=Math.min(Pi,t.interactionId),Ti=Math.max(Ti,t.interactionId),Ai=Ti?(Ti-Pi)/7+1:0)};let Mi;const Ni=()=>Mi?Ai:performance.interactionCount??0;let _i=0;class Di{u=[];l=new Map;m;p;v(){_i=Ni(),this.u.length=0,this.l.clear()}P(){const e=Math.min(this.u.length-1,Math.floor((Ni()-_i)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let r=this.l.get(e.interactionId);if(r||this.u.length<10||e.duration>t.T){if(r?e.duration>r.T?(r.entries=[e],r.T=e.duration):e.duration===r.T&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],T:e.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort((e,t)=>t.T-e.T),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(r)}}}const Li=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(t(e=vi(e)),document.addEventListener("visibilitychange",e,{once:!0}))},Fi=[200,500],Ui=(e,t={})=>{globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype&&xi(()=>{"interactionCount"in performance||Mi||(Mi=mi("event",Ri,{type:"event",buffered:!0,durationThreshold:0}));let r,n=di("INP");const i=fi(t,Di),o=e=>{Li(()=>{for(const t of e)i.h(t);const t=i.P();t&&t.T!==n.value&&(n.value=t.T,n.entries=t.entries,r())})},s=mi("event",o,{durationThreshold:t.durationThreshold??40});r=li(e,n,Fi,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(o(s.takeRecords()),r(!0))}),ai(()=>{i.v(),n=di("INP"),r=li(e,n,Fi,t.reportAllChanges)}))})};class ji{m;h(e){this.m?.(e)}}const Bi=[2500,4e3],zi=[800,1800],Vi=e=>{document.prerendering?xi(()=>Vi(e)):"complete"!==document.readyState?addEventListener("load",()=>Vi(e),!0):setTimeout(e)};function qi(e){var t,r=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+r}function Wi(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(qi(e)),navigationStart:Math.floor(performance.timeOrigin)}}var Ki,Gi=function(){var e=null,t=U(),r=null==t?void 0:t.document,n=null==t?void 0:t.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(t,i){return a(void 0,void 0,void 0,function(){var o,s;return l(this,function(a){return void 0===r||(o=Oe((null==n?void 0:n.href)||"",t.loggerProvider),s={"[Amplitude] Page Domain":(null==n?void 0:n.hostname)||"","[Amplitude] Page Location":o,"[Amplitude] Page Path":Oe((null==n?void 0:n.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":Oe(o.split("?")[0],t.loggerProvider)},((e,t={})=>{xi(()=>{const r=Ii();let n,i=di("LCP");const o=fi(t,ji),s=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)o.h(t),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-hi(),0),i.entries=[t],n())},a=mi("largest-contentful-paint",s);if(a){n=li(e,i,Bi,t.reportAllChanges);const r=vi(()=>{s(a.takeRecords()),a.disconnect(),n(!0)});for(const e of["keydown","click","visibilitychange"])addEventListener(e,()=>Li(r),{capture:!0,once:!0});ai(r=>{i=di("LCP"),n=li(e,i,Bi,t.reportAllChanges),ui(()=>{i.value=performance.now()-r.timeStamp,n(!0)})})}})})(function(e){s["[Amplitude] LCP"]=Wi(e)}),Ei(function(e){s["[Amplitude] FCP"]=Wi(e)}),Ui(function(e){s["[Amplitude] INP"]=Wi(e)}),((e,t={})=>{Ei(vi(()=>{let r,n=di("CLS",0);const i=fi(t,gi),o=e=>{for(const t of e)i.h(t);i.i>n.value&&(n.value=i.i,n.entries=i.o,r())},s=mi("layout-shift",o);s&&(r=li(e,n,Oi,t.reportAllChanges),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(o(s.takeRecords()),r(!0))}),ai(()=>{i.i=0,n=di("CLS",0),r=li(e,n,Oi,t.reportAllChanges),ui(()=>r())}),setTimeout(r))}))})(function(e){s["[Amplitude] CLS"]=Wi(e)}),((e,t={})=>{let r=di("TTFB"),n=li(e,r,zi,t.reportAllChanges);Vi(()=>{const i=ci();i&&(r.value=Math.max(i.responseStart-hi(),0),r.entries=[i],n(!0),ai(()=>{r=di("TTFB",0),n=li(e,r,zi,t.reportAllChanges),n(!0)}))})})(function(e){s["[Amplitude] TTFB"]=Wi(e)}),e=function(){"hidden"===r.visibilityState&&e&&(i.track("[Amplitude] Web Vitals",s),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e)),[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(t){return e&&(null==r||r.removeEventListener("visibilitychange",e)),[2]})})}}},Ji=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(Zi(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=Ji(o||"")!==Ji(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},Zi=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})},Hi=function(){function e(e,t){var r,n,i;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=_e(t.apiKey,"MKTG"),this.webExpStorageKey=_e(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=A,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||Se(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(){var e;return l(this,function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return(e=t.sent())?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||(new wt).parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,r,n,i,s=(t=this.currentCampaign,r=this.options,n=o(o({},A),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 N),V(i));return e&&(s.event_id=e),s},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),$i="AMP_CURRENT_PAGE",Xi="AMP_PREVIOUS_PAGE",Qi="AMP_URL_INFO";!function(e){e.Direct="direct",e.Internal="internal",e.External="external"}(Ki||(Ki={}));var eo=new Set([i.IDENTIFY,i.GROUP_IDENTIFY,i.REVENUE]),to=function(){var e=U(),t=void 0,r=!1,n=void 0,i=!1,s=!1,u=function(e){var t="undefined"!=typeof location&&location.hostname||"",r=e?function(e){var t;try{var r=Oe(e,n);t=new URL(r).hostname}catch(e){null==n||n.error("Could not parse URL: ",e)}return t}(e):void 0;switch(r){case void 0:return Ki.Direct;case t:return Ki.Internal;default:return Ki.External}},h=function(){a(void 0,void 0,void 0,function(){var e,n,i,o,s;return l(this,function(a){switch(a.label){case 0:return t&&r?[4,t.get(Qi)]:[3,3];case 1:return e=a.sent(),n=Oe("undefined"!=typeof location&&location.href||""),i=(null==e?void 0:e[$i])||"",o=void 0,o=n===i?(null==e?void 0:e[Xi])||"":i||document.referrer||"",[4,t.set(Qi,(s={},s[$i]=n,s[Xi]=o,s))];case 2:a.sent(),a.label=3;case 3:return[2]}})})},d={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(o,u){return a(void 0,void 0,void 0,function(){return l(this,function(a){switch(a.label){case 0:return(n=o.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),s=!0,e?[4,(t=new De(e.sessionStorage)).isEnabled()]:[3,2];case 1:r=a.sent(),e.addEventListener("popstate",h),i||(e.history.pushState=new Proxy(e.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&&h()}}),e.history.replaceState=new Proxy(e.history.replaceState,{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&&h()}}),i=!0),a.label=2;case 2:return[2]}})})},execute:function(e){return a(void 0,void 0,void 0,function(){var n,i,s,a,c;return l(this,function(l){switch(l.label){case 0:return n=Oe("undefined"!=typeof location&&location.href||""),t&&r?[4,t.get(Qi)]:[3,5];case 1:return(null==(i=l.sent())?void 0:i[$i])?[3,3]:[4,t.set(Qi,(c={},c[$i]=n,c[Xi]=document.referrer||"",c))];case 2:l.sent(),l.label=3;case 3:return[4,t.get(Qi)];case 4:if(s=l.sent(),a="",s&&(a=s[Xi]||""),eo.has(e.event_type))return[2,e];e.event_properties=o(o({},e.event_properties||{}),{"[Amplitude] Page Domain":ro(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":ro(e,"[Amplitude] Page Location",n),"[Amplitude] Page Path":ro(e,"[Amplitude] Page Path","undefined"!=typeof location&&Oe(location.pathname)||""),"[Amplitude] Page Title":ro(e,"[Amplitude] Page Title",Ot(Et)),"[Amplitude] Page URL":ro(e,"[Amplitude] Page URL",n.split("?")[0]),"[Amplitude] Previous Page Location":a,"[Amplitude] Previous Page Type":u(a)}),l.label=5;case 5:return[2,e]}})})},teardown:function(){return a(void 0,void 0,void 0,function(){return l(this,function(n){switch(n.label){case 0:return e&&(e.removeEventListener("popstate",h),s=!1),t&&r?[4,t.set(Qi,{})]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})}};return d};function ro(e,t,r){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?r:e.event_properties[t]}var no,io=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}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),q(this._init(o(o({},i),{userId:n,apiKey:e})))},t.prototype._init=function(t){var r,n,i,u,c;return a(this,void 0,void 0,function(){var a,h,d,p,f,g,m,v,y,b=this;return l(this,function(l){switch(l.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,jr(t.apiKey,t,this)]);case 1:return a=l.sent(),(null===(r=a.remoteConfig)||void 0===r?void 0:r.fetchRemoteConfig)?(h=new Ze(a.apiKey,a.loggerProvider,a.serverZone,null===(n=a.remoteConfig)||void 0===n?void 0:n.serverUrl),[4,new Promise(function(e){null==h||h.subscribe("configs.analyticsSDK.browserSDK","all",function(t,r,n){a.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t&&nn(t,a),e()})})]):[3,4];case 2:return l.sent(),[4,new Promise(function(e){null==h||h.subscribe("configs.diagnostics.browserSDK","all",function(t,r,n){if(a.loggerProvider.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(a.diagnosticsSampleRate=i);var o=t.enabled;"boolean"==typeof o&&(a.enableDiagnostics=o)}e()})})];case 3:l.sent(),l.label=4;case 4:return(d=new Ke(a.apiKey,a.loggerProvider,a.serverZone,{enabled:a.enableDiagnostics,sampleRate:a.diagnosticsSampleRate})).setTag("library","".concat(pr,"/").concat(dr)),[4,e.prototype._init.call(this,a)];case 5:return l.sent(),this.logBrowserOptions(a),this.config.diagnosticsClient=d,this.config.remoteConfigClient=h,er(this.config.defaultTracking)?(p=function(e){return er(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(p,this.config),[4,this.webAttribution.init()]):[3,7];case 6:l.sent(),l.label=7;case 7:return f=xe(),g=f.ampTimestamp?Number(f.ampTimestamp):void 0,m=!g||Date.now()<g,this.config.identify&&this.identify(this.config.identify),v=m&&!Number.isNaN(Number(f.ampSessionId))?Number(f.ampSessionId):void 0,this.setSessionId(null!==(c=null!==(u=null!==(i=t.sessionId)&&void 0!==i?i:v)&&void 0!==u?u:this.config.sessionId)&&void 0!==c?c:Date.now()),(y=be(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline?[3,9]:[4,this.add(en()).promise];case 8:l.sent(),l.label=9;case 9:return[4,this.add(new ae({diagnosticsClient:d})).promise];case 10:return l.sent(),[4,this.add(new fr).promise];case 11:return l.sent(),[4,this.add(new we).promise];case 12:return l.sent(),function(e){Qr||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."),Qr=!0)}(this.config),w=this.config.defaultTracking,Qt(w,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(Xr()).promise]):[3,14];case 13:l.sent(),l.label=14;case 14:return function(e){return Qt(e,"formInteractions")}(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Zr()).promise]):[3,16];case 15:l.sent(),l.label=16;case 16:return tr(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Kr(ur(this.config))).promise]):[3,18];case 17:l.sent(),l.label=18;case 18:return ir(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Vn(sr(this.config),{diagnosticsClient:d})).promise]):[3,20];case 19:l.sent(),l.label=20;case 20:return or(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(Zn(ar(this.config))).promise]):[3,22];case 21:l.sent(),l.label=22;case 22:return nr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(oi(lr(this.config))).promise]):[3,24];case 23:l.sent(),l.label=24;case 24:return function(e){return"boolean"==typeof e?e:"object"==typeof e&&!0===e.webVitals}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(Gi()).promise]):[3,26];case 25:l.sent(),l.label=26;case 26:return function(e){return Qt(e,"pageUrlEnrichment")}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(to()).promise]):[3,28];case 27:l.sent(),l.label=28;case 28:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 29:return l.sent(),y.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},r=t.time,n=s(t,["time"]),i="number"==typeof r?{time:r}:void 0;b.track(e.eventType,n,i)}),[2]}var w})})},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){be(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){be(t).identityStore.editIdentity().setDeviceId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(B()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var e,t;return{deviceId:null===(e=this.config)||void 0===e?void 0:e.deviceId,userId:null===(t=this.config)||void 0===t?void 0:t.userId,userProperties:this.userProperties}},t.prototype.getOptOut=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.optOut},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)),q(Promise.resolve());if(e===this.config.sessionId)return q(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,rr(this.config.defaultTracking)&&(n&&i&&r.push(this.track(Ar,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 rr(this.config.defaultTracking)&&r.push(this.track(Or,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,q(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=zr(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,r){if(hr(t)){var n=t._q;t._q=[],t=cr(new N,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(hr(n)){var o=n._q;n._q=[],n=cr(new N,o)}return e.prototype.groupIdentify.call(this,t,r,n,i)},t.prototype.revenue=function(t,r){if(hr(t)){var n=t._q;t._q=[],t=cr(new K,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,o;return l(this,function(s){return r=Date.now(),n=Se(this.config.sessionTimeout,this.config.lastEventTime),o=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===Or||t.event_type===Ar||t.session_id&&t.session_id!==this.getSessionId()||(n||o?(this.setSessionId(r),o&&this.config.loggerProvider.log("Created a new session for new campaign.")):n||this.trackCampaignEventIfNeeded()),t.event_type===i.IDENTIFY&&t.user_properties&&(this.userProperties=this.getOperationAppliedUserProperties(t.user_properties)),[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.prototype._setDiagnosticsSampleRate=function(e){e>1||e<0||this.config||(this._diagnosticsSampleRate=e)},t}(W),oo=Object.freeze({__proto__:null,get IdentifyOperation(){return n},get SpecialEventType(){return i},get RevenueProperty(){return L},get LogLevel(){return G},get ServerZone(){return ge},OfflineDisabled:null,DEFAULT_CSS_SELECTOR_ALLOWLIST:He,DEFAULT_DATA_ATTRIBUTE_PREFIX:$e,DEFAULT_ACTION_CLICK_ALLOWLIST:Xe}),so="[Amplitude]",ao="".concat(so," Session Replay ID"),lo=ge.US,uo={enabled:!0},co="".concat(so," Session Replay Debug"),ho="amp-mask";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision"}(no||(no={}));var po=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}(),fo="medium";var go=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 go(e,fo,r)}},mo=function(e,t){return function(r,n){return function(e,t,r){var n,i,o;if(void 0===t&&(t={defaultMaskLevel:fo}),r){if(r.closest("."+ho))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 go(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:fo,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},vo=function(e,t){return t||(e===ge.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===ge.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},yo=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},bo=function(e,t){var r,n;try{for(var i=u(t),o=i.next();!o.done;o=i.next()){var s=o.value,a=yo(s.selector);if(a.test(e))return e.replace(a,s.replacement)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},wo=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=U())?[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:""}]}})})},So=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},Co=function(){return{flushMaxRetries:2,logLevel:G.Warn,loggerProvider:new Y,transportProvider:new Je}},Io=function(e){function t(t,r){var n,i,s,a,l,u=this,c=Co();return(u=e.call(this,o(o({transportProvider:c.transportProvider,loggerProvider:new po(r.loggerProvider||c.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=c.flushMaxRetries?r.flushMaxRetries:c.flushMaxRetries,u.apiKey=t,u.sampleRate=r.sampleRate||0,u.serverZone=r.serverZone||lo,u.configServerUrl=r.configServerUrl,u.trackServerUrl=r.trackServerUrl,u.shouldInlineStylesheet=r.shouldInlineStylesheet,u.version=r.version,u.performanceConfig=r.performanceConfig||uo,u.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",u.applyBackgroundColorToBlockedElements=null!==(i=r.applyBackgroundColorToBlockedElements)&&void 0!==i&&i,u.enableUrlChangePolling=null!==(s=r.enableUrlChangePolling)&&void 0!==s&&s,u.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:1e3,u.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,r.privacyConfig&&(u.privacyConfig=r.privacyConfig),r.interactionConfig&&(u.interactionConfig=r.interactionConfig,u.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")}(u.interactionConfig.ugcFilterRules)),r.debugMode&&(u.debugMode=r.debugMode),r.experimental&&(u.experimental=r.experimental),r.omitElementTags&&(u.omitElementTags=r.omitElementTags),u}return r(t,e),t}(H),xo=(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))(xo||{}),ko=(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))(ko||{}),Eo=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,r;return a(this,void 0,void 0,function(){var n,i,s,a,h,d,p,f,g,m,v,y,b,w,S,C,I,x=this;return l(this,function(l){switch(l.label){case 0:(n=o({},this.localConfig)).optOut=this.localConfig.optOut,n.captureEnabled=!0,l.label=1;case 1:return l.trys.push([1,3,,4]),[4,new Promise(function(e,t){x.remoteConfigClient.subscribe("configs.sessionReplay","all",function(r,o){var s;if(x.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(o,":"),JSON.stringify(r,null,2)),r){var a=r,l=a.sr_sampling_config,u=a.sr_privacy_config,c=a.sr_targeting_config,h=null===(s=n.interactionConfig)||void 0===s?void 0:s.ugcFilterRules;n.interactionConfig=a.sr_interaction_config,n.interactionConfig&&h&&(n.interactionConfig.ugcFilterRules=h),n.loggingConfig=a.sr_logging_config,(l||u||c)&&(i={},l&&(i.sr_sampling_config=l),u&&(i.sr_privacy_config=u),c&&(i.sr_targeting_config=c)),e()}else t(new Error("No remote config received"))})})];case 2:return l.sent(),[3,4];case 3:return s=l.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",s),n.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:void 0}];case 4:if(!i)return[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:i}];if(a=i.sr_sampling_config,h=i.sr_privacy_config,d=i.sr_targeting_config,a&&Object.keys(a).length>0?(Object.prototype.hasOwnProperty.call(a,"capture_enabled")?n.captureEnabled=a.capture_enabled:n.captureEnabled=!1,Object.prototype.hasOwnProperty.call(a,"sample_rate")&&(n.sampleRate=a.sample_rate)):(n.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),h){p=null!==(e=n.privacyConfig)&&void 0!==e?e:{},f={defaultMaskLevel:null!==(r=null!==(t=h.defaultMaskLevel)&&void 0!==t?t:p.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},g=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},m=o(o({},g(p)),g(h));try{for(v=u(Object.entries(m)),y=v.next();!y.done;y=v.next())b=c(y.value,2),w=b[0],"mask"===(S=b[1])?f.maskSelector.push(w):"block"===S?f.blockSelector.push(w):"unmask"===S&&f.unmaskSelector.push(w)}catch(e){C={error:e}}finally{try{y&&!y.done&&(I=v.return)&&I.call(v)}finally{if(C)throw C.error}}n.privacyConfig=(k=f,E=this.localConfig.loggerProvider,O=document.createDocumentFragment(),A=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter(function(e){try{O.querySelector(e)}catch(t){return E.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0}),0!==e.length)return e},k.blockSelector=A(k.blockSelector),k.maskSelector=A(k.maskSelector),k.unmaskSelector=A(k.unmaskSelector),k)}return d&&Object.keys(d).length>0&&(n.targetingConfig=d),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:So(n)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:i}]}var k,E,O,A})})},e}(),Oo=function(e,t){return a(void 0,void 0,void 0,function(){var r,n;return l(this,function(i){return r=new Io(e,t),n=new Ze(e,r.loggerProvider,r.serverZone,t.configServerUrl),[2,new Eo(n,r)]})})},Ao=Uint8Array,Po=Uint16Array,To=Uint32Array,Ro=new Ao([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]),Mo=new Ao([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]),No=new Ao([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_o=function(e,t){for(var r=new Po(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new To(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]},Do=_o(Ro,2),Lo=Do[0],Fo=Do[1];Lo[28]=258,Fo[258]=28;for(var Uo=_o(Mo,0)[1],jo=new Po(32768),Bo=0;Bo<32768;++Bo){var zo=(43690&Bo)>>>1|(21845&Bo)<<1;zo=(61680&(zo=(52428&zo)>>>2|(13107&zo)<<2))>>>4|(3855&zo)<<4,jo[Bo]=((65280&zo)>>>8|(255&zo)<<8)>>>1}var Vo=function(e,t,r){for(var n=e.length,i=0,o=new Po(t);i<n;++i)++o[e[i]-1];var s,a=new Po(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new Po(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[jo[h]>>>l]=u}else for(s=new Po(n),i=0;i<n;++i)s[i]=jo[a[e[i]-1]++]>>>15-e[i];return s},qo=new Ao(288);for(Bo=0;Bo<144;++Bo)qo[Bo]=8;for(Bo=144;Bo<256;++Bo)qo[Bo]=9;for(Bo=256;Bo<280;++Bo)qo[Bo]=7;for(Bo=280;Bo<288;++Bo)qo[Bo]=8;var Wo=new Ao(32);for(Bo=0;Bo<32;++Bo)Wo[Bo]=5;var Ko=Vo(qo,9,0),Go=Vo(Wo,5,0),Jo=function(e){return(e/8|0)+(7&e&&1)},Yo=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof Po?Po:e instanceof To?To:Ao)(r-t);return n.set(e.subarray(t,r)),n},Zo=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},Ho=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},$o=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 Ao(0),0];if(1==i){var s=new Ao(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 Po(d+1),f=Xo(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 Ao(p),f]},Xo=function(e,t,r){return-1==e.s?Math.max(Xo(e.l,t,r+1),Xo(e.r,t,r+1)):t[e.s]=r},Qo=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Po(++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]},es=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},ts=function(e,t,r){var n=r.length,i=Jo(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)},rs=function(e,t,r,n,i,o,s,a,l,u,c){Zo(t,c++,r),++i[256];for(var h=$o(i,15),d=h[0],p=h[1],f=$o(o,15),g=f[0],m=f[1],v=Qo(d),y=v[0],b=v[1],w=Qo(g),S=w[0],C=w[1],I=new Po(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=$o(I,7),E=k[0],O=k[1],A=19;A>4&&!E[No[A-1]];--A);var P,T,R,M,N=u+5<<3,_=es(i,qo)+es(o,Wo)+s,D=es(i,d)+es(o,g)+s+14+3*A+es(I,E)+(2*I[16]+3*I[17]+7*I[18]);if(N<=_&&N<=D)return ts(t,c,e.subarray(l,l+u));if(Zo(t,c,1+(D<_)),c+=2,D<_){P=Vo(d,p,0),T=d,R=Vo(g,m,0),M=g;var L=Vo(E,O,0);Zo(t,c,b-257),Zo(t,c+5,C-1),Zo(t,c+10,A-4),c+=14;for(x=0;x<A;++x)Zo(t,c+3*x,E[No[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];Zo(t,c,L[B]),c+=E[B],B>15&&(Zo(t,c,j[x]>>>5&127),c+=j[x]>>>12)}}}else P=Ko,T=qo,R=Go,M=Wo;for(x=0;x<a;++x)if(n[x]>255){B=n[x]>>>18&31;Ho(t,c,P[B+257]),c+=T[B+257],B>7&&(Zo(t,c,n[x]>>>23&31),c+=Ro[B]);var z=31&n[x];Ho(t,c,R[z]),c+=M[z],z>3&&(Ho(t,c,n[x]>>>5&8191),c+=Mo[z])}else Ho(t,c,P[n[x]]),c+=T[n[x]];return Ho(t,c,P[256]),c+T[256]},ns=new To([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),is=function(e,t,r,n,i){return function(e,t,r,n,i,o){var s=e.length,a=new Ao(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=ts(l,u,e.subarray(c,h)):(l[c]=o,u=ts(l,u,e.subarray(c,s)))}else{for(var d=ns[t-1],p=d>>>13,f=8191&d,g=(1<<r)-1,m=new Po(32768),v=new Po(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 To(25e3),C=new Po(288),I=new Po(32),x=0,k=0,E=(c=0,0),O=0,A=0;c<s;++c){var P=w(c),T=32767&c,R=v[P];if(m[T]=R,v[P]=T,O<=c){var M=s-c;if((x>7e3||E>24576)&&M>423){u=rs(e,l,0,S,C,I,k,E,A,c-A,u),E=x=k=0,A=c;for(var N=0;N<286;++N)C[N]=0;for(N=0;N<30;++N)I[N]=0}var _=2,D=0,L=f,F=T-R&32767;if(M>2&&P==w(c-F))for(var U=Math.min(p,M)-1,j=Math.min(32767,c),B=Math.min(258,M);F<=j&&--L&&T!=R;){if(e[c+_]==e[c+_-F]){for(var z=0;z<B&&e[c+z]==e[c+z-F];++z);if(z>_){if(_=z,D=F,z>U)break;var V=Math.min(F,z-2),q=0;for(N=0;N<V;++N){var W=c-F+N+32768&32767,K=W-m[W]+32768&32767;K>q&&(q=K,R=W)}}}F+=(T=R)-(R=m[T])+32768&32767}if(D){S[E++]=268435456|Fo[_]<<18|Uo[D];var G=31&Fo[_],J=31&Uo[D];k+=Ro[G]+Mo[J],++C[257+G],++I[J],O=c+_,++x}else S[E++]=e[c],++C[e[c]]}}u=rs(e,l,o,S,C,I,k,E,A,c-A,u)}return Yo(a,0,n+Jo(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 os(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=is(e,t,2,4);return function(e,t){var r=t.level,n=0==r?0:r<6?1:9==r?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)}(n,t),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(n,n.length-4,r.d()),n}const ss=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}(os(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Ao(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 Ao(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 Yo(n,0,i)}(JSON.stringify(t))),!0)};var as=function(){function e(e,t,r,n){var i,o=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=ss(e);return JSON.stringify(t)},this.addCompressedEventToManager=function(e,t){o.eventsManager&&o.deviceId&&o.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:o.deviceId})},this.addCompressedEvent=function(e,t){if(o.worker)try{o.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?o.worker.postMessage(JSON.stringify({event:e,sessionId:t})):o.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{var r=o.compressEvent(e);o.addCompressedEventToManager(r,t)}},this.terminate=function(){var e;null===(e=o.worker)||void 0===e||e.terminate()};var s=U();if(this.canUseIdleCallback=s&&"requestIdleCallback"in s,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(i=t.performanceConfig)||void 0===i?void 0:i.timeout)||2e3,n){t.loggerProvider.log("[Experimental] Enabling web worker for compression");var a=new Worker(URL.createObjectURL(new Blob([n],{type:"application/javascript"})));a.onerror=function(e){t.loggerProvider.error(e)},a.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;o.addCompressedEventToManager(r,n)},this.worker=a}}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}(),ls="Failed to store session replay events in IndexedDB",us="1.29.8",cs=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=U(),s=(null==y?void 0:y.location)?y.location.href:"",a=us,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(vo(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 Ge).buildStatus(e)){case _.Success:this.handleSuccessResponse(t);break;case _.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 hs=(e,t)=>t.some(t=>e instanceof t);let ds,ps;const fs=new WeakMap,gs=new WeakMap,ms=new WeakMap;let vs={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return fs.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Ss(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function ys(e){vs=e(vs)}function bs(e){return(ps||(ps=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Cs(this),t),Ss(this.request)}:function(...t){return Ss(e.apply(Cs(this),t))}}function ws(e){return"function"==typeof e?bs(e):(e instanceof IDBTransaction&&function(e){if(fs.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)});fs.set(e,t)}(e),hs(e,ds||(ds=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,vs):e)}function Ss(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(Ss(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",o)});return ms.set(t,e),t}(e);if(gs.has(e))return gs.get(e);const t=ws(e);return t!==e&&(gs.set(e,t),ms.set(t,e)),t}const Cs=e=>ms.get(e);function Is(e,t,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=Ss(s);return n&&s.addEventListener("upgradeneeded",e=>{n(Ss(s.result),e.oldVersion,e.newVersion,Ss(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 xs=["get","getKey","getAll","getAllKeys","count"],ks=["put","add","delete","clear"],Es=new Map;function Os(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Es.get(t))return Es.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,i=ks.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!xs.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 Es.set(t,o),o}ys(e=>({...e,get:(t,r,n)=>Os(t,r)||e.get(t,r,n),has:(t,r)=>!!Os(t,r)||e.has(t,r)}));const As=["continue","continuePrimaryKey","advance"],Ps={},Ts=new WeakMap,Rs=new WeakMap,Ms={get(e,t){if(!As.includes(t))return e[t];let r=Ps[t];return r||(r=Ps[t]=function(...e){Ts.set(this,Rs.get(this)[t](...e))}),r}};async function*Ns(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,Ms);for(Rs.set(r,t),ms.set(r,Cs(t));t;)yield r,t=await(Ts.get(r)||t.continue()),Ts.delete(r)}function _s(e,t){return t===Symbol.asyncIterator&&hs(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&hs(e,[IDBIndex,IDBObjectStore])}ys(e=>({...e,get:(t,r,n)=>_s(t,r)?Ns:e.get(t,r,n),has:(t,r)=>_s(t,r)||e.has(t,r)}));var Ds,Ls=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=i.getStringSize(t);return i.getEventsArraySize(e)+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.prototype.getStringSize=function(e){return e.length},e.prototype.getEventsArraySize=function(e){var t,r,n=0;try{for(var i=u(e),o=i.next();!o.done;o=i.next()){var s=o.value;n+=this.getStringSize(s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n+(2+Math.max(0,e.length-1)+2*e.length)},e}();!function(e){e.RECORDING="recording",e.SENT="sent"}(Ds||(Ds={}));var Fs,Us,js,Bs="sessionCurrentSequence",zs="sequencesToSend",Vs=function(){var e=U();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)}})},qs=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]}})})},Ws=function(e){var t,r;return e.objectStoreNames.contains(Bs)||(r=e.createObjectStore(Bs,{keyPath:"sessionId"})),e.objectStoreNames.contains(zs)||(t=e.createObjectStore(zs,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},Ks=function(e){return a(void 0,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return[4,Is(e,1,{upgrade:Ws})];case 1:return[2,t.sent()]}})})},Gs=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(ls,": ").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(Bs,e)];case 1:return(t=i.sent())?[4,this.db.put(zs,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=i.sent(),[4,this.db.put(Bs,{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(ls,": ").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(Bs,"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(ls,": ").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(zs,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(ls,": ").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(zs,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(ls,": ").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(g){switch(g.label){case 0:return g.trys.push([0,6,,7]),[4,Vs()];case 1:if(!(t=g.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!==Ds.SENT&&n.push(i.storeSendingEvents(e,u.events))}),[4,qs(n)];case 1:return o.sent(),[2]}})})},n="".concat(f,"_").concat(this.apiKey.substring(0,10)),g.label=2;case 2:return g.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!==Ds.SENT&&s.push(a.storeSendingEvents(n,l[t].events))})}}),[4,qs(s)]):[3,2];case 1:l.sent(),l.label=2;case 2:return t(),[2]}})})}}),[4,o];case 3:return g.sent(),(s=U())&&s.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return u=g.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=g.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,Ks(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(ls,": ").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}(Ls),Js=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}(Ls),Ys=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 cs(o(o({},t),{loggerProvider:t.loggerProvider,payloadBatcher:u})),d=function(){return new Js({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,Gs.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&&wo().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}]}})})},Zs=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}();function Hs(e,t){if(js=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};Fs=o(o({},r),t),Us=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Fs.root,r);var n=$s(e,"all",function(){return $s(e,"two",function(){return $s(e,"one",function(){return $s(e,"none")})})});if(n){var i=aa(la(n,e));return i.length>0&&(n=i[0]),Qs(n)}throw new Error("Selector was not found.")}function $s(e,t,r){for(var n=null,i=[],o=e,s=0,a=function(){var e,a,l=(new Date).getTime()-js.getTime();if(void 0!==Fs.timeoutMs&&l>Fs.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var d=ia(function(e){var t=e.getAttribute("id");if(t&&Fs.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||ia.apply(void 0,h([],c(function(e){var t=Array.from(e.attributes).filter(function(e){return Fs.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))||ia.apply(void 0,h([],c(function(e){var t=Array.from(e.classList).filter(Fs.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(o)),!1))||ia(function(e){var t=e.tagName.toLowerCase();if(Fs.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(na).map(function(e){return ra(e,p)})));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(na).map(function(e){return ra(e,p)})));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&na(f)&&(d=[ra(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[ra(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>=Fs.seedMinLength&&(n=Xs(i,r)))return"break";o=o.parentElement,s++};o;){if("break"===a())break}return n||(n=Xs(i,r)),!n&&r?r():n}function Xs(e,t){var r,n,i=aa(sa(e));if(i.length>Fs.threshold)return t?t():null;try{for(var o=u(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(ta(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 Qs(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 ea(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function ta(e){var t=Qs(e);switch(Us.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 ra(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function na(e){return"html"!==e.name&&!e.name.startsWith("#")}function ia(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(oa);return r.length>0?r:null}function oa(e){return null!=e}function sa(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(sa(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 aa(e){return h([],c(e),!1).sort(function(e,t){return ea(e)-ea(t)})}function la(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>Fs.optimizedMinLength))return[3,5];n=1,s.label=1;case 1:return n<e.length-1?r.counter>Fs.maxNumberOfTries?[2]:(r.counter+=1,(i=h([],c(e),!1)).splice(n,1),o=Qs(i),r.visited.has(o)?[2]:ta(i)&&function(e,t){return Us.querySelector(Qs(e))===t}(i,t)?[4,i]:[3,4]):[3,5];case 2:return s.sent(),r.visited.set(o,!0),[5,u(la(i,t,r))];case 3:s.sent(),s.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var ua=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}},ca=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)}},ha=function(e,t){var r=this;this.createHook=function(e){var t=e.eventsManager,n=e.sessionId,i=e.deviceIdFn,o=e.mirror,s=e.ugcFilterRules;return function(e){if(e.type===ko.Click){var a=U();if(a){var l=a.location,u=a.innerHeight,c=a.innerWidth;if(l){var h=e.x,d=e.y;if(void 0!==h&&void 0!==d){var p,f=o.getNode(e.id);if(f)try{p=Hs(f)}catch(e){r.logger.debug("error resolving selector from finder")}var g=bo(l.href,s),m={x:h+r.scrollWatcher.currentScrollX,y:d+r.scrollWatcher.currentScrollY,selector:p,viewportHeight:u,viewportWidth:c,pageUrl:g,timestamp:Date.now(),type:"click"},v=i();v&&t.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(m)},deviceId:v})}}}}}},this.logger=e,this.scrollWatcher=t};function da(){var e=U();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function pa(){var e=U();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}var fa=function(){function e(e,t){var r=U();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=vo(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}(),ga=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=U();s&&o&&r.transport.send(o,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:da(),viewportWidth:pa(),pageUrl:bo(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._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=pa(),this._maxScrollHeight=da(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new fa(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}),Object.defineProperty(e.prototype,"currentScrollX",{get:function(){return this._currentScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollY",{get:function(){return this._currentScrollY},enumerable:!1,configurable:!0}),e.prototype.update=function(e){var t=Date.now();if(this._currentScrollX=e.x,this._currentScrollY=e.y,e.x>this._maxScrollX){var r=pa();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=da();this._maxScrollY=e.y;var o=e.y+i;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),ma=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))},va=function(){var e=this;this.dbs={},this.createStore=function(t){return a(e,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,Is(t,1,{upgrade:function(e){e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return a(e,void 0,void 0,function(){var e,r;return l(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.getTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,i=t.sessionId;return a(e,void 0,void 0,function(){var e,t,o,s;return l(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(i),[4,e.get("sessionTargetingMatch",t)];case 2:return[2,null==(o=a.sent())?void 0:o.targetingMatch];case 3:return s=a.sent(),r.warn("Failed to get targeting match for session id ".concat(i,": ").concat(s)),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,i=t.sessionId,o=t.targetingMatch;return a(e,void 0,void 0,function(){var e,t,s;return l(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(i),[4,e.put("sessionTargetingMatch",{targetingMatch:o,sessionId:t,lastUpdated:Date.now()})];case 2:return[2,a.sent()];case 3:return s=a.sent(),r.warn("Failed to store targeting match for session id ".concat(i,": ").concat(s)),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var r=t.loggerProvider,n=t.apiKey,i=t.currentSessionId;return a(e,void 0,void 0,function(){var e,t,o,s,a,u,c,h;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,8,,9]),[4,this.openOrCreateDB(n)];case 1:return e=l.sent(),t=String(i),[4,(o=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:s=l.sent(),a=0,l.label=3;case 3:return a<s.length?(u=s[a],c=Date.now()-u.lastUpdated,u.sessionId!==t&&c>1728e5?[4,o.store.delete(u.sessionId)]:[3,5]):[3,6];case 4:l.sent(),l.label=5;case 5:return a++,[3,3];case 6:return[4,o.done];case 7:return l.sent(),[3,9];case 8:return h=l.sent(),r.warn("Failed to clear old targeting matches for sessions: ".concat(h)),[3,9];case 9:return[2]}})})}},ya=new va,ba=function(e){var t=e.sessionId,r=e.targetingConfig,n=e.loggerProvider,i=e.apiKey,s=e.targetingParams;return a(void 0,void 0,void 0,function(){var e,a,u,c;return l(this,function(l){switch(l.label){case 0:return[4,ya.clearStoreOfOldSessions({loggerProvider:n,apiKey:i,currentSessionId:t})];case 1:return l.sent(),[4,ya.getTargetingMatchForSession({loggerProvider:n,apiKey:i,sessionId:t})];case 2:if(!0===l.sent())return[2,!0];e=!0,l.label=3;case 3:return l.trys.push([3,6,,7]),[4,Promise.resolve().then(function(){return gh})];case 4:return[4,(0,l.sent().evaluateTargeting)(o(o({},s),{flag:r,sessionId:t,apiKey:i,loggerProvider:n}))];case 5:return(a=l.sent())&&a.sr_targeting_config&&(e="on"===a.sr_targeting_config.key),ya.storeTargetingMatchForSession({loggerProvider:n,apiKey:i,sessionId:t,targetingMatch:e}),[3,7];case 6:return u=l.sent(),c=u,n.warn(c.message),[3,7];case 7:return[2,e]}})})};function wa(e){return void 0===e&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,r,n){var i,s,a,l=o(o({},e),n),u=l.ugcFilterRules||[],c=null!==(i=l.enablePolling)&&void 0!==i&&i,h=null!==(s=l.pollingInterval)&&void 0!==s?s:1e3,d=null!==(a=l.captureDocumentTitle)&&void 0!==a&&a;if(!r)return function(){};var p=void 0,f="__amplitude_url_tracking_patched__",g="__amplitude_url_tracking_reset__",m=function(){return r.location&&r.location.href||""},v=function(){var e=m();if(void 0===p||e!==p){p=e;var n=function(){var e=r.innerHeight,t=r.innerWidth,n=r.document,i=m(),o="";return d&&(o=(null==n?void 0:n.title)||""),{href:u.length>0?bo(i,u):i,title:o,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();t(n)}},y=function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=e.apply(this,t);return r[g]||v(),i};return t[f]=!0,t},b=function(){v()};if(c){var w=r.setInterval(function(){v()},h);return v(),function(){w&&r.clearInterval(w)}}if(r.history){var S=r.history.pushState.bind(r.history),C=r.history.replaceState.bind(r.history);return r.history.pushState[f]||(r.history.pushState=y(S),r.history.replaceState=y(C)),r.addEventListener("popstate",v),r.addEventListener("hashchange",b),v(),function(){r[g]=!0,r.removeEventListener("popstate",v),r.removeEventListener("hashchange",b)}}return r.addEventListener("hashchange",b),v(),function(){r.removeEventListener("hashchange",b)}},options:e}}wa();var Sa,Ca,Ia,xa=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,this.teardownEventListeners=function(t){var r=U();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.evaluateTargetingAndCapture=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),a(e,void 0,void 0,function(){var e,o;return l(this,function(s){switch(s.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig){if(!r)return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.")}return this.lastTargetingParams=t,!this.config.targetingConfig||this.sessionTargetingMatch?[3,2]:((e=t.event)&&Object.values(i).includes(e.event_type)&&(e=void 0),o=this,[4,ba({sessionId:this.identifiers.sessionId,targetingConfig:this.config.targetingConfig,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:e}})]);case 1:o.sessionTargetingMatch=s.sent(),this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:e,targetingParams:t},null,2)),s.label=2;case 2:return r?(this.initialize(!0),[3,5]):[3,3];case 3:return!n&&this.recordCancelCallback?[3,5]:(this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),[4,this.recordEvents()]);case 4:s.sent(),s.label=5;case 5:return[2]}})})},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!==no.METADATA?(e={config:So(i),version:us},n?[4,wo()]:[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 po(new Y)}return e.prototype.init=function(e,t){return q(this._init(e,t))},e.prototype._init=function(e,t){var r,n,i,o,s,u,d;return a(this,void 0,void 0,function(){var a,p,f,g,m,v,y,b,w,S,C,I,x,k,E,O,A;return l(this,function(l){switch(l.label){case 0:return this.loggerProvider=new po(t.loggerProvider||new Y),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new ma({sessionId:t.sessionId,deviceId:t.deviceId}),a=this,[4,Oo(e,t)];case 1:return a.joinedConfigGenerator=l.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:p=l.sent(),f=p.joinedConfig,g=p.localConfig,m=p.remoteConfig,this.config=f,this.setMetadata(t.sessionId,f,g,m,null===(r=t.version)||void 0===r?void 0:r.version,us,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)&&(v=ga.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[v.send(this.getDeviceId.bind(this)).bind(v)],this.scrollHook=v.hook.bind(v),this.clickHandler=new ha(this.loggerProvider,v)),y=[],"idb"!==(b=this.config.storeType)||(null===(o=U())||void 0===o?void 0:o.indexedDB)||(b="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(b," for event storage.")),l.label=3;case 3:return l.trys.push([3,5,,6]),[4,Ys({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:b})];case 4:return w=l.sent(),y.push({name:"replay",manager:w}),[3,6];case 5:return S=l.sent(),k=S,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(k.toString())),[3,6];case 6:if(!(null===(s=this.config.interactionConfig)||void 0===s?void 0:s.enabled))return[3,10];C=this.config.interactionConfig.batch?ca:ua,l.label=7;case 7:return l.trys.push([7,9,,10]),[4,Ys({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!==(u=this.config.interactionConfig.trackEveryNms)&&void 0!==u?u:3e4,maxInterval:6e4,payloadBatcher:C,storeType:b})];case 8:return I=l.sent(),y.push({name:"interaction",manager:I}),[3,10];case 9:return x=l.sent(),k=x,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(k.toString())),[3,10];case 10:return this.eventsManager=new(Zs.bind.apply(Zs,h([void 0],c(y),!1))),this.eventCompressor&&this.eventCompressor.terminate(),E=void 0,O=U(),(null===(d=this.config.experimental)||void 0===d?void 0:d.useWebWorker)&&O&&O.Worker?[4,Promise.resolve().then(function(){return mh})]:[3,12];case 11:A=l.sent().compressionScript,E=A,l.label=12;case 12:return this.eventCompressor=new as(this.eventsManager,this.config,this.getDeviceId(),E),[4,this.initializeNetworkObservers()];case 13:return l.sent(),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:t.userProperties},!0)];case 14:return l.sent(),[2]}})})},e.prototype.setSessionId=function(e,t){return q(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n;return a(this,void 0,void 0,function(){var i,o,s;return l(this,function(a){switch(a.label){case 0:return this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(i=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(i),o=t||this.getDeviceId(),this.identifiers=new ma({sessionId:e,deviceId:o}),this.joinedConfigGenerator&&i?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2];case 1:s=a.sent().joinedConfig,this.config=s,a.label=2;case 2:return(null===(n=this.config)||void 0===n?void 0:n.targetingConfig)?[4,this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties},!1,!0)]:[3,4];case 3:return a.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:a.sent(),a.label=6;case 6:return[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={})[ao]=r.sessionReplayId?r.sessionReplayId:null,i=e,t.debugMode&&(i[co]=JSON.stringify({appHash:Ae(t.apiKey).toString()}))),this.addCustomRRWebEvent(no.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=be(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=!1,i="",o=!1;this.config.targetingConfig?this.sessionTargetingMatch?(i="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(i),n=!0,o=!0):(i="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(i),n=!1,o=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,r=Ae(e.toString()),31*Math.abs(r)%1e6/1e6<t)?(n=!0,o=!0):(i="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(i),n=!1,o=!1);return this.lastShouldRecordDecision!==n&&this.config.targetingConfig&&(this.addCustomRRWebEvent(no.TARGETING_DECISION,{message:i,sessionId:this.identifiers.sessionId,matched:o,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=n),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,r,n,i,o,s;return a(this,void 0,void 0,function(){var a,u,c,h;return l(this,function(l){switch(l.label){case 0:a=[];try{u=wa({ugcFilterRules:(null===(r=null===(t=this.config)||void 0===t?void 0:t.interactionConfig)||void 0===r?void 0:r.ugcFilterRules)||[],enablePolling:(null===(n=this.config)||void 0===n?void 0:n.enableUrlChangePolling)||!1,pollingInterval:null===(i=this.config)||void 0===i?void 0:i.urlChangePollingInterval,captureDocumentTitle:null===(o=this.config)||void 0===o?void 0:o.captureDocumentTitle}),a.push(u)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null===(s=null==e?void 0:e.console)||void 0===s?void 0:s.enabled))return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return Xb})];case 2:return c=l.sent().getRecordConsolePlugin,a.push(c({level:e.console.levels})),[3,4];case 3:return h=l.sent(),this.loggerProvider.warn("Failed to load console plugin:",h),[3,4];case 4:return[2,a.length>0?a: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 dT})];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,i,o,s;return void 0===e&&(e=!0),a(this,void 0,void 0,function(){var a,u,c,h,d,p,f,g,m,v,y,b,w,S=this;return l(this,function(l){switch(l.label){case 0:return a=this.config,u=this.getShouldRecord(),c=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,u&&c&&a?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(h=l.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:l.sent(),null===(r=this.networkObservers)||void 0===r||r.start(function(e){S.addCustomRRWebEvent(no.FETCH_REQUEST,e)}),d=a.privacyConfig,p=a.interactionConfig,f=a.loggingConfig,g=(null==p?void 0:p.enabled)?{mouseInteraction:this.eventsManager&&(null===(n=this.clickHandler)||void 0===n?void 0:n.createHook({eventsManager:this.eventsManager,sessionId:c,deviceIdFn:this.getDeviceId.bind(this),mirror:h.mirror,ugcFilterRules:null!==(i=p.ugcFilterRules)&&void 0!==i?i:[]})),scroll:this.scrollHook}:{},m=(null==p?void 0:p.enabled)&&p.ugcFilterRules?p.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(c,".")),l.label=3;case 3:return l.trys.push([3,5,,6]),v=this,y=h,w={emit:function(e){if(S.shouldOptOut())return S.loggerProvider.log("Opting session ".concat(c," out of recording due to optOut config.")),S.stopRecordingEvents(),void S.sendEvents();e.type===xo.Meta&&(e.data.href=bo(e.data.href,m)),S.eventCompressor&&S.eventCompressor.enqueueEvent(e,c)},inlineStylesheet:a.shouldInlineStylesheet,hooks:g,maskAllInputs:!0,maskTextClass:ho,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:a.applyBackgroundColorToBlockedElements,maskInputFn:mo("input",d),maskTextFn:mo("text",d),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:null===(o=a.omitElementTags)||void 0===o?void 0:o.script,comment:null===(s=a.omitElementTags)||void 0===s?void 0:s.comment},errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return S.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(f)];case 4:return v.recordCancelCallback=y.apply(void 0,[(w.plugins=l.sent(),w)]),this.addCustomRRWebEvent(no.DEBUG_INFO),e&&this.addCustomRRWebEvent(no.METADATA,this.metadata),[3,6];case 5:return b=l.sent(),this.loggerProvider.warn("Failed to initialize session replay:",b),[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())?Ae(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 fT})];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}(),ka=function(e){return function(){var t=e.config||Co();return{logger:t.loggerProvider,logLevel:t.logLevel}}},Ea=function(){var e=new xa;return{init:oe(e.init.bind(e),"init",ka(e)),evaluateTargetingAndCapture:oe(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",ka(e)),setSessionId:oe(e.setSessionId.bind(e),"setSessionId",ka(e)),getSessionId:oe(e.getSessionId.bind(e),"getSessionId",ka(e)),getSessionReplayProperties:oe(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",ka(e)),flush:oe(e.flush.bind(e),"flush",ka(e)),shutdown:oe(e.shutdown.bind(e),"shutdown",ka(e))}}(),Oa=Ea.init,Aa=Ea.setSessionId,Pa=Ea.getSessionId,Ta=Ea.getSessionReplayProperties,Ra=Ea.flush,Ma=Ea.shutdown,Na=Ea.evaluateTargetingAndCapture;!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"}(Sa||(Sa={})),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"}(Ca||(Ca={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(Ia||(Ia={}));var _a=[Sa.SET,Sa.SET_ONCE,Sa.ADD,Sa.APPEND,Sa.PREPEND,Sa.POSTINSERT],Da="1.23.7-feat-zoning.0",La=function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:Ra,getSessionId:Pa,getSessionReplayProperties:Ta,init:Oa,setSessionId:Aa,shutdown:Ma,evaluateTargetingAndCapture:Na},this.options=o({forceSessionTracking:!1},t),this.srInitOptions=this.options}return e.prototype.setup=function(e,t){var r,n,i,s,u,c;return a(this,void 0,void 0,function(){var t,a,h;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),null==e||e.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(Da,".")),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})),t=(d=this.config.instanceName,void 0===d&&(d="$default_instance"),ye.getInstance(d)).identityStore,a=t.getIdentity().userProperties,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||(null===(n=this.config.remoteConfig)||void 0===n?void 0:n.serverUrl),trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:null===(i=this.options.privacyConfig)||void 0===i?void 0:i.blockSelector,maskSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.maskSelector,unmaskSelector:null===(u=this.options.privacyConfig)||void 0===u?void 0:u.unmaskSelector,defaultMaskLevel:null===(c=this.options.privacyConfig)||void 0===c?void 0:c.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:Da},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,experimental:this.options.experimental,userProperties:a,omitElementTags:this.options.omitElementTags,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval},[4,this.sessionReplay.init(e.apiKey,this.srInitOptions).promise];case 1:return l.sent(),[3,3];case 2:return h=l.sent(),null==e||e.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(h.message)),[3,3];case 3:return[2]}var d})})},e.prototype.onSessionIdChanged=function(e){var t;return a(this,void 0,void 0,function(){return l(this,function(r){switch(r.label){case 0:return null===(t=this.config)||void 0===t||t.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 r.sent(),[2]}})})},e.prototype.onOptOutChanged=function(e){var t;return a(this,void 0,void 0,function(){return l(this,function(r){switch(r.label){case 0:return null===(t=this.config)||void 0===t||t.loggerProvider.debug("optOut is changed to ".concat(String(e),", calling ").concat(e?"sessionReplay.shutdown()":"sessionReplay.init()",".")),e?(this.sessionReplay.shutdown(),[3,4]):[3,1];case 1:return null!=this.config?[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise]:[3,3];case 2:r.sent(),r.label=3;case 3:r.label=4;case 4:return[2]}})})},e.prototype.execute=function(e){var t,r;return a(this,void 0,void 0,function(){var n,s,a,u;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,9,,10]),this.options.customSessionId?(n=this.options.customSessionId(e))?n===this.sessionReplay.getSessionId()?[3,2]:[4,this.sessionReplay.setSessionId(n).promise]:[3,3]:[3,4];case 1:l.sent(),l.label=2;case 2:a=this.sessionReplay.getSessionReplayProperties(),e.event_properties=o(o({},e.event_properties),a),l.label=3;case 3:return[3,8];case 4:return(n=null===(t=this.config)||void 0===t?void 0:t.sessionId)&&n!==this.sessionReplay.getSessionId()?[4,this.sessionReplay.setSessionId(n).promise]:[3,6];case 5:l.sent(),l.label=6;case 6:return n&&n===e.session_id?(s=void 0,e.event_type===i.IDENTIFY&&(s=function(e){if(e.user_properties){var t={};return Object.keys(e.user_properties).forEach(function(r){if(_a.includes(r)){var n=e.user_properties&&e.user_properties[r];t=o(o({},t),n)}}),t}}(e)),[4,this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:s})]):[3,8];case 7:l.sent(),a=this.sessionReplay.getSessionReplayProperties(),e.event_properties=o(o({},e.event_properties),a),l.label=8;case 8:return[2,Promise.resolve(e)];case 9:return u=l.sent(),null===(r=this.config)||void 0===r||r.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(u.message)),[2,Promise.resolve(e)];case 10: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={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 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 qa(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 Wa(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",Ja="contains",Ya="does not contain",Za="less",Ha="less or equal",$a="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 null==e?void 0:e}},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(null==r)return this.matchNull(t.op,t.values);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)},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 Ja:case Za:case Ha:case $a: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 Ja:return this.matchesContains(e,r);case Ya:return!this.matchesContains(e,r);case Za:case Ha:case $a: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 Za:case Qa:return e<r;case Ha:case el:return e<=r;case $a: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 Za:case Qa:return n<0;case Ha:case el:return n<=0;case $a: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&&Wa([],qa(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,Wa([],qa(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 Buffer,kl=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),El=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Ol=(e=>{let t={};return e.forEach((e,r)=>t[e]=r),t})(El),Al=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Pl=String.fromCharCode.bind(String),Tl=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_")),Rl=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Ml=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+=El[t>>18&63]+El[t>>12&63]+El[t>>6&63]+El[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},Nl="function"==typeof btoa?e=>btoa(e):xl?e=>Buffer.from(e,"binary").toString("base64"):Ml,_l=xl?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(Pl.apply(null,e.subarray(r,r+4096)));return Nl(t.join(""))},Dl=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Pl(192|t>>>6)+Pl(128|63&t):Pl(224|t>>>12&15)+Pl(128|t>>>6&63)+Pl(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Pl(240|t>>>18&7)+Pl(128|t>>>12&63)+Pl(128|t>>>6&63)+Pl(128|63&t)},Ll=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Fl=e=>e.replace(Ll,Dl),Ul=xl?e=>Buffer.from(e,"utf8").toString("base64"):kl?e=>_l(kl.encode(e)):e=>Nl(Fl(e)),jl=(e,t=!1)=>t?Tl(Ul(e)):Ul(e),Bl=e=>jl(e,!0),zl=e=>{if(e=e.replace(/\s+/g,""),!Al.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,n,i="";for(let o=0;o<e.length;)t=Ol[e.charAt(o++)]<<18|Ol[e.charAt(o++)]<<12|(r=Ol[e.charAt(o++)])<<6|(n=Ol[e.charAt(o++)]),i+=64===r?Pl(t>>16&255):64===n?Pl(t>>16&255,t>>8&255):Pl(t>>16&255,t>>8&255,255&t);return i},Vl=Bl;var ql=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),Wl=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),Kl=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=Vl(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"]=Vl(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 ql(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}})})},e}(),Gl=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"]=Vl(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}(),Jl="undefined"!=typeof globalThis?globalThis:global||self,Yl=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},Zl=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=Jl.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(Jl.clearInterval(this.poller),this.poller=void 0)},e}(),Hl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},$l={},Xl={get exports(){return $l},set exports(e){$l=e}};!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",P="LG",T="Microsoft",R="Motorola",M="Opera",N="Samsung",_="Sharp",D="Sony",L="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)},q=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}},W=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,M+" Mini"]],[/\bopr\/([\w\.]+)/i],[d,[u,M]],[/(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,M+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[u,M+" 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,W,{"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,N],[c,m]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[h,N],[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,L],[c,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[h,L],[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,R],[c,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[h,R],[c,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[h,P],[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,P],[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,D],[c,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[h,D],[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,_],[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,T],[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,T],[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,D],[c,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[h,T],[c,f]],[/smart-tv.+(samsung)/i],[h,[c,v]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[h,N],[c,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,P],[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,_],[c,v]],[/(bravia[\w ]+)( bui|\))/i],[l,[h,D],[c,v]],[/(mitv-\w{5}) bui/i],[l,[h,L],[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,W,K]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[d,W,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]]},J=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof J))return new J(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,q.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,q.call(e,i,f.cpu),e},this.getDevice=function(){var e={};return e[h]=n,e[l]=n,e[c]=n,q.call(e,i,f.device),e},this.getEngine=function(){var e={};return e[u]=n,e[d]=n,q.call(e,i,f.engine),e},this.getOS=function(){var e={};return e[u]=n,e[d]=n,q.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};J.VERSION="0.7.33",J.BROWSER=j([u,d,"major"]),J.CPU=j([p]),J.DEVICE=j([l,h,c,f,g,v,m,y,b]),J.ENGINE=J.OS=j([u,d]),e.exports&&(t=e.exports=J),t.UAParser=J;var Y=typeof r!==o&&(r.jQuery||r.Zepto);if(Y&&!Y.ua){var Z=new J;Y.ua=Z.getResult(),Y.ua.get=function(){return Z.getUA()},Y.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var r in t)Y.ua[r]=t[r]}}}("object"==typeof window?window:Hl)}(Xl,$l);var Ql=function(){return Ql=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},Ql.apply(this,arguments)};function eu(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 tu(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 ru(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 nu(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 iu(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 ou=function(e,t){var r,n;void 0===t&&(t=!1);var i=su(e,t),o=void 0,s=Jl.document.cookie.split("; ");try{for(var a=ru(s),l=a.next();!l.done;l=a.next()){var u=nu(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}},su=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))},au=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 eu(this,void 0,void 0,function(){return tu(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=ou(this.apiKey,!0);return(e||(e=ou(this.apiKey,!1))||(e=function(e){var t=su(e,!0);try{var r=Jl.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=su(e,!0);try{var r=Jl.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 eu(this,void 0,void 0,function(){var t,r=this;return tu(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){Jl.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])]})})},e}();var lu,uu,cu,hu=Jl.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)})},du=function(){function e(e){this.client=e}return e.prototype.request=function(e){return eu(this,void 0,void 0,function(){return tu(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}(),pu={request:function(e,t,r,n,i){return function(e,t){return null==t||t<=0?e:new Promise(function(r,n){Jl.setTimeout(function(){n(new Wl("Request timeout after "+t+" milliseconds"))},t),e.then(r,n)})}(eu(void 0,void 0,void 0,function(){var i,o;return tu(this,function(s){switch(s.label){case 0:return[4,hu(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[e.Disable=0]="Disable",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Info=3]="Info",e[e.Debug=4]="Debug",e[e.Verbose=5]="Verbose"}(lu||(lu={})),function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(uu||(uu={})),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"}(cu||(cu={}));var fu=function(e){return!e||e===cu.FallbackInline||e===cu.FallbackConfig||e===cu.SecondaryInitialVariants},gu={debug:!1,logLevel:lu.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:uu.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:pu},mu="1.20.0",vu=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:gu.instanceName;this.queue=new bu(i),this.cache=new yu(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}(),yu=function(){function e(e){this.isSessionStorageAvailable=wu(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&Jl.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=Jl.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&Jl.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),bu=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=function(){var e=Yl();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=Jl.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=ru(this.inMemoryQueue),n=r.next();!n.done;n=r.next()){var i=n.value;try{if(!this.tracker(i))return}catch(e){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&&(Jl.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=Jl.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)),Jl.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),wu=function(){var e=Yl();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},Su=function(){function e(e,t){void 0===t&&(t=lu.Error),this.logger=e,this.logLevel=t}return e.prototype.error=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=lu.Error&&(t=this.logger).error.apply(t,iu([e],nu(r),!1))},e.prototype.warn=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=lu.Warn&&(t=this.logger).warn.apply(t,iu([e],nu(r),!1))},e.prototype.info=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=lu.Info&&(t=this.logger).info.apply(t,iu([e],nu(r),!1))},e.prototype.debug=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=lu.Debug&&(t=this.logger).debug.apply(t,iu([e],nu(r),!1))},e.prototype.verbose=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=lu.Verbose&&(t=this.logger).verbose.apply(t,iu([e],nu(r),!1))},e}(),Cu=function(){function e(){}return e.prototype.error=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.error.apply(console,iu([e],nu(t),!1))},e.prototype.warn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.warn.apply(console,iu([e],nu(t),!1))},e.prototype.info=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.info.apply(console,iu([e],nu(t),!1))},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.debug.apply(console,iu([e],nu(t),!1))},e.prototype.verbose=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.debug.apply(console,iu([e],nu(t),!1))},e}(),Iu=function(){function e(){this.globalScope=Yl()}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}(),xu=function(){function e(e,t){this.namespace=e,this.storage=t}return e.prototype.get=function(){return this.value},e.prototype.put=function(e){this.value=e},e.prototype.load=function(){var e=this.storage.get(this.namespace);e&&(this.value=JSON.parse(e))},e.prototype.store=function(){void 0===this.value?this.storage.delete(this.namespace):this.storage.put(this.namespace,JSON.stringify(this.value))},e}(),ku=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 Ql({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=ru(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=ru(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}(),Eu=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}},Ou=function(){function e(){this.globalScope=Yl()}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}(),Au=function(e){return null==e},Pu=function(e){return!!Au(e)||e&&0===Object.keys(e).length},Tu=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},Ru=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 eu(this,void 0,void 0,function(){return tu(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 eu(this,void 0,void 0,function(){var n=this;return tu(this,function(i){return this.done||(this.timeoutHandle=Jl.setTimeout(function(){return eu(n,void 0,void 0,function(){var n,i;return tu(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}(),Mu=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},Nu=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},_u=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}(),Du=function(){function e(e){this.tracked={},this.identity={},this.exposureTrackingProvider=e}return e.prototype.track=function(e,t){var r={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,r)||(this.tracked={}),this.identity=r;var n=e.flag_key in this.tracked,i=this.tracked[e.flag_key];n&&i===e.variant||(this.tracked[e.flag_key]=e.variant,this.exposureTrackingProvider.track(e))},e.prototype.identityEquals=function(e,t){return e.userId===t.userId&&e.deviceId===t.deviceId},e}(),Lu=function(){function e(t,r){var n,i,o,s,a=this;this.engine=new Cl,this.isRunning=!1,this.apiKey=t,r=function(e){var t,r;if(!e||"object"!=typeof e)return{};var n={};try{for(var i=ru(Object.entries(e)),o=i.next();!o.done;o=i.next()){var s=nu(o.value,2),a=s[0],l=s[1];Au(l)||(n[a]=l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}(r),this.config=Ql(Ql(Ql({},gu),r),{serverUrl:(null==r?void 0:r.serverUrl)||("eu"===(null===(n=null==r?void 0:r.serverZone)||void 0===n?void 0:n.toLowerCase())?"https://api.lab.eu.amplitude.com":gu.serverUrl),flagsServerUrl:(null==r?void 0:r.flagsServerUrl)||("eu"===(null===(i=null==r?void 0:r.serverZone)||void 0===i?void 0:i.toLowerCase())?"https://flag.lab.eu.amplitude.com":gu.flagsServerUrl),flagConfigPollingIntervalMillis:r.flagConfigPollingIntervalMillis<6e4?6e4:null!==(o=r.flagConfigPollingIntervalMillis)&&void 0!==o?o:gu.flagConfigPollingIntervalMillis}),this.logger=new Su(this.config.loggerProvider||new Cu,e.getLogLevel(r));var l=null===(s=this.config)||void 0===s?void 0:s.internalInstanceNameSuffix;if(this.isWebExperiment="web"===l,this.poller=new Zl(function(){return a.doFlags()},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var u in this.config.initialVariants)this.config.initialVariants[u]=Eu(this.config.initialVariants[u]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new _u(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new Du(this.config.exposureTrackingProvider)),this.integrationManager=new vu(this.config,this);var c,h=new du(this.config.httpClient||pu);this.flagApi=new Gl(this.apiKey,this.config.flagsServerUrl,h),this.evaluationApi=new Kl(this.apiKey,this.config.serverUrl,h);var d=l?"".concat(this.config.instanceName,"-").concat(l):this.config.instanceName;c=this.isWebExperiment?new Ou:new Iu,this.variants=function(e,t,r){var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n);return new ku(i,r,Eu)}(this.apiKey,d,c),this.flags=function(e,t,r){void 0===r&&(r=new Iu);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-flags");return new ku(i,r)}(this.apiKey,d,c),this.fetchVariantsOptions=function(e,t,r){void 0===r&&(r=new Iu);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-variants-options");return new xu(i,r)}(this.apiKey,d,c);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return eu(this,void 0,void 0,function(){var t,r,n;return tu(this,function(i){switch(i.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(e),i.label=1;case 1:return i.trys.push([1,6,,7]),t=this.doFlags(),null===(n=this.config.fetchOnStart)||void 0===n||n?[4,Promise.all([this.fetch(e),t])]:[3,3];case 2:return i.sent(),[3,5];case 3:return[4,t];case 4:i.sent(),i.label=5;case 5:return[3,7];case 6:if(r=i.sent(),this.config.throwOnError)throw r;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}})})},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return eu(this,arguments,void 0,function(e,t){var r;return void 0===e&&(e=this.user),tu(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:if(r=n.sent(),this.config.throwOnError)throw r;return r instanceof Wl?this.logger.debug(r):this.logger.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.logger.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);Tu(r)||delete e[t]}return Ql(Ql(Ql({},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=Ql({},this.user.user_properties);return Ql(Ql({},this.user),{user_properties:t})}return Ql({},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=Ql({},e.user_properties);this.user=Ql(Ql({},e),{user_properties:r})}else this.user=Ql({},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,Wa([],qa(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=Yl();s&&(o.page={url:s.location.href});var a={};if(!e.groups)return o;try{for(var l=ru(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=ru(Object.keys(s)),u=l.next();!u.done;u=l.next()){var c=u.value;a[c]=Nu(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===uu.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===uu.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var n=this.flags.get(e);return(Tu(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=cu.LocalEvaluation,a=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!Au(o)&&!a)return{variant:Mu(o),source:s,hasDefaultVariant:!1};if(a&&(i={variant:Mu(o),source:s,hasDefaultVariant:!0}),!Au(r))return{variant:Mu(r),source:cu.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!Au(l))return{variant:Mu(l),source:cu.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=Mu(this.config.fallbackVariant),c={variant:u,source:cu.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return Pu(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(!Au(i)&&!o)return{variant:Mu(i),source:cu.LocalStorage,hasDefaultVariant:!1};if(o&&(n={variant:Mu(i),source:cu.LocalStorage,hasDefaultVariant:!0}),!Au(t))return{variant:Mu(t),source:cu.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=this.config.initialVariants[e];if(!Au(s))return{variant:Mu(s),source:cu.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var a=Mu(this.config.fallbackVariant),l={variant:a,source:cu.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return Pu(a)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!Au(i))return{variant:Mu(i),source:cu.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(!Au(o)&&!s)return{variant:Mu(o),source:cu.LocalStorage,hasDefaultVariant:!1};if(s&&(n={variant:Mu(o),source:cu.LocalStorage,hasDefaultVariant:!0}),!Au(t))return{variant:Mu(t),source:cu.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var a=Mu(this.config.fallbackVariant),l={variant:a,source:cu.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return Pu(a)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return eu(this,void 0,void 0,function(){var i,o,s;return tu(this,function(a){switch(a.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.logger.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.doFetch(e,t,Ql({trackingOption:null===(s=this.fetchVariantsOptions.get())||void 0===s?void 0:s.trackingOption},n))];case 2:return i=a.sent(),[4,this.storeVariants(i,n)];case 3:return a.sent(),[2,i];case 4:throw o=a.sent(),r&&this.shouldRetryFetch(o)&&this.startRetries(e,n),o;case 5:return[2]}})})},e.prototype.setTracksAssignment=function(e){return eu(this,void 0,void 0,function(){return tu(this,function(t){return this.fetchVariantsOptions.put(Ql(Ql({},this.fetchVariantsOptions.get()||{}),{trackingOption:e?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]})})},e.prototype.cleanUserPropsForFetch=function(e){var t=Ql({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return eu(this,void 0,void 0,function(){var n,i,o,s,a,l,u;return tu(this,function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.logger.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,Ql({timeoutMillis:t},r))];case 2:n=c.sent(),i={};try{for(o=ru(Object.keys(n)),s=o.next();!s.done;s=o.next())a=s.value,i[a]=Nu(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.logger.debug("[Experiment] Received variants: ",i),[2,i]}})})},e.prototype.doFlags=function(){return eu(this,void 0,void 0,function(){var e,t,r;return tu(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:mu,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 Wl))throw r;if(this.logger.debug(r),this.config.throwOnError)throw r;return[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}})})},e.prototype.storeVariants=function(e,t){return eu(this,void 0,void 0,function(){var r,n,i,o;return tu(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.logger.debug("[Experiment] Stored variants: ",e),[2]})})},e.prototype.startRetries=function(e,t){return eu(this,void 0,void 0,function(){var r=this;return tu(this,function(n){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new Ru(8,500,1e4,1.5),this.retriesBackoff.start(function(){return eu(r,void 0,void 0,function(){return tu(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=Ql(Ql(Ql({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return Ql(Ql(Ql(Ql({library:"experiment-js-client/".concat(mu)},r),n),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return eu(this,void 0,void 0,function(){return tu(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==uu.LocalStorage?this.variants.getAll():this.config.source==uu.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==uu.LocalStorage?this.config.initialVariants:this.config.source==uu.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=fu(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;if(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),this.isWebExperiment&&(h.time=Date.now()),this.isWebExperiment){var f=Yl();if(null==f?void 0:f.location)try{var g=f.location.href;h.metadata.url=g.split("?")[0]||""}catch(e){}}var m=this.addContext(this.getUser());null===(c=this.userSessionExposureTracker)||void 0===c||c.track(h,m),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);fu(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.getLogLevel=function(e){var t;return!0===e.debug?lu.Debug:null!==(t=e.logLevel)&&void 0!==t?t:lu.Error},e.prototype.shouldRetryFetch=function(e){return!(e instanceof ql)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),Fu=function(){function e(e,t){var r,n,i;this.globalScope=Yl(),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 $l.UAParser(this.userAgent).getResult(),this.localStorage=new Iu,this.sessionStorage=new Ou,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 Ql({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=ru(i.searchParams),s=o.next();!s.done;s=o.next()){var a=nu(s.value,2),l=a[0],u=a[1];n[l]=iu(iu([],nu(null!==(r=n[l])&&void 0!==r?r:[]),!1),nu(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=nu(t,2),n=r[0],i=r[1];return e[n]=1==i.length?i[0]:i,e},{})}},e}();Jl.experimentInstances={};var Uu=Jl.experimentInstances,ju=function(e){return(null==e?void 0:e.instanceName)||gu.instanceName},Bu=function(e,t,r){var n=function(e,t){var r=ju(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)}(e,t),i=Uu[n];return i||(i=function(e,t){return new Lu(e,Ql(Ql({},t),{userProvider:new Fu(null==t?void 0:t.userProvider,e)}))}(e,t),r&&i.addPlugin(r()),Uu[n]=i,i)},zu=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 Bu(e,t,function(){return new au(e,ye.getInstance(ju(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}(),Vu=function(e){return new zu(e)},qu=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Wu(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),Wu=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Ku=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}(),Gu=function(){return Gu=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},Gu.apply(this,arguments)};function Ju(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 Yu(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}var Zu=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=Ju(["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||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(!Zu(u,c))return!1;var h=!0;return Object.keys(e).forEach(function(r){Zu(e[r],t[r])||(h=!1)}),h}for(var d=0;d<e.length;d++)if(!Zu(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 Hu=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=Gu({},this.identity.userProperties),r=Gu(Gu({},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=Ju(Object.entries(e)),c=u.next();!c.done;c=u.next()){var h=Yu(c.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(i=void 0,Ju(Object.entries(p))),g=f.next();!g.done;g=f.next()){var m=Yu(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,Ju(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 Gu({},this.identity)},e.prototype.setIdentity=function(e){var t=Gu({},this.identity);this.identity=Gu({},e),Zu(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}(),$u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:self,Xu=function(){function e(){this.identityStore=new Hu,this.eventBridge=new Ku,this.applicationContextProvider=new qu}return e.getInstance=function(t){return $u.analyticsConnectorInstances||($u.analyticsConnectorInstances={}),$u.analyticsConnectorInstances[t]||($u.analyticsConnectorInstances[t]=new e),$u.analyticsConnectorInstances[t]},e}(),Qu=["boot"];var ec=(e=>(e.Local="https://local.amplitude.com:3010/",e.Staging="https://apps.stag2.amplitude.com/",e.Production="https://app.amplitude.com/",e.ProductionEU="https://app.eu.amplitude.com/",e))(ec||{});var tc=((e=>{if(typeof window<"u"&&window.opener)for(let t of Object.values(ec))window.opener.postMessage({message:e},t)})("ENGAGEMENT_SNIPPET"),function(e){var t,r,n,i,o,s,a,l,u;let c=typeof window<"u"?window.engagement:void 0,h={_q:null!=(t=null==c?void 0:c._q)?t:[],_configuration:{apiKey:null!=(n=null==(r=null==c?void 0:c._configuration)?void 0:r.apiKey)?n:"",serverUrl:null==(i=null==c?void 0:c._configuration)?void 0:i.serverUrl,chatUrl:null==(o=null==c?void 0:c._configuration)?void 0:o.chatUrl,mediaUrl:null==(s=null==c?void 0:c._configuration)?void 0:s.mediaUrl,serverZone:null!=(l=null==(a=null==c?void 0:c._configuration)?void 0:a.serverZone)?l:"US",options:{...null==(u=null==c?void 0:c._configuration)?void 0:u.options}},_sentry:void 0,init(t,r){var n,i,o;if(h._configuration.apiKey)return void console.log("Engagement SDK has already been initialized. Ignoring additional init call.");let s;if(h._configuration={...h._configuration,...r,apiKey:t,options:{splitting:!0,...h._configuration.options,...null==r?void 0:r.options}},null!=(i=null==(n=h._configuration)?void 0:n.options)&&i.logger&&h._configuration.options.logger.enable(null!=(o=h._configuration.options.logLevel)?o:2),null!=r&&r.cdnUrl)s=h._configuration.options.splitting?`${r.cdnUrl}/engagement-browser/prod/split/index.js`:r.cdnUrl+"/engagement-browser/prod/index.min.js.gz";else{let e="EU"===h._configuration.serverZone?"https://cdn.eu.amplitude.com":"https://cdn.amplitude.com";s=h._configuration.options.splitting?`${e}/engagement-browser/prod/split/index.js`:`${e}/engagement-browser/prod/index.min.js.gz`}let a=null,l=()=>{if(a&&(clearTimeout(a),a=null),h._q&&h._q.length>0)for(console.warn(`Engagement SDK failed to load within ${u}ms. Resolving pending calls gracefully.`);h._q.length>0;){let e=h._q.shift();if(!e)continue;let t=e[0];if(Qu.includes(t)&&e[1]instanceof Function&&e[2]instanceof Function){let r=e[1];console.warn(`Engagement SDK method '${t}' resolved as no-op due to script loading failure`),r(void 0)}}};e(s,h._configuration.options.splitting?"module":void 0,null==r?void 0:r.nonce,l);let u=1e4;a=setTimeout(()=>{l()},u)},plugin(e){let t=h.init;return{name:"@amplitude/engagement-browser",type:"enrichment",async setup(r,n){var i;let o=null!=(i=r.instanceName)?i:"$default_instance",s=Xu.getInstance(o).identityStore;t(r.apiKey,{serverZone:r.serverZone,...e,options:{logLevel:r.logLevel,logger:r.loggerProvider,...null==e?void 0:e.options}});let a=[{track:e=>{n.track(e)}}];await window.engagement.boot({user:()=>{let e=s.getIdentity();return{user_id:n.getUserId(),device_id:n.getDeviceId(),user_properties:e.userProperties,getSessionId:n.getSessionId}},integrations:a}),s.addIdentityListener(e=>{var t,r,i,o;null!=(t=window.engagement)&&t._.user&&null!=(r=window.engagement)&&r._analytics.hasBooted?(null==(o=null==(i=window.engagement)?void 0:i._.user)?void 0:o.user_id)!==e.userId?(window.engagement.shutdown(),window.engagement.boot({user:()=>{let e=s.getIdentity();return{user_id:n.getUserId(),device_id:n.getDeviceId(),user_properties:e.userProperties,getSessionId:n.getSessionId}},integrations:a})):window.engagement._setUserProperties(e.userProperties):console.warn("Engagement SDK not booted. Ignoring identity change.")})},execute:async e=>(window.engagement.forwardEvent(e),e)}}},d=h;return new Proxy(h,{get:function(e,t){return t in d?d[t]:"then"!==t?"gs"===t||"rc"===t?new Proxy({},{get:function(e,r){return function(){let e=Array.from(arguments),n=`${t}.${r}`;e.unshift(n),h._q.push(e)}}}):Qu.includes(t)?function(){let e=Array.prototype.slice.call(arguments);return new Promise((r,n)=>{e.unshift(t,r,n),h._q.push(e)})}:function(){let e=Array.prototype.slice.call(arguments);e.unshift(t),h._q.push(e)}:void 0}})}((e,t,r,n)=>function(e,t,r,n){for(let i of e){let e=document.createElement("script");e.src=i,e.id="engagement-sdk-bundle",r&&e.setAttribute("nonce",r),t&&e.setAttribute("type",t),n&&(e.onerror=n),document.getElementsByTagName("head")[0].appendChild(e)}}([e||"https://cdn.amplitude.com/engagement-browser/prod/index.min.js.gz"],t,r,n))),rc=e=>(typeof window<"u"&&!window.engagement&&(window.engagement=tc),tc.plugin(e)),nc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.sessionReplay=function(){return this._sessionReplay},t.prototype.experiment=function(){if(void 0!==this.config){var e=this.plugins(zu);return 0===e.length?void this.config.loggerProvider.debug("".concat(zu.pluginName," plugin is not found.")):1===e.length?e[0].experiment:void this.config.loggerProvider.debug("Multiple instances of ".concat(zu.pluginName," are found."))}},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-feat-zoning.0","-").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 La(u))).promise];case 2:return s.sent(),[4,e.prototype.add.call(this,Vu(o(o({},null==r?void 0:r.experiment),n))).promise];case 3:return s.sent(),void 0===(i=this.plugin(La.pluginName))?this.config.loggerProvider.debug("".concat(La.pluginName," plugin is not found.")):this._sessionReplay=i.sessionReplay,[4,e.prototype.add.call(this,rc(o(o({},null==r?void 0:r.engagement),n))).promise];case 4:return s.sent(),[2]}var u})})},t.prototype.init=function(t,r,n){return void 0===t&&(t=""),e.prototype.init.call(this,t,r,n)},t}(io),ic=function(){var e=new nc;return{_setDiagnosticsSampleRate:oe(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",re(e),ie(e,["config"])),experiment:oe(e.experiment.bind(e),"experiment",re(e),ie(e,["config"])),sessionReplay:oe(e.sessionReplay.bind(e),"sessionReplay",re(e),ie(e,["config"])),initAll:oe(e.initAll.bind(e),"initAll",re(e),ie(e,["config"])),init:oe(e.init.bind(e),"init",re(e),ie(e,["config"])),add:oe(e.add.bind(e),"add",re(e),ie(e,["config.apiKey","timeline.plugins"])),remove:oe(e.remove.bind(e),"remove",re(e),ie(e,["config.apiKey","timeline.plugins"])),track:oe(e.track.bind(e),"track",re(e),ie(e,["config.apiKey","timeline.queue.length"])),logEvent:oe(e.logEvent.bind(e),"logEvent",re(e),ie(e,["config.apiKey","timeline.queue.length"])),identify:oe(e.identify.bind(e),"identify",re(e),ie(e,["config.apiKey","timeline.queue.length"])),groupIdentify:oe(e.groupIdentify.bind(e),"groupIdentify",re(e),ie(e,["config.apiKey","timeline.queue.length"])),setGroup:oe(e.setGroup.bind(e),"setGroup",re(e),ie(e,["config.apiKey","timeline.queue.length"])),revenue:oe(e.revenue.bind(e),"revenue",re(e),ie(e,["config.apiKey","timeline.queue.length"])),flush:oe(e.flush.bind(e),"flush",re(e),ie(e,["config.apiKey","timeline.queue.length"])),getUserId:oe(e.getUserId.bind(e),"getUserId",re(e),ie(e,["config","config.userId"])),setUserId:oe(e.setUserId.bind(e),"setUserId",re(e),ie(e,["config","config.userId"])),getDeviceId:oe(e.getDeviceId.bind(e),"getDeviceId",re(e),ie(e,["config","config.deviceId"])),setDeviceId:oe(e.setDeviceId.bind(e),"setDeviceId",re(e),ie(e,["config","config.deviceId"])),reset:oe(e.reset.bind(e),"reset",re(e),ie(e,["config","config.userId","config.deviceId"])),getSessionId:oe(e.getSessionId.bind(e),"getSessionId",re(e),ie(e,["config"])),setSessionId:oe(e.setSessionId.bind(e),"setSessionId",re(e),ie(e,["config"])),extendSession:oe(e.extendSession.bind(e),"extendSession",re(e),ie(e,["config"])),setOptOut:oe(e.setOptOut.bind(e),"setOptOut",re(e),ie(e,["config"])),getOptOut:oe(e.getOptOut.bind(e),"getOptOut",re(e),ie(e,["config"])),setTransport:oe(e.setTransport.bind(e),"setTransport",re(e),ie(e,["config"])),getIdentity:oe(e.getIdentity.bind(e),"getIdentity",re(e),ie(e,["config"]))}},oc=ic(),sc=oc._setDiagnosticsSampleRate,ac=oc.initAll,lc=oc.experiment,uc=oc.sessionReplay,cc=oc.add,hc=oc.extendSession,dc=oc.flush,pc=oc.getDeviceId,fc=oc.getSessionId,gc=oc.getUserId,mc=oc.groupIdentify,vc=oc.identify,yc=oc.logEvent,bc=oc.remove,wc=oc.reset,Sc=oc.revenue,Cc=oc.setDeviceId,Ic=oc.setGroup,xc=oc.setOptOut,kc=oc.setSessionId,Ec=oc.setTransport,Oc=oc.setUserId,Ac=oc.track,Pc=function(e,t){return Pc=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])},Pc(e,t)};var Tc=function(){return Tc=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},Tc.apply(this,arguments)};function Rc(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"==typeof SuppressedError&&SuppressedError;var Mc="is",Nc="is not",_c="contains",Dc="does not contain",Lc="less",Fc="less or equal",Uc="greater",jc="greater or equal",Bc="version less",zc="version less or equal",Vc="version greater",qc="version greater or equal",Wc="set is",Kc="set is not",Gc="set contains",Jc="set does not contain",Yc="set contains any",Zc="set does not contain any",Hc="regex match",$c="regex does not match",Xc=-862048943,Qc=461845907,eh=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=ih(r,s<<2);o=th(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,Xc),u=nh(u,15),o^=u=Math.imul(u,Qc);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,Xc),u=nh(u,15),o^=u=Math.imul(u,Qc);break;case 1:u^=r[l],u=Math.imul(u,Xc),u=nh(u,15),o^=u=Math.imul(u,Qc)}return rh(o^=n)>>>0},th=function(e,t){var r=e,n=t;return r=Math.imul(r,Xc),r=nh(r,15),r=Math.imul(r,Qc),n=nh(n^=r,13),(n=Math.imul(n,5))+-430675100|0},rh=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},nh=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},ih=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 oh(r)},oh=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},sh=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=Rc(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}},ah="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),lh=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(ah).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}(),uh=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=Rc(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=Rc(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=Tc(Tc(Tc({},t.metadata),a.metadata),i.metadata);i=Tc(Tc({},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,i,o,s;if(!r.conditions)return void 0!==(u=this.bucket(e,r))?t.variants[u]:void 0;try{for(var a=Rc(r.conditions),l=a.next();!l.done;l=a.next()){var u,c=l.value,h=!0;try{for(var d=(o=void 0,Rc(c)),p=d.next();!p.done;p=d.next()){var f=p.value;if(!(h=this.matchCondition(e,f)))break}}catch(e){o={error:e}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}if(h)return void 0!==(u=this.bucket(e,r))?t.variants[u]:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}},e.prototype.matchCondition=function(e,t){var r=sh(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 eh(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(sh(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=Rc(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,Rc(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 Mc:case _c:case Lc:case Fc:case Uc:case jc:case Bc:case zc:case Vc:case qc:case Wc:case Gc:case Yc:return r;case Nc:case Dc:case Jc:case Zc:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Wc:return this.setEquals(e,r);case Kc:return!this.setEquals(e,r);case Gc:return this.matchesSetContainsAll(e,r);case Jc:return!this.matchesSetContainsAll(e,r);case Yc:return this.matchesSetContainsAny(e,r);case Zc:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Mc:return this.matchesIs(e,r);case Nc:return!this.matchesIs(e,r);case _c:return this.matchesContains(e,r);case Dc:return!this.matchesContains(e,r);case Lc:case Fc:case Uc:case jc:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case Bc:case zc:case Vc:case qc:return this.matchesComparable(e,t,r,function(e){return lh.parse(e)},this.versionComparator);case Hc:return this.matchesRegex(e,r);case $c: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=Rc(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 Lc:case Bc:return e<r;case Fc:case zc:return e<=r;case Uc:case Vc:return e>r;case jc:case qc:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Lc:case Bc:return n<0;case Fc:case zc:return n<=0;case Uc:case Vc:return n>0;case jc:case qc: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(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):void 0}catch(e){return}},e.prototype.isSetOperator=function(e){switch(e){case Wc:case Kc:case Gc:case Jc:case Yc:case Zc: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&&function(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(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}(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=Rc(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=Rc(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}();"function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder&&new TextEncoder;(e=>{let t={};e.forEach((e,r)=>t[e]=r)})(Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=")),String.fromCharCode.bind(String),"function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}(function(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}Pc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var ch,hh=function(){var e=this;this.dbs={},this.createStore=function(t){return a(e,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,Is(t,1,{upgrade:function(e){e.objectStoreNames.contains("eventTypesForSession")||e.createObjectStore("eventTypesForSession",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return a(e,void 0,void 0,function(){var e,r;return l(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.updateEventListForSession=function(t){var r=t.sessionId,n=t.eventType,i=t.eventTime,s=t.loggerProvider,u=t.tx;return a(e,void 0,void 0,function(){var e,t,a,c,h,d,p,f,g;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=String(r),[4,u.store.get(e)];case 1:return t=l.sent(),a=t?t.eventTypes:{},c=a[n]||{},h=o(o({},a),((f={})[n]=o(o({},c),((g={})[i]={event_type:n},g)),f)),d={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,u.store.put(d)];case 2:return l.sent(),[2,h];case 3:return p=l.sent(),s.warn("Failed to store events for targeting ".concat(r,": ").concat(p)),[3,4];case 4:return[2,void 0]}})})},this.deleteOldSessionEventTypes=function(t){var r=t.currentSessionId,n=t.loggerProvider,i=t.tx;return a(e,void 0,void 0,function(){var e,t,o,s,a,u;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),e=String(r),[4,i.store.getAll()];case 1:t=l.sent(),o=0,l.label=2;case 2:return o<t.length?(s=t[o],a=Date.now()-s.lastUpdated,s.sessionId!==e&&a>1728e5?[4,i.store.delete(s.sessionId)]:[3,4]):[3,5];case 3:l.sent(),l.label=4;case 4:return o++,[3,2];case 5:return[3,7];case 6:return u=l.sent(),n.warn("Failed to clear old session event types for targeting: ".concat(u)),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,i=t.eventType,o=t.eventTime,s=t.apiKey;return a(e,void 0,void 0,function(){var e,t,a,u;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,5,,6]),[4,this.openOrCreateDB(s)];case 1:return e=l.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:i,eventTime:o})]:[2];case 2:return a=l.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return l.sent(),[4,t.done];case 4:return l.sent(),[2,a];case 5:return u=l.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(u)),[3,6];case 6:return[2,void 0]}})})}},dh=new hh,ph=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,i=t.event,o=t.sessionId,s=t.userProperties,u=t.deviceId,c=t.flag;return a(e,void 0,void 0,function(){var e,t,a,h;return l(this,function(l){switch(l.label){case 0:return i&&i.time?[4,dh.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:o,eventType:i.event_type,eventTime:i.time})]:[3,2];case 1:return t=l.sent(),[3,3];case 2:t=void 0,l.label=3;case 3:return a=(e=t)&&new Set(Object.keys(e)),h={session_id:o,event:i,event_types:a&&Array.from(a),user:{device_id:u,user_properties:s}},[2,this.evaluationEngine.evaluate(h,[c])]}})})},this.evaluationEngine=new uh},fh=function(){var e=new ph;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,gh=Object.freeze({__proto__:null,evaluateTargeting:fh}),mh=Object.freeze({__proto__:null,compressionScript:'var WebWorker=function(r){"use strict";var n=Uint8Array,e=Uint16Array,f=Uint32Array,t=new n([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]),a=new n([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]),o=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i=function(r,n){for(var t=new e(31),a=0;a<31;++a)t[a]=n+=1<<r[a-1];var o=new f(t[30]);for(a=1;a<30;++a)for(var i=t[a];i<t[a+1];++i)o[i]=i-t[a]<<5|a;return[t,o]},v=i(t,2),u=v[0],s=v[1];u[28]=258,s[258]=28;for(var l=i(a,0)[1],c=new e(32768),h=0;h<32768;++h){var g=(43690&h)>>>1|(21845&h)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,c[h]=((65280&g)>>>8|(255&g)<<8)>>>1}var w=function(r,n,f){for(var t=r.length,a=0,o=new e(n);a<t;++a)++o[r[a]-1];var i,v=new e(n);for(a=0;a<n;++a)v[a]=v[a-1]+o[a-1]<<1;if(f){i=new e(1<<n);var u=15-n;for(a=0;a<t;++a)if(r[a])for(var s=a<<4|r[a],l=n-r[a],h=v[r[a]-1]++<<l,g=h|(1<<l)-1;h<=g;++h)i[c[h]>>>u]=s}else for(i=new e(t),a=0;a<t;++a)i[a]=c[v[r[a]-1]++]>>>15-r[a];return i},d=new n(288);for(h=0;h<144;++h)d[h]=8;for(h=144;h<256;++h)d[h]=9;for(h=256;h<280;++h)d[h]=7;for(h=280;h<288;++h)d[h]=8;var m=new n(32);for(h=0;h<32;++h)m[h]=5;var y=w(d,9,0),M=w(m,5,0),p=function(r){return(r/8|0)+(7&r&&1)},b=function(r,t,a){(null==a||a>r.length)&&(a=r.length);var o=new(r instanceof e?e:r instanceof f?f:n)(a-t);return o.set(r.subarray(t,a)),o},C=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8},S=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8,r[f+2]|=e>>>16},x=function(r,f){for(var t=[],a=0;a<r.length;++a)r[a]&&t.push({s:a,f:r[a]});var o=t.length,i=t.slice();if(!o)return[new n(0),0];if(1==o){var v=new n(t[0].s+1);return v[t[0].s]=1,[v,1]}t.sort(function(r,n){return r.f-n.f}),t.push({s:-1,f:25001});var u=t[0],s=t[1],l=0,c=1,h=2;for(t[0]={s:-1,f:u.f+s.f,l:u,r:s};c!=o-1;)u=t[t[l].f<t[h].f?l++:h++],s=t[l!=c&&t[l].f<t[h].f?l++:h++],t[c++]={s:-1,f:u.f+s.f,l:u,r:s};var g=i[0].s;for(a=1;a<o;++a)i[a].s>g&&(g=i[a].s);var w=new e(g+1),d=A(t[c-1],w,0);if(d>f){a=0;var m=0,y=d-f,M=1<<y;for(i.sort(function(r,n){return w[n.s]-w[r.s]||r.f-n.f});a<o;++a){var p=i[a].s;if(!(w[p]>f))break;m+=M-(1<<d-w[p]),w[p]=f}for(m>>>=y;m>0;){var b=i[a].s;w[b]<f?m-=1<<f-w[b]++-1:++a}for(;a>=0&&m;--a){var C=i[a].s;w[C]==f&&(--w[C],++m)}d=f}return[new n(w),d]},A=function(r,n,e){return-1==r.s?Math.max(A(r.l,n,e+1),A(r.r,n,e+1)):n[r.s]=e},O=function(r){for(var n=r.length;n&&!r[--n];);for(var f=new e(++n),t=0,a=r[0],o=1,i=function(r){f[t++]=r},v=1;v<=n;++v)if(r[v]==a&&v!=n)++o;else{if(!a&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(a),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(a);o=1,a=r[v]}return[f.subarray(0,t),n]},T=function(r,n){for(var e=0,f=0;f<n.length;++f)e+=r[f]*n[f];return e},k=function(r,n,e){var f=e.length,t=p(n+2);r[t]=255&f,r[t+1]=f>>>8,r[t+2]=255^r[t],r[t+3]=255^r[t+1];for(var a=0;a<f;++a)r[t+a+4]=e[a];return 8*(t+4+f)},E=function(r,n,f,i,v,u,s,l,c,h,g){C(n,g++,f),++v[256];for(var p=x(v,15),b=p[0],A=p[1],E=x(u,15),J=E[0],N=E[1],U=O(b),D=U[0],I=U[1],W=O(J),_=W[0],j=W[1],P=new e(19),q=0;q<D.length;++q)P[31&D[q]]++;for(q=0;q<_.length;++q)P[31&_[q]]++;for(var z=x(P,7),B=z[0],F=z[1],G=19;G>4&&!B[o[G-1]];--G);var H,K,L,Q,R=h+5<<3,V=T(v,d)+T(u,m)+s,X=T(v,b)+T(u,J)+s+14+3*G+T(P,B)+(2*P[16]+3*P[17]+7*P[18]);if(R<=V&&R<=X)return k(n,g,r.subarray(c,c+h));if(C(n,g,1+(X<V)),g+=2,X<V){H=w(b,A,0),K=b,L=w(J,N,0),Q=J;var Y=w(B,F,0);C(n,g,I-257),C(n,g+5,j-1),C(n,g+10,G-4),g+=14;for(q=0;q<G;++q)C(n,g+3*q,B[o[q]]);g+=3*G;for(var Z=[D,_],$=0;$<2;++$){var rr=Z[$];for(q=0;q<rr.length;++q){var nr=31&rr[q];C(n,g,Y[nr]),g+=B[nr],nr>15&&(C(n,g,rr[q]>>>5&127),g+=rr[q]>>>12)}}}else H=y,K=d,L=M,Q=m;for(q=0;q<l;++q)if(i[q]>255){nr=i[q]>>>18&31;S(n,g,H[nr+257]),g+=K[nr+257],nr>7&&(C(n,g,i[q]>>>23&31),g+=t[nr]);var er=31&i[q];S(n,g,L[er]),g+=Q[er],er>3&&(S(n,g,i[q]>>>5&8191),g+=a[er])}else S(n,g,H[i[q]]),g+=K[i[q]];return S(n,g,H[256]),g+K[256]},J=new f([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),N=function(r,o,i,v,u){return function(r,o,i,v,u,c){var h=r.length,g=new n(v+h+5*(1+Math.floor(h/7e3))+u),w=g.subarray(v,g.length-u),d=0;if(!o||h<8)for(var m=0;m<=h;m+=65535){var y=m+65535;y<h?d=k(w,d,r.subarray(m,y)):(w[m]=c,d=k(w,d,r.subarray(m,h)))}else{for(var M=J[o-1],C=M>>>13,S=8191&M,x=(1<<i)-1,A=new e(32768),O=new e(x+1),T=Math.ceil(i/3),N=2*T,U=function(n){return(r[n]^r[n+1]<<T^r[n+2]<<N)&x},D=new f(25e3),I=new e(288),W=new e(32),_=0,j=0,P=(m=0,0),q=0,z=0;m<h;++m){var B=U(m),F=32767&m,G=O[B];if(A[F]=G,O[B]=F,q<=m){var H=h-m;if((_>7e3||P>24576)&&H>423){d=E(r,w,0,D,I,W,j,P,z,m-z,d),P=_=j=0,z=m;for(var K=0;K<286;++K)I[K]=0;for(K=0;K<30;++K)W[K]=0}var L=2,Q=0,R=S,V=F-G&32767;if(H>2&&B==U(m-V))for(var X=Math.min(C,H)-1,Y=Math.min(32767,m),Z=Math.min(258,H);V<=Y&&--R&&F!=G;){if(r[m+L]==r[m+L-V]){for(var $=0;$<Z&&r[m+$]==r[m+$-V];++$);if($>L){if(L=$,Q=V,$>X)break;var rr=Math.min(V,$-2),nr=0;for(K=0;K<rr;++K){var er=m-V+K+32768&32767,fr=er-A[er]+32768&32767;fr>nr&&(nr=fr,G=er)}}}V+=(F=G)-(G=A[F])+32768&32767}if(Q){D[P++]=268435456|s[L]<<18|l[Q];var tr=31&s[L],ar=31&l[Q];j+=t[tr]+a[ar],++I[257+tr],++W[ar],q=m+L,++_}else D[P++]=r[m],++I[r[m]]}}d=E(r,w,c,D,I,W,j,P,z,m-z,d)}return b(g,0,v+p(d)+u)}(r,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,i,v,!u)};function U(r,n){void 0===n&&(n={});var e=function(){var r=1,n=0;return{p:function(e){for(var f=r,t=n,a=e.length,o=0;o!=a;){for(var i=Math.min(o+5552,a);o<i;++o)t+=f+=e[o];f%=65521,t%=65521}r=f,n=t},d:function(){return(r>>>8<<16|(255&n)<<8|n>>>8)+2*((255&r)<<23)}}}();e.p(r);var f,t,a,o=N(r,n,2,4);return f=o,t=n.level,a=0==t?0:t<6?1:9==t?3:2,f[0]=120,f[1]=a<<6|(a?32-2*a:1),function(r,n,e){for(;e;++n)r[n]=e,e>>>=8}(o,o.length-4,e.d()),o}const D=r=>{const e={...r,v:"v1"};return function(r,n){var e="";if(!n&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(r);for(var f=0;f<r.length;){var t=r[f++];t<128||n?e+=String.fromCharCode(t):t<224?e+=String.fromCharCode((31&t)<<6|63&r[f++]):t<240?e+=String.fromCharCode((15&t)<<12|(63&r[f++])<<6|63&r[f++]):(t=((15&t)<<18|(63&r[f++])<<12|(63&r[f++])<<6|63&r[f++])-65536,e+=String.fromCharCode(55296|t>>10,56320|1023&t))}return e}(U(function(r,e){var f=r.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(r);for(var t=new n(r.length+(r.length>>>1)),a=0,o=function(r){t[a++]=r},i=0;i<f;++i){if(a+5>t.length){var v=new n(a+8+(f-i<<1));v.set(t),t=v}var u=r.charCodeAt(i);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&r.charCodeAt(++i))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return b(t,0,a)}(JSON.stringify(e))),!0)};onmessage=r=>{const{event:n,sessionId:e}="string"==typeof r.data?JSON.parse(r.data):r.data,f=JSON.stringify(D(n));postMessage({compressedEvent:f,sessionId:e})};const I=onmessage;return r.compressionOnMessage=I,Object.defineProperty(r,"__esModule",{value:!0}),r}({});\n'}),vh=Object.defineProperty,yh=(e,t,r)=>((e,t,r)=>t in e?vh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),bh=Object.defineProperty,wh=(e,t,r)=>((e,t,r)=>t in e?bh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Sh=Object.defineProperty,Ch=(e,t,r)=>((e,t,r)=>t in e?Sh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const Ih={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},xh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},kh={};function Eh(e){if(kh[e])return kh[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in Ih?Ih[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 xh?xh[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)return kh[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?kh[e]=o:r}catch{return r}}const Oh={};function Ah(e,t,r){var n;const i=`${e}.${String(r)}`;if(Oh[i])return Oh[i].call(t);const o=Eh(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Oh[i]=s,s.call(t)):t[r]}const Ph={};function Th(e,t,r){const n=`${e}.${String(r)}`;if(Ph[n])return Ph[n].bind(t);const i=Eh(e)[r];return"function"!=typeof i?t[r]:(Ph[n]=i,i.bind(t))}const Rh={childNodes:function(e){return Ah("Node",e,"childNodes")},parentNode:function(e){return Ah("Node",e,"parentNode")},parentElement:function(e){return Ah("Node",e,"parentElement")},textContent:function(e){return Ah("Node",e,"textContent")},contains:function(e,t){return Th("Node",e,"contains")(t)},getRootNode:function(e){return Th("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ah("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ah("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ah("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ah("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Eh("MutationObserver").constructor}};class Mh{constructor(){Ch(this,"idNodeMap",new Map),Ch(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 Nh(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Nh(Rh.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Nh(Rh.parentNode(e),t,r)}function _h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Dh(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 Lh={exports:{}},Fh=String,Uh=function(){return{isColorSupported:!1,reset:Fh,bold:Fh,dim:Fh,italic:Fh,underline:Fh,inverse:Fh,hidden:Fh,strikethrough:Fh,black:Fh,red:Fh,green:Fh,yellow:Fh,blue:Fh,magenta:Fh,cyan:Fh,white:Fh,gray:Fh,bgBlack:Fh,bgRed:Fh,bgGreen:Fh,bgYellow:Fh,bgBlue:Fh,bgMagenta:Fh,bgCyan:Fh,bgWhite:Fh}};Lh.exports=Uh(),Lh.exports.createColors=Uh;var jh=Lh.exports;const Bh=Dh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let zh=jh,Vh=Bh,qh=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=zh.isColorSupported),Vh&&e&&(t=Vh(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}=zh.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 Wh=qh;qh.default=qh;var Kh={};Kh.isClean=Symbol("isClean"),Kh.my=Symbol("my");const Gh={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Jh=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 Gh[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=Gh[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 Yh=Jh;Jh.default=Jh;let Zh=Yh;function Hh(e,t){new Zh(t).stringify(e)}var $h=Hh;Hh.default=Hh;let{isClean:Xh,my:Qh}=Kh,ed=Wh,td=Yh,rd=$h;function nd(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=>nd(e,r)):("object"===o&&null!==i&&(i=nd(i)),r[n]=i)}return r}let id=class{constructor(e={}){this.raws={},this[Xh]=!1,this[Qh]=!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=nd(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 ed(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[Xh]){this[Xh]=!1;let e=this;for(;e=e.parent;)e[Xh]=!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 td).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=rd){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 od=id;id.default=id;let sd=od,ad=class extends sd{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 ld=ad;ad.default=ad;var ud={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:cd,SourceMapGenerator:hd}=Bh,{existsSync:dd,readFileSync:pd}=Bh,{dirname:fd,join:gd}=Bh;let md=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=fd(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new cd(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=fd(e),dd(e))return this.mapFile=e,pd(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 cd)return hd.fromSourceMap(t).toString();if(t instanceof hd)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=gd(fd(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 vd=md;md.default=md;let{SourceMapConsumer:yd,SourceMapGenerator:bd}=Bh,{fileURLToPath:wd,pathToFileURL:Sd}=Bh,{isAbsolute:Cd,resolve:Id}=Bh,{nanoid:xd}=ud,kd=Bh,Ed=Wh,Od=vd,Ad=Symbol("fromOffsetCache"),Pd=Boolean(yd&&bd),Td=Boolean(Id&&Cd),Rd=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&&(!Td||/^\w+:\/\//.test(t.from)||Cd(t.from)?this.file=t.from:this.file=Id(t.from)),Td&&Pd){let e=new Od(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 "+xd(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 Ed(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 Ed(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&&(Sd&&(i.input.url=Sd(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[Ad])r=this[Ad];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[Ad]=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:Id(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=Cd(a.source)?Sd(a.source):new URL(a.source,this.map.consumer().sourceRoot||Sd(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(!wd)throw new Error("file: protocol is not available in this PostCSS build");l.file=wd(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 Md=Rd;Rd.default=Rd,kd&&kd.registerInput&&kd.registerInput(Rd);let{SourceMapConsumer:Nd,SourceMapGenerator:_d}=Bh,{dirname:Dd,relative:Ld,resolve:Fd,sep:Ud}=Bh,{pathToFileURL:jd}=Bh,Bd=Md,zd=Boolean(Nd&&_d),Vd=Boolean(Dd&&Fd&&Ld&&Ud);var qd=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||Dd(e.file);!1===this.mapOpts.sourcesContent?(t=new Nd(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(),Vd&&zd&&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=_d.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new _d({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 _d({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?Dd(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Dd(Fd(r,this.mapOpts.annotation)));let n=Ld(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 Bd(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(jd){let t=jd(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;"\\"===Ud&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Wd=od,Kd=class extends Wd{constructor(e){super(e),this.type="comment"}};var Gd=Kd;Kd.default=Kd;let Jd,Yd,Zd,Hd,{isClean:$d,my:Xd}=Kh,Qd=ld,ep=Gd,tp=od;function rp(e){return e.map(e=>(e.nodes&&(e.nodes=rp(e.nodes)),delete e.source,e))}function np(e){if(e[$d]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)np(t)}let ip=class e extends tp{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=rp(Jd(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 Qd(t)]}else if(t.selector)t=[new Yd(t)];else if(t.name)t=[new Zd(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new ep(t)]}return t.map(t=>(t[Xd]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[$d]&&np(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]}};ip.registerParse=e=>{Jd=e},ip.registerRule=e=>{Yd=e},ip.registerAtRule=e=>{Zd=e},ip.registerRoot=e=>{Hd=e};var op=ip;ip.default=ip,ip.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Zd.prototype):"rule"===e.type?Object.setPrototypeOf(e,Yd.prototype):"decl"===e.type?Object.setPrototypeOf(e,Qd.prototype):"comment"===e.type?Object.setPrototypeOf(e,ep.prototype):"root"===e.type&&Object.setPrototypeOf(e,Hd.prototype),e[Xd]=!0,e.nodes&&e.nodes.forEach(e=>{ip.rebuild(e)})};let sp,ap,lp=op,up=class extends lp{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new sp(new ap,this,e).stringify()}};up.registerLazyResult=e=>{sp=e},up.registerProcessor=e=>{ap=e};var cp=up;up.default=up;let hp={};var dp=function(e){hp[e]||(hp[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let pp=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 fp=pp;pp.default=pp;let gp=fp,mp=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 gp(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var vp=mp;mp.default=mp;const yp="'".charCodeAt(0),bp='"'.charCodeAt(0),wp="\\".charCodeAt(0),Sp="/".charCodeAt(0),Cp="\n".charCodeAt(0),Ip=" ".charCodeAt(0),xp="\f".charCodeAt(0),kp="\t".charCodeAt(0),Ep="\r".charCodeAt(0),Op="[".charCodeAt(0),Ap="]".charCodeAt(0),Pp="(".charCodeAt(0),Tp=")".charCodeAt(0),Rp="{".charCodeAt(0),Mp="}".charCodeAt(0),Np=";".charCodeAt(0),_p="*".charCodeAt(0),Dp=":".charCodeAt(0),Lp="@".charCodeAt(0),Fp=/[\t\n\f\r "#'()/;[\\\]{}]/g,Up=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,jp=/.[\r\n"'(/\\]/,Bp=/[\da-f]/i;let zp=op,Vp=class extends zp{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 qp=Vp;Vp.default=Vp,zp.registerAtRule(Vp);let Wp,Kp,Gp=op,Jp=class extends Gp{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 Wp(new Kp,this,e).stringify()}};Jp.registerLazyResult=e=>{Wp=e},Jp.registerProcessor=e=>{Kp=e};var Yp=Jp;Jp.default=Jp,Gp.registerRoot(Jp);let Zp={comma:e=>Zp.split(e,[","],!0),space:e=>Zp.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 Hp=Zp;Zp.default=Zp;let $p=op,Xp=Hp,Qp=class extends $p{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Xp.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 ef=Qp;Qp.default=Qp,$p.registerRule(Qp);let tf=ld,rf=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 Cp:case Ip:case kp:case Ep:case xp:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===Ip||r===Cp||r===kp||r===Ep||r===xp);h=["space",d.slice(g,n)],g=n-1;break;case Op:case Ap:case Rp:case Mp:case Dp:case Np:case Tp:{let e=String.fromCharCode(r);h=[e,e,g];break}case Pp:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==yp&&c!==bp&&c!==Ip&&c!==Cp&&c!==kp&&c!==xp&&c!==Ep){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)===wp;)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||jp.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case yp:case bp:i=r===yp?"'":'"',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)===wp;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case Lp:Fp.lastIndex=g+1,Fp.test(d),n=0===Fp.lastIndex?d.length-1:Fp.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case wp:for(n=g,s=!0;d.charCodeAt(n+1)===wp;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==Sp&&r!==Ip&&r!==Cp&&r!==kp&&r!==Ep&&r!==xp&&(n+=1,Bp.test(d.charAt(n)))){for(;Bp.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Ip&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===Sp&&d.charCodeAt(g+1)===_p?(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):(Up.lastIndex=g+1,Up.test(d),n=0===Up.lastIndex?d.length-1:Up.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},nf=Gd,of=qp,sf=Yp,af=ef;const lf={empty:!0,space:!0};var uf=class{constructor(e){this.input=e,this.root=new sf,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 of;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 nf;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=rf(this.input)}decl(e,t){let r=new tf;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 af;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",lf[a]||lf[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 af;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 cf=op,hf=uf,df=Md;function pf(e,t){let r=new df(e,t),n=new hf(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 ff=pf;pf.default=pf,cf.registerParse(pf);let{isClean:gf,my:mf}=Kh,vf=qd,yf=$h,bf=op,wf=cp,Sf=dp,Cf=vp,If=ff,xf=Yp;const kf={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Ef={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},Of={Once:!0,postcssPlugin:!0,prepare:!0};function Af(e){return"object"==typeof e&&"function"==typeof e.then}function Pf(e){let t=!1,r=kf[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 Tf(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Pf(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Rf(e){return e[gf]=!1,e.nodes&&e.nodes.forEach(e=>Rf(e)),e}let Mf={},Nf=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 Cf)i=Rf(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=If;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[mf]&&bf.rebuild(i)}else i=Rf(r);this.result=new Cf(t,i,n),this.helpers={...Mf,postcss:Mf,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(!Ef[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Of[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(Af(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[gf];){e[gf]=!0;let t=[Tf(e)];for(;t.length>0;){let e=this.visitTick(t);if(Af(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 Af(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=yf;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new vf(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(Af(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[gf];)e[gf]=!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||Sf("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(Af(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[gf])return n[gf]=!0,void e.push(Tf(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[gf]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[gf]=!0;let t=Pf(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[gf]||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"}};Nf.registerPostcss=e=>{Mf=e};var _f=Nf;Nf.default=Nf,xf.registerLazyResult(Nf),wf.registerLazyResult(Nf);let Df=qd,Lf=$h,Ff=dp,Uf=ff;const jf=vp;let Bf=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=Lf;this.result=new jf(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new Df(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||Ff("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=Uf;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 zf=Bf;Bf.default=Bf;let Vf=zf,qf=_f,Wf=cp,Kf=Yp,Gf=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 qf(this,e,t):new Vf(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Jf=Gf;Gf.default=Gf,Kf.registerProcessor(Gf),Wf.registerProcessor(Gf);let Yf=ld,Zf=vd,Hf=Gd,$f=qp,Xf=Md,Qf=Yp,eg=ef;function tg(e,t){if(Array.isArray(e))return e.map(e=>tg(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Xf.prototype};r.map&&(r.map={...r.map,__proto__:Zf.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>tg(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 Qf(n);if("decl"===n.type)return new Yf(n);if("rule"===n.type)return new eg(n);if("comment"===n.type)return new Hf(n);if("atrule"===n.type)return new $f(n);throw new Error("Unknown node type: "+e.type)}var rg=tg;tg.default=tg;let ng=Wh,ig=ld,og=_f,sg=op,ag=Jf,lg=$h,ug=rg,cg=cp,hg=fp,dg=Gd,pg=qp,fg=vp,gg=Md,mg=ff,vg=Hp,yg=ef,bg=Yp,wg=od;function Sg(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new ag(e)}Sg.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 ag).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return Sg([i(r)]).process(e,t)},i},Sg.stringify=lg,Sg.parse=mg,Sg.fromJSON=ug,Sg.list=vg,Sg.comment=e=>new dg(e),Sg.atRule=e=>new pg(e),Sg.decl=e=>new ig(e),Sg.rule=e=>new yg(e),Sg.root=e=>new bg(e),Sg.document=e=>new cg(e),Sg.CssSyntaxError=ng,Sg.Declaration=ig,Sg.Container=sg,Sg.Processor=ag,Sg.Document=cg,Sg.Comment=dg,Sg.Warning=hg,Sg.AtRule=pg,Sg.Result=fg,Sg.Input=gg,Sg.Rule=yg,Sg.Root=bg,Sg.Node=wg,og.registerPostcss(Sg);var Cg=Sg;Sg.default=Sg;const Ig=_h(Cg);Ig.stringify,Ig.fromJSON,Ig.plugin,Ig.parse,Ig.list,Ig.document,Ig.comment,Ig.atRule,Ig.rule,Ig.decl,Ig.root,Ig.CssSyntaxError,Ig.Declaration,Ig.Container,Ig.Processor,Ig.Document,Ig.Comment,Ig.Warning,Ig.AtRule,Ig.Result,Ig.Input,Ig.Rule,Ig.Root,Ig.Node;var xg=Object.defineProperty,kg=(e,t,r)=>((e,t,r)=>t in e?xg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Eg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Og(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 Ag={exports:{}},Pg=String,Tg=function(){return{isColorSupported:!1,reset:Pg,bold:Pg,dim:Pg,italic:Pg,underline:Pg,inverse:Pg,hidden:Pg,strikethrough:Pg,black:Pg,red:Pg,green:Pg,yellow:Pg,blue:Pg,magenta:Pg,cyan:Pg,white:Pg,gray:Pg,bgBlack:Pg,bgRed:Pg,bgGreen:Pg,bgYellow:Pg,bgBlue:Pg,bgMagenta:Pg,bgCyan:Pg,bgWhite:Pg}};Ag.exports=Tg(),Ag.exports.createColors=Tg;var Rg=Ag.exports;const Mg=Og(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ng=Rg,_g=Mg,Dg=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=Ng.isColorSupported),_g&&e&&(t=_g(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}=Ng.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 Lg=Dg;Dg.default=Dg;var Fg={};Fg.isClean=Symbol("isClean"),Fg.my=Symbol("my");const Ug={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let jg=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 Ug[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=Ug[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 Bg=jg;jg.default=jg;let zg=Bg;function Vg(e,t){new zg(t).stringify(e)}var qg=Vg;Vg.default=Vg;let{isClean:Wg,my:Kg}=Fg,Gg=Lg,Jg=Bg,Yg=qg;function Zg(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=>Zg(e,r)):("object"===o&&null!==i&&(i=Zg(i)),r[n]=i)}return r}let Hg=class{constructor(e={}){this.raws={},this[Wg]=!1,this[Kg]=!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=Zg(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 Gg(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[Wg]){this[Wg]=!1;let e=this;for(;e=e.parent;)e[Wg]=!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 Jg).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=Yg){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 $g=Hg;Hg.default=Hg;let Xg=$g,Qg=class extends Xg{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 em=Qg;Qg.default=Qg;var tm={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:rm,SourceMapGenerator:nm}=Mg,{existsSync:im,readFileSync:om}=Mg,{dirname:sm,join:am}=Mg;let lm=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=sm(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new rm(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=sm(e),im(e))return this.mapFile=e,om(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 rm)return nm.fromSourceMap(t).toString();if(t instanceof nm)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=am(sm(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 um=lm;lm.default=lm;let{SourceMapConsumer:cm,SourceMapGenerator:hm}=Mg,{fileURLToPath:dm,pathToFileURL:pm}=Mg,{isAbsolute:fm,resolve:gm}=Mg,{nanoid:mm}=tm,vm=Mg,ym=Lg,bm=um,wm=Symbol("fromOffsetCache"),Sm=Boolean(cm&&hm),Cm=Boolean(gm&&fm),Im=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&&(!Cm||/^\w+:\/\//.test(t.from)||fm(t.from)?this.file=t.from:this.file=gm(t.from)),Cm&&Sm){let e=new bm(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 "+mm(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 ym(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 ym(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&&(pm&&(i.input.url=pm(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[wm])r=this[wm];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[wm]=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:gm(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=fm(a.source)?pm(a.source):new URL(a.source,this.map.consumer().sourceRoot||pm(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(!dm)throw new Error("file: protocol is not available in this PostCSS build");l.file=dm(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 xm=Im;Im.default=Im,vm&&vm.registerInput&&vm.registerInput(Im);let{SourceMapConsumer:km,SourceMapGenerator:Em}=Mg,{dirname:Om,relative:Am,resolve:Pm,sep:Tm}=Mg,{pathToFileURL:Rm}=Mg,Mm=xm,Nm=Boolean(km&&Em),_m=Boolean(Om&&Pm&&Am&&Tm);var Dm=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||Om(e.file);!1===this.mapOpts.sourcesContent?(t=new km(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(),_m&&Nm&&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=Em.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Em({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 Em({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?Om(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Om(Pm(r,this.mapOpts.annotation)));let n=Am(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 Mm(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(Rm){let t=Rm(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;"\\"===Tm&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Lm=$g,Fm=class extends Lm{constructor(e){super(e),this.type="comment"}};var Um=Fm;Fm.default=Fm;let jm,Bm,zm,Vm,{isClean:qm,my:Wm}=Fg,Km=em,Gm=Um,Jm=$g;function Ym(e){return e.map(e=>(e.nodes&&(e.nodes=Ym(e.nodes)),delete e.source,e))}function Zm(e){if(e[qm]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Zm(t)}let Hm=class e extends Jm{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=Ym(jm(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 Km(t)]}else if(t.selector)t=[new Bm(t)];else if(t.name)t=[new zm(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Gm(t)]}return t.map(t=>(t[Wm]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[qm]&&Zm(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]}};Hm.registerParse=e=>{jm=e},Hm.registerRule=e=>{Bm=e},Hm.registerAtRule=e=>{zm=e},Hm.registerRoot=e=>{Vm=e};var $m=Hm;Hm.default=Hm,Hm.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,zm.prototype):"rule"===e.type?Object.setPrototypeOf(e,Bm.prototype):"decl"===e.type?Object.setPrototypeOf(e,Km.prototype):"comment"===e.type?Object.setPrototypeOf(e,Gm.prototype):"root"===e.type&&Object.setPrototypeOf(e,Vm.prototype),e[Wm]=!0,e.nodes&&e.nodes.forEach(e=>{Hm.rebuild(e)})};let Xm,Qm,ev=$m,tv=class extends ev{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Xm(new Qm,this,e).stringify()}};tv.registerLazyResult=e=>{Xm=e},tv.registerProcessor=e=>{Qm=e};var rv=tv;tv.default=tv;let nv={};var iv=function(e){nv[e]||(nv[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let ov=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 sv=ov;ov.default=ov;let av=sv,lv=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 av(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var uv=lv;lv.default=lv;const cv="'".charCodeAt(0),hv='"'.charCodeAt(0),dv="\\".charCodeAt(0),pv="/".charCodeAt(0),fv="\n".charCodeAt(0),gv=" ".charCodeAt(0),mv="\f".charCodeAt(0),vv="\t".charCodeAt(0),yv="\r".charCodeAt(0),bv="[".charCodeAt(0),wv="]".charCodeAt(0),Sv="(".charCodeAt(0),Cv=")".charCodeAt(0),Iv="{".charCodeAt(0),xv="}".charCodeAt(0),kv=";".charCodeAt(0),Ev="*".charCodeAt(0),Ov=":".charCodeAt(0),Av="@".charCodeAt(0),Pv=/[\t\n\f\r "#'()/;[\\\]{}]/g,Tv=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Rv=/.[\r\n"'(/\\]/,Mv=/[\da-f]/i;let Nv=$m,_v=class extends Nv{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 Dv=_v;_v.default=_v,Nv.registerAtRule(_v);let Lv,Fv,Uv=$m,jv=class extends Uv{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 Lv(new Fv,this,e).stringify()}};jv.registerLazyResult=e=>{Lv=e},jv.registerProcessor=e=>{Fv=e};var Bv=jv;jv.default=jv,Uv.registerRoot(jv);let zv={comma:e=>zv.split(e,[","],!0),space:e=>zv.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 Vv=zv;zv.default=zv;let qv=$m,Wv=Vv,Kv=class extends qv{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Wv.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 Gv=Kv;Kv.default=Kv,qv.registerRule(Kv);let Jv=em,Yv=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 fv:case gv:case vv:case yv:case mv:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===gv||r===fv||r===vv||r===yv||r===mv);h=["space",d.slice(g,n)],g=n-1;break;case bv:case wv:case Iv:case xv:case Ov:case kv:case Cv:{let e=String.fromCharCode(r);h=[e,e,g];break}case Sv:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==cv&&c!==hv&&c!==gv&&c!==fv&&c!==vv&&c!==mv&&c!==yv){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)===dv;)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||Rv.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case cv:case hv:i=r===cv?"'":'"',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)===dv;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case Av:Pv.lastIndex=g+1,Pv.test(d),n=0===Pv.lastIndex?d.length-1:Pv.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case dv:for(n=g,s=!0;d.charCodeAt(n+1)===dv;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==pv&&r!==gv&&r!==fv&&r!==vv&&r!==yv&&r!==mv&&(n+=1,Mv.test(d.charAt(n)))){for(;Mv.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===gv&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===pv&&d.charCodeAt(g+1)===Ev?(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):(Tv.lastIndex=g+1,Tv.test(d),n=0===Tv.lastIndex?d.length-1:Tv.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},Zv=Um,Hv=Dv,$v=Bv,Xv=Gv;const Qv={empty:!0,space:!0};var ey=class{constructor(e){this.input=e,this.root=new $v,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 Hv;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 Zv;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=Yv(this.input)}decl(e,t){let r=new Jv;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 Xv;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",Qv[a]||Qv[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 Xv;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 ty=$m,ry=ey,ny=xm;function iy(e,t){let r=new ny(e,t),n=new ry(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 oy=iy;iy.default=iy,ty.registerParse(iy);let{isClean:sy,my:ay}=Fg,ly=Dm,uy=qg,cy=$m,hy=rv,dy=iv,py=uv,fy=oy,gy=Bv;const my={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},vy={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},yy={Once:!0,postcssPlugin:!0,prepare:!0};function by(e){return"object"==typeof e&&"function"==typeof e.then}function wy(e){let t=!1,r=my[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 Sy(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:wy(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Cy(e){return e[sy]=!1,e.nodes&&e.nodes.forEach(e=>Cy(e)),e}let Iy={},xy=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 py)i=Cy(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=fy;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[ay]&&cy.rebuild(i)}else i=Cy(r);this.result=new py(t,i,n),this.helpers={...Iy,postcss:Iy,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(!vy[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!yy[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(by(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[sy];){e[sy]=!0;let t=[Sy(e)];for(;t.length>0;){let e=this.visitTick(t);if(by(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 by(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=uy;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new ly(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(by(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[sy];)e[sy]=!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||dy("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(by(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[sy])return n[sy]=!0,void e.push(Sy(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[sy]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[sy]=!0;let t=wy(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[sy]||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"}};xy.registerPostcss=e=>{Iy=e};var ky=xy;xy.default=xy,gy.registerLazyResult(xy),hy.registerLazyResult(xy);let Ey=Dm,Oy=qg,Ay=iv,Py=oy;const Ty=uv;let Ry=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=Oy;this.result=new Ty(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new Ey(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||Ay("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=Py;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 My=Ry;Ry.default=Ry;let Ny=My,_y=ky,Dy=rv,Ly=Bv,Fy=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 _y(this,e,t):new Ny(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Uy=Fy;Fy.default=Fy,Ly.registerProcessor(Fy),Dy.registerProcessor(Fy);let jy=em,By=um,zy=Um,Vy=Dv,qy=xm,Wy=Bv,Ky=Gv;function Gy(e,t){if(Array.isArray(e))return e.map(e=>Gy(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:qy.prototype};r.map&&(r.map={...r.map,__proto__:By.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Gy(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 Wy(n);if("decl"===n.type)return new jy(n);if("rule"===n.type)return new Ky(n);if("comment"===n.type)return new zy(n);if("atrule"===n.type)return new Vy(n);throw new Error("Unknown node type: "+e.type)}var Jy=Gy;Gy.default=Gy;let Yy=Lg,Zy=em,Hy=ky,$y=$m,Xy=Uy,Qy=qg,eb=Jy,tb=rv,rb=sv,nb=Um,ib=Dv,ob=uv,sb=xm,ab=oy,lb=Vv,ub=Gv,cb=Bv,hb=$g;function db(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Xy(e)}db.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 Xy).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return db([i(r)]).process(e,t)},i},db.stringify=Qy,db.parse=ab,db.fromJSON=eb,db.list=lb,db.comment=e=>new nb(e),db.atRule=e=>new ib(e),db.decl=e=>new Zy(e),db.rule=e=>new ub(e),db.root=e=>new cb(e),db.document=e=>new tb(e),db.CssSyntaxError=Yy,db.Declaration=Zy,db.Container=$y,db.Processor=Xy,db.Document=tb,db.Comment=nb,db.Warning=rb,db.AtRule=ib,db.Result=ob,db.Input=sb,db.Rule=ub,db.Root=cb,db.Node=hb,Hy.registerPostcss(db);var pb=db;db.default=db;const fb=Eg(pb);fb.stringify,fb.fromJSON,fb.plugin,fb.parse,fb.list,fb.document,fb.comment,fb.atRule,fb.rule,fb.decl,fb.root,fb.CssSyntaxError,fb.Declaration,fb.Container,fb.Processor,fb.Document,fb.Comment,fb.Warning,fb.AtRule,fb.Result,fb.Input,fb.Rule,fb.Root,fb.Node;class gb{constructor(...e){kg(this,"parentElement",null),kg(this,"parentNode",null),kg(this,"ownerDocument"),kg(this,"firstChild",null),kg(this,"lastChild",null),kg(this,"previousSibling",null),kg(this,"nextSibling",null),kg(this,"ELEMENT_NODE",1),kg(this,"TEXT_NODE",3),kg(this,"nodeType"),kg(this,"nodeName"),kg(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 gb))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 mb={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},vb={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},yb={};function bb(e){if(yb[e])return yb[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in mb?mb[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 vb?vb[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)return yb[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?yb[e]=o:r}catch{return r}}const wb={};function Sb(e,t,r){var n;const i=`${e}.${String(r)}`;if(wb[i])return wb[i].call(t);const o=bb(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(wb[i]=s,s.call(t)):t[r]}const Cb={};function Ib(e,t,r){const n=`${e}.${String(r)}`;if(Cb[n])return Cb[n].bind(t);const i=bb(e)[r];return"function"!=typeof i?t[r]:(Cb[n]=i,i.bind(t))}const xb={childNodes:function(e){return Sb("Node",e,"childNodes")},parentNode:function(e){return Sb("Node",e,"parentNode")},parentElement:function(e){return Sb("Node",e,"parentElement")},textContent:function(e){return Sb("Node",e,"textContent")},contains:function(e,t){return Ib("Node",e,"contains")(t)},getRootNode:function(e){return Ib("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Sb("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Sb("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Sb("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Sb("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return bb("MutationObserver").constructor}};const kb="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 Eb={map:{},getId:()=>(console.error(kb),-1),getNode:()=>(console.error(kb),null),removeNodeFromMap(){console.error(kb)},has:()=>(console.error(kb),!1),reset(){console.error(kb)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Eb=new Proxy(Eb,{get:(e,t,r)=>("map"===t&&console.error(kb),Reflect.get(e,t,r))}));let Ob=Date.now;function Ab(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:xb.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ob=()=>(new Date).getTime());function Pb(e){var t;let r=null;return"getRootNode"in e&&(null==(t=xb.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&xb.host(xb.getRootNode(e))&&(r=xb.host(xb.getRootNode(e))),r}function Tb(e){let t,r=e;for(;t=Pb(r);)r=t;return r}function Rb(e){const t=e.ownerDocument;if(!t)return!1;const r=Tb(e);return xb.contains(t,r)}const Mb=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){wh(this,"id",1),wh(this,"styleIDMap",new WeakMap),wh(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 Eb},closestElementOfNode:Ab,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:Tb,getShadowHost:Pb,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=xb.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=xb.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 gb&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(xb.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&&(xb.contains(t,e)||Rb(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&Rh.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Rh.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const i=xb.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=Ab(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(Nh(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 Ob},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))}continue}if(o in t){const e=t[o];e.children.push(r(i,e));continue}n.push(r(i,null))}return n},shadowHostInDom:Rb,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 Nb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_b="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Db=0;Db<64;Db++)_b[Nb.charCodeAt(Db)]=Db;var Lb,Fb,Ub;"undefined"!=typeof window&&window.Blob&&new Blob([(Lb="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Uint8Array.from(atob(Lb),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==(ch=e.contentWindow)?void 0:ch.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}new Mh,(Ub=Fb||(Fb={}))[Ub.NotStarted=0]="NotStarted",Ub[Ub.Running=1]="Running",Ub[Ub.Stopped=2]="Stopped";class jb{constructor(e){yh(this,"fileName"),yh(this,"functionName"),yh(this,"lineNumber"),yh(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 Bb=/(^|@)\S+:\d+/,zb=/^\s*at .*(\S+:\d+|\(native\))/m,Vb=/^(eval@)?(\[native code])?$/,qb={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(zb)?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(zb)},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 jb({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(Vb)},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 jb({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new jb({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 jb({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 jb({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(Bb)&&!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 jb({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Wb(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 Kb(e){return"[object Object]"===Object.prototype.toString.call(e)}function Gb(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Kb(e[n])&&Gb(e[n],t-1))return!0;return!1}function Jb(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(Kb(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Kb(e)&&Gb(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]=Wb(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 Yb={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 Zb(e,t,r){const n=r?Object.assign({},Yb,r):Yb,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=qb.parse(i).map(e=>e.toString()),s=[Jb(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=[Jb(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,i=[Jb("Uncaught (in promise)",n.stringifyOptions),Jb(t.reason,n.stringifyOptions)]);const o=qb.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]?Mb.patch(t,r,t=>(...i)=>{if(t.apply(this,i),!("assert"===r&&i[0]||a)){a=!0;try{const t=qb.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?i.slice(1):i).map(e=>Jb(e,n.stringifyOptions));s++,s<n.lengthThreshold?e({level:r,trace:t,payload:o}):s===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Jb("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...i)}finally{a=!1}}}):()=>{}}}const Hb="rrweb/console@1";var $b,Xb=Object.freeze({__proto__:null,PLUGIN_NAME:Hb,getRecordConsolePlugin:e=>({name:Hb,observer:Zb,options:e})}),Qb=Object.defineProperty,ew=(e,t,r)=>((e,t,r)=>t in e?Qb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),tw=Object.defineProperty,rw=(e,t,r)=>((e,t,r)=>t in e?tw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),nw=(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))(nw||{});const iw={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ow={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},sw={};function aw(e){if(sw[e])return sw[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in iw?iw[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 ow?ow[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)return sw[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?sw[e]=o:r}catch{return r}}const lw={};function uw(e,t,r){var n;const i=`${e}.${String(r)}`;if(lw[i])return lw[i].call(t);const o=aw(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(lw[i]=s,s.call(t)):t[r]}const cw={};function hw(e,t,r){const n=`${e}.${String(r)}`;if(cw[n])return cw[n].bind(t);const i=aw(e)[r];return"function"!=typeof i?t[r]:(cw[n]=i,i.bind(t))}const dw={childNodes:function(e){return uw("Node",e,"childNodes")},parentNode:function(e){return uw("Node",e,"parentNode")},parentElement:function(e){return uw("Node",e,"parentElement")},textContent:function(e){return uw("Node",e,"textContent")},contains:function(e,t){return hw("Node",e,"contains")(t)},getRootNode:function(e){return hw("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?uw("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?uw("Element",e,"shadowRoot"):null},querySelector:function(e,t){return uw("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return uw("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return aw("MutationObserver").constructor}};function pw(e){return e.nodeType===e.ELEMENT_NODE}function fw(e){const t=e&&"host"in e&&"mode"in e&&dw.host(e)||null;return Boolean(t&&"shadowRoot"in t&&dw.shadowRoot(t)===e)}function gw(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function mw(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=>vw(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 vw(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=mw(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?Aw(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?Aw(r,t):r}}class yw{constructor(){rw(this,"idNodeMap",new Map),rw(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 bw({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"";const a=n&&ww(n);return(t[r.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function ww(e){return e.toLowerCase()}const Sw="__rrweb_original__";function Cw(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ww(t):null}function Iw(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 xw=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,kw=/^(?:[a-z+]+:)?\/\//i,Ew=/^www\..*/i,Ow=/^(data:)([^,]*),(.*)/i;function Aw(e,t){return(e||"").replace(xw,(e,r,n,i,o,s)=>{const a=n||o||s,l=r||i||"";if(!a)return e;if(kw.test(a)||Ew.test(a))return`url(${l}${a}${l})`;if(Ow.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 Pw(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Tw(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=Pw(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=Pw(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=Pw(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=Pw(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 Rw="lightgrey";let Mw=1;const Nw=new RegExp("[^a-z0-9-_:]");function _w(){return Mw++}let Dw,Lw;const Fw=/^[^ \t\n\r\u000c]+/,Uw=/^[, \t\n\r\u000c]+/;const jw=new WeakMap;function Bw(e,t){return t&&""!==t.trim()?Vw(e,t):t}function zw(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Vw(e,t){let r=jw.get(e);if(r||(r=e.createElement("a"),jw.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function qw(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Bw(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(Uw),!(r>=t.length);){let o=n(Fw);if(","===o.slice(-1))o=Bw(e,o.substring(0,o.length-1)),i.push(o);else{let n="";o=Bw(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?Aw(n,Vw(e)):"object"===t&&"data"===r?Bw(e,n):n:Bw(e,n):n}function Ww(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Kw(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Kw(dw.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Kw(dw.parentNode(e),t,r)}function Gw(e,t,r,n){let i;if(pw(e)){if(i=e,!dw.childNodes(i).length)return!1}else{if(null===dw.parentElement(e))return!1;i=dw.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(Kw(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 Jw(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:nw.Document,childNodes:[],compatMode:e.compatMode}:{type:nw.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:nw.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=ww(e.tagName);return Nw.test(t)?"div":t}(e);let v={};const y=e.attributes.length;for(let t=0;t<y;t++){const n=e.attributes[t];Ww(m,n.name,n.value)||(v[n.name]=qw(r,m,ww(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=mw(t)),n&&(delete v.rel,delete v.href,v._cssText=n)}if("style"===m&&e.sheet){let t=mw(e.sheet);t&&(e.childNodes.length>1&&(t=Tw(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=bw({element:e,type:Cw(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=Sw in i?i[Sw]: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){Dw||(Dw=r.createElement("canvas"),Lw=Dw.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",i=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{Dw.width=t.naturalWidth,Dw.height=t.naturalHeight,Lw.drawImage(t,0,0),v.rr_dataURL=Dw.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:Rw}:{}}}"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:nw.Element,tagName:m,attributes:v,childNodes:[],isSVG:zw(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=dw.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=dw.textContent(e),u&&l&&(l=Aw(l,Vw(t.doc))));!u&&!c&&l&&r&&(l=n?n(l,dw.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:nw.Text,textContent:l||"",rootId:i}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:y,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:nw.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:nw.Comment,textContent:dw.textContent(e)||"",rootId:y};default:return!1}}function Yw(e){return null==e?"":e.toLowerCase()}function Zw(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=Gw(e,s,a,void 0===E)}const A=Jw(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 P;P=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===nw.Comment)return!0;if(e.type===nw.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"===Iw(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Yw(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Yw(e.attributes.name)||"icon"===Yw(e.attributes.rel)||"apple-touch-icon"===Yw(e.attributes.rel)||"shortcut icon"===Yw(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Yw(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Yw(e.attributes.property).match(/^(og|twitter|fb):/)||Yw(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Yw(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Yw(e.attributes.name)||"googlebot"===Yw(e.attributes.name)||"bingbot"===Yw(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Yw(e.attributes.name)||"generator"===Yw(e.attributes.name)||"framework"===Yw(e.attributes.name)||"publisher"===Yw(e.attributes.name)||"progid"===Yw(e.attributes.name)||Yw(e.attributes.property).match(/^article:/)||Yw(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Yw(e.attributes.name)||"yandex-verification"===Yw(e.attributes.name)||"csrf-token"===Yw(e.attributes.name)||"p:domain_verify"===Yw(e.attributes.name)||"verify-v1"===Yw(e.attributes.name)||"verification"===Yw(e.attributes.name)||"shopify-checkout-api-token"===Yw(e.attributes.name)))return!0}}return!1}(A,p)||!O&&A.type===nw.Text&&!A.textContent.replace(/^\s+|\s+$/gm,"").length?-2:_w();const T=Object.assign(A,{id:P});if(n.add(e,T),-2===P)return null;v&&v(e);let R=!l;if(T.type===nw.Element){R=R&&!T.needBlock,delete T.needBlock;const t=dw.shadowRoot(e);t&&gw(t)&&(T.isShadowHost=!0)}if((T.type===nw.Document||T.type===nw.Element)&&R){p.headWhitespace&&T.type===nw.Element&&"head"===T.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(T.type===nw.Element&&"textarea"===T.tagName&&void 0!==T.attributes.value);else{T.type===nw.Element&&void 0!==T.attributes._cssText&&"string"==typeof T.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(dw.childNodes(e))){const e=Zw(r,t);e&&T.childNodes.push(e)}}let I=null;if(pw(e)&&(I=dw.shadowRoot(e)))for(const e of Array.from(dw.childNodes(I))){const r=Zw(e,t);r&&(gw(I)&&(r.isShadow=!0),T.childNodes.push(r))}}const M=dw.parentNode(e);return M&&fw(M)&&gw(M)&&(T.isShadow=!0),T.type===nw.Element&&"iframe"===T.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=Zw(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),T.type===nw.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===Iw(T.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=Zw(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),T}function Hw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $w(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 Xw={exports:{}},Qw=String,eS=function(){return{isColorSupported:!1,reset:Qw,bold:Qw,dim:Qw,italic:Qw,underline:Qw,inverse:Qw,hidden:Qw,strikethrough:Qw,black:Qw,red:Qw,green:Qw,yellow:Qw,blue:Qw,magenta:Qw,cyan:Qw,white:Qw,gray:Qw,bgBlack:Qw,bgRed:Qw,bgGreen:Qw,bgYellow:Qw,bgBlue:Qw,bgMagenta:Qw,bgCyan:Qw,bgWhite:Qw}};Xw.exports=eS(),Xw.exports.createColors=eS;var tS=Xw.exports;const rS=$w(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let nS=tS,iS=rS,oS=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=nS.isColorSupported),iS&&e&&(t=iS(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}=nS.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 sS=oS;oS.default=oS;var aS={};aS.isClean=Symbol("isClean"),aS.my=Symbol("my");const lS={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let uS=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 lS[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=lS[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 cS=uS;uS.default=uS;let hS=cS;function dS(e,t){new hS(t).stringify(e)}var pS=dS;dS.default=dS;let{isClean:fS,my:gS}=aS,mS=sS,vS=cS,yS=pS;function bS(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=>bS(e,r)):("object"===o&&null!==i&&(i=bS(i)),r[n]=i)}return r}let wS=class{constructor(e={}){this.raws={},this[fS]=!1,this[gS]=!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=bS(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 mS(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[fS]){this[fS]=!1;let e=this;for(;e=e.parent;)e[fS]=!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 vS).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=yS){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 SS=wS;wS.default=wS;let CS=SS,IS=class extends CS{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 xS=IS;IS.default=IS;var kS={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:ES,SourceMapGenerator:OS}=rS,{existsSync:AS,readFileSync:PS}=rS,{dirname:TS,join:RS}=rS;let MS=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=TS(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new ES(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=TS(e),AS(e))return this.mapFile=e,PS(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 ES)return OS.fromSourceMap(t).toString();if(t instanceof OS)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=RS(TS(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 NS=MS;MS.default=MS;let{SourceMapConsumer:_S,SourceMapGenerator:DS}=rS,{fileURLToPath:LS,pathToFileURL:FS}=rS,{isAbsolute:US,resolve:jS}=rS,{nanoid:BS}=kS,zS=rS,VS=sS,qS=NS,WS=Symbol("fromOffsetCache"),KS=Boolean(_S&&DS),GS=Boolean(jS&&US),JS=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&&(!GS||/^\w+:\/\//.test(t.from)||US(t.from)?this.file=t.from:this.file=jS(t.from)),GS&&KS){let e=new qS(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 "+BS(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 VS(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 VS(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&&(FS&&(i.input.url=FS(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[WS])r=this[WS];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[WS]=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:jS(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=US(a.source)?FS(a.source):new URL(a.source,this.map.consumer().sourceRoot||FS(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(!LS)throw new Error("file: protocol is not available in this PostCSS build");l.file=LS(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 YS=JS;JS.default=JS,zS&&zS.registerInput&&zS.registerInput(JS);let{SourceMapConsumer:ZS,SourceMapGenerator:HS}=rS,{dirname:$S,relative:XS,resolve:QS,sep:eC}=rS,{pathToFileURL:tC}=rS,rC=YS,nC=Boolean(ZS&&HS),iC=Boolean($S&&QS&&XS&&eC);var oC=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||$S(e.file);!1===this.mapOpts.sourcesContent?(t=new ZS(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(),iC&&nC&&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=HS.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new HS({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 HS({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?$S(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=$S(QS(r,this.mapOpts.annotation)));let n=XS(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 rC(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(tC){let t=tC(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;"\\"===eC&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let sC=SS,aC=class extends sC{constructor(e){super(e),this.type="comment"}};var lC=aC;aC.default=aC;let uC,cC,hC,dC,{isClean:pC,my:fC}=aS,gC=xS,mC=lC,vC=SS;function yC(e){return e.map(e=>(e.nodes&&(e.nodes=yC(e.nodes)),delete e.source,e))}function bC(e){if(e[pC]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)bC(t)}let wC=class e extends vC{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=yC(uC(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 gC(t)]}else if(t.selector)t=[new cC(t)];else if(t.name)t=[new hC(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new mC(t)]}return t.map(t=>(t[fC]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[pC]&&bC(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]}};wC.registerParse=e=>{uC=e},wC.registerRule=e=>{cC=e},wC.registerAtRule=e=>{hC=e},wC.registerRoot=e=>{dC=e};var SC=wC;wC.default=wC,wC.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,hC.prototype):"rule"===e.type?Object.setPrototypeOf(e,cC.prototype):"decl"===e.type?Object.setPrototypeOf(e,gC.prototype):"comment"===e.type?Object.setPrototypeOf(e,mC.prototype):"root"===e.type&&Object.setPrototypeOf(e,dC.prototype),e[fC]=!0,e.nodes&&e.nodes.forEach(e=>{wC.rebuild(e)})};let CC,IC,xC=SC,kC=class extends xC{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new CC(new IC,this,e).stringify()}};kC.registerLazyResult=e=>{CC=e},kC.registerProcessor=e=>{IC=e};var EC=kC;kC.default=kC;let OC={};var AC=function(e){OC[e]||(OC[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let PC=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 TC=PC;PC.default=PC;let RC=TC,MC=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 RC(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var NC=MC;MC.default=MC;const _C="'".charCodeAt(0),DC='"'.charCodeAt(0),LC="\\".charCodeAt(0),FC="/".charCodeAt(0),UC="\n".charCodeAt(0),jC=" ".charCodeAt(0),BC="\f".charCodeAt(0),zC="\t".charCodeAt(0),VC="\r".charCodeAt(0),qC="[".charCodeAt(0),WC="]".charCodeAt(0),KC="(".charCodeAt(0),GC=")".charCodeAt(0),JC="{".charCodeAt(0),YC="}".charCodeAt(0),ZC=";".charCodeAt(0),HC="*".charCodeAt(0),$C=":".charCodeAt(0),XC="@".charCodeAt(0),QC=/[\t\n\f\r "#'()/;[\\\]{}]/g,eI=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,tI=/.[\r\n"'(/\\]/,rI=/[\da-f]/i;let nI=SC,iI=class extends nI{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 oI=iI;iI.default=iI,nI.registerAtRule(iI);let sI,aI,lI=SC,uI=class extends lI{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 sI(new aI,this,e).stringify()}};uI.registerLazyResult=e=>{sI=e},uI.registerProcessor=e=>{aI=e};var cI=uI;uI.default=uI,lI.registerRoot(uI);let hI={comma:e=>hI.split(e,[","],!0),space:e=>hI.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 dI=hI;hI.default=hI;let pI=SC,fI=dI,gI=class extends pI{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return fI.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 mI=gI;gI.default=gI,pI.registerRule(gI);let vI=xS,yI=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 UC:case jC:case zC:case VC:case BC:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===jC||r===UC||r===zC||r===VC||r===BC);h=["space",d.slice(g,n)],g=n-1;break;case qC:case WC:case JC:case YC:case $C:case ZC:case GC:{let e=String.fromCharCode(r);h=[e,e,g];break}case KC:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==_C&&c!==DC&&c!==jC&&c!==UC&&c!==zC&&c!==BC&&c!==VC){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)===LC;)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||tI.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case _C:case DC:i=r===_C?"'":'"',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)===LC;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case XC:QC.lastIndex=g+1,QC.test(d),n=0===QC.lastIndex?d.length-1:QC.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case LC:for(n=g,s=!0;d.charCodeAt(n+1)===LC;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==FC&&r!==jC&&r!==UC&&r!==zC&&r!==VC&&r!==BC&&(n+=1,rI.test(d.charAt(n)))){for(;rI.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===jC&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===FC&&d.charCodeAt(g+1)===HC?(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):(eI.lastIndex=g+1,eI.test(d),n=0===eI.lastIndex?d.length-1:eI.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},bI=lC,wI=oI,SI=cI,CI=mI;const II={empty:!0,space:!0};var xI=class{constructor(e){this.input=e,this.root=new SI,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 wI;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 bI;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=yI(this.input)}decl(e,t){let r=new vI;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 CI;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",II[a]||II[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 CI;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 kI=SC,EI=xI,OI=YS;function AI(e,t){let r=new OI(e,t),n=new EI(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 PI=AI;AI.default=AI,kI.registerParse(AI);let{isClean:TI,my:RI}=aS,MI=oC,NI=pS,_I=SC,DI=EC,LI=AC,FI=NC,UI=PI,jI=cI;const BI={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},zI={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},VI={Once:!0,postcssPlugin:!0,prepare:!0};function qI(e){return"object"==typeof e&&"function"==typeof e.then}function WI(e){let t=!1,r=BI[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 KI(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:WI(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function GI(e){return e[TI]=!1,e.nodes&&e.nodes.forEach(e=>GI(e)),e}let JI={},YI=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 FI)i=GI(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=UI;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[RI]&&_I.rebuild(i)}else i=GI(r);this.result=new FI(t,i,n),this.helpers={...JI,postcss:JI,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(!zI[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!VI[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(qI(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[TI];){e[TI]=!0;let t=[KI(e)];for(;t.length>0;){let e=this.visitTick(t);if(qI(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 qI(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=NI;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new MI(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(qI(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[TI];)e[TI]=!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||LI("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(qI(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[TI])return n[TI]=!0,void e.push(KI(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[TI]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[TI]=!0;let t=WI(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[TI]||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"}};YI.registerPostcss=e=>{JI=e};var ZI=YI;YI.default=YI,jI.registerLazyResult(YI),DI.registerLazyResult(YI);let HI=oC,$I=pS,XI=AC,QI=PI;const ex=NC;let tx=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=$I;this.result=new ex(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new HI(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||XI("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=QI;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 rx=tx;tx.default=tx;let nx=rx,ix=ZI,ox=EC,sx=cI,ax=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 ix(this,e,t):new nx(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var lx=ax;ax.default=ax,sx.registerProcessor(ax),ox.registerProcessor(ax);let ux=xS,cx=NS,hx=lC,dx=oI,px=YS,fx=cI,gx=mI;function mx(e,t){if(Array.isArray(e))return e.map(e=>mx(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:px.prototype};r.map&&(r.map={...r.map,__proto__:cx.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>mx(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 fx(n);if("decl"===n.type)return new ux(n);if("rule"===n.type)return new gx(n);if("comment"===n.type)return new hx(n);if("atrule"===n.type)return new dx(n);throw new Error("Unknown node type: "+e.type)}var vx=mx;mx.default=mx;let yx=sS,bx=xS,wx=ZI,Sx=SC,Cx=lx,Ix=pS,xx=vx,kx=EC,Ex=TC,Ox=lC,Ax=oI,Px=NC,Tx=YS,Rx=PI,Mx=dI,Nx=mI,_x=cI,Dx=SS;function Lx(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Cx(e)}Lx.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 Cx).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return Lx([i(r)]).process(e,t)},i},Lx.stringify=Ix,Lx.parse=Rx,Lx.fromJSON=xx,Lx.list=Mx,Lx.comment=e=>new Ox(e),Lx.atRule=e=>new Ax(e),Lx.decl=e=>new bx(e),Lx.rule=e=>new Nx(e),Lx.root=e=>new _x(e),Lx.document=e=>new kx(e),Lx.CssSyntaxError=yx,Lx.Declaration=bx,Lx.Container=Sx,Lx.Processor=Cx,Lx.Document=kx,Lx.Comment=Ox,Lx.Warning=Ex,Lx.AtRule=Ax,Lx.Result=Px,Lx.Input=Tx,Lx.Rule=Nx,Lx.Root=_x,Lx.Node=Dx,wx.registerPostcss(Lx);var Fx=Lx;Lx.default=Lx;const Ux=Hw(Fx);Ux.stringify,Ux.fromJSON,Ux.plugin,Ux.parse,Ux.list,Ux.document,Ux.comment,Ux.atRule,Ux.rule,Ux.decl,Ux.root,Ux.CssSyntaxError,Ux.Declaration,Ux.Container,Ux.Processor,Ux.Document,Ux.Comment,Ux.Warning,Ux.AtRule,Ux.Result,Ux.Input,Ux.Rule,Ux.Root,Ux.Node;var jx=Object.defineProperty,Bx=(e,t,r)=>((e,t,r)=>t in e?jx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function zx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vx(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 qx={exports:{}},Wx=String,Kx=function(){return{isColorSupported:!1,reset:Wx,bold:Wx,dim:Wx,italic:Wx,underline:Wx,inverse:Wx,hidden:Wx,strikethrough:Wx,black:Wx,red:Wx,green:Wx,yellow:Wx,blue:Wx,magenta:Wx,cyan:Wx,white:Wx,gray:Wx,bgBlack:Wx,bgRed:Wx,bgGreen:Wx,bgYellow:Wx,bgBlue:Wx,bgMagenta:Wx,bgCyan:Wx,bgWhite:Wx}};qx.exports=Kx(),qx.exports.createColors=Kx;var Gx=qx.exports;const Jx=Vx(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Yx=Gx,Zx=Jx,Hx=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=Yx.isColorSupported),Zx&&e&&(t=Zx(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}=Yx.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 $x=Hx;Hx.default=Hx;var Xx={};Xx.isClean=Symbol("isClean"),Xx.my=Symbol("my");const Qx={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let ek=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 Qx[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=Qx[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 tk=ek;ek.default=ek;let rk=tk;function nk(e,t){new rk(t).stringify(e)}var ik=nk;nk.default=nk;let{isClean:ok,my:sk}=Xx,ak=$x,lk=tk,uk=ik;function ck(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=>ck(e,r)):("object"===o&&null!==i&&(i=ck(i)),r[n]=i)}return r}let hk=class{constructor(e={}){this.raws={},this[ok]=!1,this[sk]=!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=ck(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 ak(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[ok]){this[ok]=!1;let e=this;for(;e=e.parent;)e[ok]=!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 lk).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=uk){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 dk=hk;hk.default=hk;let pk=dk,fk=class extends pk{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 gk=fk;fk.default=fk;var mk={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:vk,SourceMapGenerator:yk}=Jx,{existsSync:bk,readFileSync:wk}=Jx,{dirname:Sk,join:Ck}=Jx;let Ik=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=Sk(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new vk(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=Sk(e),bk(e))return this.mapFile=e,wk(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 vk)return yk.fromSourceMap(t).toString();if(t instanceof yk)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=Ck(Sk(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 xk=Ik;Ik.default=Ik;let{SourceMapConsumer:kk,SourceMapGenerator:Ek}=Jx,{fileURLToPath:Ok,pathToFileURL:Ak}=Jx,{isAbsolute:Pk,resolve:Tk}=Jx,{nanoid:Rk}=mk,Mk=Jx,Nk=$x,_k=xk,Dk=Symbol("fromOffsetCache"),Lk=Boolean(kk&&Ek),Fk=Boolean(Tk&&Pk),Uk=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&&(!Fk||/^\w+:\/\//.test(t.from)||Pk(t.from)?this.file=t.from:this.file=Tk(t.from)),Fk&&Lk){let e=new _k(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 "+Rk(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 Nk(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 Nk(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&&(Ak&&(i.input.url=Ak(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[Dk])r=this[Dk];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[Dk]=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:Tk(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=Pk(a.source)?Ak(a.source):new URL(a.source,this.map.consumer().sourceRoot||Ak(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(!Ok)throw new Error("file: protocol is not available in this PostCSS build");l.file=Ok(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 jk=Uk;Uk.default=Uk,Mk&&Mk.registerInput&&Mk.registerInput(Uk);let{SourceMapConsumer:Bk,SourceMapGenerator:zk}=Jx,{dirname:Vk,relative:qk,resolve:Wk,sep:Kk}=Jx,{pathToFileURL:Gk}=Jx,Jk=jk,Yk=Boolean(Bk&&zk),Zk=Boolean(Vk&&Wk&&qk&&Kk);var Hk=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||Vk(e.file);!1===this.mapOpts.sourcesContent?(t=new Bk(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(),Zk&&Yk&&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=zk.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new zk({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 zk({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?Vk(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Vk(Wk(r,this.mapOpts.annotation)));let n=qk(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 Jk(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(Gk){let t=Gk(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;"\\"===Kk&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let $k=dk,Xk=class extends $k{constructor(e){super(e),this.type="comment"}};var Qk=Xk;Xk.default=Xk;let eE,tE,rE,nE,{isClean:iE,my:oE}=Xx,sE=gk,aE=Qk,lE=dk;function uE(e){return e.map(e=>(e.nodes&&(e.nodes=uE(e.nodes)),delete e.source,e))}function cE(e){if(e[iE]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)cE(t)}let hE=class e extends lE{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=uE(eE(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 sE(t)]}else if(t.selector)t=[new tE(t)];else if(t.name)t=[new rE(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new aE(t)]}return t.map(t=>(t[oE]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[iE]&&cE(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]}};hE.registerParse=e=>{eE=e},hE.registerRule=e=>{tE=e},hE.registerAtRule=e=>{rE=e},hE.registerRoot=e=>{nE=e};var dE=hE;hE.default=hE,hE.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,rE.prototype):"rule"===e.type?Object.setPrototypeOf(e,tE.prototype):"decl"===e.type?Object.setPrototypeOf(e,sE.prototype):"comment"===e.type?Object.setPrototypeOf(e,aE.prototype):"root"===e.type&&Object.setPrototypeOf(e,nE.prototype),e[oE]=!0,e.nodes&&e.nodes.forEach(e=>{hE.rebuild(e)})};let pE,fE,gE=dE,mE=class extends gE{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new pE(new fE,this,e).stringify()}};mE.registerLazyResult=e=>{pE=e},mE.registerProcessor=e=>{fE=e};var vE=mE;mE.default=mE;let yE={};var bE=function(e){yE[e]||(yE[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let wE=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 SE=wE;wE.default=wE;let CE=SE,IE=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 CE(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var xE=IE;IE.default=IE;const kE="'".charCodeAt(0),EE='"'.charCodeAt(0),OE="\\".charCodeAt(0),AE="/".charCodeAt(0),PE="\n".charCodeAt(0),TE=" ".charCodeAt(0),RE="\f".charCodeAt(0),ME="\t".charCodeAt(0),NE="\r".charCodeAt(0),_E="[".charCodeAt(0),DE="]".charCodeAt(0),LE="(".charCodeAt(0),FE=")".charCodeAt(0),UE="{".charCodeAt(0),jE="}".charCodeAt(0),BE=";".charCodeAt(0),zE="*".charCodeAt(0),VE=":".charCodeAt(0),qE="@".charCodeAt(0),WE=/[\t\n\f\r "#'()/;[\\\]{}]/g,KE=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,GE=/.[\r\n"'(/\\]/,JE=/[\da-f]/i;let YE=dE,ZE=class extends YE{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 HE=ZE;ZE.default=ZE,YE.registerAtRule(ZE);let $E,XE,QE=dE,eO=class extends QE{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 $E(new XE,this,e).stringify()}};eO.registerLazyResult=e=>{$E=e},eO.registerProcessor=e=>{XE=e};var tO=eO;eO.default=eO,QE.registerRoot(eO);let rO={comma:e=>rO.split(e,[","],!0),space:e=>rO.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 nO=rO;rO.default=rO;let iO=dE,oO=nO,sO=class extends iO{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return oO.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 aO=sO;sO.default=sO,iO.registerRule(sO);let lO=gk,uO=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 PE:case TE:case ME:case NE:case RE:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===TE||r===PE||r===ME||r===NE||r===RE);h=["space",d.slice(g,n)],g=n-1;break;case _E:case DE:case UE:case jE:case VE:case BE:case FE:{let e=String.fromCharCode(r);h=[e,e,g];break}case LE:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==kE&&c!==EE&&c!==TE&&c!==PE&&c!==ME&&c!==RE&&c!==NE){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)===OE;)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||GE.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case kE:case EE:i=r===kE?"'":'"',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)===OE;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case qE:WE.lastIndex=g+1,WE.test(d),n=0===WE.lastIndex?d.length-1:WE.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case OE:for(n=g,s=!0;d.charCodeAt(n+1)===OE;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==AE&&r!==TE&&r!==PE&&r!==ME&&r!==NE&&r!==RE&&(n+=1,JE.test(d.charAt(n)))){for(;JE.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===TE&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===AE&&d.charCodeAt(g+1)===zE?(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):(KE.lastIndex=g+1,KE.test(d),n=0===KE.lastIndex?d.length-1:KE.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},cO=Qk,hO=HE,dO=tO,pO=aO;const fO={empty:!0,space:!0};var gO=class{constructor(e){this.input=e,this.root=new dO,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 hO;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 cO;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=uO(this.input)}decl(e,t){let r=new lO;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 pO;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",fO[a]||fO[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 pO;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 mO=dE,vO=gO,yO=jk;function bO(e,t){let r=new yO(e,t),n=new vO(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 wO=bO;bO.default=bO,mO.registerParse(bO);let{isClean:SO,my:CO}=Xx,IO=Hk,xO=ik,kO=dE,EO=vE,OO=bE,AO=xE,PO=wO,TO=tO;const RO={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},MO={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},NO={Once:!0,postcssPlugin:!0,prepare:!0};function _O(e){return"object"==typeof e&&"function"==typeof e.then}function DO(e){let t=!1,r=RO[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 LO(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:DO(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function FO(e){return e[SO]=!1,e.nodes&&e.nodes.forEach(e=>FO(e)),e}let UO={},jO=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 AO)i=FO(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=PO;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[CO]&&kO.rebuild(i)}else i=FO(r);this.result=new AO(t,i,n),this.helpers={...UO,postcss:UO,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(!MO[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!NO[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(_O(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[SO];){e[SO]=!0;let t=[LO(e)];for(;t.length>0;){let e=this.visitTick(t);if(_O(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 _O(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=xO;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new IO(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(_O(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[SO];)e[SO]=!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||OO("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(_O(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[SO])return n[SO]=!0,void e.push(LO(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[SO]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[SO]=!0;let t=DO(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[SO]||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"}};jO.registerPostcss=e=>{UO=e};var BO=jO;jO.default=jO,TO.registerLazyResult(jO),EO.registerLazyResult(jO);let zO=Hk,VO=ik,qO=bE,WO=wO;const KO=xE;let GO=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=VO;this.result=new KO(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new zO(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||qO("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=WO;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 JO=GO;GO.default=GO;let YO=JO,ZO=BO,HO=vE,$O=tO,XO=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 ZO(this,e,t):new YO(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var QO=XO;XO.default=XO,$O.registerProcessor(XO),HO.registerProcessor(XO);let eA=gk,tA=xk,rA=Qk,nA=HE,iA=jk,oA=tO,sA=aO;function aA(e,t){if(Array.isArray(e))return e.map(e=>aA(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:iA.prototype};r.map&&(r.map={...r.map,__proto__:tA.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>aA(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 oA(n);if("decl"===n.type)return new eA(n);if("rule"===n.type)return new sA(n);if("comment"===n.type)return new rA(n);if("atrule"===n.type)return new nA(n);throw new Error("Unknown node type: "+e.type)}var lA=aA;aA.default=aA;let uA=$x,cA=gk,hA=BO,dA=dE,pA=QO,fA=ik,gA=lA,mA=vE,vA=SE,yA=Qk,bA=HE,wA=xE,SA=jk,CA=wO,IA=nO,xA=aO,kA=tO,EA=dk;function OA(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new pA(e)}OA.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 pA).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return OA([i(r)]).process(e,t)},i},OA.stringify=fA,OA.parse=CA,OA.fromJSON=gA,OA.list=IA,OA.comment=e=>new yA(e),OA.atRule=e=>new bA(e),OA.decl=e=>new cA(e),OA.rule=e=>new xA(e),OA.root=e=>new kA(e),OA.document=e=>new mA(e),OA.CssSyntaxError=uA,OA.Declaration=cA,OA.Container=dA,OA.Processor=pA,OA.Document=mA,OA.Comment=yA,OA.Warning=vA,OA.AtRule=bA,OA.Result=wA,OA.Input=SA,OA.Rule=xA,OA.Root=kA,OA.Node=EA,hA.registerPostcss(OA);var AA=OA;OA.default=OA;const PA=zx(AA);PA.stringify,PA.fromJSON,PA.plugin,PA.parse,PA.list,PA.document,PA.comment,PA.atRule,PA.rule,PA.decl,PA.root,PA.CssSyntaxError,PA.Declaration,PA.Container,PA.Processor,PA.Document,PA.Comment,PA.Warning,PA.AtRule,PA.Result,PA.Input,PA.Rule,PA.Root,PA.Node;class TA{constructor(...e){Bx(this,"parentElement",null),Bx(this,"parentNode",null),Bx(this,"ownerDocument"),Bx(this,"firstChild",null),Bx(this,"lastChild",null),Bx(this,"previousSibling",null),Bx(this,"nextSibling",null),Bx(this,"ELEMENT_NODE",1),Bx(this,"TEXT_NODE",3),Bx(this,"nodeType"),Bx(this,"nodeName"),Bx(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 TA))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 RA={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},MA={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},NA={};function _A(e){if(NA[e])return NA[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in RA?RA[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 MA?MA[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)return NA[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?NA[e]=o:r}catch{return r}}const DA={};function LA(e,t,r){var n;const i=`${e}.${String(r)}`;if(DA[i])return DA[i].call(t);const o=_A(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(DA[i]=s,s.call(t)):t[r]}const FA={};function UA(e,t,r){const n=`${e}.${String(r)}`;if(FA[n])return FA[n].bind(t);const i=_A(e)[r];return"function"!=typeof i?t[r]:(FA[n]=i,i.bind(t))}function jA(){return _A("MutationObserver").constructor}const BA={childNodes:function(e){return LA("Node",e,"childNodes")},parentNode:function(e){return LA("Node",e,"parentNode")},parentElement:function(e){return LA("Node",e,"parentElement")},textContent:function(e){return LA("Node",e,"textContent")},contains:function(e,t){return UA("Node",e,"contains")(t)},getRootNode:function(e){return UA("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?LA("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?LA("Element",e,"shadowRoot"):null},querySelector:function(e,t){return LA("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return LA("Element",e,"querySelectorAll")(t)},mutationObserver:jA};function zA(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const VA="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 qA={map:{},getId:()=>(console.error(VA),-1),getNode:()=>(console.error(VA),null),removeNodeFromMap(){console.error(VA)},has:()=>(console.error(VA),!1),reset(){console.error(VA)}};function WA(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 KA(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)}}),()=>KA(e,t,o||{},!0)}function GA(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&&(qA=new Proxy(qA,{get:(e,t,r)=>("map"===t&&console.error(VA),Reflect.get(e,t,r))}));let JA=Date.now;function YA(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=BA.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=BA.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function ZA(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function HA(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function $A(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:BA.parentElement(e)}function XA(e,t,r,n){if(!e)return!1;const i=$A(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(Kw(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 QA(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function eP(e,t){if(fw(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=BA.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||eP(n,t))}function tP(e){return Boolean(e.changedTouches)}function rP(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function nP(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function iP(e){return!!e&&(e instanceof TA&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(BA.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(JA=()=>(new Date).getTime());class oP{constructor(){ew(this,"id",1),ew(this,"styleIDMap",new WeakMap),ew(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 sP(e){var t;let r=null;return"getRootNode"in e&&(null==(t=BA.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&BA.host(BA.getRootNode(e))&&(r=BA.host(BA.getRootNode(e))),r}function aP(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=sP(r);)r=t;return r}(e);return BA.contains(t,r)}function lP(e){const t=e.ownerDocument;return!!t&&(BA.contains(t,e)||aP(e))}var uP=(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))(uP||{}),cP=(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))(cP||{}),hP=(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))(hP||{}),dP=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(dP||{}),pP=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(pP||{}),fP=(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))(fP||{}),gP=(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))(gP||{});function mP(e){return"__ln"in e}class vP{constructor(){ew(this,"length",0),ew(this,"head",null),ew(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&&mP(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&&mP(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 yP=(e,t)=>`${e}@${t}`;class bP{constructor(){ew(this,"frozen",!1),ew(this,"locked",!1),ew(this,"texts",[]),ew(this,"attributes",[]),ew(this,"attributeMap",new WeakMap),ew(this,"removes",[]),ew(this,"mapRemoves",[]),ew(this,"movedMap",{}),ew(this,"addedSet",new Set),ew(this,"movedSet",new Set),ew(this,"droppedSet",new Set),ew(this,"removesSubTreeCache",new Set),ew(this,"mutationCb"),ew(this,"blockClass"),ew(this,"blockSelector"),ew(this,"maskTextClass"),ew(this,"maskTextSelector"),ew(this,"inlineStylesheet"),ew(this,"maskInputOptions"),ew(this,"maskTextFn"),ew(this,"maskInputFn"),ew(this,"keepIframeSrcFn"),ew(this,"recordCanvas"),ew(this,"inlineImages"),ew(this,"slimDOMOptions"),ew(this,"dataURLOptions"),ew(this,"doc"),ew(this,"mirror"),ew(this,"iframeManager"),ew(this,"stylesheetManager"),ew(this,"shadowDomManager"),ew(this,"canvasManager"),ew(this,"processedNodeManager"),ew(this,"unattachedDoc"),ew(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),ew(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new vP,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=BA.parentNode(i);if(!o||!lP(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=fw(o)?this.mirror.getId(sP(i)):this.mirror.getId(o),l=n(i);if(-1===a||-1===l)return r.addNode(i);const u=Zw(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=>{rP(e,this.mirror)&&this.iframeManager.addIframe(e),nP(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),iP(i)&&this.shadowDomManager.addShadowRoot(BA.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)SP(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(BA.parentNode(e))||i(e);for(const e of this.addedSet)CP(this.droppedSet,e)||SP(this.removesSubTreeCache,e,this.mirror)?CP(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(BA.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(BA.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=BA.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=BA.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=BA.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))}),ew(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(BA.childNodes(e),e=>BA.textContent(e)||"").join("");t.attributes.value=bw({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Cw(e),value:r,maskInputFn:this.maskInputFn})}),ew(this,"processMutation",e=>{if(!QA(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=BA.textContent(e.target);XA(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Gw(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,$A(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=Cw(t);n=bw({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(XA(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"),!Ww(t.tagName,r))if(i.attributes[r]=qw(this.doc,ww(t.tagName),ww(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(XA(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=fw(e.target)?this.mirror.getId(BA.host(e.target)):this.mirror.getId(e.target);XA(e.target,this.blockClass,this.blockSelector,!1)||QA(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(wP(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||eP(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[yP(r,n)]?wP(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!fw(e.target)||!gw(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),BA.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),ew(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(QA(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[yP(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);XA(e,this.blockClass,this.blockSelector,!1)||(BA.childNodes(e).forEach(e=>this.genAdds(e)),iP(e)&&BA.childNodes(BA.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 wP(e,t){e.delete(t),BA.childNodes(t).forEach(t=>wP(e,t))}function SP(e,t,r){return 0!==e.size&&function(e,t){const r=BA.parentNode(t);return!!r&&e.has(r)}(e,t)}function CP(e,t){return 0!==e.size&&IP(e,t)}function IP(e,t){const r=BA.parentNode(t);return!!r&&(!!e.has(r)||IP(e,r))}let xP;const kP=e=>{if(!xP)return e;return(...t)=>{try{return e(...t)}catch(e){if(xP&&!0===xP(e))return;throw e}}};function EP(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const OP=[];function AP(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 PP(e,t){const r=new bP;OP.push(r),r.init(e);const n=new(jA())(kP(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function TP({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(hP).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(o=>{let s=ww(o);const u=(t=>o=>{const s=AP(o);if(XA(s,n,i,!0))return;let a=null,u=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=dP.Mouse;break;case"touch":a=dP.Touch;break;case"pen":a=dP.Pen}a===dP.Touch?hP[t]===hP.MouseDown?u="TouchStart":hP[t]===hP.MouseUp&&(u="TouchEnd"):dP.Pen}else tP(o)&&(a=dP.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===dP.Touch||u.startsWith("Mouse")&&a===dP.Mouse)&&(a=null)):hP[t]===hP.Click&&(a=l,l=null);const c=tP(o)?o.changedTouches[0]:o;if(!c)return;const h=r.getId(s),{clientX:d,clientY:p}=c;kP(e)({type:hP[u],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(hP[o]){case hP.MouseDown:case hP.MouseUp:s=s.replace("mouse","pointer");break;case hP.TouchStart:case hP.TouchEnd:return}a.push(zA(s,u,t))}),kP(()=>{a.forEach(e=>e())})}function RP({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const s=kP(WA(kP(o=>{const s=AP(o);if(!s||XA(s,n,i,!0))return;const a=r.getId(s);if(s===t&&t.defaultView){const r=YA(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 zA("scroll",s,t)}const MP=["INPUT","TEXTAREA","SELECT"],NP=new WeakMap;function _P(e){return function(e,t){if(UP("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||UP("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||UP("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||UP("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 DP(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function LP({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(BA.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}}),kP(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function FP(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=PP(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=WA(kP(t=>{const r=Date.now()-s;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],s=null}),o),u=kP(WA(kP(e=>{const t=AP(e),{clientX:r,clientY:i}=tP(e)?e.changedTouches[0]:e;s||(s=JA()),a.push({x:r,y:i,id:n.getId(t),timeOffset:JA()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?cP.Drag:e instanceof MouseEvent?cP.MouseMove:cP.TouchMove)}),i,{trailing:!1})),c=[zA("mousemove",u,r),zA("touchmove",u,r),zA("drag",u,r)];return kP(()=>{c.forEach(e=>e())})}(e),o=TP(e),s=RP(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return zA("resize",kP(WA(kP(()=>{const t=ZA(),i=HA();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=AP(e);const u=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=BA.parentElement(r)),!r||!h||MP.indexOf(h)<0||XA(r,n,i,!0))return;if(r.classList.contains(o)||s&&r.matches(s))return;let p=r.value,f=!1;const g=Cw(r)||"";"radio"===g||"checkbox"===g?f=r.checked:(a[h.toLowerCase()]||a[g])&&(p=bw({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=NP.get(t);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){NP.set(t,n);const i=r.getId(t);kP(e)({...n,id:i})}}const p=("last"===u.input?["change"]:["input","change"]).map(e=>zA(e,kP(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=>KA(e[0],e[1],{set(){kP(h)({target:this,isTrusted:!1})}},!1,f))),kP(()=>{p.forEach(e=>e())})}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const s=kP(o=>WA(kP(i=>{const s=AP(i);if(!s||XA(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=[zA("play",s(fP.Play),o),zA("pause",s(fP.Pause),o),zA("seeked",s(fP.Seeked),o),zA("volumechange",s(fP.VolumeChange),o),zA("ratechange",s(fP.RateChange),o)];return kP(()=>{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:kP((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=DP(i,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:a}]}),EP(()=>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:kP((n,i,o)=>{const[s]=o,{id:a,styleId:l}=DP(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),EP(()=>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:kP((n,i,o)=>{const[s]=o,{id:a,styleId:l}=DP(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:kP((n,i,o)=>{const[s]=o,{id:a,styleId:l}=DP(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),n.apply(i,o)})}));const l={};jP("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(jP("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),jP("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),jP("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:kP((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=DP(i.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:[..._P(i),a||0]}]}),n.apply(i,o)})}),i.prototype.deleteRule=new Proxy(u[n].deleteRule,{apply:kP((n,i,o)=>{const[s]=o,{id:a,styleId:l}=DP(i.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[..._P(i),s]}]}),n.apply(i,o)})})}),kP(()=>{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=LP(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:kP((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}=DP(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:_P(s.parentRule)}),i.apply(s,a)})});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:kP((i,o,a)=>{var l;const[u]=a;if(r.has(u))return s.apply(o,[u]);const{id:c,styleId:h}=DP(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:_P(o.parentRule)}),i.apply(o,a)})}),kP(()=>{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=GA(t.fonts,"add",function(t){return function(r){return setTimeout(kP(()=>{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),kP(()=>{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=kP(()=>{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;XA(s,n,i,!0)||XA(u,n,i,!0)||a.push({start:r.getId(s),startOffset:l,end:r.getId(u),endOffset:c})}o({ranges:a})});return a(),zA("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?GA(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 kP(()=>{OP.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 UP(e){return void 0!==window[e]}function jP(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class BP{constructor(e){ew(this,"iframeIdToRemoteIdMap",new WeakMap),ew(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 zP{constructor(e){ew(this,"iframes",new WeakMap),ew(this,"crossOriginIframeMap",new WeakMap),ew(this,"crossOriginIframeMirror",new BP(_w)),ew(this,"crossOriginIframeStyleMirror"),ew(this,"crossOriginIframeRootIdMap",new WeakMap),ew(this,"mirror"),ew(this,"mutationCb"),ew(this,"wrappedEmit"),ew(this,"loadListener"),ew(this,"stylesheetManager"),ew(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new BP(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 uP.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:uP.IncrementalSnapshot,data:{source:cP.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case uP.Meta:case uP.Load:case uP.DomContentLoaded:return!1;case uP.Plugin:return t;case uP.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case uP.IncrementalSnapshot:switch(t.data.source){case cP.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 cP.Drag:case cP.TouchMove:case cP.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case cP.ViewportResize:return!1;case cP.MediaInteraction:case cP.MouseInteraction:case cP.Scroll:case cP.CanvasMutation:case cP.Input:return this.replaceIds(t.data,e,["id"]),t;case cP.StyleSheetRule:case cP.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case cP.Font:return t;case cP.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case cP.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===gP.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class VP{constructor(e){ew(this,"shadowDoms",new WeakSet),ew(this,"mutationCb"),ew(this,"scrollCb"),ew(this,"bypassOptions"),ew(this,"mirror"),ew(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(!gw(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=PP({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(RP({...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(BA.host(e))),this.restoreHandlers.push(LP({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(GA(e.prototype,"attachShadow",function(e){return function(n){const i=e.call(this,n),o=BA.shadowRoot(this);return o&&lP(this)&&r.addShadowRoot(o,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var qP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",WP="undefined"==typeof Uint8Array?[]:new Uint8Array(256),KP=0;KP<64;KP++)WP[qP.charCodeAt(KP)]=KP;const GP=new Map;const JP=(e,t,r)=>{if(!e||!HP(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=GP.get(e);return r||(r=new Map,GP.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 YP(e,t,r){if(e instanceof Array)return e.map(e=>YP(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+=qP[r[t]>>2],i+=qP[(3&r[t])<<4|r[t+1]>>4],i+=qP[(15&r[t+1])<<2|r[t+2]>>6],i+=qP[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:[YP(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:[YP(e.data,t,r),e.width,e.height]}}if(HP(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:JP(e,t,r)}}return e}const ZP=(e,t,r)=>e.map(e=>YP(e,t,r)),HP=(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 $P(e,t,r,n){const i=[];try{const o=GA(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(i,...o){if(!XA(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 XP(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=GA(e,l,function(e){return function(...s){const a=e.apply(this,s);if(JP(a,o,this),"tagName"in this.canvas&&!XA(this.canvas,n,i,!0)){const e=ZP(s,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});s.push(a)}catch{const n=KA(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(n)}return s}const QP="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",eT="undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0)))(QP)],{type:"text/javascript;charset=utf-8"});function tT(e){let t;try{if(t=eT&&(window.URL||window.webkitURL).createObjectURL(eT),!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,"+QP,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class rT{constructor(e){ew(this,"pendingCanvasMutations",new Map),ew(this,"rafStamps",{latestId:0,invokeId:null}),ew(this,"mirror"),ew(this,"mutationCb"),ew(this,"resetObservers"),ew(this,"frozen",!1),ew(this,"locked",!1),ew(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=$P(t,r,n,!0),s=new Map,a=new tT;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:pP["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=>{XA(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=$P(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=GA(t.CanvasRenderingContext2D.prototype,s,function(i){return function(...o){return XA(this.canvas,r,n,!0)||setTimeout(()=>{const r=ZP(o,t,this);e(this.canvas,{type:pP["2D"],property:s,args:r})},0),i.apply(this,o)}});i.push(o)}catch{const r=KA(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:pP["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(...XP(t.WebGLRenderingContext.prototype,pP.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...XP(t.WebGL2RenderingContext.prototype,pP.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 nT{constructor(e){ew(this,"trackedLinkElements",new WeakSet),ew(this,"mutationCb"),ew(this,"adoptedStyleSheetCb"),ew(this,"styleMirror",new oP),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:vw(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 iT{constructor(){ew(this,"nodeMap",new WeakMap),ew(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 oT,sT,aT,lT=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==($b=e.contentWindow)?void 0:$b.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const uT=new yw;function cT(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:P=()=>!1,ignoreCSSAttributes:T=new Set([]),errorHandler:R,applyBackgroundColorToBlockedElements:M=!1}=e;xP=R;const N=!I||window.parent===window;let _=!1;if(!N)try{window.parent.document&&(_=!1)}catch(e){_=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!_)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),uT.reset();const D=!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},L=!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&&!_&&(e=v(e)),e};oT=(e,i)=>{var o;const s=e;if(s.timestamp=JA(),!(null==(o=OP[0])?void 0:o.isFrozen())||s.type===uP.FullSnapshot||s.type===uP.IncrementalSnapshot&&s.data.source===cP.Mutation||OP.forEach(e=>e.unfreeze()),N)null==t||t(j(s),i);else if(_){const e={type:"rrweb",event:j(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,"*")}if(s.type===uP.FullSnapshot)F=s,U=0;else if(s.type===uP.IncrementalSnapshot){if(s.data.source===cP.Mutation&&s.data.isAttachIframe)return;U++;const e=n&&U>=n,t=r&&s.timestamp-F.timestamp>r;(e||t)&&sT(!0)}};const B=e=>{oT({type:uP.IncrementalSnapshot,data:{source:cP.Mutation,...e}})},z=e=>oT({type:uP.IncrementalSnapshot,data:{source:cP.Scroll,...e}}),V=e=>oT({type:uP.IncrementalSnapshot,data:{source:cP.CanvasMutation,...e}}),q=new nT({mutationCb:B,adoptedStyleSheetCb:e=>oT({type:uP.IncrementalSnapshot,data:{source:cP.AdoptedStyleSheet,...e}})}),W=new zP({mirror:uT,mutationCb:B,stylesheetManager:q,recordCrossOriginIframes:I,wrappedEmit:oT});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:uT,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});const K=new iT;aT=new rT({recordCanvas:C,mutationCb:V,win:window,blockClass:i,blockSelector:o,mirror:uT,sampling:y.canvas,dataURLOptions:b});const G=new VP({mutationCb:B,scrollCb:z,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:b,maskTextFn:g,maskInputFn:f,recordCanvas:C,inlineImages:O,sampling:y,slimDOMOptions:L,iframeManager:W,stylesheetManager:q,canvasManager:aT,keepIframeSrcFn:P,processedNodeManager:K},mirror:uT});sT=(e=!1)=>{if(!S)return;oT({type:uP.Meta,data:{href:window.location.href,width:HA(),height:ZA()}},e),q.reset(),G.init(),OP.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new yw,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 Zw(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:uT,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:f,slimDOM:L,dataURLOptions:b,recordCanvas:C,inlineImages:O,applyBackgroundColorToBlockedElements:M,onSerialize:e=>{rP(e,uT)&&W.addIframe(e),nP(e,uT)&&q.trackLinkElement(e),iP(e)&&G.addShadowRoot(BA.shadowRoot(e),document)},onIframeLoad:(e,t)=>{W.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{q.attachLinkElement(e,t)},keepIframeSrcFn:P});if(!t)return console.warn("Failed to snapshot the document");oT({type:uP.FullSnapshot,data:{node:t,initialOffset:YA(window)}},e),OP.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&q.adoptStyleSheets(document.adoptedStyleSheets,uT.getId(document))};try{const e=[],t=e=>{var t;return kP(FP)({mutationCb:B,mousemoveCb:(e,t)=>oT({type:uP.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>oT({type:uP.IncrementalSnapshot,data:{source:cP.MouseInteraction,...e}}),scrollCb:z,viewportResizeCb:e=>oT({type:uP.IncrementalSnapshot,data:{source:cP.ViewportResize,...e}}),inputCb:e=>oT({type:uP.IncrementalSnapshot,data:{source:cP.Input,...e}}),mediaInteractionCb:e=>oT({type:uP.IncrementalSnapshot,data:{source:cP.MediaInteraction,...e}}),styleSheetRuleCb:e=>oT({type:uP.IncrementalSnapshot,data:{source:cP.StyleSheetRule,...e}}),styleDeclarationCb:e=>oT({type:uP.IncrementalSnapshot,data:{source:cP.StyleDeclaration,...e}}),canvasMutationCb:V,fontCb:e=>oT({type:uP.IncrementalSnapshot,data:{source:cP.Font,...e}}),selectionCb:e=>{oT({type:uP.IncrementalSnapshot,data:{source:cP.Selection,...e}})},customElementCb:e=>{oT({type:uP.IncrementalSnapshot,data:{source:cP.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:D,inlineStylesheet:c,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:O,userTriggeredOnInput:k,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:P,blockSelector:o,slimDOMOptions:L,dataURLOptions:b,mirror:uT,iframeManager:W,stylesheetManager:q,shadowDomManager:G,processedNodeManager:K,canvasManager:aT,ignoreCSSAttributes:T,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=>oT({type:uP.Plugin,data:{plugin:e.name,payload:t}})})))||[]},m)};W.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{sT(),e.push(t(document)),lT=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(zA("DOMContentLoaded",()=>{oT({type:uP.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&r()})),e.push(zA("load",()=>{oT({type:uP.Load,data:{}}),"load"===x&&r()},window))),()=>{e.forEach(e=>e()),K.destroy(),lT=!1,xP=void 0}}catch(e){console.warn(e)}}var hT;cT.addCustomEvent=(e,t)=>{if(!lT)throw new Error("please add custom event after start recording");oT({type:uP.Custom,data:{tag:e,payload:t}})},cT.freezePage=()=>{OP.forEach(e=>e.freeze())},cT.takeFullSnapshot=e=>{if(!lT)throw new Error("please take full snapshot after start recording");sT(e)},cT.mirror=uT,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(hT||(hT={}));var dT=Object.freeze({__proto__:null,record:cT}),pT=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=U();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}(),fT=Object.freeze({__proto__:null,NetworkObservers:pT});e.Identify=N,e.Revenue=K,e.Types=oo,e._setDiagnosticsSampleRate=sc,e.add=cc,e.createInstance=ic,e.experiment=lc,e.extendSession=hc,e.flush=dc,e.getDeviceId=pc,e.getSessionId=fc,e.getUserId=gc,e.groupIdentify=mc,e.identify=vc,e.initAll=ac,e.logEvent=yc,e.remove=bc,e.reset=wc,e.revenue=Sc,e.sessionReplay=uc,e.setDeviceId=Cc,e.setGroup=Ic,e.setOptOut=xc,e.setSessionId=kc,e.setTransport=Ec,e.setUserId=Oc,e.track=Ac,Object.defineProperty(e,"__esModule",{value:!0})});
|