@amplitude/unified 1.0.0-zen-observable-migration.1 → 1.0.0-zen-plus-zoning.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.d.ts.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/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/version.d.ts +1 -1
- package/lib/scripts/version.d.ts.map +1 -1
- package/package.json +5 -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"==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",k="rdt_cid",x="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,k;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&&(k=f.return)&&k.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}(),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 Z="Amplitude Logger ",J=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(Z,"[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(Z,"[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(Z,"[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(Z,"[Debug]: ").concat(e.join(" ")))},e}(),Y=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:g,logLevel:G.Warn,loggerProvider:new J,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=Y();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=Y().serverZone),void 0===r&&(r=Y().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:Y().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){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 Q,l.label=1;case 1:return l.trys.push([1,3,,4]),n=X(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(se(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:_.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 _.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(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(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:""},ke=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=xe(r[0]),i=xe(r[1]);return i?(e[n]=i,e):e},{}):{}},xe=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,k=this.buildStatus(I);switch(k){case _.Success:return{status:k,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:k,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:k,statusCode:I,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case _.RateLimit:return{status:k,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:k,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}(),Ze=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),Je=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}(),Ye=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],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 Je(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[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"}(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=ke();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=ke();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[k]=t[k],e[x]=t[x],e[E]=t[E],e[O]=t[O],e},e}(),St="data-amp-mask",Ct="*****",It=/\b(?:\d[ -]*?){13,16}\b/,kt=/(\d{3}-?\d{2}-?\d{4})/g,xt=/[^\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(kt,Ct)).replace(xt,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:Yt}function Bt(e){return e instanceof Yt}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 Zt=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var r=new Jt(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}(),Jt=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}(),Yt=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 Zt(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 Yt(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 Yt(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;return new Yt(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)}});function n(){null==r||r.unsubscribe(),r=null,t.clear()}}Mt()&&Object.defineProperty(Yt,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.30.2-zen-observable-migration.1",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]",kr="".concat(Ir," Form Started"),xr="".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,k,x,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 J),void 0===v&&(v=G.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===I&&(I=""),void 0===k&&(k="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=k,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=x,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,k,x,E,O,A,P,T,R,M,N,_,D,L,F,U,j,z,V,q,W,K,G,Z,J,Y,H;return l(this,function(l){switch(l.label){case 0:return n=t.identityStorage||Fr,x={},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,[(x.domain=s,x.expiration=365,x.sameSite="Lax",x.secure=!1,x.upgrade=!0,x),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=ke(),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===(J=null===(Z=t.trackingOptions)||void 0===Z?void 0:Z.language)||void 0===J||J,platform:null===(H=null===(Y=t.trackingOptions)||void 0===Y?void 0:Y.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,(k=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,void 0,void 0,t.remoteConfig)).storageProvider.isEnabled()];case 8:return l.sent()||(k.loggerProvider.warn("Storage provider ".concat(k.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),k.storageProvider=new Te),[2,k]}})})},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 Ze},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=function(e){var t;void 0===e&&(e={});var r,n=U(),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,Kr()];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":Ot(Et),"[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=Zr(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&&Gr(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},Kr=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()])]}})})},Gr=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},Zr=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=Hr(e);t||n.track(kr,((r={})[_r]=Yr(e.id),r[Dr]=Yr(e.name),r[Lr]=i,r)),t=!0}),r(e,"submit",function(){var r,i,o=Hr(e);t||n.track(kr,((r={})[_r]=Yr(e.id),r[Dr]=Yr(e.name),r[Lr]=o,r)),n.track(xr,((i={})[_r]=Yr(e.id),i[Dr]=Yr(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]})})}}},Yr=function(e){if("string"==typeof e)return e},Hr=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},$r=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]})})}}},Xr=!1,Qr=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 en(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),en(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"])),k=I.next();!k.done;k=I.next()){var x=k.value,E=null!==(p=C[x])&&void 0!==p?p:{},O=E.captureSafeHeaders,A=E.allowlist;(O||A)&&(void 0===A||Array.isArray(A)?C[x]=h(h([],c(O?P:[]),!1),c(null!=A?A:[]),!1):delete C[x])}}catch(e){o={error:e}}finally{try{k&&!k.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 tn(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 rn(e,t){var r,n,i,s,a,l,c;if(e){en(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=tn(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=tn(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 nn="1.18.0-zen-observable-migration.1",on="[Amplitude] Element Clicked",sn="[Amplitude] Element Tag",an="[Amplitude] Element Text",ln="[Amplitude] Page URL",un="https://app.amplitude.com",cn={US:un,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},hn="data-amp-mask-attributes",dn=["input","select","textarea"],pn=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},fn=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=pn(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}}},gn=function(e){return e?e.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[]},mn=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},{})},vn=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:vn(null==e?void 0:e.parentElement,t):null};var yn=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};var bn=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",hn,St]),wn=["type"],Sn=["svg","path","g"],Cn=["password","hidden"];function In(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!bn.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!dn.includes(i)&&!o}(e);if(!Cn.includes(String(e.getAttribute("type")))&&!Sn.includes(l))try{for(var y=u(m),b=y.next();!b.done;b=y.next()){var w=b.value;v&&!wn.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 kn=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}})},xn=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=gn(f.getAttribute(hn)),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 In(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.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[sn]=h,n[an]=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[ln]=Oe(window.location.href.split("?")[0]),n["[Amplitude] Page Title"]=Ot(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)),mn(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&&pn(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,n),s;var a=vn(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={})[sn]=i,t[an]=o.getText(e),t[ln]=window.location.href.split("?")[0],t);return mn(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},En=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?un:t,n=this;this.endpoint=un,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 xn({})}: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===un&&(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:nn}}}),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 On,An=function(){return new Yt(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()}})},Pn=function(e){return void 0===e&&(e="click"),new Yt(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})}})},Tn={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},Rn=function(e){var t,r,n,i,o=Object.values(Tn).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=Tn[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},Mn=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},Nn=function(e,t){return t.filter(function(t){return t.definition.some(function(t){return Tn[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)})})})},_n=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=Nn(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;kn(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.ClickObservableZen="clickObservableZen",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.MutationObservableZen="mutationObservableZen",e.NavigateObservableZen="navigateObservableZen"}(On||(On={}));var Dn=function(e,t){var r,n,i,s,d,p,f,g;void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",nn);var m=e.dataAttributePrefix,v=void 0===m?$e:m,y=e.visualTaggingOptions,b=void 0===y?{enabled:!0,messenger:new En}: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="@amplitude/plugin-autocapture-browser",S=[],C=new xn(e,t),I=Rn(Object.values(null!==(p=null===(d=e.pageActions)||void 0===d?void 0:d.labeledEvents)&&void 0!==p?p:{})),k=Mn(null!==(g=null===(f=e.pageActions)||void 0===f?void 0:f.triggers)&&void 0!==g?g:[]),x=function(e,t,r,n){return new _n(e,t,r,n)}(I,k,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=Rn(Object.values(null!==(r=e.pageActions.labeledEvents)&&void 0!==r?r:{})),k=Mn(null!==(n=e.pageActions.triggers)&&void 0!==n?n:[]),x.update(I,k,e))}(t)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),n=fn(e,e.cssSelectorAllowlist),i=fn(e,e.actionClickAllowlist),s=function(){var t,r,n=Xt(Pn().map(function(t){return C.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,v)})),i=Xt(new Yt(function(t){var r,n=function(r){var n=C.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 Yt(function(t){var r=function(r){var n=C.addAdditionalEventProperties(r,"navigate",e.cssSelectorAllowlist,v);t.next(n)};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}})));var o=Xt(An().map(function(t){return C.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,v)}));return(t={})[On.ChangeObservable]=i,t[On.ClickObservableZen]=n,t[On.MutationObservableZen]=o,t[On.NavigateObservableZen]=r,t}(),a=function(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackEvent,i=e.evaluateTriggers;return r.clickObservableZen.filter(yn).filter(function(e){return n("click",e.closestTrackedAncestor)}).map(function(e){return i(e)}).subscribe(function(e){null==t||t.track(on,e.targetElementProperties)})}({allObservables:s,amplitude:r,shouldTrackEvent:n,evaluateTriggers:x.evaluate.bind(x)}),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.filter(yn).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: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:x.evaluate.bind(x)}),S.push(u),d=function(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,s=e.shouldTrackActionClick,a=r.clickObservableZen,l=r.mutationObservableZen,u=r.navigateObservableZen,c=a.filter(function(e){return!o("click",e.closestTrackedAncestor)}).map(function(e){var t=vn(e.event.target,n.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e}).filter(yn).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(){return p=null,f=null,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(on,i("click",e.closestTrackedAncestor)))})}({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}),d&&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:cn[t.serverZone]}),{isElementSelectable:fn(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]})})}}},Ln=["mutation","navigate"];function Fn(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 Un(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 jn(e){var t=this,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,o=n.clickObservable;if(o){var s=[],u={},c=null,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 Fn(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=Un(s)),function(e){s=[],u={},e&&(Fn(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(Un(s))},1e3)}})]:[2,null]})})});return h.subscribe(function(e){null!==e&&r.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})})}}var Bn,zn,Vn=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 xn(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=fn(e,f),i=fn(e,g),s=function(){var e,t,r=Xt(Pn("pointerdown").map(function(e){return v.addAdditionalEventProperties(e,"click",y,m,!0)})),n=Xt(An().map(function(e){return v.addAdditionalEventProperties(e,"mutation",y,m)}));return window.navigation&&(t=Xt(new Yt(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={})[On.ClickObservable]=r,e[On.MutationObservable]=n,e[On.NavigateObservable]=t,e}(),a=jn({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 yn(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&&Ln.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,i;return l(this,function(o){try{for(e=u(p),t=e.next();!t.done;t=e.next())null==(r=t.value)||r.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(n)throw n.error}}return[2]})})}}},qn="[Amplitude] Network Request",Wn="500-599";function Kn(e,t){var r="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(r).test(e)}function Gn(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 Zn(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 Jn(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 Yn(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 Hn(e,t){var r;void 0===t&&(t={});var n=Zn(e.url);if(!n)return!1;var i,o=n.host;if(!1!==t.ignoreAmplitudeRequests&&(Kn(o,"*.amplitude.com")||Kn(o,"amplitude.com")))return!1;if(null===(r=t.ignoreHosts)||void 0===r?void 0:r.find(function(e){return Kn(o,e)}))return!1;if(!t.captureRules&&void 0!==e.status&&!Gn(e.status,Wn))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 Kn(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)&&!Gn(r,e.statusCodeRange||Wn))}(t,o,e.status,e.url,e.method),i){var r=Jn(t.responseHeaders);if(e.responseWrapper&&r){var n=e.responseWrapper.headers(r);n&&(e.responseHeaders=n)}var s=Jn(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}e.responseWrapper&&t.responseBody&&!Yn(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!Yn(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===qn}))return!0}catch(e){}return!1}(o,e.requestWrapper)}function $n(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude,i=e.loggerProvider;return t.networkObservable.filter(function(e){return Hn(e.event,r)}).subscribe(function(e){var t,r,o,s=e.event,u=Zn(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(qn,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"}(Bn||(Bn={}));var Xn=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=function(){var e,r=new Yt(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={})[Bn.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,zn=$n({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 zn.unsubscribe(),[2]})})}}};let Qn=-1;const ei=e=>{addEventListener("pageshow",t=>{t.persisted&&(Qn=t.timeStamp,e(t))},!0)},ti=(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)))}},ri=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},ni=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ii=()=>{const e=ni();return e?.activationStart??0},oi=(e,t=-1)=>{const r=ni();let n="navigate";return Qn>=0?n="back-forward-cache":r&&(document.prerendering||ii()>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}},si=new WeakMap;function ai(e,t){return si.get(e)||si.set(e,new t),si.get(e)}class li{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 ui=(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{}},ci=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let hi=-1;const di=new Set,pi=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,fi=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of di)e();isFinite(hi)||(hi="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",fi,!0))}},gi=()=>{if(hi<0){const e=ii(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;hi=t??pi(),addEventListener("visibilitychange",fi,!0),addEventListener("prerenderingchange",fi,!0),ei(()=>{setTimeout(()=>{hi=pi()})})}return{get firstHiddenTime(){return hi},onHidden(e){di.add(e)}}},mi=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},vi=[1800,3e3],yi=(e,t={})=>{mi(()=>{const r=gi();let n,i=oi("FCP");const o=ui("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-ii(),0),i.entries.push(t),n(!0)))});o&&(n=ti(e,i,vi,t.reportAllChanges),ei(r=>{i=oi("FCP"),n=ti(e,i,vi,t.reportAllChanges),ri(()=>{i.value=performance.now()-r.timeStamp,n(!0)})}))})},bi=[.1,.25];let wi=0,Si=1/0,Ci=0;const Ii=e=>{for(const t of e)t.interactionId&&(Si=Math.min(Si,t.interactionId),Ci=Math.max(Ci,t.interactionId),wi=Ci?(Ci-Si)/7+1:0)};let ki;const xi=()=>ki?wi:performance.interactionCount??0;let Ei=0;class Oi{u=[];l=new Map;m;p;v(){Ei=xi(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((xi()-Ei)/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.P){if(r?e.duration>r.P?(r.entries=[e],r.P=e.duration):e.duration===r.P&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],P:e.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort((e,t)=>t.P-e.P),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(r)}}}const Ai=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=ci(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},Pi=[200,500],Ti=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=gi();mi(()=>{"interactionCount"in performance||ki||(ki=ui("event",Ii,{type:"event",buffered:!0,durationThreshold:0}));let n,i=oi("INP");const o=ai(t,Oi),s=e=>{Ai(()=>{for(const t of e)o.h(t);const t=o.L();t&&t.P!==i.value&&(i.value=t.P,i.entries=t.entries,n())})},a=ui("event",s,{durationThreshold:t.durationThreshold??40});n=ti(e,i,Pi,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),r.onHidden(()=>{s(a.takeRecords()),n(!0)}),ei(()=>{o.v(),i=oi("INP"),n=ti(e,i,Pi,t.reportAllChanges)}))})};class Ri{m;h(e){this.m?.(e)}}const Mi=[2500,4e3],Ni=[800,1800],_i=e=>{document.prerendering?mi(()=>_i(e)):"complete"!==document.readyState?addEventListener("load",()=>_i(e),!0):setTimeout(e)};function Di(e){var t,r=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+r}function Li(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(Di(e)),navigationStart:Math.floor(performance.timeOrigin)}}var Fi,Ui=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={})=>{mi(()=>{const r=gi();let n,i=oi("LCP");const o=ai(t,Ri),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-ii(),0),i.entries=[t],n())},a=ui("largest-contentful-paint",s);if(a){n=ti(e,i,Mi,t.reportAllChanges);const r=ci(()=>{s(a.takeRecords()),a.disconnect(),n(!0)}),o=e=>{e.isTrusted&&(Ai(r),removeEventListener(e.type,o,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});ei(r=>{i=oi("LCP"),n=ti(e,i,Mi,t.reportAllChanges),ri(()=>{i.value=performance.now()-r.timeStamp,n(!0)})})}})})(function(e){s["[Amplitude] LCP"]=Li(e)}),yi(function(e){s["[Amplitude] FCP"]=Li(e)}),Ti(function(e){s["[Amplitude] INP"]=Li(e)}),((e,t={})=>{const r=gi();yi(ci(()=>{let n,i=oi("CLS",0);const o=ai(t,li),s=e=>{for(const t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},a=ui("layout-shift",s);a&&(n=ti(e,i,bi,t.reportAllChanges),r.onHidden(()=>{s(a.takeRecords()),n(!0)}),ei(()=>{o.i=0,i=oi("CLS",0),n=ti(e,i,bi,t.reportAllChanges),ri(()=>n())}),setTimeout(n))}))})(function(e){s["[Amplitude] CLS"]=Li(e)}),((e,t={})=>{let r=oi("TTFB"),n=ti(e,r,Ni,t.reportAllChanges);_i(()=>{const i=ni();i&&(r.value=Math.max(i.responseStart-ii(),0),r.entries=[i],n(!0),ei(()=>{r=oi("TTFB",0),n=ti(e,r,Ni,t.reportAllChanges),n(!0)}))})})(function(e){s["[Amplitude] TTFB"]=Li(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(".")},Bi=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})},Vi=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),Bi(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}(),qi="AMP_CURRENT_PAGE",Wi="AMP_PREVIOUS_PAGE",Ki="AMP_URL_INFO";!function(e){e.Direct="direct",e.Internal="internal",e.External="external"}(Fi||(Fi={}));var Gi=new Set([i.IDENTIFY,i.GROUP_IDENTIFY,i.REVENUE]),Zi=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 Fi.Direct;case t:return Fi.Internal;default:return Fi.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(Ki)]:[3,3];case 1:return e=a.sent(),n=Oe("undefined"!=typeof location&&location.href||""),i=(null==e?void 0:e[qi])||"",o=void 0,o=n===i?(null==e?void 0:e[Wi])||"":i||document.referrer||"",[4,t.set(Ki,(s={},s[qi]=n,s[Wi]=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(Ki)]:[3,5];case 1:return(null==(i=l.sent())?void 0:i[qi])?[3,3]:[4,t.set(Ki,(c={},c[qi]=n,c[Wi]=document.referrer||"",c))];case 2:l.sent(),l.label=3;case 3:return[4,t.get(Ki)];case 4:if(s=l.sent(),a="",s&&(a=s[Wi]||""),Gi.has(e.event_type))return[2,e];e.event_properties=o(o({},e.event_properties||{}),{"[Amplitude] Page Domain":Ji(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":Ji(e,"[Amplitude] Page Location",n),"[Amplitude] Page Path":Ji(e,"[Amplitude] Page Path","undefined"!=typeof location&&Oe(location.pathname)||""),"[Amplitude] Page Title":Ji(e,"[Amplitude] Page Title",Ot(Et)),"[Amplitude] Page URL":Ji(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(Ki,{})]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})}};return d};function Ji(e,t,r){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?r:e.event_properties[t]}var Yi,Hi=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 Ye(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&&rn(t,a),e()})})]):[3,3];case 2:l.sent(),l.label=3;case 3:return(d=new Ke(a.apiKey,a.loggerProvider,a.serverZone,{enabled:a.enableDiagnostics,sampleRate:a.diagnosticsSampleRate||this._diagnosticsSampleRate})).setTag("library","".concat(pr,"/").concat(dr)),[4,e.prototype._init.call(this,a)];case 4: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 Vi(p,this.config),[4,this.webAttribution.init()]):[3,6];case 5:l.sent(),l.label=6;case 6:return f=ke(),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,8]:[4,this.add(Qr()).promise];case 7:l.sent(),l.label=8;case 8:return[4,this.add(new ae({diagnosticsClient:d})).promise];case 9:return l.sent(),[4,this.add(new fr).promise];case 10:return l.sent(),[4,this.add(new we).promise];case 11:return l.sent(),function(e){Xr||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."),Xr=!0)}(this.config),w=this.config.defaultTracking,Qt(w,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add($r()).promise]):[3,13];case 12:l.sent(),l.label=13;case 13:return function(e){return Qt(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 tr(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Wr(ur(this.config))).promise]):[3,17];case 16:l.sent(),l.label=17;case 17:return ir(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Dn(sr(this.config),{diagnosticsClient:d})).promise]):[3,19];case 18:l.sent(),l.label=19;case 19:return or(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(Vn(ar(this.config))).promise]):[3,21];case 20:l.sent(),l.label=21;case 21:return nr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(Xn(lr(this.config))).promise]):[3,23];case 22:l.sent(),l.label=23;case 23: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(Ui()).promise]):[3,25];case 24:l.sent(),l.label=25;case 25:return function(e){return Qt(e,"pageUrlEnrichment")}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(Zi()).promise]):[3,27];case 26:l.sent(),l.label=27;case 27:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 28: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)},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),$i=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}),Xi="[Amplitude]",Qi="".concat(Xi," Session Replay ID"),eo=ge.US,to={enabled:!0},ro="".concat(Xi," Session Replay Debug"),no="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"}(Yi||(Yi={}));var io=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}(),oo="medium";var so=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 so(e,oo,r)}},ao=function(e,t){return function(r,n){return function(e,t,r){var n,i,o;if(void 0===t&&(t={defaultMaskLevel:oo}),r){if(r.closest("."+no))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 so(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:oo,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},lo=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")},uo=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},co=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=uo(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},ho=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:""}]}})})},po=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},fo=function(){return{flushMaxRetries:2,logLevel:G.Warn,loggerProvider:new J,transportProvider:new Ze}},go=function(e){function t(t,r){var n,i,s,a,l,u=this,c=fo();return(u=e.call(this,o(o({transportProvider:c.transportProvider,loggerProvider:new io(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||eo,u.configServerUrl=r.configServerUrl,u.trackServerUrl=r.trackServerUrl,u.shouldInlineStylesheet=r.shouldInlineStylesheet,u.version=r.version,u.performanceConfig=r.performanceConfig||to,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),mo=(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))(mo||{}),vo=(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))(vo||{}),yo=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=this;return l(this,function(l){switch(l.label){case 0:return(n=o({},this.localConfig)).optOut=this.localConfig.optOut,n.captureEnabled=!0,[4,new Promise(function(e){I.remoteConfigClient.subscribe("configs.sessionReplay","all",function(t,r){var o;if(I.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(r,":"),JSON.stringify(t,null,2)),t){var s=t,a=s.sr_sampling_config,l=s.sr_privacy_config,u=s.sr_targeting_config,c=null===(o=n.interactionConfig)||void 0===o?void 0:o.ugcFilterRules;n.interactionConfig=s.sr_interaction_config,n.interactionConfig&&c&&(n.interactionConfig.ugcFilterRules=c),n.loggingConfig=s.sr_logging_config,(a||l||u)&&(i={},a&&(i.sr_sampling_config=a),l&&(i.sr_privacy_config=l),u&&(i.sr_targeting_config=u))}e()})})];case 1:if(l.sent(),!i)return[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:i}];if(s=i.sr_sampling_config,a=i.sr_privacy_config,h=i.sr_targeting_config,s&&Object.keys(s).length>0?(Object.prototype.hasOwnProperty.call(s,"capture_enabled")?n.captureEnabled=s.capture_enabled:n.captureEnabled=!1,Object.prototype.hasOwnProperty.call(s,"sample_rate")&&(n.sampleRate=s.sample_rate)):(n.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),a){d=null!==(e=n.privacyConfig)&&void 0!==e?e:{},p={defaultMaskLevel:null!==(r=null!==(t=a.defaultMaskLevel)&&void 0!==t?t:d.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},f=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},g=o(o({},f(d)),f(a));try{for(m=u(Object.entries(g)),v=m.next();!v.done;v=m.next())y=c(v.value,2),b=y[0],"mask"===(w=y[1])?p.maskSelector.push(b):"block"===w?p.blockSelector.push(b):"unmask"===w&&p.unmaskSelector.push(b)}catch(e){S={error:e}}finally{try{v&&!v.done&&(C=m.return)&&C.call(m)}finally{if(S)throw S.error}}n.privacyConfig=(k=p,x=this.localConfig.loggerProvider,E=document.createDocumentFragment(),O=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter(function(e){try{E.querySelector(e)}catch(t){return x.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0}),0!==e.length)return e},k.blockSelector=O(k.blockSelector),k.maskSelector=O(k.maskSelector),k.unmaskSelector=O(k.unmaskSelector),k)}return h&&Object.keys(h).length>0&&(n.targetingConfig=h),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:po(n)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:i}]}var k,x,E,O})})},e}(),bo=function(e,t){return a(void 0,void 0,void 0,function(){var r,n;return l(this,function(i){return r=new go(e,t),n=new Ye(e,r.loggerProvider,r.serverZone,t.configServerUrl),[2,new yo(n,r)]})})},wo=Uint8Array,So=Uint16Array,Co=Uint32Array,Io=new wo([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]),ko=new wo([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]),xo=new wo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Eo=function(e,t){for(var r=new So(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new Co(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]},Oo=Eo(Io,2),Ao=Oo[0],Po=Oo[1];Ao[28]=258,Po[258]=28;for(var To=Eo(ko,0)[1],Ro=new So(32768),Mo=0;Mo<32768;++Mo){var No=(43690&Mo)>>>1|(21845&Mo)<<1;No=(61680&(No=(52428&No)>>>2|(13107&No)<<2))>>>4|(3855&No)<<4,Ro[Mo]=((65280&No)>>>8|(255&No)<<8)>>>1}var _o=function(e,t,r){for(var n=e.length,i=0,o=new So(t);i<n;++i)++o[e[i]-1];var s,a=new So(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new So(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[Ro[h]>>>l]=u}else for(s=new So(n),i=0;i<n;++i)s[i]=Ro[a[e[i]-1]++]>>>15-e[i];return s},Do=new wo(288);for(Mo=0;Mo<144;++Mo)Do[Mo]=8;for(Mo=144;Mo<256;++Mo)Do[Mo]=9;for(Mo=256;Mo<280;++Mo)Do[Mo]=7;for(Mo=280;Mo<288;++Mo)Do[Mo]=8;var Lo=new wo(32);for(Mo=0;Mo<32;++Mo)Lo[Mo]=5;var Fo=_o(Do,9,0),Uo=_o(Lo,5,0),jo=function(e){return(e/8|0)+(7&e&&1)},Bo=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof So?So:e instanceof Co?Co:wo)(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},Vo=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},qo=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 wo(0),0];if(1==i){var s=new wo(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 So(d+1),f=Wo(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 wo(p),f]},Wo=function(e,t,r){return-1==e.s?Math.max(Wo(e.l,t,r+1),Wo(e.r,t,r+1)):t[e.s]=r},Ko=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new So(++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]},Go=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},Zo=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)},Jo=function(e,t,r,n,i,o,s,a,l,u,c){zo(t,c++,r),++i[256];for(var h=qo(i,15),d=h[0],p=h[1],f=qo(o,15),g=f[0],m=f[1],v=Ko(d),y=v[0],b=v[1],w=Ko(g),S=w[0],C=w[1],I=new So(19),k=0;k<y.length;++k)I[31&y[k]]++;for(k=0;k<S.length;++k)I[31&S[k]]++;for(var x=qo(I,7),E=x[0],O=x[1],A=19;A>4&&!E[xo[A-1]];--A);var P,T,R,M,N=u+5<<3,_=Go(i,Do)+Go(o,Lo)+s,D=Go(i,d)+Go(o,g)+s+14+3*A+Go(I,E)+(2*I[16]+3*I[17]+7*I[18]);if(N<=_&&N<=D)return Zo(t,c,e.subarray(l,l+u));if(zo(t,c,1+(D<_)),c+=2,D<_){P=_o(d,p,0),T=d,R=_o(g,m,0),M=g;var L=_o(E,O,0);zo(t,c,b-257),zo(t,c+5,C-1),zo(t,c+10,A-4),c+=14;for(k=0;k<A;++k)zo(t,c+3*k,E[xo[k]]);c+=3*A;for(var F=[y,S],U=0;U<2;++U){var j=F[U];for(k=0;k<j.length;++k){var B=31&j[k];zo(t,c,L[B]),c+=E[B],B>15&&(zo(t,c,j[k]>>>5&127),c+=j[k]>>>12)}}}else P=Fo,T=Do,R=Uo,M=Lo;for(k=0;k<a;++k)if(n[k]>255){B=n[k]>>>18&31;Vo(t,c,P[B+257]),c+=T[B+257],B>7&&(zo(t,c,n[k]>>>23&31),c+=Io[B]);var z=31&n[k];Vo(t,c,R[z]),c+=M[z],z>3&&(Vo(t,c,n[k]>>>5&8191),c+=ko[z])}else Vo(t,c,P[n[k]]),c+=T[n[k]];return Vo(t,c,P[256]),c+T[256]},Yo=new Co([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ho=function(e,t,r,n,i){return function(e,t,r,n,i,o){var s=e.length,a=new wo(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=Zo(l,u,e.subarray(c,h)):(l[c]=o,u=Zo(l,u,e.subarray(c,s)))}else{for(var d=Yo[t-1],p=d>>>13,f=8191&d,g=(1<<r)-1,m=new So(32768),v=new So(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 Co(25e3),C=new So(288),I=new So(32),k=0,x=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((k>7e3||E>24576)&&M>423){u=Jo(e,l,0,S,C,I,x,E,A,c-A,u),E=k=x=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|Po[_]<<18|To[D];var G=31&Po[_],Z=31&To[D];x+=Io[G]+ko[Z],++C[257+G],++I[Z],O=c+_,++k}else S[E++]=e[c],++C[e[c]]}}u=Jo(e,l,o,S,C,I,x,E,A,c-A,u)}return Bo(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 $o(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=Ho(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 Xo=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}($o(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new wo(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 wo(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 Bo(n,0,i)}(JSON.stringify(t))),!0)};var Qo=function(){function e(e,t,r,n){var i,o=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=Xo(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}(),es="Failed to store session replay events in IndexedDB",ts="1.29.5-zen-observable-migration.0",rs=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=ts,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(lo(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 ns=(e,t)=>t.some(t=>e instanceof t);let is,os;const ss=new WeakMap,as=new WeakMap,ls=new WeakMap;let us={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return ss.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return ps(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function cs(e){us=e(us)}function hs(e){return(os||(os=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(fs(this),t),ps(this.request)}:function(...t){return ps(e.apply(fs(this),t))}}function ds(e){return"function"==typeof e?hs(e):(e instanceof IDBTransaction&&function(e){if(ss.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)});ss.set(e,t)}(e),ns(e,is||(is=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,us):e)}function ps(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(ps(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",o)});return ls.set(t,e),t}(e);if(as.has(e))return as.get(e);const t=ds(e);return t!==e&&(as.set(e,t),ls.set(t,e)),t}const fs=e=>ls.get(e);function gs(e,t,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=ps(s);return n&&s.addEventListener("upgradeneeded",e=>{n(ps(s.result),e.oldVersion,e.newVersion,ps(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 ms=["get","getKey","getAll","getAllKeys","count"],vs=["put","add","delete","clear"],ys=new Map;function bs(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(ys.get(t))return ys.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,i=vs.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!ms.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 ys.set(t,o),o}cs(e=>({...e,get:(t,r,n)=>bs(t,r)||e.get(t,r,n),has:(t,r)=>!!bs(t,r)||e.has(t,r)}));const ws=["continue","continuePrimaryKey","advance"],Ss={},Cs=new WeakMap,Is=new WeakMap,ks={get(e,t){if(!ws.includes(t))return e[t];let r=Ss[t];return r||(r=Ss[t]=function(...e){Cs.set(this,Is.get(this)[t](...e))}),r}};async function*xs(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,ks);for(Is.set(r,t),ls.set(r,fs(t));t;)yield r,t=await(Cs.get(r)||t.continue()),Cs.delete(r)}function Es(e,t){return t===Symbol.asyncIterator&&ns(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&ns(e,[IDBIndex,IDBObjectStore])}cs(e=>({...e,get:(t,r,n)=>Es(t,r)?xs:e.get(t,r,n),has:(t,r)=>Es(t,r)||e.has(t,r)}));var Os,As=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"}(Os||(Os={}));var Ps,Ts,Rs,Ms="sessionCurrentSequence",Ns="sequencesToSend",_s=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)}})},Ds=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]}})})},Ls=function(e){var t,r;return e.objectStoreNames.contains(Ms)||(r=e.createObjectStore(Ms,{keyPath:"sessionId"})),e.objectStoreNames.contains(Ns)||(t=e.createObjectStore(Ns,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},Fs=function(e){return a(void 0,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return[4,gs(e,1,{upgrade:Ls})];case 1:return[2,t.sent()]}})})},Us=function(e){function t(t){var r=e.call(this,t)||this;return r.getSequencesToSend=function(){return a(r,void 0,void 0,function(){var e,t,r,n,i,o;return l(this,function(s){switch(s.label){case 0:return s.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=s.sent(),s.label=2;case 2:return t?(r=t.value,n=r.sessionId,i=r.events,e.push({events:i,sequenceId:t.key,sessionId:n}),[4,t.continue()]):[3,4];case 3:return t=s.sent(),[3,2];case 4:return[2,e];case 5:return o=s.sent(),this.loggerProvider.warn("".concat(es,": ").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(Ms,e)];case 1:return(t=i.sent())?[4,this.db.put(Ns,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=i.sent(),[4,this.db.put(Ms,{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(es,": ").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(Ms,"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(es,": ").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(Ns,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(es,": ").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(Ns,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(es,": ").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,_s()];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!==Os.SENT&&n.push(i.storeSendingEvents(e,u.events))}),[4,Ds(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!==Os.SENT&&s.push(a.storeSendingEvents(n,l[t].events))})}}),[4,Ds(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,Fs(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(es,": ").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}(As),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}(As),Bs=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 rs(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,Us.new(s,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:i,apiKey:t.apiKey},r)];case 1:return e=o.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,null!=e?e:d()]}})})},"idb"!==c?[3,2]:[4,p()];case 1:return g=w.sent(),[3,3];case 2:g=d(),w.label=3;case 3:return f=g,m=function(e){var r=e.events,n=e.sessionId,i=e.deviceId,o=e.sequenceId;t.debugMode&&ho().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 Vs(e,t){if(Rs=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};Ps=o(o({},r),t),Ts=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Ps.root,r);var n=qs(e,"all",function(){return qs(e,"two",function(){return qs(e,"one",function(){return qs(e,"none")})})});if(n){var i=Qs(ea(n,e));return i.length>0&&(n=i[0]),Ks(n)}throw new Error("Selector was not found.")}function qs(e,t,r){for(var n=null,i=[],o=e,s=0,a=function(){var e,a,l=(new Date).getTime()-Rs.getTime();if(void 0!==Ps.timeoutMs&&l>Ps.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var d=Hs(function(e){var t=e.getAttribute("id");if(t&&Ps.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||Hs.apply(void 0,h([],c(function(e){var t=Array.from(e.attributes).filter(function(e){return Ps.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))||Hs.apply(void 0,h([],c(function(e){var t=Array.from(e.classList).filter(Ps.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(o)),!1))||Hs(function(e){var t=e.tagName.toLowerCase();if(Ps.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(Ys).map(function(e){return Js(e,p)})));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(Ys).map(function(e){return Js(e,p)})));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&Ys(f)&&(d=[Js(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[Js(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>=Ps.seedMinLength&&(n=Ws(i,r)))return"break";o=o.parentElement,s++};o;){if("break"===a())break}return n||(n=Ws(i,r)),!n&&r?r():n}function Ws(e,t){var r,n,i=Qs(Xs(e));if(i.length>Ps.threshold)return t?t():null;try{for(var o=u(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(Zs(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 Ks(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 Gs(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function Zs(e){var t=Ks(e);switch(Ts.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 Js(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Ys(e){return"html"!==e.name&&!e.name.startsWith("#")}function Hs(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter($s);return r.length>0?r:null}function $s(e){return null!=e}function Xs(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(Xs(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 Qs(e){return h([],c(e),!1).sort(function(e,t){return Gs(e)-Gs(t)})}function ea(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>Ps.optimizedMinLength))return[3,5];n=1,s.label=1;case 1:return n<e.length-1?r.counter>Ps.maxNumberOfTries?[2]:(r.counter+=1,(i=h([],c(e),!1)).splice(n,1),o=Ks(i),r.visited.has(o)?[2]:Zs(i)&&function(e,t){return Ts.querySelector(Ks(e))===t}(i,t)?[4,i]:[3,4]):[3,5];case 2:return s.sent(),r.visited.set(o,!0),[5,u(ea(i,t,r))];case 3:s.sent(),s.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var ta=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}},ra=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)}},na=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===vo.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=Vs(f)}catch(e){r.logger.debug("error resolving selector from finder")}var g=co(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 ia(){var e=U();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function oa(){var e=U();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}var sa=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=lo(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}(),aa=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:ia(),viewportWidth:oa(),pageUrl:co(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=oa(),this._maxScrollHeight=ia(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new sa(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=oa();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=ia();this._maxScrollY=e.y;var o=e.y+i;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),la=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))},ua=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,gs(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]}})})}},ca=new ua,ha=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,ca.clearStoreOfOldSessions({loggerProvider:n,apiKey:i,currentSessionId:t})];case 1:return l.sent(),[4,ca.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 nh})];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),ca.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 da(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?co(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}}da();var pa,fa,ga,ma=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,ha({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!==Yi.METADATA?(e={config:po(i),version:ts},n?[4,ho()]:[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 io(new J)}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,k,x,E,O,A;return l(this,function(l){switch(l.label){case 0:return this.loggerProvider=new io(t.loggerProvider||new J),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new la({sessionId:t.sessionId,deviceId:t.deviceId}),a=this,[4,bo(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,ts,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=aa.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 na(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,Bs({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(),x=S,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(x.toString())),[3,6];case 6:if(!(null===(s=this.config.interactionConfig)||void 0===s?void 0:s.enabled))return[3,10];C=this.config.interactionConfig.batch?ra:ta,l.label=7;case 7:return l.trys.push([7,9,,10]),[4,Bs({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 k=l.sent(),x=k,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(x.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 ih})]:[3,12];case 11:A=l.sent().compressionScript,E=A,l.label=12;case 12:return this.eventCompressor=new Qo(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 la({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={})[Qi]=r.sessionReplayId?r.sessionReplayId:null,i=e,t.debugMode&&(i[ro]=JSON.stringify({appHash:Ae(t.apiKey).toString()}))),this.addCustomRRWebEvent(Yi.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(Yi.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=da({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 Bb})];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 eT})];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(Yi.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===mo.Meta&&(e.data.href=co(e.data.href,m)),S.eventCompressor&&S.eventCompressor.enqueueEvent(e,c)},inlineStylesheet:a.shouldInlineStylesheet,hooks:g,maskAllInputs:!0,maskTextClass:no,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:a.applyBackgroundColorToBlockedElements,maskInputFn:ao("input",d),maskTextFn:ao("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(Yi.DEBUG_INFO),e&&this.addCustomRRWebEvent(Yi.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 rT})];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}(),va=function(e){return function(){var t=e.config||fo();return{logger:t.loggerProvider,logLevel:t.logLevel}}},ya=function(){var e=new ma;return{init:oe(e.init.bind(e),"init",va(e)),evaluateTargetingAndCapture:oe(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",va(e)),setSessionId:oe(e.setSessionId.bind(e),"setSessionId",va(e)),getSessionId:oe(e.getSessionId.bind(e),"getSessionId",va(e)),getSessionReplayProperties:oe(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",va(e)),flush:oe(e.flush.bind(e),"flush",va(e)),shutdown:oe(e.shutdown.bind(e),"shutdown",va(e))}}(),ba=ya.init,wa=ya.setSessionId,Sa=ya.getSessionId,Ca=ya.getSessionReplayProperties,Ia=ya.flush,ka=ya.shutdown,xa=ya.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"}(pa||(pa={})),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"}(fa||(fa={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(ga||(ga={}));var Ea=[pa.SET,pa.SET_ONCE,pa.ADD,pa.APPEND,pa.PREPEND,pa.POSTINSERT],Oa="1.23.3-zen-observable-migration.1",Aa=function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.sessionReplay={flush:Ia,getSessionId:Sa,getSessionReplayProperties:Ca,init:ba,setSessionId:wa,shutdown:ka,evaluateTargetingAndCapture:xa},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(Oa,".")),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:Oa},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){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(Ea.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}(),Pa=function(e,t){return Pa=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])},Pa(e,t)};function Ta(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}Pa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var Ra=function(){return Ra=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},Ra.apply(this,arguments)};function Ma(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 Na(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 _a(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 Da(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 La(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 Fa="is",Ua="is not",ja="contains",Ba="does not contain",za="less",Va="less or equal",qa="greater",Wa="greater or equal",Ka="version less",Ga="version less or equal",Za="version greater",Ja="version greater or equal",Ya="set is",Ha="set is not",$a="set contains",Xa="set does not contain",Qa="set contains any",el="set does not contain any",tl="regex match",rl="regex does not match",nl=-862048943,il=461845907,ol=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=ul(r,s<<2);o=sl(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,nl),u=ll(u,15),o^=u=Math.imul(u,il);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,nl),u=ll(u,15),o^=u=Math.imul(u,il);break;case 1:u^=r[l],u=Math.imul(u,nl),u=ll(u,15),o^=u=Math.imul(u,il)}return al(o^=n)>>>0},sl=function(e,t){var r=e,n=t;return r=Math.imul(r,nl),r=ll(r,15),r=Math.imul(r,il),n=ll(n^=r,13),(n=Math.imul(n,5))+-430675100|0},al=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},ll=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},ul=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 cl(r)},cl=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},hl=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=_a(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}},dl="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),pl=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(dl).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}(),fl=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=_a(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=_a(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=Ra(Ra(Ra({},t.metadata),a.metadata),i.metadata);i=Ra(Ra({},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=_a(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=!0;try{for(var c=(i=void 0,_a(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=hl(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 ol(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(hl(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=_a(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,_a(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 Fa:case ja:case za:case Va:case qa:case Wa:case Ka:case Ga:case Za:case Ja:case Ya:case $a:case Qa:return r;case Ua:case Ba:case Xa:case el:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Ya:return this.setEquals(e,r);case Ha:return!this.setEquals(e,r);case $a:return this.matchesSetContainsAll(e,r);case Xa:return!this.matchesSetContainsAll(e,r);case Qa:return this.matchesSetContainsAny(e,r);case el:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Fa:return this.matchesIs(e,r);case Ua:return!this.matchesIs(e,r);case ja:return this.matchesContains(e,r);case Ba:return!this.matchesContains(e,r);case za:case Va:case qa:case Wa:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case Ka:case Ga:case Za:case Ja:return this.matchesComparable(e,t,r,function(e){return pl.parse(e)},this.versionComparator);case tl:return this.matchesRegex(e,r);case rl: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=_a(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 Ka:return e<r;case Va:case Ga:return e<=r;case qa:case Za:return e>r;case Wa:case Ja:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case za:case Ka:return n<0;case Va:case Ga:return n<=0;case qa:case Za:return n>0;case Wa:case Ja: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 Ya:case Ha:case $a:case Xa:case Qa:case el: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&&La([],Da(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=_a(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=_a(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}(),gl=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=gl(e,t,r);n&&s.push.apply(s,La([],Da(n),!1))};try{for(var l=_a(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 ml="function"==typeof Buffer,vl=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),yl=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),bl=(e=>{let t={};return e.forEach((e,r)=>t[e]=r),t})(yl),wl=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Sl=String.fromCharCode.bind(String),Cl=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_")),Il=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),kl=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+=yl[t>>18&63]+yl[t>>12&63]+yl[t>>6&63]+yl[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},xl="function"==typeof btoa?e=>btoa(e):ml?e=>Buffer.from(e,"binary").toString("base64"):kl,El=ml?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(Sl.apply(null,e.subarray(r,r+4096)));return xl(t.join(""))},Ol=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Sl(192|t>>>6)+Sl(128|63&t):Sl(224|t>>>12&15)+Sl(128|t>>>6&63)+Sl(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Sl(240|t>>>18&7)+Sl(128|t>>>12&63)+Sl(128|t>>>6&63)+Sl(128|63&t)},Al=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Pl=e=>e.replace(Al,Ol),Tl=ml?e=>Buffer.from(e,"utf8").toString("base64"):vl?e=>El(vl.encode(e)):e=>xl(Pl(e)),Rl=(e,t=!1)=>t?Cl(Tl(e)):Tl(e),Ml=e=>Rl(e,!0),Nl=e=>{if(e=e.replace(/\s+/g,""),!wl.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=bl[e.charAt(o++)]<<18|bl[e.charAt(o++)]<<12|(r=bl[e.charAt(o++)])<<6|(n=bl[e.charAt(o++)]),i+=64===r?Sl(t>>16&255):64===n?Sl(t>>16&255,t>>8&255):Sl(t>>16&255,t>>8&255,255&t);return i},_l=Ml;var Dl=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return Ta(t,e),t}(Error),Ll=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return Ta(t,e),t}(Error),Fl=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return Ma(this,void 0,void 0,function(){var r,n,i,o;return Na(this,function(s){switch(s.label){case 0:return r=_l(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"]=_l(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 Dl(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}})})},e}(),Ul=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return Ma(this,void 0,void 0,function(){var t,r;return Na(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"]=_l(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,Bl=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}(),Vl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ql={},Wl={get exports(){return ql},set exports(e){ql=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",k="Browser",x="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"+k]],[/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 "+k],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 "+k]],[/fxios\/([-\w\.]+)/i],[d,[u,E]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+k]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+k],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,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,x+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[u,"Android "+k]],[/(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,x+"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,x+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],d],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,d],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,d]]},Z=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof Z))return new Z(e,t).getResult();var i=e||(typeof r!==o&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),f=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(G,t):G;return this.getBrowser=function(){var e={};return e[u]=n,e[d]=n,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};Z.VERSION="0.7.33",Z.BROWSER=j([u,d,"major"]),Z.CPU=j([p]),Z.DEVICE=j([l,h,c,f,g,v,m,y,b]),Z.ENGINE=Z.OS=j([u,d]),e.exports&&(t=e.exports=Z),t.UAParser=Z;var J=typeof r!==o&&(r.jQuery||r.Zepto);if(J&&!J.ua){var Y=new Z;J.ua=Y.getResult(),J.ua.get=function(){return Y.getUA()},J.ua.set=function(e){Y.setUA(e);var t=Y.getResult();for(var r in t)J.ua[r]=t[r]}}}("object"==typeof window?window:Vl)}(Wl,ql);var Kl=function(){return Kl=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},Kl.apply(this,arguments)};function Gl(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 Zl(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 Jl(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 Yl(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 Hl(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 $l=function(e,t){var r,n;void 0===t&&(t=!1);var i=Xl(e,t),o=void 0,s=jl.document.cookie.split("; ");try{for(var a=Jl(s),l=a.next();!l.done;l=a.next()){var u=Yl(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}},Xl=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))},Ql=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 Gl(this,void 0,void 0,function(){return Zl(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=$l(this.apiKey,!0);return(e||(e=$l(this.apiKey,!1))||(e=function(e){var t=Xl(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=Xl(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 Gl(this,void 0,void 0,function(){var t,r=this;return Zl(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 eu,tu,ru=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)})},nu=function(){function e(e){this.client=e}return e.prototype.request=function(e){return Gl(this,void 0,void 0,function(){return Zl(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}(),iu={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 Ll("Request timeout after "+t+" milliseconds"))},t),e.then(r,n)})}(Gl(void 0,void 0,void 0,function(){var i,o;return Zl(this,function(s){switch(s.label){case 0:return[4,ru(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"}(eu||(eu={})),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"}(tu||(tu={}));var ou=function(e){return!e||e===tu.FallbackInline||e===tu.FallbackConfig||e===tu.SecondaryInitialVariants},su={debug:!1,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:eu.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:iu},au="1.18.0",lu=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:su.instanceName;this.queue=new cu(i),this.cache=new uu(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}(),uu=function(){function e(e){this.isSessionStorageAvailable=hu(),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}(),cu=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=function(){var e=Bl();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=Jl(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}(),hu=function(){var e=Bl();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},du=function(){function e(){this.globalScope=Bl()}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}(),pu=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 Kl({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=Jl(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=Jl(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}(),fu=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}},gu=function(){function e(){this.globalScope=Bl()}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}(),mu=function(e){return null==e},vu=function(e){return!!mu(e)||e&&0===Object.keys(e).length},yu=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},bu=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 Gl(this,void 0,void 0,function(){return Zl(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 Gl(this,void 0,void 0,function(){var n=this;return Zl(this,function(i){return this.done||(this.timeoutHandle=jl.setTimeout(function(){return Gl(n,void 0,void 0,function(){var n,i;return Zl(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}(),wu=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},Su=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},Cu=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}(),Iu=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}(),ku=function(){function e(e,t){var r,n,i,o,s=this;this.engine=new fl,this.isRunning=!1,this.apiKey=e,t=function(e){var t,r;if(!e||"object"!=typeof e)return{};var n={};try{for(var i=Jl(Object.entries(e)),o=i.next();!o.done;o=i.next()){var s=Yl(o.value,2),a=s[0],l=s[1];mu(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}(t),this.config=Kl(Kl(Kl({},su),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":su.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":su.flagsServerUrl),flagConfigPollingIntervalMillis:t.flagConfigPollingIntervalMillis<6e4?6e4:null!==(i=t.flagConfigPollingIntervalMillis)&&void 0!==i?i:su.flagConfigPollingIntervalMillis});var a=null===(o=this.config)||void 0===o?void 0:o.internalInstanceNameSuffix;if(this.isWebExperiment="web"===a,this.poller=new zl(function(){return s.doFlags()},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var l in this.config.initialVariants)this.config.initialVariants[l]=fu(this.config.initialVariants[l]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new Cu(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new Iu(this.config.exposureTrackingProvider)),this.integrationManager=new lu(this.config,this);var u,c=new nu(this.config.httpClient||iu);this.flagApi=new Ul(this.apiKey,this.config.flagsServerUrl,c),this.evaluationApi=new Fl(this.apiKey,this.config.serverUrl,c);var h=a?"".concat(this.config.instanceName,"-").concat(a):this.config.instanceName;u=this.isWebExperiment?new gu:new du,this.variants=function(e,t,r){var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n);return new pu(i,r,fu)}(this.apiKey,h,u),this.flags=function(e,t,r){void 0===r&&(r=new du);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-flags");return new pu(i,r)}(this.apiKey,h,u);try{this.flags.load(),this.variants.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return Gl(this,void 0,void 0,function(){var t,r,n;return Zl(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 Gl(this,arguments,void 0,function(e,t){var r;return void 0===e&&(e=this.user),Zl(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 this.config.debug&&(r instanceof Ll?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);yu(r)||delete e[t]}return Kl(Kl(Kl({},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=Kl({},this.user.user_properties);return Kl(Kl({},this.user),{user_properties:t})}return Kl({},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=Kl({},e.user_properties);this.user=Kl(Kl({},e),{user_properties:r})}else this.user=Kl({},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=Ra({},e),o=[],s=t||Object.keys(i);try{for(var a=_a(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=gl(u,i);c&&o.push.apply(o,La([],Da(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=Bl();s&&(o.page={url:s.location.href});var a={};if(!e.groups)return o;try{for(var l=Jl(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=Jl(Object.keys(s)),u=l.next();!u.done;u=l.next()){var c=u.value;a[c]=Su(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===eu.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===eu.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var n=this.flags.get(e);return(yu(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=tu.LocalEvaluation,a=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!mu(o)&&!a)return{variant:wu(o),source:s,hasDefaultVariant:!1};if(a&&(i={variant:wu(o),source:s,hasDefaultVariant:!0}),!mu(r))return{variant:wu(r),source:tu.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!mu(l))return{variant:wu(l),source:tu.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=wu(this.config.fallbackVariant),c={variant:u,source:tu.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return vu(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(!mu(i)&&!o)return{variant:wu(i),source:tu.LocalStorage,hasDefaultVariant:!1};if(o&&(n={variant:wu(i),source:tu.LocalStorage,hasDefaultVariant:!0}),!mu(t))return{variant:wu(t),source:tu.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=this.config.initialVariants[e];if(!mu(s))return{variant:wu(s),source:tu.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var a=wu(this.config.fallbackVariant),l={variant:a,source:tu.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return vu(a)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!mu(i))return{variant:wu(i),source:tu.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(!mu(o)&&!s)return{variant:wu(o),source:tu.LocalStorage,hasDefaultVariant:!1};if(s&&(n={variant:wu(o),source:tu.LocalStorage,hasDefaultVariant:!0}),!mu(t))return{variant:wu(t),source:tu.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var a=wu(this.config.fallbackVariant),l={variant:a,source:tu.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return vu(a)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return Gl(this,void 0,void 0,function(){var i,o;return Zl(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=Kl({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return Gl(this,void 0,void 0,function(){var n,i,o,s,a,l,u;return Zl(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,Kl({timeoutMillis:t},r))];case 2:n=c.sent(),i={};try{for(o=Jl(Object.keys(n)),s=o.next();!s.done;s=o.next())a=s.value,i[a]=Su(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 Gl(this,void 0,void 0,function(){var e,t,r;return Zl(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:au,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 Ll))throw r;if(this.config.debug&&console.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 Gl(this,void 0,void 0,function(){var r,n,i,o;return Zl(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 Gl(this,void 0,void 0,function(){var r=this;return Zl(this,function(n){return this.debug("[Experiment] Retry fetch"),this.retriesBackoff=new bu(8,500,1e4,1.5),this.retriesBackoff.start(function(){return Gl(r,void 0,void 0,function(){return Zl(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=Kl(Kl(Kl({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return Kl(Kl(Kl(Kl({library:"experiment-js-client/".concat(au)},r),n),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return Gl(this,void 0,void 0,function(){return Zl(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==eu.LocalStorage?this.variants.getAll():this.config.source==eu.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==eu.LocalStorage?this.config.initialVariants:this.config.source==eu.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=ou(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){var f=Bl();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);ou(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,Hl([e],Yl(t),!1))},e.prototype.shouldRetryFetch=function(e){return!(e instanceof Dl)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),xu=function(){function e(e,t){var r,n,i;this.globalScope=Bl(),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 ql.UAParser(this.userAgent).getResult(),this.localStorage=new du,this.sessionStorage=new gu,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 Kl({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=Jl(i.searchParams),s=o.next();!s.done;s=o.next()){var a=Yl(s.value,2),l=a[0],u=a[1];n[l]=Hl(Hl([],Yl(null!==(r=n[l])&&void 0!==r?r:[]),!1),Yl(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=Yl(t,2),n=r[0],i=r[1];return e[n]=1==i.length?i[0]:i,e},{})}},e}();jl.experimentInstances={};var Eu=jl.experimentInstances,Ou=function(e){return(null==e?void 0:e.instanceName)||su.instanceName},Au=function(e,t,r){var n=function(e,t){var r=Ou(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)}(e,t),i=Eu[n];return i||(i=function(e,t){return new ku(e,Kl(Kl({},t),{userProvider:new xu(null==t?void 0:t.userProvider,e)}))}(e,t),r&&i.addPlugin(r()),Eu[n]=i,i)},Pu=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 Au(e,t,function(){return new Ql(e,ye.getInstance(Ou(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}(),Tu=function(e){return new Pu(e)},Ru=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Mu(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),Mu=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Nu=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}(),_u=function(){return _u=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},_u.apply(this,arguments)};function Du(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 Lu(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 Fu=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=Du(["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(!Fu(u,c))return!1;var h=!0;return Object.keys(e).forEach(function(r){Fu(e[r],t[r])||(h=!1)}),h}for(var d=0;d<e.length;d++)if(!Fu(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 Uu=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=_u({},this.identity.userProperties),r=_u(_u({},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=Du(Object.entries(e)),c=u.next();!c.done;c=u.next()){var h=Lu(c.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(i=void 0,Du(Object.entries(p))),g=f.next();!g.done;g=f.next()){var m=Lu(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,Du(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 _u({},this.identity)},e.prototype.setIdentity=function(e){var t=_u({},this.identity);this.identity=_u({},e),Fu(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}(),ju=typeof globalThis<"u"?globalThis:typeof window<"u"?window:self,Bu=function(){function e(){this.identityStore=new Uu,this.eventBridge=new Nu,this.applicationContextProvider=new Ru}return e.getInstance=function(t){return ju.analyticsConnectorInstances||(ju.analyticsConnectorInstances={}),ju.analyticsConnectorInstances[t]||(ju.analyticsConnectorInstances[t]=new e),ju.analyticsConnectorInstances[t]},e}(),zu=["boot"];var Vu=(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))(Vu||{});var qu=((e=>{if(typeof window<"u"&&window.opener)for(let t of Object.values(Vu))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(zu.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=Bu.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)}}}):zu.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))),Wu=e=>(typeof window<"u"&&!window.engagement&&(window.engagement=qu),qu.plugin(e)),Ku=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(Pu);return 0===e.length?void this.config.loggerProvider.debug("".concat(Pu.pluginName," plugin is not found.")):1===e.length?e[0].experiment:void this.config.loggerProvider.debug("Multiple instances of ".concat(Pu.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-zen-observable-migration.1","-").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 Aa(u))).promise];case 2:return s.sent(),[4,e.prototype.add.call(this,Tu(o(o({},null==r?void 0:r.experiment),n))).promise];case 3:return s.sent(),void 0===(i=this.plugin(Aa.pluginName))?this.config.loggerProvider.debug("".concat(Aa.pluginName," plugin is not found.")):this._sessionReplay=i.sessionReplay,[4,e.prototype.add.call(this,Wu(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}(Hi),Gu=function(){var e=new Ku;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"]))}},Zu=Gu(),Ju=Zu._setDiagnosticsSampleRate,Yu=Zu.initAll,Hu=Zu.experiment,$u=Zu.sessionReplay,Xu=Zu.add,Qu=Zu.extendSession,ec=Zu.flush,tc=Zu.getDeviceId,rc=Zu.getSessionId,nc=Zu.getUserId,ic=Zu.groupIdentify,oc=Zu.identify,sc=Zu.logEvent,ac=Zu.remove,lc=Zu.reset,uc=Zu.revenue,cc=Zu.setDeviceId,hc=Zu.setGroup,dc=Zu.setOptOut,pc=Zu.setSessionId,fc=Zu.setTransport,gc=Zu.setUserId,mc=Zu.track,vc=function(e,t){return vc=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])},vc(e,t)};var yc=function(){return yc=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},yc.apply(this,arguments)};function bc(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 wc="is",Sc="is not",Cc="contains",Ic="does not contain",kc="less",xc="less or equal",Ec="greater",Oc="greater or equal",Ac="version less",Pc="version less or equal",Tc="version greater",Rc="version greater or equal",Mc="set is",Nc="set is not",_c="set contains",Dc="set does not contain",Lc="set contains any",Fc="set does not contain any",Uc="regex match",jc="regex does not match",Bc=-862048943,zc=461845907,Vc=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=Gc(r,s<<2);o=qc(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,Bc),u=Kc(u,15),o^=u=Math.imul(u,zc);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,Bc),u=Kc(u,15),o^=u=Math.imul(u,zc);break;case 1:u^=r[l],u=Math.imul(u,Bc),u=Kc(u,15),o^=u=Math.imul(u,zc)}return Wc(o^=n)>>>0},qc=function(e,t){var r=e,n=t;return r=Math.imul(r,Bc),r=Kc(r,15),r=Math.imul(r,zc),n=Kc(n^=r,13),(n=Math.imul(n,5))+-430675100|0},Wc=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},Kc=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},Gc=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 Zc(r)},Zc=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Jc=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=bc(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}},Yc="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),Hc=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(Yc).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}(),$c=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=bc(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=bc(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=yc(yc(yc({},t.metadata),a.metadata),i.metadata);i=yc(yc({},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=bc(r.conditions),l=a.next();!l.done;l=a.next()){var u,c=l.value,h=!0;try{for(var d=(o=void 0,bc(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=Jc(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 Vc(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(Jc(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=bc(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,bc(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 wc:case Cc:case kc:case xc:case Ec:case Oc:case Ac:case Pc:case Tc:case Rc:case Mc:case _c:case Lc:return r;case Sc:case Ic:case Dc:case Fc:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Mc:return this.setEquals(e,r);case Nc:return!this.setEquals(e,r);case _c:return this.matchesSetContainsAll(e,r);case Dc:return!this.matchesSetContainsAll(e,r);case Lc:return this.matchesSetContainsAny(e,r);case Fc:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case wc:return this.matchesIs(e,r);case Sc:return!this.matchesIs(e,r);case Cc:return this.matchesContains(e,r);case Ic:return!this.matchesContains(e,r);case kc:case xc:case Ec:case Oc:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case Ac:case Pc:case Tc:case Rc:return this.matchesComparable(e,t,r,function(e){return Hc.parse(e)},this.versionComparator);case Uc:return this.matchesRegex(e,r);case jc: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=bc(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 kc:case Ac:return e<r;case xc:case Pc:return e<=r;case Ec:case Tc:return e>r;case Oc:case Rc:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case kc:case Ac:return n<0;case xc:case Pc:return n<=0;case Ec:case Tc:return n>0;case Oc:case Rc: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 Mc:case Nc:case _c:case Dc:case Lc:case Fc: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=bc(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=bc(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}vc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var Xc,Qc=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,gs(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]}})})}},eh=new Qc,th=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,eh.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 $c},rh=function(){var e=new th;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,nh=Object.freeze({__proto__:null,evaluateTargeting:rh}),ih=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'}),oh=Object.defineProperty,sh=(e,t,r)=>((e,t,r)=>t in e?oh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),ah=Object.defineProperty,lh=(e,t,r)=>((e,t,r)=>t in e?ah(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),uh=Object.defineProperty,ch=(e,t,r)=>((e,t,r)=>t in e?uh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const hh={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},dh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ph={};function fh(e){if(ph[e])return ph[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 hh?hh[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 dh?dh[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 ph[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?ph[e]=o:r}catch{return r}}const gh={};function mh(e,t,r){var n;const i=`${e}.${String(r)}`;if(gh[i])return gh[i].call(t);const o=fh(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(gh[i]=s,s.call(t)):t[r]}const vh={};function yh(e,t,r){const n=`${e}.${String(r)}`;if(vh[n])return vh[n].bind(t);const i=fh(e)[r];return"function"!=typeof i?t[r]:(vh[n]=i,i.bind(t))}const bh={childNodes:function(e){return mh("Node",e,"childNodes")},parentNode:function(e){return mh("Node",e,"parentNode")},parentElement:function(e){return mh("Node",e,"parentElement")},textContent:function(e){return mh("Node",e,"textContent")},contains:function(e,t){return yh("Node",e,"contains")(t)},getRootNode:function(e){return yh("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?mh("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?mh("Element",e,"shadowRoot"):null},querySelector:function(e,t){return mh("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return mh("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return fh("MutationObserver").constructor}};class wh{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 Sh(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Sh(bh.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Sh(bh.parentNode(e),t,r)}function Ch(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ih(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 kh={exports:{}},xh=String,Eh=function(){return{isColorSupported:!1,reset:xh,bold:xh,dim:xh,italic:xh,underline:xh,inverse:xh,hidden:xh,strikethrough:xh,black:xh,red:xh,green:xh,yellow:xh,blue:xh,magenta:xh,cyan:xh,white:xh,gray:xh,bgBlack:xh,bgRed:xh,bgGreen:xh,bgYellow:xh,bgBlue:xh,bgMagenta:xh,bgCyan:xh,bgWhite:xh}};kh.exports=Eh(),kh.exports.createColors=Eh;var Oh=kh.exports;const Ah=Ih(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ph=Oh,Th=Ah,Rh=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=Ph.isColorSupported),Th&&e&&(t=Th(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}=Ph.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 Mh=Rh;Rh.default=Rh;var Nh={};Nh.isClean=Symbol("isClean"),Nh.my=Symbol("my");const _h={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Dh=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 _h[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=_h[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 Lh=Dh;Dh.default=Dh;let Fh=Lh;function Uh(e,t){new Fh(t).stringify(e)}var jh=Uh;Uh.default=Uh;let{isClean:Bh,my:zh}=Nh,Vh=Mh,qh=Lh,Wh=jh;function Kh(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=>Kh(e,r)):("object"===o&&null!==i&&(i=Kh(i)),r[n]=i)}return r}let Gh=class{constructor(e={}){this.raws={},this[Bh]=!1,this[zh]=!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=Kh(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 Vh(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[Bh]){this[Bh]=!1;let e=this;for(;e=e.parent;)e[Bh]=!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 qh).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=Wh){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 Zh=Gh;Gh.default=Gh;let Jh=Zh,Yh=class extends Jh{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 Hh=Yh;Yh.default=Yh;var $h={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:Xh,SourceMapGenerator:Qh}=Ah,{existsSync:ed,readFileSync:td}=Ah,{dirname:rd,join:nd}=Ah;let id=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=rd(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Xh(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=rd(e),ed(e))return this.mapFile=e,td(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 Xh)return Qh.fromSourceMap(t).toString();if(t instanceof Qh)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=nd(rd(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 od=id;id.default=id;let{SourceMapConsumer:sd,SourceMapGenerator:ad}=Ah,{fileURLToPath:ld,pathToFileURL:ud}=Ah,{isAbsolute:cd,resolve:hd}=Ah,{nanoid:dd}=$h,pd=Ah,fd=Mh,gd=od,md=Symbol("fromOffsetCache"),vd=Boolean(sd&&ad),yd=Boolean(hd&&cd),bd=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&&(!yd||/^\w+:\/\//.test(t.from)||cd(t.from)?this.file=t.from:this.file=hd(t.from)),yd&&vd){let e=new gd(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 "+dd(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 fd(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 fd(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&&(ud&&(i.input.url=ud(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[md])r=this[md];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[md]=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:hd(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)?ud(a.source):new URL(a.source,this.map.consumer().sourceRoot||ud(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(!ld)throw new Error("file: protocol is not available in this PostCSS build");l.file=ld(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 wd=bd;bd.default=bd,pd&&pd.registerInput&&pd.registerInput(bd);let{SourceMapConsumer:Sd,SourceMapGenerator:Cd}=Ah,{dirname:Id,relative:kd,resolve:xd,sep:Ed}=Ah,{pathToFileURL:Od}=Ah,Ad=wd,Pd=Boolean(Sd&&Cd),Td=Boolean(Id&&xd&&kd&&Ed);var Rd=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||Id(e.file);!1===this.mapOpts.sourcesContent?(t=new Sd(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(),Td&&Pd&&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=Cd.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Cd({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 Cd({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?Id(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Id(xd(r,this.mapOpts.annotation)));let n=kd(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 Ad(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(Od){let t=Od(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;"\\"===Ed&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Md=Zh,Nd=class extends Md{constructor(e){super(e),this.type="comment"}};var _d=Nd;Nd.default=Nd;let Dd,Ld,Fd,Ud,{isClean:jd,my:Bd}=Nh,zd=Hh,Vd=_d,qd=Zh;function Wd(e){return e.map(e=>(e.nodes&&(e.nodes=Wd(e.nodes)),delete e.source,e))}function Kd(e){if(e[jd]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Kd(t)}let Gd=class e extends qd{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=Wd(Dd(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 zd(t)]}else if(t.selector)t=[new Ld(t)];else if(t.name)t=[new Fd(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Vd(t)]}return t.map(t=>(t[Bd]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[jd]&&Kd(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]}};Gd.registerParse=e=>{Dd=e},Gd.registerRule=e=>{Ld=e},Gd.registerAtRule=e=>{Fd=e},Gd.registerRoot=e=>{Ud=e};var Zd=Gd;Gd.default=Gd,Gd.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Fd.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ld.prototype):"decl"===e.type?Object.setPrototypeOf(e,zd.prototype):"comment"===e.type?Object.setPrototypeOf(e,Vd.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ud.prototype),e[Bd]=!0,e.nodes&&e.nodes.forEach(e=>{Gd.rebuild(e)})};let Jd,Yd,Hd=Zd,$d=class extends Hd{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Jd(new Yd,this,e).stringify()}};$d.registerLazyResult=e=>{Jd=e},$d.registerProcessor=e=>{Yd=e};var Xd=$d;$d.default=$d;let Qd={};var ep=function(e){Qd[e]||(Qd[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let tp=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 rp=tp;tp.default=tp;let np=rp,ip=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 np(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var op=ip;ip.default=ip;const sp="'".charCodeAt(0),ap='"'.charCodeAt(0),lp="\\".charCodeAt(0),up="/".charCodeAt(0),cp="\n".charCodeAt(0),hp=" ".charCodeAt(0),dp="\f".charCodeAt(0),pp="\t".charCodeAt(0),fp="\r".charCodeAt(0),gp="[".charCodeAt(0),mp="]".charCodeAt(0),vp="(".charCodeAt(0),yp=")".charCodeAt(0),bp="{".charCodeAt(0),wp="}".charCodeAt(0),Sp=";".charCodeAt(0),Cp="*".charCodeAt(0),Ip=":".charCodeAt(0),kp="@".charCodeAt(0),xp=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ep=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Op=/.[\r\n"'(/\\]/,Ap=/[\da-f]/i;let Pp=Zd,Tp=class extends Pp{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 Rp=Tp;Tp.default=Tp,Pp.registerAtRule(Tp);let Mp,Np,_p=Zd,Dp=class extends _p{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 Mp(new Np,this,e).stringify()}};Dp.registerLazyResult=e=>{Mp=e},Dp.registerProcessor=e=>{Np=e};var Lp=Dp;Dp.default=Dp,_p.registerRoot(Dp);let Fp={comma:e=>Fp.split(e,[","],!0),space:e=>Fp.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 Up=Fp;Fp.default=Fp;let jp=Zd,Bp=Up,zp=class extends jp{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Bp.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 Vp=zp;zp.default=zp,jp.registerRule(zp);let qp=Hh,Wp=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 hp:case pp:case fp:case dp:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===hp||r===cp||r===pp||r===fp||r===dp);h=["space",d.slice(g,n)],g=n-1;break;case gp:case mp:case bp:case wp:case Ip:case Sp:case yp:{let e=String.fromCharCode(r);h=[e,e,g];break}case vp:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==sp&&c!==ap&&c!==hp&&c!==cp&&c!==pp&&c!==dp&&c!==fp){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)===lp;)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||Op.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case sp:case ap:i=r===sp?"'":'"',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)===lp;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case kp:xp.lastIndex=g+1,xp.test(d),n=0===xp.lastIndex?d.length-1:xp.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case lp:for(n=g,s=!0;d.charCodeAt(n+1)===lp;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==up&&r!==hp&&r!==cp&&r!==pp&&r!==fp&&r!==dp&&(n+=1,Ap.test(d.charAt(n)))){for(;Ap.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===hp&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===up&&d.charCodeAt(g+1)===Cp?(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):(Ep.lastIndex=g+1,Ep.test(d),n=0===Ep.lastIndex?d.length-1:Ep.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},Kp=_d,Gp=Rp,Zp=Lp,Jp=Vp;const Yp={empty:!0,space:!0};var Hp=class{constructor(e){this.input=e,this.root=new Zp,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 Gp;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 Kp;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=Wp(this.input)}decl(e,t){let r=new qp;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 Jp;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",Yp[a]||Yp[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 Jp;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 $p=Zd,Xp=Hp,Qp=wd;function ef(e,t){let r=new Qp(e,t),n=new Xp(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 tf=ef;ef.default=ef,$p.registerParse(ef);let{isClean:rf,my:nf}=Nh,of=Rd,sf=jh,af=Zd,lf=Xd,uf=ep,cf=op,hf=tf,df=Lp;const pf={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ff={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},gf={Once:!0,postcssPlugin:!0,prepare:!0};function mf(e){return"object"==typeof e&&"function"==typeof e.then}function vf(e){let t=!1,r=pf[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 yf(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:vf(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function bf(e){return e[rf]=!1,e.nodes&&e.nodes.forEach(e=>bf(e)),e}let wf={},Sf=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=bf(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=hf;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[nf]&&af.rebuild(i)}else i=bf(r);this.result=new cf(t,i,n),this.helpers={...wf,postcss:wf,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(!ff[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!gf[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(mf(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[rf];){e[rf]=!0;let t=[yf(e)];for(;t.length>0;){let e=this.visitTick(t);if(mf(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 mf(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=sf;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new of(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(mf(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[rf];)e[rf]=!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||uf("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(mf(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[rf])return n[rf]=!0,void e.push(yf(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[rf]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[rf]=!0;let t=vf(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[rf]||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"}};Sf.registerPostcss=e=>{wf=e};var Cf=Sf;Sf.default=Sf,df.registerLazyResult(Sf),lf.registerLazyResult(Sf);let If=Rd,kf=jh,xf=ep,Ef=tf;const Of=op;let Af=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=kf;this.result=new Of(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new If(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||xf("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=Ef;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 Pf=Af;Af.default=Af;let Tf=Pf,Rf=Cf,Mf=Xd,Nf=Lp,_f=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 Rf(this,e,t):new Tf(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Df=_f;_f.default=_f,Nf.registerProcessor(_f),Mf.registerProcessor(_f);let Lf=Hh,Ff=od,Uf=_d,jf=Rp,Bf=wd,zf=Lp,Vf=Vp;function qf(e,t){if(Array.isArray(e))return e.map(e=>qf(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Bf.prototype};r.map&&(r.map={...r.map,__proto__:Ff.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>qf(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 zf(n);if("decl"===n.type)return new Lf(n);if("rule"===n.type)return new Vf(n);if("comment"===n.type)return new Uf(n);if("atrule"===n.type)return new jf(n);throw new Error("Unknown node type: "+e.type)}var Wf=qf;qf.default=qf;let Kf=Mh,Gf=Hh,Zf=Cf,Jf=Zd,Yf=Df,Hf=jh,$f=Wf,Xf=Xd,Qf=rp,eg=_d,tg=Rp,rg=op,ng=wd,ig=tf,og=Up,sg=Vp,ag=Lp,lg=Zh;function ug(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Yf(e)}ug.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 Yf).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return ug([i(r)]).process(e,t)},i},ug.stringify=Hf,ug.parse=ig,ug.fromJSON=$f,ug.list=og,ug.comment=e=>new eg(e),ug.atRule=e=>new tg(e),ug.decl=e=>new Gf(e),ug.rule=e=>new sg(e),ug.root=e=>new ag(e),ug.document=e=>new Xf(e),ug.CssSyntaxError=Kf,ug.Declaration=Gf,ug.Container=Jf,ug.Processor=Yf,ug.Document=Xf,ug.Comment=eg,ug.Warning=Qf,ug.AtRule=tg,ug.Result=rg,ug.Input=ng,ug.Rule=sg,ug.Root=ag,ug.Node=lg,Zf.registerPostcss(ug);var cg=ug;ug.default=ug;const hg=Ch(cg);hg.stringify,hg.fromJSON,hg.plugin,hg.parse,hg.list,hg.document,hg.comment,hg.atRule,hg.rule,hg.decl,hg.root,hg.CssSyntaxError,hg.Declaration,hg.Container,hg.Processor,hg.Document,hg.Comment,hg.Warning,hg.AtRule,hg.Result,hg.Input,hg.Rule,hg.Root,hg.Node;var dg=Object.defineProperty,pg=(e,t,r)=>((e,t,r)=>t in e?dg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function fg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gg(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 mg={exports:{}},vg=String,yg=function(){return{isColorSupported:!1,reset:vg,bold:vg,dim:vg,italic:vg,underline:vg,inverse:vg,hidden:vg,strikethrough:vg,black:vg,red:vg,green:vg,yellow:vg,blue:vg,magenta:vg,cyan:vg,white:vg,gray:vg,bgBlack:vg,bgRed:vg,bgGreen:vg,bgYellow:vg,bgBlue:vg,bgMagenta:vg,bgCyan:vg,bgWhite:vg}};mg.exports=yg(),mg.exports.createColors=yg;var bg=mg.exports;const wg=gg(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Sg=bg,Cg=wg,Ig=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=Sg.isColorSupported),Cg&&e&&(t=Cg(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}=Sg.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 kg=Ig;Ig.default=Ig;var xg={};xg.isClean=Symbol("isClean"),xg.my=Symbol("my");const Eg={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Og=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 Eg[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=Eg[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 Ag=Og;Og.default=Og;let Pg=Ag;function Tg(e,t){new Pg(t).stringify(e)}var Rg=Tg;Tg.default=Tg;let{isClean:Mg,my:Ng}=xg,_g=kg,Dg=Ag,Lg=Rg;function Fg(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=>Fg(e,r)):("object"===o&&null!==i&&(i=Fg(i)),r[n]=i)}return r}let Ug=class{constructor(e={}){this.raws={},this[Mg]=!1,this[Ng]=!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=Fg(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 _g(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[Mg]){this[Mg]=!1;let e=this;for(;e=e.parent;)e[Mg]=!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 Dg).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=Lg){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 jg=Ug;Ug.default=Ug;let Bg=jg,zg=class extends Bg{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 Vg=zg;zg.default=zg;var qg={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:Wg,SourceMapGenerator:Kg}=wg,{existsSync:Gg,readFileSync:Zg}=wg,{dirname:Jg,join:Yg}=wg;let Hg=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=Jg(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Wg(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=Jg(e),Gg(e))return this.mapFile=e,Zg(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 Wg)return Kg.fromSourceMap(t).toString();if(t instanceof Kg)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=Yg(Jg(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 $g=Hg;Hg.default=Hg;let{SourceMapConsumer:Xg,SourceMapGenerator:Qg}=wg,{fileURLToPath:em,pathToFileURL:tm}=wg,{isAbsolute:rm,resolve:nm}=wg,{nanoid:im}=qg,om=wg,sm=kg,am=$g,lm=Symbol("fromOffsetCache"),um=Boolean(Xg&&Qg),cm=Boolean(nm&&rm),hm=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)||rm(t.from)?this.file=t.from:this.file=nm(t.from)),cm&&um){let e=new am(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 "+im(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 sm(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 sm(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&&(tm&&(i.input.url=tm(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[lm])r=this[lm];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[lm]=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:nm(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=rm(a.source)?tm(a.source):new URL(a.source,this.map.consumer().sourceRoot||tm(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(!em)throw new Error("file: protocol is not available in this PostCSS build");l.file=em(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 dm=hm;hm.default=hm,om&&om.registerInput&&om.registerInput(hm);let{SourceMapConsumer:pm,SourceMapGenerator:fm}=wg,{dirname:gm,relative:mm,resolve:vm,sep:ym}=wg,{pathToFileURL:bm}=wg,wm=dm,Sm=Boolean(pm&&fm),Cm=Boolean(gm&&vm&&mm&&ym);var Im=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||gm(e.file);!1===this.mapOpts.sourcesContent?(t=new pm(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(),Cm&&Sm&&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=fm.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new fm({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 fm({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?gm(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=gm(vm(r,this.mapOpts.annotation)));let n=mm(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 wm(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(bm){let t=bm(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;"\\"===ym&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let km=jg,xm=class extends km{constructor(e){super(e),this.type="comment"}};var Em=xm;xm.default=xm;let Om,Am,Pm,Tm,{isClean:Rm,my:Mm}=xg,Nm=Vg,_m=Em,Dm=jg;function Lm(e){return e.map(e=>(e.nodes&&(e.nodes=Lm(e.nodes)),delete e.source,e))}function Fm(e){if(e[Rm]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Fm(t)}let Um=class e extends Dm{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=Lm(Om(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 Nm(t)]}else if(t.selector)t=[new Am(t)];else if(t.name)t=[new Pm(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new _m(t)]}return t.map(t=>(t[Mm]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Rm]&&Fm(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]}};Um.registerParse=e=>{Om=e},Um.registerRule=e=>{Am=e},Um.registerAtRule=e=>{Pm=e},Um.registerRoot=e=>{Tm=e};var jm=Um;Um.default=Um,Um.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Pm.prototype):"rule"===e.type?Object.setPrototypeOf(e,Am.prototype):"decl"===e.type?Object.setPrototypeOf(e,Nm.prototype):"comment"===e.type?Object.setPrototypeOf(e,_m.prototype):"root"===e.type&&Object.setPrototypeOf(e,Tm.prototype),e[Mm]=!0,e.nodes&&e.nodes.forEach(e=>{Um.rebuild(e)})};let Bm,zm,Vm=jm,qm=class extends Vm{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Bm(new zm,this,e).stringify()}};qm.registerLazyResult=e=>{Bm=e},qm.registerProcessor=e=>{zm=e};var Wm=qm;qm.default=qm;let Km={};var Gm=function(e){Km[e]||(Km[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Zm=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 Jm=Zm;Zm.default=Zm;let Ym=Jm,Hm=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 Ym(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var $m=Hm;Hm.default=Hm;const Xm="'".charCodeAt(0),Qm='"'.charCodeAt(0),ev="\\".charCodeAt(0),tv="/".charCodeAt(0),rv="\n".charCodeAt(0),nv=" ".charCodeAt(0),iv="\f".charCodeAt(0),ov="\t".charCodeAt(0),sv="\r".charCodeAt(0),av="[".charCodeAt(0),lv="]".charCodeAt(0),uv="(".charCodeAt(0),cv=")".charCodeAt(0),hv="{".charCodeAt(0),dv="}".charCodeAt(0),pv=";".charCodeAt(0),fv="*".charCodeAt(0),gv=":".charCodeAt(0),mv="@".charCodeAt(0),vv=/[\t\n\f\r "#'()/;[\\\]{}]/g,yv=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,bv=/.[\r\n"'(/\\]/,wv=/[\da-f]/i;let Sv=jm,Cv=class extends Sv{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 Iv=Cv;Cv.default=Cv,Sv.registerAtRule(Cv);let kv,xv,Ev=jm,Ov=class extends Ev{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 kv(new xv,this,e).stringify()}};Ov.registerLazyResult=e=>{kv=e},Ov.registerProcessor=e=>{xv=e};var Av=Ov;Ov.default=Ov,Ev.registerRoot(Ov);let Pv={comma:e=>Pv.split(e,[","],!0),space:e=>Pv.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 Tv=Pv;Pv.default=Pv;let Rv=jm,Mv=Tv,Nv=class extends Rv{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Mv.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 _v=Nv;Nv.default=Nv,Rv.registerRule(Nv);let Dv=Vg,Lv=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 rv:case nv:case ov:case sv:case iv:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===nv||r===rv||r===ov||r===sv||r===iv);h=["space",d.slice(g,n)],g=n-1;break;case av:case lv:case hv:case dv:case gv:case pv:case cv:{let e=String.fromCharCode(r);h=[e,e,g];break}case uv:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==Xm&&c!==Qm&&c!==nv&&c!==rv&&c!==ov&&c!==iv&&c!==sv){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)===ev;)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||bv.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case Xm:case Qm:i=r===Xm?"'":'"',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)===ev;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case mv:vv.lastIndex=g+1,vv.test(d),n=0===vv.lastIndex?d.length-1:vv.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case ev:for(n=g,s=!0;d.charCodeAt(n+1)===ev;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==tv&&r!==nv&&r!==rv&&r!==ov&&r!==sv&&r!==iv&&(n+=1,wv.test(d.charAt(n)))){for(;wv.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===nv&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===tv&&d.charCodeAt(g+1)===fv?(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):(yv.lastIndex=g+1,yv.test(d),n=0===yv.lastIndex?d.length-1:yv.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},Fv=Em,Uv=Iv,jv=Av,Bv=_v;const zv={empty:!0,space:!0};var Vv=class{constructor(e){this.input=e,this.root=new jv,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 Uv;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 Fv;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=Lv(this.input)}decl(e,t){let r=new Dv;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 Bv;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",zv[a]||zv[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 Bv;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 qv=jm,Wv=Vv,Kv=dm;function Gv(e,t){let r=new Kv(e,t),n=new Wv(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 Zv=Gv;Gv.default=Gv,qv.registerParse(Gv);let{isClean:Jv,my:Yv}=xg,Hv=Im,$v=Rg,Xv=jm,Qv=Wm,ey=Gm,ty=$m,ry=Zv,ny=Av;const iy={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},oy={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},sy={Once:!0,postcssPlugin:!0,prepare:!0};function ay(e){return"object"==typeof e&&"function"==typeof e.then}function ly(e){let t=!1,r=iy[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 uy(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ly(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function cy(e){return e[Jv]=!1,e.nodes&&e.nodes.forEach(e=>cy(e)),e}let hy={},dy=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 ty)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=ry;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[Yv]&&Xv.rebuild(i)}else i=cy(r);this.result=new ty(t,i,n),this.helpers={...hy,postcss:hy,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(!oy[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!sy[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(ay(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Jv];){e[Jv]=!0;let t=[uy(e)];for(;t.length>0;){let e=this.visitTick(t);if(ay(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 ay(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=$v;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Hv(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(ay(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Jv];)e[Jv]=!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||ey("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(ay(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[Jv])return n[Jv]=!0,void e.push(uy(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[Jv]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Jv]=!0;let t=ly(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[Jv]||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"}};dy.registerPostcss=e=>{hy=e};var py=dy;dy.default=dy,ny.registerLazyResult(dy),Qv.registerLazyResult(dy);let fy=Im,gy=Rg,my=Gm,vy=Zv;const yy=$m;let by=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=gy;this.result=new yy(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new fy(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||my("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=vy;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 wy=by;by.default=by;let Sy=wy,Cy=py,Iy=Wm,ky=Av,xy=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 Cy(this,e,t):new Sy(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ey=xy;xy.default=xy,ky.registerProcessor(xy),Iy.registerProcessor(xy);let Oy=Vg,Ay=$g,Py=Em,Ty=Iv,Ry=dm,My=Av,Ny=_v;function _y(e,t){if(Array.isArray(e))return e.map(e=>_y(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Ry.prototype};r.map&&(r.map={...r.map,__proto__:Ay.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>_y(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 My(n);if("decl"===n.type)return new Oy(n);if("rule"===n.type)return new Ny(n);if("comment"===n.type)return new Py(n);if("atrule"===n.type)return new Ty(n);throw new Error("Unknown node type: "+e.type)}var Dy=_y;_y.default=_y;let Ly=kg,Fy=Vg,Uy=py,jy=jm,By=Ey,zy=Rg,Vy=Dy,qy=Wm,Wy=Jm,Ky=Em,Gy=Iv,Zy=$m,Jy=dm,Yy=Zv,Hy=Tv,$y=_v,Xy=Av,Qy=jg;function eb(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new By(e)}eb.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 By).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return eb([i(r)]).process(e,t)},i},eb.stringify=zy,eb.parse=Yy,eb.fromJSON=Vy,eb.list=Hy,eb.comment=e=>new Ky(e),eb.atRule=e=>new Gy(e),eb.decl=e=>new Fy(e),eb.rule=e=>new $y(e),eb.root=e=>new Xy(e),eb.document=e=>new qy(e),eb.CssSyntaxError=Ly,eb.Declaration=Fy,eb.Container=jy,eb.Processor=By,eb.Document=qy,eb.Comment=Ky,eb.Warning=Wy,eb.AtRule=Gy,eb.Result=Zy,eb.Input=Jy,eb.Rule=$y,eb.Root=Xy,eb.Node=Qy,Uy.registerPostcss(eb);var tb=eb;eb.default=eb;const rb=fg(tb);rb.stringify,rb.fromJSON,rb.plugin,rb.parse,rb.list,rb.document,rb.comment,rb.atRule,rb.rule,rb.decl,rb.root,rb.CssSyntaxError,rb.Declaration,rb.Container,rb.Processor,rb.Document,rb.Comment,rb.Warning,rb.AtRule,rb.Result,rb.Input,rb.Rule,rb.Root,rb.Node;class nb{constructor(...e){pg(this,"parentElement",null),pg(this,"parentNode",null),pg(this,"ownerDocument"),pg(this,"firstChild",null),pg(this,"lastChild",null),pg(this,"previousSibling",null),pg(this,"nextSibling",null),pg(this,"ELEMENT_NODE",1),pg(this,"TEXT_NODE",3),pg(this,"nodeType"),pg(this,"nodeName"),pg(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 nb))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 ib={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ob={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},sb={};function ab(e){if(sb[e])return sb[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 ib?ib[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 ob?ob[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 sb[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?sb[e]=o:r}catch{return r}}const lb={};function ub(e,t,r){var n;const i=`${e}.${String(r)}`;if(lb[i])return lb[i].call(t);const o=ab(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(lb[i]=s,s.call(t)):t[r]}const cb={};function hb(e,t,r){const n=`${e}.${String(r)}`;if(cb[n])return cb[n].bind(t);const i=ab(e)[r];return"function"!=typeof i?t[r]:(cb[n]=i,i.bind(t))}const db={childNodes:function(e){return ub("Node",e,"childNodes")},parentNode:function(e){return ub("Node",e,"parentNode")},parentElement:function(e){return ub("Node",e,"parentElement")},textContent:function(e){return ub("Node",e,"textContent")},contains:function(e,t){return hb("Node",e,"contains")(t)},getRootNode:function(e){return hb("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ub("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ub("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ub("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ub("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ab("MutationObserver").constructor}};const pb="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 fb={map:{},getId:()=>(console.error(pb),-1),getNode:()=>(console.error(pb),null),removeNodeFromMap(){console.error(pb)},has:()=>(console.error(pb),!1),reset(){console.error(pb)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(fb=new Proxy(fb,{get:(e,t,r)=>("map"===t&&console.error(pb),Reflect.get(e,t,r))}));let gb=Date.now;function mb(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:db.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(gb=()=>(new Date).getTime());function vb(e){var t;let r=null;return"getRootNode"in e&&(null==(t=db.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&db.host(db.getRootNode(e))&&(r=db.host(db.getRootNode(e))),r}function yb(e){let t,r=e;for(;t=vb(r);)r=t;return r}function bb(e){const t=e.ownerDocument;if(!t)return!1;const r=yb(e);return db.contains(t,r)}const wb=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){lh(this,"id",1),lh(this,"styleIDMap",new WeakMap),lh(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 fb},closestElementOfNode:mb,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:yb,getShadowHost:vb,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=db.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=db.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 nb&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(db.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&&(db.contains(t,e)||bb(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&bh.host(e)||null;return Boolean(t&&"shadowRoot"in t&&bh.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const i=db.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=mb(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(Sh(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 gb},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:bb,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 Sb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cb="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ib=0;Ib<64;Ib++)Cb[Sb.charCodeAt(Ib)]=Ib;var kb,xb,Eb;"undefined"!=typeof window&&window.Blob&&new Blob([(kb="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Uint8Array.from(atob(kb),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==(Xc=e.contentWindow)?void 0:Xc.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}new wh,(Eb=xb||(xb={}))[Eb.NotStarted=0]="NotStarted",Eb[Eb.Running=1]="Running",Eb[Eb.Stopped=2]="Stopped";class Ob{constructor(e){sh(this,"fileName"),sh(this,"functionName"),sh(this,"lineNumber"),sh(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 Ab=/(^|@)\S+:\d+/,Pb=/^\s*at .*(\S+:\d+|\(native\))/m,Tb=/^(eval@)?(\[native code])?$/,Rb={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Pb)?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(Pb)},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 Ob({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(Tb)},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 Ob({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Ob({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 Ob({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 Ob({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(Ab)&&!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 Ob({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Mb(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 Nb(e){return"[object Object]"===Object.prototype.toString.call(e)}function _b(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Nb(e[n])&&_b(e[n],t-1))return!0;return!1}function Db(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(Nb(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Nb(e)&&_b(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]=Mb(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 Lb={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 Fb(e,t,r){const n=r?Object.assign({},Lb,r):Lb,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=Rb.parse(i).map(e=>e.toString()),s=[Db(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=[Db(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,i=[Db("Uncaught (in promise)",n.stringifyOptions),Db(t.reason,n.stringifyOptions)]);const o=Rb.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]?wb.patch(t,r,t=>(...i)=>{if(t.apply(this,i),!("assert"===r&&i[0]||a)){a=!0;try{const t=Rb.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?i.slice(1):i).map(e=>Db(e,n.stringifyOptions));s++,s<n.lengthThreshold?e({level:r,trace:t,payload:o}):s===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Db("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...i)}finally{a=!1}}}):()=>{}}}const Ub="rrweb/console@1";var jb,Bb=Object.freeze({__proto__:null,PLUGIN_NAME:Ub,getRecordConsolePlugin:e=>({name:Ub,observer:Fb,options:e})}),zb=Object.defineProperty,Vb=(e,t,r)=>((e,t,r)=>t in e?zb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),qb=Object.defineProperty,Wb=(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),Kb=(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))(Kb||{});const Gb={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Zb={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Jb={};function Yb(e){if(Jb[e])return Jb[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 Gb?Gb[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 Zb?Zb[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 Jb[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?Jb[e]=o:r}catch{return r}}const Hb={};function $b(e,t,r){var n;const i=`${e}.${String(r)}`;if(Hb[i])return Hb[i].call(t);const o=Yb(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Hb[i]=s,s.call(t)):t[r]}const Xb={};function Qb(e,t,r){const n=`${e}.${String(r)}`;if(Xb[n])return Xb[n].bind(t);const i=Yb(e)[r];return"function"!=typeof i?t[r]:(Xb[n]=i,i.bind(t))}const ew={childNodes:function(e){return $b("Node",e,"childNodes")},parentNode:function(e){return $b("Node",e,"parentNode")},parentElement:function(e){return $b("Node",e,"parentElement")},textContent:function(e){return $b("Node",e,"textContent")},contains:function(e,t){return Qb("Node",e,"contains")(t)},getRootNode:function(e){return Qb("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?$b("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?$b("Element",e,"shadowRoot"):null},querySelector:function(e,t){return $b("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return $b("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Yb("MutationObserver").constructor}};function tw(e){return e.nodeType===e.ELEMENT_NODE}function rw(e){const t=e&&"host"in e&&"mode"in e&&ew.host(e)||null;return Boolean(t&&"shadowRoot"in t&&ew.shadowRoot(t)===e)}function nw(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function iw(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=>ow(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 ow(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=iw(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?mw(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?mw(r,t):r}}class sw{constructor(){Wb(this,"idNodeMap",new Map),Wb(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 aw({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"";const a=n&&lw(n);return(t[r.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function lw(e){return e.toLowerCase()}const uw="__rrweb_original__";function cw(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?lw(t):null}function hw(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 dw=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,pw=/^(?:[a-z+]+:)?\/\//i,fw=/^www\..*/i,gw=/^(data:)([^,]*),(.*)/i;function mw(e,t){return(e||"").replace(dw,(e,r,n,i,o,s)=>{const a=n||o||s,l=r||i||"";if(!a)return e;if(pw.test(a)||fw.test(a))return`url(${l}${a}${l})`;if(gw.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 vw(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function yw(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=vw(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=vw(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=vw(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=vw(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 bw="lightgrey";let ww=1;const Sw=new RegExp("[^a-z0-9-_:]");function Cw(){return ww++}let Iw,kw;const xw=/^[^ \t\n\r\u000c]+/,Ew=/^[, \t\n\r\u000c]+/;const Ow=new WeakMap;function Aw(e,t){return t&&""!==t.trim()?Tw(e,t):t}function Pw(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Tw(e,t){let r=Ow.get(e);if(r||(r=e.createElement("a"),Ow.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Rw(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Aw(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(Ew),!(r>=t.length);){let o=n(xw);if(","===o.slice(-1))o=Aw(e,o.substring(0,o.length-1)),i.push(o);else{let n="";o=Aw(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?mw(n,Tw(e)):"object"===t&&"data"===r?Aw(e,n):n:Aw(e,n):n}function Mw(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Nw(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Nw(ew.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Nw(ew.parentNode(e),t,r)}function _w(e,t,r,n){let i;if(tw(e)){if(i=e,!ew.childNodes(i).length)return!1}else{if(null===ew.parentElement(e))return!1;i=ew.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(Nw(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 Dw(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:Kb.Document,childNodes:[],compatMode:e.compatMode}:{type:Kb.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Kb.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=lw(e.tagName);return Sw.test(t)?"div":t}(e);let v={};const y=e.attributes.length;for(let t=0;t<y;t++){const n=e.attributes[t];Mw(m,n.name,n.value)||(v[n.name]=Rw(r,m,lw(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=iw(t)),n&&(delete v.rel,delete v.href,v._cssText=n)}if("style"===m&&e.sheet){let t=iw(e.sheet);t&&(e.childNodes.length>1&&(t=yw(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=aw({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=uw in i?i[uw]: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){Iw||(Iw=r.createElement("canvas"),kw=Iw.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",i=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{Iw.width=t.naturalWidth,Iw.height=t.naturalHeight,kw.drawImage(t,0,0),v.rr_dataURL=Iw.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:bw}:{}}}"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:Kb.Element,tagName:m,attributes:v,childNodes:[],isSVG:Pw(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=ew.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=ew.textContent(e),u&&l&&(l=mw(l,Tw(t.doc))));!u&&!c&&l&&r&&(l=n?n(l,ew.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Kb.Text,textContent:l||"",rootId:i}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:y,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:Kb.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:Kb.Comment,textContent:ew.textContent(e)||"",rootId:y};default:return!1}}function Lw(e){return null==e?"":e.toLowerCase()}function Fw(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:k=!1,applyBackgroundColorToBlockedElements:x=!1}=t;let{needsMask:E}=t,{preserveWhiteSpace:O=!0}=t;if(!E){E=_w(e,s,a,void 0===E)}const A=Dw(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:k,applyBackgroundColorToBlockedElements:x});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===Kb.Comment)return!0;if(e.type===Kb.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"===hw(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Lw(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Lw(e.attributes.name)||"icon"===Lw(e.attributes.rel)||"apple-touch-icon"===Lw(e.attributes.rel)||"shortcut icon"===Lw(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Lw(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Lw(e.attributes.property).match(/^(og|twitter|fb):/)||Lw(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Lw(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Lw(e.attributes.name)||"googlebot"===Lw(e.attributes.name)||"bingbot"===Lw(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Lw(e.attributes.name)||"generator"===Lw(e.attributes.name)||"framework"===Lw(e.attributes.name)||"publisher"===Lw(e.attributes.name)||"progid"===Lw(e.attributes.name)||Lw(e.attributes.property).match(/^article:/)||Lw(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Lw(e.attributes.name)||"yandex-verification"===Lw(e.attributes.name)||"csrf-token"===Lw(e.attributes.name)||"p:domain_verify"===Lw(e.attributes.name)||"verify-v1"===Lw(e.attributes.name)||"verification"===Lw(e.attributes.name)||"shopify-checkout-api-token"===Lw(e.attributes.name)))return!0}}return!1}(A,p)||!O&&A.type===Kb.Text&&!A.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Cw();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===Kb.Element){R=R&&!T.needBlock,delete T.needBlock;const t=ew.shadowRoot(e);t&&nw(t)&&(T.isShadowHost=!0)}if((T.type===Kb.Document||T.type===Kb.Element)&&R){p.headWhitespace&&T.type===Kb.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:x};if(T.type===Kb.Element&&"textarea"===T.tagName&&void 0!==T.attributes.value);else{T.type===Kb.Element&&void 0!==T.attributes._cssText&&"string"==typeof T.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(ew.childNodes(e))){const e=Fw(r,t);e&&T.childNodes.push(e)}}let I=null;if(tw(e)&&(I=ew.shadowRoot(e)))for(const e of Array.from(ew.childNodes(I))){const r=Fw(e,t);r&&(nw(I)&&(r.isShadow=!0),T.childNodes.push(r))}}const M=ew.parentNode(e);return M&&rw(M)&&nw(M)&&(T.isShadow=!0),T.type===Kb.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=Fw(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===Kb.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===hw(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=Fw(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 Uw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jw(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 Bw={exports:{}},zw=String,Vw=function(){return{isColorSupported:!1,reset:zw,bold:zw,dim:zw,italic:zw,underline:zw,inverse:zw,hidden:zw,strikethrough:zw,black:zw,red:zw,green:zw,yellow:zw,blue:zw,magenta:zw,cyan:zw,white:zw,gray:zw,bgBlack:zw,bgRed:zw,bgGreen:zw,bgYellow:zw,bgBlue:zw,bgMagenta:zw,bgCyan:zw,bgWhite:zw}};Bw.exports=Vw(),Bw.exports.createColors=Vw;var qw=Bw.exports;const Ww=jw(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Kw=qw,Gw=Ww,Zw=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=Kw.isColorSupported),Gw&&e&&(t=Gw(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}=Kw.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 Jw=Zw;Zw.default=Zw;var Yw={};Yw.isClean=Symbol("isClean"),Yw.my=Symbol("my");const Hw={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let $w=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 Hw[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=Hw[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 Xw=$w;$w.default=$w;let Qw=Xw;function eS(e,t){new Qw(t).stringify(e)}var tS=eS;eS.default=eS;let{isClean:rS,my:nS}=Yw,iS=Jw,oS=Xw,sS=tS;function aS(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=>aS(e,r)):("object"===o&&null!==i&&(i=aS(i)),r[n]=i)}return r}let lS=class{constructor(e={}){this.raws={},this[rS]=!1,this[nS]=!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=aS(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 iS(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[rS]){this[rS]=!1;let e=this;for(;e=e.parent;)e[rS]=!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 oS).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=sS){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 uS=lS;lS.default=lS;let cS=uS,hS=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 dS=hS;hS.default=hS;var pS={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:fS,SourceMapGenerator:gS}=Ww,{existsSync:mS,readFileSync:vS}=Ww,{dirname:yS,join:bS}=Ww;let wS=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=yS(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new fS(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=yS(e),mS(e))return this.mapFile=e,vS(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 fS)return gS.fromSourceMap(t).toString();if(t instanceof gS)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=bS(yS(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 SS=wS;wS.default=wS;let{SourceMapConsumer:CS,SourceMapGenerator:IS}=Ww,{fileURLToPath:kS,pathToFileURL:xS}=Ww,{isAbsolute:ES,resolve:OS}=Ww,{nanoid:AS}=pS,PS=Ww,TS=Jw,RS=SS,MS=Symbol("fromOffsetCache"),NS=Boolean(CS&&IS),_S=Boolean(OS&&ES),DS=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&&(!_S||/^\w+:\/\//.test(t.from)||ES(t.from)?this.file=t.from:this.file=OS(t.from)),_S&&NS){let e=new RS(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 "+AS(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 TS(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 TS(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&&(xS&&(i.input.url=xS(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[MS])r=this[MS];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[MS]=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:OS(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=ES(a.source)?xS(a.source):new URL(a.source,this.map.consumer().sourceRoot||xS(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(!kS)throw new Error("file: protocol is not available in this PostCSS build");l.file=kS(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 LS=DS;DS.default=DS,PS&&PS.registerInput&&PS.registerInput(DS);let{SourceMapConsumer:FS,SourceMapGenerator:US}=Ww,{dirname:jS,relative:BS,resolve:zS,sep:VS}=Ww,{pathToFileURL:qS}=Ww,WS=LS,KS=Boolean(FS&&US),GS=Boolean(jS&&zS&&BS&&VS);var ZS=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||jS(e.file);!1===this.mapOpts.sourcesContent?(t=new FS(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(),GS&&KS&&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=US.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new US({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 US({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?jS(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=jS(zS(r,this.mapOpts.annotation)));let n=BS(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 WS(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(qS){let t=qS(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;"\\"===VS&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let JS=uS,YS=class extends JS{constructor(e){super(e),this.type="comment"}};var HS=YS;YS.default=YS;let $S,XS,QS,eC,{isClean:tC,my:rC}=Yw,nC=dS,iC=HS,oC=uS;function sC(e){return e.map(e=>(e.nodes&&(e.nodes=sC(e.nodes)),delete e.source,e))}function aC(e){if(e[tC]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)aC(t)}let lC=class e extends oC{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=sC($S(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 nC(t)]}else if(t.selector)t=[new XS(t)];else if(t.name)t=[new QS(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new iC(t)]}return t.map(t=>(t[rC]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[tC]&&aC(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]}};lC.registerParse=e=>{$S=e},lC.registerRule=e=>{XS=e},lC.registerAtRule=e=>{QS=e},lC.registerRoot=e=>{eC=e};var uC=lC;lC.default=lC,lC.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,QS.prototype):"rule"===e.type?Object.setPrototypeOf(e,XS.prototype):"decl"===e.type?Object.setPrototypeOf(e,nC.prototype):"comment"===e.type?Object.setPrototypeOf(e,iC.prototype):"root"===e.type&&Object.setPrototypeOf(e,eC.prototype),e[rC]=!0,e.nodes&&e.nodes.forEach(e=>{lC.rebuild(e)})};let cC,hC,dC=uC,pC=class extends dC{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new cC(new hC,this,e).stringify()}};pC.registerLazyResult=e=>{cC=e},pC.registerProcessor=e=>{hC=e};var fC=pC;pC.default=pC;let gC={};var mC=function(e){gC[e]||(gC[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let vC=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 yC=vC;vC.default=vC;let bC=yC,wC=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 bC(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var SC=wC;wC.default=wC;const CC="'".charCodeAt(0),IC='"'.charCodeAt(0),kC="\\".charCodeAt(0),xC="/".charCodeAt(0),EC="\n".charCodeAt(0),OC=" ".charCodeAt(0),AC="\f".charCodeAt(0),PC="\t".charCodeAt(0),TC="\r".charCodeAt(0),RC="[".charCodeAt(0),MC="]".charCodeAt(0),NC="(".charCodeAt(0),_C=")".charCodeAt(0),DC="{".charCodeAt(0),LC="}".charCodeAt(0),FC=";".charCodeAt(0),UC="*".charCodeAt(0),jC=":".charCodeAt(0),BC="@".charCodeAt(0),zC=/[\t\n\f\r "#'()/;[\\\]{}]/g,VC=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,qC=/.[\r\n"'(/\\]/,WC=/[\da-f]/i;let KC=uC,GC=class extends KC{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 ZC=GC;GC.default=GC,KC.registerAtRule(GC);let JC,YC,HC=uC,$C=class extends HC{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 JC(new YC,this,e).stringify()}};$C.registerLazyResult=e=>{JC=e},$C.registerProcessor=e=>{YC=e};var XC=$C;$C.default=$C,HC.registerRoot($C);let QC={comma:e=>QC.split(e,[","],!0),space:e=>QC.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 eI=QC;QC.default=QC;let tI=uC,rI=eI,nI=class extends tI{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return rI.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 iI=nI;nI.default=nI,tI.registerRule(nI);let oI=dS,sI=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 EC:case OC:case PC:case TC:case AC:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===OC||r===EC||r===PC||r===TC||r===AC);h=["space",d.slice(g,n)],g=n-1;break;case RC:case MC:case DC:case LC:case jC:case FC:case _C:{let e=String.fromCharCode(r);h=[e,e,g];break}case NC:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==CC&&c!==IC&&c!==OC&&c!==EC&&c!==PC&&c!==AC&&c!==TC){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)===kC;)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||qC.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case CC:case IC:i=r===CC?"'":'"',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)===kC;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case BC:zC.lastIndex=g+1,zC.test(d),n=0===zC.lastIndex?d.length-1:zC.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case kC:for(n=g,s=!0;d.charCodeAt(n+1)===kC;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==xC&&r!==OC&&r!==EC&&r!==PC&&r!==TC&&r!==AC&&(n+=1,WC.test(d.charAt(n)))){for(;WC.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===OC&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===xC&&d.charCodeAt(g+1)===UC?(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):(VC.lastIndex=g+1,VC.test(d),n=0===VC.lastIndex?d.length-1:VC.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},aI=HS,lI=ZC,uI=XC,cI=iI;const hI={empty:!0,space:!0};var dI=class{constructor(e){this.input=e,this.root=new uI,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 lI;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 aI;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=sI(this.input)}decl(e,t){let r=new oI;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",hI[a]||hI[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 pI=uC,fI=dI,gI=LS;function mI(e,t){let r=new gI(e,t),n=new fI(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 vI=mI;mI.default=mI,pI.registerParse(mI);let{isClean:yI,my:bI}=Yw,wI=ZS,SI=tS,CI=uC,II=fC,kI=mC,xI=SC,EI=vI,OI=XC;const AI={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},PI={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},TI={Once:!0,postcssPlugin:!0,prepare:!0};function RI(e){return"object"==typeof e&&"function"==typeof e.then}function MI(e){let t=!1,r=AI[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 NI(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:MI(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function _I(e){return e[yI]=!1,e.nodes&&e.nodes.forEach(e=>_I(e)),e}let DI={},LI=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 xI)i=_I(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=EI;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[bI]&&CI.rebuild(i)}else i=_I(r);this.result=new xI(t,i,n),this.helpers={...DI,postcss:DI,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(!PI[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!TI[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(RI(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[yI];){e[yI]=!0;let t=[NI(e)];for(;t.length>0;){let e=this.visitTick(t);if(RI(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 RI(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=SI;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new wI(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(RI(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[yI];)e[yI]=!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||kI("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(RI(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[yI])return n[yI]=!0,void e.push(NI(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[yI]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[yI]=!0;let t=MI(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[yI]||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"}};LI.registerPostcss=e=>{DI=e};var FI=LI;LI.default=LI,OI.registerLazyResult(LI),II.registerLazyResult(LI);let UI=ZS,jI=tS,BI=mC,zI=vI;const VI=SC;let qI=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=jI;this.result=new VI(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new UI(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||BI("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=zI;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 WI=qI;qI.default=qI;let KI=WI,GI=FI,ZI=fC,JI=XC,YI=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 GI(this,e,t):new KI(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var HI=YI;YI.default=YI,JI.registerProcessor(YI),ZI.registerProcessor(YI);let $I=dS,XI=SS,QI=HS,ek=ZC,tk=LS,rk=XC,nk=iI;function ik(e,t){if(Array.isArray(e))return e.map(e=>ik(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:tk.prototype};r.map&&(r.map={...r.map,__proto__:XI.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>ik(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 rk(n);if("decl"===n.type)return new $I(n);if("rule"===n.type)return new nk(n);if("comment"===n.type)return new QI(n);if("atrule"===n.type)return new ek(n);throw new Error("Unknown node type: "+e.type)}var ok=ik;ik.default=ik;let sk=Jw,ak=dS,lk=FI,uk=uC,ck=HI,hk=tS,dk=ok,pk=fC,fk=yC,gk=HS,mk=ZC,vk=SC,yk=LS,bk=vI,wk=eI,Sk=iI,Ck=XC,Ik=uS;function kk(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new ck(e)}kk.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 ck).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return kk([i(r)]).process(e,t)},i},kk.stringify=hk,kk.parse=bk,kk.fromJSON=dk,kk.list=wk,kk.comment=e=>new gk(e),kk.atRule=e=>new mk(e),kk.decl=e=>new ak(e),kk.rule=e=>new Sk(e),kk.root=e=>new Ck(e),kk.document=e=>new pk(e),kk.CssSyntaxError=sk,kk.Declaration=ak,kk.Container=uk,kk.Processor=ck,kk.Document=pk,kk.Comment=gk,kk.Warning=fk,kk.AtRule=mk,kk.Result=vk,kk.Input=yk,kk.Rule=Sk,kk.Root=Ck,kk.Node=Ik,lk.registerPostcss(kk);var xk=kk;kk.default=kk;const Ek=Uw(xk);Ek.stringify,Ek.fromJSON,Ek.plugin,Ek.parse,Ek.list,Ek.document,Ek.comment,Ek.atRule,Ek.rule,Ek.decl,Ek.root,Ek.CssSyntaxError,Ek.Declaration,Ek.Container,Ek.Processor,Ek.Document,Ek.Comment,Ek.Warning,Ek.AtRule,Ek.Result,Ek.Input,Ek.Rule,Ek.Root,Ek.Node;var Ok=Object.defineProperty,Ak=(e,t,r)=>((e,t,r)=>t in e?Ok(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Pk(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Tk(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 Rk={exports:{}},Mk=String,Nk=function(){return{isColorSupported:!1,reset:Mk,bold:Mk,dim:Mk,italic:Mk,underline:Mk,inverse:Mk,hidden:Mk,strikethrough:Mk,black:Mk,red:Mk,green:Mk,yellow:Mk,blue:Mk,magenta:Mk,cyan:Mk,white:Mk,gray:Mk,bgBlack:Mk,bgRed:Mk,bgGreen:Mk,bgYellow:Mk,bgBlue:Mk,bgMagenta:Mk,bgCyan:Mk,bgWhite:Mk}};Rk.exports=Nk(),Rk.exports.createColors=Nk;var _k=Rk.exports;const Dk=Tk(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Lk=_k,Fk=Dk,Uk=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=Lk.isColorSupported),Fk&&e&&(t=Fk(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}=Lk.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 jk=Uk;Uk.default=Uk;var Bk={};Bk.isClean=Symbol("isClean"),Bk.my=Symbol("my");const zk={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Vk=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 zk[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=zk[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 qk=Vk;Vk.default=Vk;let Wk=qk;function Kk(e,t){new Wk(t).stringify(e)}var Gk=Kk;Kk.default=Kk;let{isClean:Zk,my:Jk}=Bk,Yk=jk,Hk=qk,$k=Gk;function Xk(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=>Xk(e,r)):("object"===o&&null!==i&&(i=Xk(i)),r[n]=i)}return r}let Qk=class{constructor(e={}){this.raws={},this[Zk]=!1,this[Jk]=!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=Xk(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 Yk(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[Zk]){this[Zk]=!1;let e=this;for(;e=e.parent;)e[Zk]=!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 Hk).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=$k){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 ex=Qk;Qk.default=Qk;let tx=ex,rx=class extends tx{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 nx=rx;rx.default=rx;var ix={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:ox,SourceMapGenerator:sx}=Dk,{existsSync:ax,readFileSync:lx}=Dk,{dirname:ux,join:cx}=Dk;let hx=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=ux(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new ox(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=ux(e),ax(e))return this.mapFile=e,lx(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 ox)return sx.fromSourceMap(t).toString();if(t instanceof sx)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=cx(ux(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 dx=hx;hx.default=hx;let{SourceMapConsumer:px,SourceMapGenerator:fx}=Dk,{fileURLToPath:gx,pathToFileURL:mx}=Dk,{isAbsolute:vx,resolve:yx}=Dk,{nanoid:bx}=ix,wx=Dk,Sx=jk,Cx=dx,Ix=Symbol("fromOffsetCache"),kx=Boolean(px&&fx),xx=Boolean(yx&&vx),Ex=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&&(!xx||/^\w+:\/\//.test(t.from)||vx(t.from)?this.file=t.from:this.file=yx(t.from)),xx&&kx){let e=new Cx(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 "+bx(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 Sx(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 Sx(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&&(mx&&(i.input.url=mx(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[Ix])r=this[Ix];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[Ix]=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:yx(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=vx(a.source)?mx(a.source):new URL(a.source,this.map.consumer().sourceRoot||mx(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(!gx)throw new Error("file: protocol is not available in this PostCSS build");l.file=gx(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 Ox=Ex;Ex.default=Ex,wx&&wx.registerInput&&wx.registerInput(Ex);let{SourceMapConsumer:Ax,SourceMapGenerator:Px}=Dk,{dirname:Tx,relative:Rx,resolve:Mx,sep:Nx}=Dk,{pathToFileURL:_x}=Dk,Dx=Ox,Lx=Boolean(Ax&&Px),Fx=Boolean(Tx&&Mx&&Rx&&Nx);var Ux=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||Tx(e.file);!1===this.mapOpts.sourcesContent?(t=new Ax(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(),Fx&&Lx&&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=Px.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Px({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 Px({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?Tx(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Tx(Mx(r,this.mapOpts.annotation)));let n=Rx(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 Dx(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(_x){let t=_x(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;"\\"===Nx&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let jx=ex,Bx=class extends jx{constructor(e){super(e),this.type="comment"}};var zx=Bx;Bx.default=Bx;let Vx,qx,Wx,Kx,{isClean:Gx,my:Zx}=Bk,Jx=nx,Yx=zx,Hx=ex;function $x(e){return e.map(e=>(e.nodes&&(e.nodes=$x(e.nodes)),delete e.source,e))}function Xx(e){if(e[Gx]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Xx(t)}let Qx=class e extends Hx{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=$x(Vx(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 Jx(t)]}else if(t.selector)t=[new qx(t)];else if(t.name)t=[new Wx(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Yx(t)]}return t.map(t=>(t[Zx]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Gx]&&Xx(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]}};Qx.registerParse=e=>{Vx=e},Qx.registerRule=e=>{qx=e},Qx.registerAtRule=e=>{Wx=e},Qx.registerRoot=e=>{Kx=e};var eE=Qx;Qx.default=Qx,Qx.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Wx.prototype):"rule"===e.type?Object.setPrototypeOf(e,qx.prototype):"decl"===e.type?Object.setPrototypeOf(e,Jx.prototype):"comment"===e.type?Object.setPrototypeOf(e,Yx.prototype):"root"===e.type&&Object.setPrototypeOf(e,Kx.prototype),e[Zx]=!0,e.nodes&&e.nodes.forEach(e=>{Qx.rebuild(e)})};let tE,rE,nE=eE,iE=class extends nE{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new tE(new rE,this,e).stringify()}};iE.registerLazyResult=e=>{tE=e},iE.registerProcessor=e=>{rE=e};var oE=iE;iE.default=iE;let sE={};var aE=function(e){sE[e]||(sE[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let lE=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 uE=lE;lE.default=lE;let cE=uE,hE=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 dE=hE;hE.default=hE;const pE="'".charCodeAt(0),fE='"'.charCodeAt(0),gE="\\".charCodeAt(0),mE="/".charCodeAt(0),vE="\n".charCodeAt(0),yE=" ".charCodeAt(0),bE="\f".charCodeAt(0),wE="\t".charCodeAt(0),SE="\r".charCodeAt(0),CE="[".charCodeAt(0),IE="]".charCodeAt(0),kE="(".charCodeAt(0),xE=")".charCodeAt(0),EE="{".charCodeAt(0),OE="}".charCodeAt(0),AE=";".charCodeAt(0),PE="*".charCodeAt(0),TE=":".charCodeAt(0),RE="@".charCodeAt(0),ME=/[\t\n\f\r "#'()/;[\\\]{}]/g,NE=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,_E=/.[\r\n"'(/\\]/,DE=/[\da-f]/i;let LE=eE,FE=class extends LE{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 UE=FE;FE.default=FE,LE.registerAtRule(FE);let jE,BE,zE=eE,VE=class extends zE{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 jE(new BE,this,e).stringify()}};VE.registerLazyResult=e=>{jE=e},VE.registerProcessor=e=>{BE=e};var qE=VE;VE.default=VE,zE.registerRoot(VE);let WE={comma:e=>WE.split(e,[","],!0),space:e=>WE.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 KE=WE;WE.default=WE;let GE=eE,ZE=KE,JE=class extends GE{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ZE.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 YE=JE;JE.default=JE,GE.registerRule(JE);let HE=nx,$E=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 vE:case yE:case wE:case SE:case bE:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===yE||r===vE||r===wE||r===SE||r===bE);h=["space",d.slice(g,n)],g=n-1;break;case CE:case IE:case EE:case OE:case TE:case AE:case xE:{let e=String.fromCharCode(r);h=[e,e,g];break}case kE:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==pE&&c!==fE&&c!==yE&&c!==vE&&c!==wE&&c!==bE&&c!==SE){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)===gE;)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||_E.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case pE:case fE:i=r===pE?"'":'"',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)===gE;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case RE:ME.lastIndex=g+1,ME.test(d),n=0===ME.lastIndex?d.length-1:ME.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case gE:for(n=g,s=!0;d.charCodeAt(n+1)===gE;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==mE&&r!==yE&&r!==vE&&r!==wE&&r!==SE&&r!==bE&&(n+=1,DE.test(d.charAt(n)))){for(;DE.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===yE&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===mE&&d.charCodeAt(g+1)===PE?(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):(NE.lastIndex=g+1,NE.test(d),n=0===NE.lastIndex?d.length-1:NE.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},XE=zx,QE=UE,eO=qE,tO=YE;const rO={empty:!0,space:!0};var nO=class{constructor(e){this.input=e,this.root=new eO,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 QE;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 XE;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=$E(this.input)}decl(e,t){let r=new HE;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 tO;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",rO[a]||rO[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 tO;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 iO=eE,oO=nO,sO=Ox;function aO(e,t){let r=new sO(e,t),n=new oO(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 lO=aO;aO.default=aO,iO.registerParse(aO);let{isClean:uO,my:cO}=Bk,hO=Ux,dO=Gk,pO=eE,fO=oE,gO=aE,mO=dE,vO=lO,yO=qE;const bO={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},wO={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},SO={Once:!0,postcssPlugin:!0,prepare:!0};function CO(e){return"object"==typeof e&&"function"==typeof e.then}function IO(e){let t=!1,r=bO[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 kO(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:IO(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function xO(e){return e[uO]=!1,e.nodes&&e.nodes.forEach(e=>xO(e)),e}let EO={},OO=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 mO)i=xO(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=vO;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]&&pO.rebuild(i)}else i=xO(r);this.result=new mO(t,i,n),this.helpers={...EO,postcss:EO,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(!wO[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!SO[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(CO(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[uO];){e[uO]=!0;let t=[kO(e)];for(;t.length>0;){let e=this.visitTick(t);if(CO(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 CO(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=dO;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new hO(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(CO(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[uO];)e[uO]=!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||gO("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(CO(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[uO])return n[uO]=!0,void e.push(kO(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[uO]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[uO]=!0;let t=IO(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[uO]||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"}};OO.registerPostcss=e=>{EO=e};var AO=OO;OO.default=OO,yO.registerLazyResult(OO),fO.registerLazyResult(OO);let PO=Ux,TO=Gk,RO=aE,MO=lO;const NO=dE;let _O=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=TO;this.result=new NO(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new PO(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||RO("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=MO;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 DO=_O;_O.default=_O;let LO=DO,FO=AO,UO=oE,jO=qE,BO=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 FO(this,e,t):new LO(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var zO=BO;BO.default=BO,jO.registerProcessor(BO),UO.registerProcessor(BO);let VO=nx,qO=dx,WO=zx,KO=UE,GO=Ox,ZO=qE,JO=YE;function YO(e,t){if(Array.isArray(e))return e.map(e=>YO(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:GO.prototype};r.map&&(r.map={...r.map,__proto__:qO.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>YO(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 ZO(n);if("decl"===n.type)return new VO(n);if("rule"===n.type)return new JO(n);if("comment"===n.type)return new WO(n);if("atrule"===n.type)return new KO(n);throw new Error("Unknown node type: "+e.type)}var HO=YO;YO.default=YO;let $O=jk,XO=nx,QO=AO,eA=eE,tA=zO,rA=Gk,nA=HO,iA=oE,oA=uE,sA=zx,aA=UE,lA=dE,uA=Ox,cA=lO,hA=KE,dA=YE,pA=qE,fA=ex;function gA(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new tA(e)}gA.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 tA).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return gA([i(r)]).process(e,t)},i},gA.stringify=rA,gA.parse=cA,gA.fromJSON=nA,gA.list=hA,gA.comment=e=>new sA(e),gA.atRule=e=>new aA(e),gA.decl=e=>new XO(e),gA.rule=e=>new dA(e),gA.root=e=>new pA(e),gA.document=e=>new iA(e),gA.CssSyntaxError=$O,gA.Declaration=XO,gA.Container=eA,gA.Processor=tA,gA.Document=iA,gA.Comment=sA,gA.Warning=oA,gA.AtRule=aA,gA.Result=lA,gA.Input=uA,gA.Rule=dA,gA.Root=pA,gA.Node=fA,QO.registerPostcss(gA);var mA=gA;gA.default=gA;const vA=Pk(mA);vA.stringify,vA.fromJSON,vA.plugin,vA.parse,vA.list,vA.document,vA.comment,vA.atRule,vA.rule,vA.decl,vA.root,vA.CssSyntaxError,vA.Declaration,vA.Container,vA.Processor,vA.Document,vA.Comment,vA.Warning,vA.AtRule,vA.Result,vA.Input,vA.Rule,vA.Root,vA.Node;class yA{constructor(...e){Ak(this,"parentElement",null),Ak(this,"parentNode",null),Ak(this,"ownerDocument"),Ak(this,"firstChild",null),Ak(this,"lastChild",null),Ak(this,"previousSibling",null),Ak(this,"nextSibling",null),Ak(this,"ELEMENT_NODE",1),Ak(this,"TEXT_NODE",3),Ak(this,"nodeType"),Ak(this,"nodeName"),Ak(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 yA))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 bA={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},wA={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},SA={};function CA(e){if(SA[e])return SA[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 bA?bA[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 wA?wA[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 SA[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?SA[e]=o:r}catch{return r}}const IA={};function kA(e,t,r){var n;const i=`${e}.${String(r)}`;if(IA[i])return IA[i].call(t);const o=CA(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(IA[i]=s,s.call(t)):t[r]}const xA={};function EA(e,t,r){const n=`${e}.${String(r)}`;if(xA[n])return xA[n].bind(t);const i=CA(e)[r];return"function"!=typeof i?t[r]:(xA[n]=i,i.bind(t))}function OA(){return CA("MutationObserver").constructor}const AA={childNodes:function(e){return kA("Node",e,"childNodes")},parentNode:function(e){return kA("Node",e,"parentNode")},parentElement:function(e){return kA("Node",e,"parentElement")},textContent:function(e){return kA("Node",e,"textContent")},contains:function(e,t){return EA("Node",e,"contains")(t)},getRootNode:function(e){return EA("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?kA("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?kA("Element",e,"shadowRoot"):null},querySelector:function(e,t){return kA("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return kA("Element",e,"querySelectorAll")(t)},mutationObserver:OA};function PA(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const TA="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 RA={map:{},getId:()=>(console.error(TA),-1),getNode:()=>(console.error(TA),null),removeNodeFromMap(){console.error(TA)},has:()=>(console.error(TA),!1),reset(){console.error(TA)}};function MA(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 NA(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)}}),()=>NA(e,t,o||{},!0)}function _A(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&&(RA=new Proxy(RA,{get:(e,t,r)=>("map"===t&&console.error(TA),Reflect.get(e,t,r))}));let DA=Date.now;function LA(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=AA.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=AA.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function FA(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function UA(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function jA(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:AA.parentElement(e)}function BA(e,t,r,n){if(!e)return!1;const i=jA(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(Nw(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 zA(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function VA(e,t){if(rw(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=AA.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||VA(n,t))}function qA(e){return Boolean(e.changedTouches)}function WA(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function KA(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function GA(e){return!!e&&(e instanceof yA&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(AA.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(DA=()=>(new Date).getTime());class ZA{constructor(){Vb(this,"id",1),Vb(this,"styleIDMap",new WeakMap),Vb(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 JA(e){var t;let r=null;return"getRootNode"in e&&(null==(t=AA.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&AA.host(AA.getRootNode(e))&&(r=AA.host(AA.getRootNode(e))),r}function YA(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=JA(r);)r=t;return r}(e);return AA.contains(t,r)}function HA(e){const t=e.ownerDocument;return!!t&&(AA.contains(t,e)||YA(e))}var $A=(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))($A||{}),XA=(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))(XA||{}),QA=(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))(QA||{}),eP=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(eP||{}),tP=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(tP||{}),rP=(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))(rP||{}),nP=(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))(nP||{});function iP(e){return"__ln"in e}class oP{constructor(){Vb(this,"length",0),Vb(this,"head",null),Vb(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&&iP(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&&iP(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 sP=(e,t)=>`${e}@${t}`;class aP{constructor(){Vb(this,"frozen",!1),Vb(this,"locked",!1),Vb(this,"texts",[]),Vb(this,"attributes",[]),Vb(this,"attributeMap",new WeakMap),Vb(this,"removes",[]),Vb(this,"mapRemoves",[]),Vb(this,"movedMap",{}),Vb(this,"addedSet",new Set),Vb(this,"movedSet",new Set),Vb(this,"droppedSet",new Set),Vb(this,"removesSubTreeCache",new Set),Vb(this,"mutationCb"),Vb(this,"blockClass"),Vb(this,"blockSelector"),Vb(this,"maskTextClass"),Vb(this,"maskTextSelector"),Vb(this,"inlineStylesheet"),Vb(this,"maskInputOptions"),Vb(this,"maskTextFn"),Vb(this,"maskInputFn"),Vb(this,"keepIframeSrcFn"),Vb(this,"recordCanvas"),Vb(this,"inlineImages"),Vb(this,"slimDOMOptions"),Vb(this,"dataURLOptions"),Vb(this,"doc"),Vb(this,"mirror"),Vb(this,"iframeManager"),Vb(this,"stylesheetManager"),Vb(this,"shadowDomManager"),Vb(this,"canvasManager"),Vb(this,"processedNodeManager"),Vb(this,"unattachedDoc"),Vb(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Vb(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new oP,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=AA.parentNode(i);if(!o||!HA(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=rw(o)?this.mirror.getId(JA(i)):this.mirror.getId(o),l=n(i);if(-1===a||-1===l)return r.addNode(i);const u=Fw(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=>{WA(e,this.mirror)&&this.iframeManager.addIframe(e),KA(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),GA(i)&&this.shadowDomManager.addShadowRoot(AA.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)uP(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(AA.parentNode(e))||i(e);for(const e of this.addedSet)cP(this.droppedSet,e)||uP(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(AA.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(AA.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=AA.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=AA.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=AA.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))}),Vb(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(AA.childNodes(e),e=>AA.textContent(e)||"").join("");t.attributes.value=aw({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:cw(e),value:r,maskInputFn:this.maskInputFn})}),Vb(this,"processMutation",e=>{if(!zA(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=AA.textContent(e.target);BA(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:_w(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,jA(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=aw({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(BA(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"),!Mw(t.tagName,r))if(i.attributes[r]=Rw(this.doc,lw(t.tagName),lw(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(BA(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=rw(e.target)?this.mirror.getId(AA.host(e.target)):this.mirror.getId(e.target);BA(e.target,this.blockClass,this.blockSelector,!1)||zA(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(lP(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||VA(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[sP(r,n)]?lP(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!rw(e.target)||!nw(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),AA.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Vb(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(zA(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[sP(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);BA(e,this.blockClass,this.blockSelector,!1)||(AA.childNodes(e).forEach(e=>this.genAdds(e)),GA(e)&&AA.childNodes(AA.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 lP(e,t){e.delete(t),AA.childNodes(t).forEach(t=>lP(e,t))}function uP(e,t,r){return 0!==e.size&&function(e,t){const r=AA.parentNode(t);return!!r&&e.has(r)}(e,t)}function cP(e,t){return 0!==e.size&&hP(e,t)}function hP(e,t){const r=AA.parentNode(t);return!!r&&(!!e.has(r)||hP(e,r))}let dP;const pP=e=>{if(!dP)return e;return(...t)=>{try{return e(...t)}catch(e){if(dP&&!0===dP(e))return;throw e}}};function fP(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const gP=[];function mP(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 vP(e,t){const r=new aP;gP.push(r),r.init(e);const n=new(OA())(pP(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function yP({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(QA).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(o=>{let s=lw(o);const u=(t=>o=>{const s=mP(o);if(BA(s,n,i,!0))return;let a=null,u=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=eP.Mouse;break;case"touch":a=eP.Touch;break;case"pen":a=eP.Pen}a===eP.Touch?QA[t]===QA.MouseDown?u="TouchStart":QA[t]===QA.MouseUp&&(u="TouchEnd"):eP.Pen}else qA(o)&&(a=eP.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===eP.Touch||u.startsWith("Mouse")&&a===eP.Mouse)&&(a=null)):QA[t]===QA.Click&&(a=l,l=null);const c=qA(o)?o.changedTouches[0]:o;if(!c)return;const h=r.getId(s),{clientX:d,clientY:p}=c;pP(e)({type:QA[u],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(QA[o]){case QA.MouseDown:case QA.MouseUp:s=s.replace("mouse","pointer");break;case QA.TouchStart:case QA.TouchEnd:return}a.push(PA(s,u,t))}),pP(()=>{a.forEach(e=>e())})}function bP({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const s=pP(MA(pP(o=>{const s=mP(o);if(!s||BA(s,n,i,!0))return;const a=r.getId(s);if(s===t&&t.defaultView){const r=LA(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 PA("scroll",s,t)}const wP=["INPUT","TEXTAREA","SELECT"],SP=new WeakMap;function CP(e){return function(e,t){if(EP("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||EP("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||EP("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||EP("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 IP(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function kP({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(AA.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}}),pP(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function xP(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=vP(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=MA(pP(t=>{const r=Date.now()-s;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],s=null}),o),u=pP(MA(pP(e=>{const t=mP(e),{clientX:r,clientY:i}=qA(e)?e.changedTouches[0]:e;s||(s=DA()),a.push({x:r,y:i,id:n.getId(t),timeOffset:DA()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?XA.Drag:e instanceof MouseEvent?XA.MouseMove:XA.TouchMove)}),i,{trailing:!1})),c=[PA("mousemove",u,r),PA("touchmove",u,r),PA("drag",u,r)];return pP(()=>{c.forEach(e=>e())})}(e),o=yP(e),s=bP(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return PA("resize",pP(MA(pP(()=>{const t=FA(),i=UA();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=mP(e);const u=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=AA.parentElement(r)),!r||!h||wP.indexOf(h)<0||BA(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=aw({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=SP.get(t);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){SP.set(t,n);const i=r.getId(t);pP(e)({...n,id:i})}}const p=("last"===u.input?["change"]:["input","change"]).map(e=>PA(e,pP(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=>NA(e[0],e[1],{set(){pP(h)({target:this,isTrusted:!1})}},!1,f))),pP(()=>{p.forEach(e=>e())})}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const s=pP(o=>MA(pP(i=>{const s=mP(i);if(!s||BA(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=[PA("play",s(rP.Play),o),PA("pause",s(rP.Pause),o),PA("seeked",s(rP.Seeked),o),PA("volumechange",s(rP.VolumeChange),o),PA("ratechange",s(rP.RateChange),o)];return pP(()=>{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:pP((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=IP(i,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:a}]}),fP(()=>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:pP((n,i,o)=>{const[s]=o,{id:a,styleId:l}=IP(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),fP(()=>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:pP((n,i,o)=>{const[s]=o,{id:a,styleId:l}=IP(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:pP((n,i,o)=>{const[s]=o,{id:a,styleId:l}=IP(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),n.apply(i,o)})}));const l={};OP("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(OP("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),OP("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),OP("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:pP((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=IP(i.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:[...CP(i),a||0]}]}),n.apply(i,o)})}),i.prototype.deleteRule=new Proxy(u[n].deleteRule,{apply:pP((n,i,o)=>{const[s]=o,{id:a,styleId:l}=IP(i.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...CP(i),s]}]}),n.apply(i,o)})})}),pP(()=>{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=kP(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:pP((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}=IP(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:CP(s.parentRule)}),i.apply(s,a)})});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:pP((i,o,a)=>{var l;const[u]=a;if(r.has(u))return s.apply(o,[u]);const{id:c,styleId:h}=IP(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:CP(o.parentRule)}),i.apply(o,a)})}),pP(()=>{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=_A(t.fonts,"add",function(t){return function(r){return setTimeout(pP(()=>{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),pP(()=>{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=pP(()=>{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;BA(s,n,i,!0)||BA(u,n,i,!0)||a.push({start:r.getId(s),startOffset:l,end:r.getId(u),endOffset:c})}o({ranges:a})});return a(),PA("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?_A(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 pP(()=>{gP.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 EP(e){return void 0!==window[e]}function OP(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class AP{constructor(e){Vb(this,"iframeIdToRemoteIdMap",new WeakMap),Vb(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 PP{constructor(e){Vb(this,"iframes",new WeakMap),Vb(this,"crossOriginIframeMap",new WeakMap),Vb(this,"crossOriginIframeMirror",new AP(Cw)),Vb(this,"crossOriginIframeStyleMirror"),Vb(this,"crossOriginIframeRootIdMap",new WeakMap),Vb(this,"mirror"),Vb(this,"mutationCb"),Vb(this,"wrappedEmit"),Vb(this,"loadListener"),Vb(this,"stylesheetManager"),Vb(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new AP(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 $A.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:$A.IncrementalSnapshot,data:{source:XA.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case $A.Meta:case $A.Load:case $A.DomContentLoaded:return!1;case $A.Plugin:return t;case $A.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case $A.IncrementalSnapshot:switch(t.data.source){case XA.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 XA.Drag:case XA.TouchMove:case XA.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case XA.ViewportResize:return!1;case XA.MediaInteraction:case XA.MouseInteraction:case XA.Scroll:case XA.CanvasMutation:case XA.Input:return this.replaceIds(t.data,e,["id"]),t;case XA.StyleSheetRule:case XA.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case XA.Font:return t;case XA.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case XA.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===nP.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class TP{constructor(e){Vb(this,"shadowDoms",new WeakSet),Vb(this,"mutationCb"),Vb(this,"scrollCb"),Vb(this,"bypassOptions"),Vb(this,"mirror"),Vb(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(!nw(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=vP({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(bP({...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(AA.host(e))),this.restoreHandlers.push(kP({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(_A(e.prototype,"attachShadow",function(e){return function(n){const i=e.call(this,n),o=AA.shadowRoot(this);return o&&HA(this)&&r.addShadowRoot(o,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var RP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",MP="undefined"==typeof Uint8Array?[]:new Uint8Array(256),NP=0;NP<64;NP++)MP[RP.charCodeAt(NP)]=NP;const _P=new Map;const DP=(e,t,r)=>{if(!e||!UP(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=_P.get(e);return r||(r=new Map,_P.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 LP(e,t,r){if(e instanceof Array)return e.map(e=>LP(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+=RP[r[t]>>2],i+=RP[(3&r[t])<<4|r[t+1]>>4],i+=RP[(15&r[t+1])<<2|r[t+2]>>6],i+=RP[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:[LP(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:[LP(e.data,t,r),e.width,e.height]}}if(UP(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:DP(e,t,r)}}return e}const FP=(e,t,r)=>e.map(e=>LP(e,t,r)),UP=(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 jP(e,t,r,n){const i=[];try{const o=_A(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(i,...o){if(!BA(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 BP(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=_A(e,l,function(e){return function(...s){const a=e.apply(this,s);if(DP(a,o,this),"tagName"in this.canvas&&!BA(this.canvas,n,i,!0)){const e=FP(s,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});s.push(a)}catch{const n=NA(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(n)}return s}const zP="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",VP="undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0)))(zP)],{type:"text/javascript;charset=utf-8"});function qP(e){let t;try{if(t=VP&&(window.URL||window.webkitURL).createObjectURL(VP),!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,"+zP,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class WP{constructor(e){Vb(this,"pendingCanvasMutations",new Map),Vb(this,"rafStamps",{latestId:0,invokeId:null}),Vb(this,"mirror"),Vb(this,"mutationCb"),Vb(this,"resetObservers"),Vb(this,"frozen",!1),Vb(this,"locked",!1),Vb(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=jP(t,r,n,!0),s=new Map,a=new qP;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:tP["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=>{BA(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=jP(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=_A(t.CanvasRenderingContext2D.prototype,s,function(i){return function(...o){return BA(this.canvas,r,n,!0)||setTimeout(()=>{const r=FP(o,t,this);e(this.canvas,{type:tP["2D"],property:s,args:r})},0),i.apply(this,o)}});i.push(o)}catch{const r=NA(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:tP["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(...BP(t.WebGLRenderingContext.prototype,tP.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...BP(t.WebGL2RenderingContext.prototype,tP.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 KP{constructor(e){Vb(this,"trackedLinkElements",new WeakSet),Vb(this,"mutationCb"),Vb(this,"adoptedStyleSheetCb"),Vb(this,"styleMirror",new ZA),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:ow(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 GP{constructor(){Vb(this,"nodeMap",new WeakMap),Vb(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 ZP,JP,YP,HP=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(jb=e.contentWindow)?void 0:jb.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const $P=new sw;function XP(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:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:E=!1,inlineImages:O=!1,plugins:A,keepIframeSrcFn:P=()=>!1,ignoreCSSAttributes:T=new Set([]),errorHandler:R,applyBackgroundColorToBlockedElements:M=!1}=e;dP=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),$P.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};ZP=(e,i)=>{var o;const s=e;if(s.timestamp=DA(),!(null==(o=gP[0])?void 0:o.isFrozen())||s.type===$A.FullSnapshot||s.type===$A.IncrementalSnapshot&&s.data.source===XA.Mutation||gP.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===$A.FullSnapshot)F=s,U=0;else if(s.type===$A.IncrementalSnapshot){if(s.data.source===XA.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=>{ZP({type:$A.IncrementalSnapshot,data:{source:XA.Mutation,...e}})},z=e=>ZP({type:$A.IncrementalSnapshot,data:{source:XA.Scroll,...e}}),V=e=>ZP({type:$A.IncrementalSnapshot,data:{source:XA.CanvasMutation,...e}}),q=new KP({mutationCb:B,adoptedStyleSheetCb:e=>ZP({type:$A.IncrementalSnapshot,data:{source:XA.AdoptedStyleSheet,...e}})}),W=new PP({mirror:$P,mutationCb:B,stylesheetManager:q,recordCrossOriginIframes:I,wrappedEmit:ZP});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:$P,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});const K=new GP;YP=new WP({recordCanvas:C,mutationCb:V,win:window,blockClass:i,blockSelector:o,mirror:$P,sampling:y.canvas,dataURLOptions:b});const G=new TP({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:YP,keepIframeSrcFn:P,processedNodeManager:K},mirror:$P});JP=(e=!1)=>{if(!S)return;ZP({type:$A.Meta,data:{href:window.location.href,width:UA(),height:FA()}},e),q.reset(),G.init(),gP.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new sw,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 Fw(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:$P,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=>{WA(e,$P)&&W.addIframe(e),KA(e,$P)&&q.trackLinkElement(e),GA(e)&&G.addShadowRoot(AA.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");ZP({type:$A.FullSnapshot,data:{node:t,initialOffset:LA(window)}},e),gP.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&q.adoptStyleSheets(document.adoptedStyleSheets,$P.getId(document))};try{const e=[],t=e=>{var t;return pP(xP)({mutationCb:B,mousemoveCb:(e,t)=>ZP({type:$A.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>ZP({type:$A.IncrementalSnapshot,data:{source:XA.MouseInteraction,...e}}),scrollCb:z,viewportResizeCb:e=>ZP({type:$A.IncrementalSnapshot,data:{source:XA.ViewportResize,...e}}),inputCb:e=>ZP({type:$A.IncrementalSnapshot,data:{source:XA.Input,...e}}),mediaInteractionCb:e=>ZP({type:$A.IncrementalSnapshot,data:{source:XA.MediaInteraction,...e}}),styleSheetRuleCb:e=>ZP({type:$A.IncrementalSnapshot,data:{source:XA.StyleSheetRule,...e}}),styleDeclarationCb:e=>ZP({type:$A.IncrementalSnapshot,data:{source:XA.StyleDeclaration,...e}}),canvasMutationCb:V,fontCb:e=>ZP({type:$A.IncrementalSnapshot,data:{source:XA.Font,...e}}),selectionCb:e=>{ZP({type:$A.IncrementalSnapshot,data:{source:XA.Selection,...e}})},customElementCb:e=>{ZP({type:$A.IncrementalSnapshot,data:{source:XA.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:x,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:P,blockSelector:o,slimDOMOptions:L,dataURLOptions:b,mirror:$P,iframeManager:W,stylesheetManager:q,shadowDomManager:G,processedNodeManager:K,canvasManager:YP,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=>ZP({type:$A.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)),HP=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(PA("DOMContentLoaded",()=>{ZP({type:$A.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&r()})),e.push(PA("load",()=>{ZP({type:$A.Load,data:{}}),"load"===k&&r()},window))),()=>{e.forEach(e=>e()),K.destroy(),HP=!1,dP=void 0}}catch(e){console.warn(e)}}var QP;XP.addCustomEvent=(e,t)=>{if(!HP)throw new Error("please add custom event after start recording");ZP({type:$A.Custom,data:{tag:e,payload:t}})},XP.freezePage=()=>{gP.forEach(e=>e.freeze())},XP.takeFullSnapshot=e=>{if(!HP)throw new Error("please take full snapshot after start recording");JP(e)},XP.mirror=$P,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(QP||(QP={}));var eT=Object.freeze({__proto__:null,record:XP}),tT=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}(),rT=Object.freeze({__proto__:null,NetworkObservers:tT});e.Identify=N,e.Revenue=K,e.Types=$i,e._setDiagnosticsSampleRate=Ju,e.add=Xu,e.createInstance=Gu,e.experiment=Hu,e.extendSession=Qu,e.flush=ec,e.getDeviceId=tc,e.getSessionId=rc,e.getUserId=nc,e.groupIdentify=ic,e.identify=oc,e.initAll=Yu,e.logEvent=sc,e.remove=ac,e.reset=lc,e.revenue=uc,e.sessionReplay=$u,e.setDeviceId=cc,e.setGroup=hc,e.setOptOut=dc,e.setSessionId=pc,e.setTransport=fc,e.setUserId=gc,e.track=mc,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",k="rdt_cid",x="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,k;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&&(k=f.return)&&k.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 Z="Amplitude Logger ",J=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(Z,"[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(Z,"[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(Z,"[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(Z,"[Debug]: ").concat(e.join(" ")))},e}(),Y=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:g,logLevel:G.Warn,loggerProvider:new J,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=Y();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=Y().serverZone),void 0===r&&(r=Y().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:Y().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){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 Q,l.label=1;case 1:return l.trys.push([1,3,,4]),n=X(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(se(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:_.Failed,statusCode:0},e),[3,4];case 4:return[2]}var u})})},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,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:""},ke=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=xe(r[0]),i=xe(r[1]);return i?(e[n]=i,e):e},{}):{}},xe=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,k=this.buildStatus(I);switch(k){case _.Success:return{status:k,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:k,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:k,statusCode:I,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case _.RateLimit:return{status:k,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:k,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}(),Ze=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),Je=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}(),Ye=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],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 Je(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[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"}(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=ke();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=ke();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[k]=t[k],e[x]=t[x],e[E]=t[E],e[O]=t[O],e},e}(),St="data-amp-mask",Ct="*****",It=/\b(?:\d[ -]*?){13,16}\b/,kt=/(\d{3}-?\d{2}-?\d{4})/g,xt=/[^\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(kt,Ct)).replace(xt,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:Yt}function Bt(e){return e instanceof Yt}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 Zt=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var r=new Jt(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}(),Jt=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}(),Yt=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 Zt(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 Yt(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 Yt(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;return new Yt(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)}});function n(){null==r||r.unsubscribe(),r=null,t.clear()}}Mt()&&Object.defineProperty(Yt,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.0-zen-plus-zoning.1",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]",kr="".concat(Ir," Form Started"),xr="".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,k,x,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 J),void 0===v&&(v=G.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===I&&(I=""),void 0===k&&(k="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=k,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=x,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,k,x,E,O,A,P,T,R,M,N,_,D,L,F,U,j,z,V,q,W,K,G,Z,J,Y,H;return l(this,function(l){switch(l.label){case 0:return n=t.identityStorage||Fr,x={},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,[(x.domain=s,x.expiration=365,x.sameSite="Lax",x.secure=!1,x.upgrade=!0,x),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=ke(),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===(J=null===(Z=t.trackingOptions)||void 0===Z?void 0:Z.language)||void 0===J||J,platform:null===(H=null===(Y=t.trackingOptions)||void 0===Y?void 0:Y.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,(k=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,void 0,void 0,t.remoteConfig)).storageProvider.isEnabled()];case 8:return l.sent()||(k.loggerProvider.warn("Storage provider ".concat(k.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),k.storageProvider=new Te),[2,k]}})})},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 Ze},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=Jr(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&&Zr(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()])]}})})},Zr=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},Jr=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},Yr=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(kr,((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(kr,((r={})[_r]=Hr(e.id),r[Dr]=Hr(e.name),r[Lr]=o,r)),n.track(xr,((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"])),k=I.next();!k.done;k=I.next()){var x=k.value,E=null!==(p=C[x])&&void 0!==p?p:{},O=E.captureSafeHeaders,A=E.allowlist;(O||A)&&(void 0===A||Array.isArray(A)?C[x]=h(h([],c(O?P:[]),!1),c(null!=A?A:[]),!1):delete C[x])}}catch(e){o={error:e}}finally{try{k&&!k.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.18.0-zen-plus-zoning.1",sn="[Amplitude] Element Clicked",an="[Amplitude] Element Tag",ln="[Amplitude] Element Text",un="[Amplitude] Page URL",cn="https://app.amplitude.com",hn={US:cn,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},dn="data-amp-mask-attributes",pn=["input","select","textarea"],fn=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},gn=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=fn(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}}},mn=function(e){return e?e.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[]},vn=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},{})},yn=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:yn(null==e?void 0:e.parentElement,t):null};var bn=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};var wn=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",dn,St]),Sn=["type"],Cn=["svg","path","g"],In=["password","hidden"];function kn(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!wn.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!pn.includes(i)&&!o}(e);if(!In.includes(String(e.getAttribute("type")))&&!Cn.includes(l))try{for(var y=u(m),b=y.next();!b.done;b=y.next()){var w=b.value;v&&!Sn.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 xn=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}})},En=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),On=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 En(h(o),!0);var s=e.tagName.toLowerCase();if("body"===s||"head"===s||"html"===s)return new En(s,!0)}var a=e.tagName.toLowerCase();if(o)return new En(a+h(o),!0);var l=e.parentNode;if(!l||l.nodeType===Node.DOCUMENT_NODE)return new En(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 k=a;if(r&&"input"===a.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(k+="[type="+CSS.escape(e.getAttribute("type")||"")+"]"),f)k+=":nth-child("+String(g+1)+")";else if(p)try{for(var x=u(d),E=x.next();!E.done;E=x.next()){var O=E.value;k+="."+CSS.escape(O.slice(1))}}catch(e){n={error:e}}finally{try{E&&!E.done&&(i=x.return)&&i.call(x)}finally{if(n)throw n.error}}return new En(k,!1)},An=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=mn(f.getAttribute(dn)),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 kn(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,r=performance.now(),n=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var r=[],n=e;n;){var i=On(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,d=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),p="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},f=o.getHierarchy(t),g=null===(a=f[0])||void 0===a?void 0:a.attrs,m=o.getNearestLabel(t),v=(u=null!=g?g:{},h=r,Object.entries(u).reduce(function(e,t){var r=c(t,2),n=r[0],i=r[1];if(n.startsWith(h)){var o=n.replace(h,"");o&&(e[o]=i||"")}return e},{})),y=((n={})["[Amplitude] Element Hierarchy"]=f,n[an]=d,n[ln]=o.getText(t),n["[Amplitude] Element Position Left"]=null==p.left?null:Math.round(p.left),n["[Amplitude] Element Position Top"]=null==p.top?null:Math.round(p.top),n["[Amplitude] Element Attributes"]=v,n["[Amplitude] Element Path"]=o.getElementPath(t),n["[Amplitude] Element Parent Label"]=m,n[un]=Oe(window.location.href.split("?")[0]),n["[Amplitude] Page Title"]=Ot(o.replaceSensitiveString),n["[Amplitude] Viewport Height"]=window.innerHeight,n["[Amplitude] Viewport Width"]=window.innerWidth,n);try{var b=null===(l=window.sessionStorage)||void 0===l?void 0:l.getItem("AMP_PAGE_VIEW");if(b){var w=JSON.parse(b);"string"==typeof w.pageViewId&&(y["[Amplitude] Page View ID"]=w.pageViewId)}}catch(e){}return y["[Amplitude] Element ID"]=t.getAttribute("id")||"",y["[Amplitude] Element Class"]=t.getAttribute("class"),y["[Amplitude] Element Aria Label"]=null==g?void 0:g["aria-label"],"a"===d&&"click"===e&&t instanceof HTMLAnchorElement&&(y["[Amplitude] Element Href"]=o.replaceSensitiveString(t.href)),vn(y)},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&&fn(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,n),s;var a=yn(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 vn(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},Pn=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?cn:t,n=this;this.endpoint=cn,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 An({})}: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===cn&&(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 Tn,Rn=function(){return new Yt(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()}})},Mn=function(e){return void 0===e&&(e="click"),new Yt(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})}})},Nn={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},_n=function(e){var t,r,n,i,o=Object.values(Nn).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=Nn[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},Dn=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},Ln=function(e,t){return t.filter(function(t){return t.definition.some(function(t){return Nn[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)})})})},Fn=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=Ln(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;xn(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.ClickObservableZen="clickObservableZen",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.MutationObservableZen="mutationObservableZen",e.NavigateObservableZen="navigateObservableZen"}(Tn||(Tn={}));var Un=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 Pn}: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="@amplitude/plugin-autocapture-browser",S=[],C=new An(e,t),I=_n(Object.values(null!==(p=null===(d=e.pageActions)||void 0===d?void 0:d.labeledEvents)&&void 0!==p?p:{})),k=Dn(null!==(g=null===(f=e.pageActions)||void 0===f?void 0:f.triggers)&&void 0!==g?g:[]),x=function(e,t,r,n){return new Fn(e,t,r,n)}(I,k,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=_n(Object.values(null!==(r=e.pageActions.labeledEvents)&&void 0!==r?r:{})),k=Dn(null!==(n=e.pageActions.triggers)&&void 0!==n?n:[]),x.update(I,k,e))}(t)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),n=gn(e,e.cssSelectorAllowlist),i=gn(e,e.actionClickAllowlist),s=function(){var t,r,n=Xt(Mn().map(function(t){return C.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,v)})),i=Xt(new Yt(function(t){var r,n=function(r){var n=C.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 Yt(function(t){var r=function(r){var n=C.addAdditionalEventProperties(r,"navigate",e.cssSelectorAllowlist,v);t.next(n)};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}})));var o=Xt(Rn().map(function(t){return C.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,v)}));return(t={})[Tn.ChangeObservable]=i,t[Tn.ClickObservableZen]=n,t[Tn.MutationObservableZen]=o,t[Tn.NavigateObservableZen]=r,t}(),a=function(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackEvent,i=e.evaluateTriggers;return r.clickObservableZen.filter(bn).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:s,amplitude:r,shouldTrackEvent:n,evaluateTriggers:x.evaluate.bind(x)}),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.filter(bn).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: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:x.evaluate.bind(x)}),S.push(u),d=function(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,s=e.shouldTrackActionClick,a=r.clickObservableZen,l=r.mutationObservableZen,u=r.navigateObservableZen,c=a.filter(function(e){return!o("click",e.closestTrackedAncestor)}).map(function(e){var t=yn(e.event.target,n.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e}).filter(bn).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(){return p=null,f=null,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: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}),d&&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:hn[t.serverZone]}),{isElementSelectable:gn(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]})})}}},jn=["mutation","navigate"];function Bn(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 zn(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 Vn(e){var t=this,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,o=n.clickObservable;if(o){var s=[],u={},c=null,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 Bn(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=zn(s)),function(e){s=[],u={},e&&(Bn(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(zn(s))},1e3)}})]:[2,null]})})});return h.subscribe(function(e){null!==e&&r.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})})}}var qn,Wn,Kn=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 An(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=gn(e,f),i=gn(e,g),s=function(){var e,t,r=Xt(Mn("pointerdown").map(function(e){return v.addAdditionalEventProperties(e,"click",y,m,!0)})),n=Xt(Rn().map(function(e){return v.addAdditionalEventProperties(e,"mutation",y,m)}));return window.navigation&&(t=Xt(new Yt(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={})[Tn.ClickObservable]=r,e[Tn.MutationObservable]=n,e[Tn.NavigateObservable]=t,e}(),a=Vn({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 bn(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&&jn.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,i;return l(this,function(o){try{for(e=u(p),t=e.next();!t.done;t=e.next())null==(r=t.value)||r.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(n)throw n.error}}return[2]})})}}},Gn="[Amplitude] Network Request",Zn="500-599";function Jn(e,t){var r="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(r).test(e)}function Yn(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 Hn(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 $n(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 Xn(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 Qn(e,t){var r;void 0===t&&(t={});var n=Hn(e.url);if(!n)return!1;var i,o=n.host;if(!1!==t.ignoreAmplitudeRequests&&(Jn(o,"*.amplitude.com")||Jn(o,"amplitude.com")))return!1;if(null===(r=t.ignoreHosts)||void 0===r?void 0:r.find(function(e){return Jn(o,e)}))return!1;if(!t.captureRules&&void 0!==e.status&&!Yn(e.status,Zn))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 Jn(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)&&!Yn(r,e.statusCodeRange||Zn))}(t,o,e.status,e.url,e.method),i){var r=$n(t.responseHeaders);if(e.responseWrapper&&r){var n=e.responseWrapper.headers(r);n&&(e.responseHeaders=n)}var s=$n(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}e.responseWrapper&&t.responseBody&&!Xn(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!Xn(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===Gn}))return!0}catch(e){}return!1}(o,e.requestWrapper)}function ei(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude,i=e.loggerProvider;return t.networkObservable.filter(function(e){return Qn(e.event,r)}).subscribe(function(e){var t,r,o,s=e.event,u=Hn(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(Gn,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"}(qn||(qn={}));var ti=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=function(){var e,r=new Yt(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={})[qn.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,Wn=ei({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 Wn.unsubscribe(),[2]})})}}};let ri=-1;const ni=e=>{addEventListener("pageshow",t=>{t.persisted&&(ri=t.timeStamp,e(t))},!0)},ii=(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)))}},oi=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},si=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ai=()=>{const e=si();return e?.activationStart??0},li=(e,t=-1)=>{const r=si();let n="navigate";return ri>=0?n="back-forward-cache":r&&(document.prerendering||ai()>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}},ui=new WeakMap;function ci(e,t){return ui.get(e)||ui.set(e,new t),ui.get(e)}class hi{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 di=(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{}},pi=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let fi=-1;const gi=new Set,mi=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,vi=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of gi)e();isFinite(fi)||(fi="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",vi,!0))}},yi=()=>{if(fi<0){const e=ai(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;fi=t??mi(),addEventListener("visibilitychange",vi,!0),addEventListener("prerenderingchange",vi,!0),ni(()=>{setTimeout(()=>{fi=mi()})})}return{get firstHiddenTime(){return fi},onHidden(e){gi.add(e)}}},bi=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},wi=[1800,3e3],Si=(e,t={})=>{bi(()=>{const r=yi();let n,i=li("FCP");const o=di("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-ai(),0),i.entries.push(t),n(!0)))});o&&(n=ii(e,i,wi,t.reportAllChanges),ni(r=>{i=li("FCP"),n=ii(e,i,wi,t.reportAllChanges),oi(()=>{i.value=performance.now()-r.timeStamp,n(!0)})}))})},Ci=[.1,.25];let Ii=0,ki=1/0,xi=0;const Ei=e=>{for(const t of e)t.interactionId&&(ki=Math.min(ki,t.interactionId),xi=Math.max(xi,t.interactionId),Ii=xi?(xi-ki)/7+1:0)};let Oi;const Ai=()=>Oi?Ii:performance.interactionCount??0;let Pi=0;class Ti{u=[];l=new Map;m;p;v(){Pi=Ai(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((Ai()-Pi)/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.P){if(r?e.duration>r.P?(r.entries=[e],r.P=e.duration):e.duration===r.P&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],P:e.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort((e,t)=>t.P-e.P),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(r)}}}const Ri=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=pi(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},Mi=[200,500],Ni=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=yi();bi(()=>{"interactionCount"in performance||Oi||(Oi=di("event",Ei,{type:"event",buffered:!0,durationThreshold:0}));let n,i=li("INP");const o=ci(t,Ti),s=e=>{Ri(()=>{for(const t of e)o.h(t);const t=o.L();t&&t.P!==i.value&&(i.value=t.P,i.entries=t.entries,n())})},a=di("event",s,{durationThreshold:t.durationThreshold??40});n=ii(e,i,Mi,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),r.onHidden(()=>{s(a.takeRecords()),n(!0)}),ni(()=>{o.v(),i=li("INP"),n=ii(e,i,Mi,t.reportAllChanges)}))})};class _i{m;h(e){this.m?.(e)}}const Di=[2500,4e3],Li=[800,1800],Fi=e=>{document.prerendering?bi(()=>Fi(e)):"complete"!==document.readyState?addEventListener("load",()=>Fi(e),!0):setTimeout(e)};function Ui(e){var t,r=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+r}function ji(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(Ui(e)),navigationStart:Math.floor(performance.timeOrigin)}}var Bi,zi=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={})=>{bi(()=>{const r=yi();let n,i=li("LCP");const o=ci(t,_i),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-ai(),0),i.entries=[t],n())},a=di("largest-contentful-paint",s);if(a){n=ii(e,i,Di,t.reportAllChanges);const r=pi(()=>{s(a.takeRecords()),a.disconnect(),n(!0)}),o=e=>{e.isTrusted&&(Ri(r),removeEventListener(e.type,o,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});ni(r=>{i=li("LCP"),n=ii(e,i,Di,t.reportAllChanges),oi(()=>{i.value=performance.now()-r.timeStamp,n(!0)})})}})})(function(e){s["[Amplitude] LCP"]=ji(e)}),Si(function(e){s["[Amplitude] FCP"]=ji(e)}),Ni(function(e){s["[Amplitude] INP"]=ji(e)}),((e,t={})=>{const r=yi();Si(pi(()=>{let n,i=li("CLS",0);const o=ci(t,hi),s=e=>{for(const t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},a=di("layout-shift",s);a&&(n=ii(e,i,Ci,t.reportAllChanges),r.onHidden(()=>{s(a.takeRecords()),n(!0)}),ni(()=>{o.i=0,i=li("CLS",0),n=ii(e,i,Ci,t.reportAllChanges),oi(()=>n())}),setTimeout(n))}))})(function(e){s["[Amplitude] CLS"]=ji(e)}),((e,t={})=>{let r=li("TTFB"),n=ii(e,r,Li,t.reportAllChanges);Fi(()=>{const i=si();i&&(r.value=Math.max(i.responseStart-ai(),0),r.entries=[i],n(!0),ni(()=>{r=li("TTFB",0),n=ii(e,r,Li,t.reportAllChanges),n(!0)}))})})(function(e){s["[Amplitude] TTFB"]=ji(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]})})}}},Vi=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},qi=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(Wi(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=Vi(o||"")!==Vi(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},Wi=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})},Ki=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),qi(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}(),Gi="AMP_CURRENT_PAGE",Zi="AMP_PREVIOUS_PAGE",Ji="AMP_URL_INFO";!function(e){e.Direct="direct",e.Internal="internal",e.External="external"}(Bi||(Bi={}));var Yi=new Set([i.IDENTIFY,i.GROUP_IDENTIFY,i.REVENUE]),Hi=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 Bi.Direct;case t:return Bi.Internal;default:return Bi.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(Ji)]:[3,3];case 1:return e=a.sent(),n=Oe("undefined"!=typeof location&&location.href||""),i=(null==e?void 0:e[Gi])||"",o=void 0,o=n===i?(null==e?void 0:e[Zi])||"":i||document.referrer||"",[4,t.set(Ji,(s={},s[Gi]=n,s[Zi]=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(Ji)]:[3,5];case 1:return(null==(i=l.sent())?void 0:i[Gi])?[3,3]:[4,t.set(Ji,(c={},c[Gi]=n,c[Zi]=document.referrer||"",c))];case 2:l.sent(),l.label=3;case 3:return[4,t.get(Ji)];case 4:if(s=l.sent(),a="",s&&(a=s[Zi]||""),Yi.has(e.event_type))return[2,e];e.event_properties=o(o({},e.event_properties||{}),{"[Amplitude] Page Domain":$i(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":$i(e,"[Amplitude] Page Location",n),"[Amplitude] Page Path":$i(e,"[Amplitude] Page Path","undefined"!=typeof location&&Oe(location.pathname)||""),"[Amplitude] Page Title":$i(e,"[Amplitude] Page Title",Ot(Et)),"[Amplitude] Page URL":$i(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(Ji,{})]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})}};return d};function $i(e,t,r){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?r:e.event_properties[t]}var Xi,Qi=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 Ye(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,3];case 2:l.sent(),l.label=3;case 3:return(d=new Ke(a.apiKey,a.loggerProvider,a.serverZone,{enabled:a.enableDiagnostics,sampleRate:a.diagnosticsSampleRate||this._diagnosticsSampleRate})).setTag("library","".concat(pr,"/").concat(dr)),[4,e.prototype._init.call(this,a)];case 4: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 Ki(p,this.config),[4,this.webAttribution.init()]):[3,6];case 5:l.sent(),l.label=6;case 6:return f=ke(),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,8]:[4,this.add(en()).promise];case 7:l.sent(),l.label=8;case 8:return[4,this.add(new ae({diagnosticsClient:d})).promise];case 9:return l.sent(),[4,this.add(new fr).promise];case 10:return l.sent(),[4,this.add(new we).promise];case 11: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,13];case 12:l.sent(),l.label=13;case 13:return function(e){return Qt(e,"formInteractions")}(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Yr()).promise]):[3,15];case 14:l.sent(),l.label=15;case 15:return tr(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Kr(ur(this.config))).promise]):[3,17];case 16:l.sent(),l.label=17;case 17:return ir(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Un(sr(this.config),{diagnosticsClient:d})).promise]):[3,19];case 18:l.sent(),l.label=19;case 19:return or(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(Kn(ar(this.config))).promise]):[3,21];case 20:l.sent(),l.label=21;case 21:return nr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(ti(lr(this.config))).promise]):[3,23];case 22:l.sent(),l.label=23;case 23: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(zi()).promise]):[3,25];case 24:l.sent(),l.label=25;case 25:return function(e){return Qt(e,"pageUrlEnrichment")}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(Hi()).promise]):[3,27];case 26:l.sent(),l.label=27;case 27:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 28: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),eo=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}),to="[Amplitude]",ro="".concat(to," Session Replay ID"),no=ge.US,io={enabled:!0},oo="".concat(to," Session Replay Debug"),so="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"}(Xi||(Xi={}));var ao=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}(),lo="medium";var uo=function(e,t,r){switch(t){case"light":if("input"!==e)return!0;var n=r?function(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}(r):"";return!!n&&(!!["password","hidden","email","tel"].includes(n)||!!r.autocomplete.startsWith("cc-"));case"medium":case"conservative":return!0;default:return uo(e,lo,r)}},co=function(e,t){return function(r,n){return function(e,t,r){var n,i,o;if(void 0===t&&(t={defaultMaskLevel:lo}),r){if(r.closest("."+so))return!0;var s=(null!==(n=t.maskSelector)&&void 0!==n?n:[]).some(function(e){return r.closest(e)});if(s)return!0;if(r.closest(".amp-unmask"))return!1;var a=(null!==(i=t.unmaskSelector)&&void 0!==i?i:[]).some(function(e){return r.closest(e)});if(a)return!1}return uo(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:lo,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},ho=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")},po=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},fo=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=po(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},go=function(){return a(void 0,void 0,void 0,function(){var e,t,r,n,i,o,s;return l(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(e=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:""}]}})})},mo=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},vo=function(){return{flushMaxRetries:2,logLevel:G.Warn,loggerProvider:new J,transportProvider:new Ze}},yo=function(e){function t(t,r){var n,i,s,a,l,u=this,c=vo();return(u=e.call(this,o(o({transportProvider:c.transportProvider,loggerProvider:new ao(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||no,u.configServerUrl=r.configServerUrl,u.trackServerUrl=r.trackServerUrl,u.shouldInlineStylesheet=r.shouldInlineStylesheet,u.version=r.version,u.performanceConfig=r.performanceConfig||io,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),bo=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(bo||{}),wo=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(wo||{}),So=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=this;return l(this,function(l){switch(l.label){case 0:return(n=o({},this.localConfig)).optOut=this.localConfig.optOut,n.captureEnabled=!0,[4,new Promise(function(e){I.remoteConfigClient.subscribe("configs.sessionReplay","all",function(t,r){var o;if(I.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(r,":"),JSON.stringify(t,null,2)),t){var s=t,a=s.sr_sampling_config,l=s.sr_privacy_config,u=s.sr_targeting_config,c=null===(o=n.interactionConfig)||void 0===o?void 0:o.ugcFilterRules;n.interactionConfig=s.sr_interaction_config,n.interactionConfig&&c&&(n.interactionConfig.ugcFilterRules=c),n.loggingConfig=s.sr_logging_config,(a||l||u)&&(i={},a&&(i.sr_sampling_config=a),l&&(i.sr_privacy_config=l),u&&(i.sr_targeting_config=u))}e()})})];case 1:if(l.sent(),!i)return[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:i}];if(s=i.sr_sampling_config,a=i.sr_privacy_config,h=i.sr_targeting_config,s&&Object.keys(s).length>0?(Object.prototype.hasOwnProperty.call(s,"capture_enabled")?n.captureEnabled=s.capture_enabled:n.captureEnabled=!1,Object.prototype.hasOwnProperty.call(s,"sample_rate")&&(n.sampleRate=s.sample_rate)):(n.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),a){d=null!==(e=n.privacyConfig)&&void 0!==e?e:{},p={defaultMaskLevel:null!==(r=null!==(t=a.defaultMaskLevel)&&void 0!==t?t:d.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},f=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},g=o(o({},f(d)),f(a));try{for(m=u(Object.entries(g)),v=m.next();!v.done;v=m.next())y=c(v.value,2),b=y[0],"mask"===(w=y[1])?p.maskSelector.push(b):"block"===w?p.blockSelector.push(b):"unmask"===w&&p.unmaskSelector.push(b)}catch(e){S={error:e}}finally{try{v&&!v.done&&(C=m.return)&&C.call(m)}finally{if(S)throw S.error}}n.privacyConfig=(k=p,x=this.localConfig.loggerProvider,E=document.createDocumentFragment(),O=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter(function(e){try{E.querySelector(e)}catch(t){return x.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0}),0!==e.length)return e},k.blockSelector=O(k.blockSelector),k.maskSelector=O(k.maskSelector),k.unmaskSelector=O(k.unmaskSelector),k)}return h&&Object.keys(h).length>0&&(n.targetingConfig=h),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:mo(n)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:i}]}var k,x,E,O})})},e}(),Co=function(e,t){return a(void 0,void 0,void 0,function(){var r,n;return l(this,function(i){return r=new yo(e,t),n=new Ye(e,r.loggerProvider,r.serverZone,t.configServerUrl),[2,new So(n,r)]})})},Io=Uint8Array,ko=Uint16Array,xo=Uint32Array,Eo=new Io([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]),Oo=new Io([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]),Ao=new Io([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Po=function(e,t){for(var r=new ko(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new xo(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]},To=Po(Eo,2),Ro=To[0],Mo=To[1];Ro[28]=258,Mo[258]=28;for(var No=Po(Oo,0)[1],_o=new ko(32768),Do=0;Do<32768;++Do){var Lo=(43690&Do)>>>1|(21845&Do)<<1;Lo=(61680&(Lo=(52428&Lo)>>>2|(13107&Lo)<<2))>>>4|(3855&Lo)<<4,_o[Do]=((65280&Lo)>>>8|(255&Lo)<<8)>>>1}var Fo=function(e,t,r){for(var n=e.length,i=0,o=new ko(t);i<n;++i)++o[e[i]-1];var s,a=new ko(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new ko(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[_o[h]>>>l]=u}else for(s=new ko(n),i=0;i<n;++i)s[i]=_o[a[e[i]-1]++]>>>15-e[i];return s},Uo=new Io(288);for(Do=0;Do<144;++Do)Uo[Do]=8;for(Do=144;Do<256;++Do)Uo[Do]=9;for(Do=256;Do<280;++Do)Uo[Do]=7;for(Do=280;Do<288;++Do)Uo[Do]=8;var jo=new Io(32);for(Do=0;Do<32;++Do)jo[Do]=5;var Bo=Fo(Uo,9,0),zo=Fo(jo,5,0),Vo=function(e){return(e/8|0)+(7&e&&1)},qo=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof ko?ko:e instanceof xo?xo:Io)(r-t);return n.set(e.subarray(t,r)),n},Wo=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},Ko=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},Go=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 Io(0),0];if(1==i){var s=new Io(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 ko(d+1),f=Zo(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 Io(p),f]},Zo=function(e,t,r){return-1==e.s?Math.max(Zo(e.l,t,r+1),Zo(e.r,t,r+1)):t[e.s]=r},Jo=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ko(++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]},Yo=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},Ho=function(e,t,r){var n=r.length,i=Vo(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)},$o=function(e,t,r,n,i,o,s,a,l,u,c){Wo(t,c++,r),++i[256];for(var h=Go(i,15),d=h[0],p=h[1],f=Go(o,15),g=f[0],m=f[1],v=Jo(d),y=v[0],b=v[1],w=Jo(g),S=w[0],C=w[1],I=new ko(19),k=0;k<y.length;++k)I[31&y[k]]++;for(k=0;k<S.length;++k)I[31&S[k]]++;for(var x=Go(I,7),E=x[0],O=x[1],A=19;A>4&&!E[Ao[A-1]];--A);var P,T,R,M,N=u+5<<3,_=Yo(i,Uo)+Yo(o,jo)+s,D=Yo(i,d)+Yo(o,g)+s+14+3*A+Yo(I,E)+(2*I[16]+3*I[17]+7*I[18]);if(N<=_&&N<=D)return Ho(t,c,e.subarray(l,l+u));if(Wo(t,c,1+(D<_)),c+=2,D<_){P=Fo(d,p,0),T=d,R=Fo(g,m,0),M=g;var L=Fo(E,O,0);Wo(t,c,b-257),Wo(t,c+5,C-1),Wo(t,c+10,A-4),c+=14;for(k=0;k<A;++k)Wo(t,c+3*k,E[Ao[k]]);c+=3*A;for(var F=[y,S],U=0;U<2;++U){var j=F[U];for(k=0;k<j.length;++k){var B=31&j[k];Wo(t,c,L[B]),c+=E[B],B>15&&(Wo(t,c,j[k]>>>5&127),c+=j[k]>>>12)}}}else P=Bo,T=Uo,R=zo,M=jo;for(k=0;k<a;++k)if(n[k]>255){B=n[k]>>>18&31;Ko(t,c,P[B+257]),c+=T[B+257],B>7&&(Wo(t,c,n[k]>>>23&31),c+=Eo[B]);var z=31&n[k];Ko(t,c,R[z]),c+=M[z],z>3&&(Ko(t,c,n[k]>>>5&8191),c+=Oo[z])}else Ko(t,c,P[n[k]]),c+=T[n[k]];return Ko(t,c,P[256]),c+T[256]},Xo=new xo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Qo=function(e,t,r,n,i){return function(e,t,r,n,i,o){var s=e.length,a=new Io(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=Ho(l,u,e.subarray(c,h)):(l[c]=o,u=Ho(l,u,e.subarray(c,s)))}else{for(var d=Xo[t-1],p=d>>>13,f=8191&d,g=(1<<r)-1,m=new ko(32768),v=new ko(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 xo(25e3),C=new ko(288),I=new ko(32),k=0,x=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((k>7e3||E>24576)&&M>423){u=$o(e,l,0,S,C,I,x,E,A,c-A,u),E=k=x=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|Mo[_]<<18|No[D];var G=31&Mo[_],Z=31&No[D];x+=Eo[G]+Oo[Z],++C[257+G],++I[Z],O=c+_,++k}else S[E++]=e[c],++C[e[c]]}}u=$o(e,l,o,S,C,I,x,E,A,c-A,u)}return qo(a,0,n+Vo(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 es(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=Qo(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 ts=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}(es(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Io(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 Io(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 qo(n,0,i)}(JSON.stringify(t))),!0)};var rs=function(){function e(e,t,r,n){var i,o=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=ts(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}(),ns="Failed to store session replay events in IndexedDB",is="1.29.5-zen-plus-zoning.1",os=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=is,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(ho(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 ss=(e,t)=>t.some(t=>e instanceof t);let as,ls;const us=new WeakMap,cs=new WeakMap,hs=new WeakMap;let ds={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return us.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return ms(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function ps(e){ds=e(ds)}function fs(e){return(ls||(ls=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(vs(this),t),ms(this.request)}:function(...t){return ms(e.apply(vs(this),t))}}function gs(e){return"function"==typeof e?fs(e):(e instanceof IDBTransaction&&function(e){if(us.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)});us.set(e,t)}(e),ss(e,as||(as=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,ds):e)}function ms(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(ms(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",o)});return hs.set(t,e),t}(e);if(cs.has(e))return cs.get(e);const t=gs(e);return t!==e&&(cs.set(e,t),hs.set(t,e)),t}const vs=e=>hs.get(e);function ys(e,t,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=ms(s);return n&&s.addEventListener("upgradeneeded",e=>{n(ms(s.result),e.oldVersion,e.newVersion,ms(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 bs=["get","getKey","getAll","getAllKeys","count"],ws=["put","add","delete","clear"],Ss=new Map;function Cs(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Ss.get(t))return Ss.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,i=ws.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!bs.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 Ss.set(t,o),o}ps(e=>({...e,get:(t,r,n)=>Cs(t,r)||e.get(t,r,n),has:(t,r)=>!!Cs(t,r)||e.has(t,r)}));const Is=["continue","continuePrimaryKey","advance"],ks={},xs=new WeakMap,Es=new WeakMap,Os={get(e,t){if(!Is.includes(t))return e[t];let r=ks[t];return r||(r=ks[t]=function(...e){xs.set(this,Es.get(this)[t](...e))}),r}};async function*As(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,Os);for(Es.set(r,t),hs.set(r,vs(t));t;)yield r,t=await(xs.get(r)||t.continue()),xs.delete(r)}function Ps(e,t){return t===Symbol.asyncIterator&&ss(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&ss(e,[IDBIndex,IDBObjectStore])}ps(e=>({...e,get:(t,r,n)=>Ps(t,r)?As:e.get(t,r,n),has:(t,r)=>Ps(t,r)||e.has(t,r)}));var Ts,Rs=function(){function e(e){var t,r,n,i=this;this.minInterval=500,this.maxInterval=1e4,this.maxPersistedEventsSize=1e6,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var r=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"}(Ts||(Ts={}));var Ms,Ns,_s,Ds="sessionCurrentSequence",Ls="sequencesToSend",Fs=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)}})},Us=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]}})})},js=function(e){var t,r;return e.objectStoreNames.contains(Ds)||(r=e.createObjectStore(Ds,{keyPath:"sessionId"})),e.objectStoreNames.contains(Ls)||(t=e.createObjectStore(Ls,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},Bs=function(e){return a(void 0,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return[4,ys(e,1,{upgrade:js})];case 1:return[2,t.sent()]}})})},zs=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(ns,": ").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(Ds,e)];case 1:return(t=i.sent())?[4,this.db.put(Ls,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=i.sent(),[4,this.db.put(Ds,{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(ns,": ").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(Ds,"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(ns,": ").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(Ls,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(ns,": ").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(Ls,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(ns,": ").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,Fs()];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!==Ts.SENT&&n.push(i.storeSendingEvents(e,u.events))}),[4,Us(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!==Ts.SENT&&s.push(a.storeSendingEvents(n,l[t].events))})}}),[4,Us(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,Bs(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(ns,": ").concat(c)),[3,4];case 4:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return a(this,void 0,void 0,function(){var t,r,n,i,o,s,a;return l(this,function(l){switch(l.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(i=l.sent())?[2,[i]]:[2,void 0];case 2:t=[],l.label=3;case 3:return l.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=u.apply(void 0,[l.sent()]),n=r.next(),l.label=5;case 5:if(n.done)return[3,7];i=n.value,t.push(i),l.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return o=l.sent(),s={error:o},[3,10];case 9:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}return[7];case 10:return[2,t]}})})},t}(Rs),Vs=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t}return r(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=h([],c(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},t.prototype.getSequencesToSend=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return[2,Object.entries(this.finalizedSequences).map(function(e){var t=c(e,2),r=t[0],n=t[1],i=n.sessionId,o=n.events;return{sequenceId:Number(r),sessionId:i,events:o}})]})})},t.prototype.storeCurrentSequence=function(e){return a(this,void 0,void 0,function(){return l(this,function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return a(this,void 0,void 0,function(){var r;return l(this,function(n){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(r=this.addSequence(e)),this.sequences[e].push(t),[2,r]})})},t.prototype.storeSendingEvents=function(e,t){return a(this,void 0,void 0,function(){return l(this,function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return a(this,void 0,void 0,function(){return l(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(Rs),qs=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 os(o(o({},t),{loggerProvider:t.loggerProvider,payloadBatcher:u})),d=function(){return new Vs({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,zs.new(s,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:i,apiKey:t.apiKey},r)];case 1:return e=o.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,null!=e?e:d()]}})})},"idb"!==c?[3,2]:[4,p()];case 1:return g=w.sent(),[3,3];case 2:g=d(),w.label=3;case 3:return f=g,m=function(e){var r=e.events,n=e.sessionId,i=e.deviceId,o=e.sequenceId;t.debugMode&&go().then(function(e){var r=e.totalStorageSize,n=e.percentOfQuota,i=e.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(r," KB, percentage of quota: ").concat(n,"%, usage details: ").concat(i))}).catch(function(){}),h.sendEventsList({events:r,sessionId:n,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:i,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:s,onComplete:function(){return a(void 0,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,f.cleanUpSessionEventsStore(n,o)];case 1:return e.sent(),[2]}})})}})},v=function(e){var r=e.sessionId,n=e.deviceId;f.storeCurrentSequence(r).then(function(e){e&&m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})}).catch(function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)})},y=function(e){var t=e.deviceId;return a(void 0,void 0,void 0,function(){var e;return l(this,function(r){switch(r.label){case 0:return[4,f.getSequencesToSend()];case 1:return(e=r.sent())&&e.forEach(function(e){m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]}})})},b=function(e){var r=e.event,n=e.sessionId,i=e.deviceId;f.addEventToCurrentSequence(n,r.data).then(function(e){return e&&m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:i})}).catch(function(e){t.loggerProvider.warn("Failed to add event to session replay capture:",e)})},[2,{sendCurrentSequenceEvents:v,addEvent:b,sendStoredEvents:y,flush:e}]}})})},Ws=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 Ks(e,t){if(_s=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};Ms=o(o({},r),t),Ns=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Ms.root,r);var n=Gs(e,"all",function(){return Gs(e,"two",function(){return Gs(e,"one",function(){return Gs(e,"none")})})});if(n){var i=ra(na(n,e));return i.length>0&&(n=i[0]),Js(n)}throw new Error("Selector was not found.")}function Gs(e,t,r){for(var n=null,i=[],o=e,s=0,a=function(){var e,a,l=(new Date).getTime()-_s.getTime();if(void 0!==Ms.timeoutMs&&l>Ms.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var d=Qs(function(e){var t=e.getAttribute("id");if(t&&Ms.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||Qs.apply(void 0,h([],c(function(e){var t=Array.from(e.attributes).filter(function(e){return Ms.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))||Qs.apply(void 0,h([],c(function(e){var t=Array.from(e.classList).filter(Ms.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(o)),!1))||Qs(function(e){var t=e.tagName.toLowerCase();if(Ms.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(Xs).map(function(e){return $s(e,p)})));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(Xs).map(function(e){return $s(e,p)})));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&Xs(f)&&(d=[$s(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[$s(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>=Ms.seedMinLength&&(n=Zs(i,r)))return"break";o=o.parentElement,s++};o;){if("break"===a())break}return n||(n=Zs(i,r)),!n&&r?r():n}function Zs(e,t){var r,n,i=ra(ta(e));if(i.length>Ms.threshold)return t?t():null;try{for(var o=u(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(Hs(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 Js(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 Ys(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function Hs(e){var t=Js(e);switch(Ns.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 $s(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Xs(e){return"html"!==e.name&&!e.name.startsWith("#")}function Qs(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(ea);return r.length>0?r:null}function ea(e){return null!=e}function ta(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(ta(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 ra(e){return h([],c(e),!1).sort(function(e,t){return Ys(e)-Ys(t)})}function na(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>Ms.optimizedMinLength))return[3,5];n=1,s.label=1;case 1:return n<e.length-1?r.counter>Ms.maxNumberOfTries?[2]:(r.counter+=1,(i=h([],c(e),!1)).splice(n,1),o=Js(i),r.visited.has(o)?[2]:Hs(i)&&function(e,t){return Ns.querySelector(Js(e))===t}(i,t)?[4,i]:[3,4]):[3,5];case 2:return s.sent(),r.visited.set(o,!0),[5,u(na(i,t,r))];case 3:s.sent(),s.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var ia=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}},oa=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)}},sa=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===wo.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=Ks(f)}catch(e){r.logger.debug("error resolving selector from finder")}var g=fo(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 aa(){var e=U();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function la(){var e=U();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}var ua=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=ho(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}(),ca=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:aa(),viewportWidth:la(),pageUrl:fo(s.location.href,null!==(i=null===(n=r.config.interactionConfig)||void 0===n?void 0:n.ugcFilterRules)&&void 0!==i?i:[]),timestamp:r.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=la(),this._maxScrollHeight=aa(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new ua(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=la();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=aa();this._maxScrollY=e.y;var o=e.y+i;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),ha=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))},da=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,ys(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]}})})}},pa=new da,fa=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,pa.clearStoreOfOldSessions({loggerProvider:n,apiKey:i,currentSessionId:t})];case 1:return l.sent(),[4,pa.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 uh})];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),pa.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 ga(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?fo(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}}ga();var ma,va,ya,ba=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,fa({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!==Xi.METADATA?(e={config:mo(i),version:is},n?[4,go()]:[3,2]):[3,2];case 1:s=l.sent(),e=o(o({},s),e),l.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(t,o(o({},r),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(t," due to no ongoing recording.")),[3,4];case 3:return a=l.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",a),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var t;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null===(t=e.networkObservers)||void 0===t||t.stop()}catch(t){var r=t;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(r.toString()))}},this.loggerProvider=new ao(new J)}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,k,x,E,O,A;return l(this,function(l){switch(l.label){case 0:return this.loggerProvider=new ao(t.loggerProvider||new J),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new ha({sessionId:t.sessionId,deviceId:t.deviceId}),a=this,[4,Co(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,is,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=ca.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 sa(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,qs({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(),x=S,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(x.toString())),[3,6];case 6:if(!(null===(s=this.config.interactionConfig)||void 0===s?void 0:s.enabled))return[3,10];C=this.config.interactionConfig.batch?oa:ia,l.label=7;case 7:return l.trys.push([7,9,,10]),[4,qs({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 k=l.sent(),x=k,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(x.toString())),[3,10];case 10:return this.eventsManager=new(Ws.bind.apply(Ws,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 ch})]:[3,12];case 11:A=l.sent().compressionScript,E=A,l.label=12;case 12:return this.eventCompressor=new rs(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 ha({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={})[ro]=r.sessionReplayId?r.sessionReplayId:null,i=e,t.debugMode&&(i[oo]=JSON.stringify({appHash:Ae(t.apiKey).toString()}))),this.addCustomRRWebEvent(Xi.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(Xi.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=ga({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 Gb})];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 sT})];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(Xi.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===bo.Meta&&(e.data.href=fo(e.data.href,m)),S.eventCompressor&&S.eventCompressor.enqueueEvent(e,c)},inlineStylesheet:a.shouldInlineStylesheet,hooks:g,maskAllInputs:!0,maskTextClass:so,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:a.applyBackgroundColorToBlockedElements,maskInputFn:co("input",d),maskTextFn:co("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(Xi.DEBUG_INFO),e&&this.addCustomRRWebEvent(Xi.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 lT})];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}(),wa=function(e){return function(){var t=e.config||vo();return{logger:t.loggerProvider,logLevel:t.logLevel}}},Sa=function(){var e=new ba;return{init:oe(e.init.bind(e),"init",wa(e)),evaluateTargetingAndCapture:oe(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",wa(e)),setSessionId:oe(e.setSessionId.bind(e),"setSessionId",wa(e)),getSessionId:oe(e.getSessionId.bind(e),"getSessionId",wa(e)),getSessionReplayProperties:oe(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",wa(e)),flush:oe(e.flush.bind(e),"flush",wa(e)),shutdown:oe(e.shutdown.bind(e),"shutdown",wa(e))}}(),Ca=Sa.init,Ia=Sa.setSessionId,ka=Sa.getSessionId,xa=Sa.getSessionReplayProperties,Ea=Sa.flush,Oa=Sa.shutdown,Aa=Sa.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"}(ma||(ma={})),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"}(va||(va={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(ya||(ya={}));var Pa=[ma.SET,ma.SET_ONCE,ma.ADD,ma.APPEND,ma.PREPEND,ma.POSTINSERT],Ta="1.23.3-zen-plus-zoning.1",Ra=function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.sessionReplay={flush:Ea,getSessionId:ka,getSessionReplayProperties:xa,init:Ca,setSessionId:Ia,shutdown:Oa,evaluateTargetingAndCapture:Aa},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(Ta,".")),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:Ta},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){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(Pa.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}(),Ma=function(e,t){return Ma=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])},Ma(e,t)};function Na(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}Ma(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var _a=function(){return _a=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},_a.apply(this,arguments)};function Da(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 La(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 Fa(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 Ua(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 ja(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 Ba="is",za="is not",Va="contains",qa="does not contain",Wa="less",Ka="less or equal",Ga="greater",Za="greater or equal",Ja="version less",Ya="version less or equal",Ha="version greater",$a="version greater or equal",Xa="set is",Qa="set is not",el="set contains",tl="set does not contain",rl="set contains any",nl="set does not contain any",il="regex match",ol="regex does not match",sl=-862048943,al=461845907,ll=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=dl(r,s<<2);o=ul(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,sl),u=hl(u,15),o^=u=Math.imul(u,al);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,sl),u=hl(u,15),o^=u=Math.imul(u,al);break;case 1:u^=r[l],u=Math.imul(u,sl),u=hl(u,15),o^=u=Math.imul(u,al)}return cl(o^=n)>>>0},ul=function(e,t){var r=e,n=t;return r=Math.imul(r,sl),r=hl(r,15),r=Math.imul(r,al),n=hl(n^=r,13),(n=Math.imul(n,5))+-430675100|0},cl=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},hl=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},dl=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 pl(r)},pl=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},fl=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=Fa(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}},gl="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),ml=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(gl).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}(),vl=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=Fa(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=Fa(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=_a(_a(_a({},t.metadata),a.metadata),i.metadata);i=_a(_a({},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=Fa(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=!0;try{for(var c=(i=void 0,Fa(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=fl(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 ll(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(fl(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=Fa(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,Fa(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 Ba:case Va:case Wa:case Ka:case Ga:case Za:case Ja:case Ya:case Ha:case $a:case Xa:case el:case rl:return r;case za:case qa:case tl:case nl:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Xa:return this.setEquals(e,r);case Qa:return!this.setEquals(e,r);case el:return this.matchesSetContainsAll(e,r);case tl:return!this.matchesSetContainsAll(e,r);case rl:return this.matchesSetContainsAny(e,r);case nl:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Ba:return this.matchesIs(e,r);case za:return!this.matchesIs(e,r);case Va:return this.matchesContains(e,r);case qa:return!this.matchesContains(e,r);case Wa:case Ka:case Ga:case Za:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case Ja:case Ya:case Ha:case $a:return this.matchesComparable(e,t,r,function(e){return ml.parse(e)},this.versionComparator);case il:return this.matchesRegex(e,r);case ol: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=Fa(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 Wa:case Ja:return e<r;case Ka:case Ya:return e<=r;case Ga:case Ha:return e>r;case Za:case $a:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Wa:case Ja:return n<0;case Ka:case Ya:return n<=0;case Ga:case Ha:return n>0;case Za:case $a: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 Xa:case Qa:case el:case tl:case rl:case nl: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&&ja([],Ua(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=Fa(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=Fa(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}(),yl=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=yl(e,t,r);n&&s.push.apply(s,ja([],Ua(n),!1))};try{for(var l=Fa(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 bl="function"==typeof Buffer,wl=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),Sl=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Cl=(e=>{let t={};return e.forEach((e,r)=>t[e]=r),t})(Sl),Il=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,kl=String.fromCharCode.bind(String),xl=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_")),El=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Ol=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+=Sl[t>>18&63]+Sl[t>>12&63]+Sl[t>>6&63]+Sl[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},Al="function"==typeof btoa?e=>btoa(e):bl?e=>Buffer.from(e,"binary").toString("base64"):Ol,Pl=bl?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(kl.apply(null,e.subarray(r,r+4096)));return Al(t.join(""))},Tl=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?kl(192|t>>>6)+kl(128|63&t):kl(224|t>>>12&15)+kl(128|t>>>6&63)+kl(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return kl(240|t>>>18&7)+kl(128|t>>>12&63)+kl(128|t>>>6&63)+kl(128|63&t)},Rl=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Ml=e=>e.replace(Rl,Tl),Nl=bl?e=>Buffer.from(e,"utf8").toString("base64"):wl?e=>Pl(wl.encode(e)):e=>Al(Ml(e)),_l=(e,t=!1)=>t?xl(Nl(e)):Nl(e),Dl=e=>_l(e,!0),Ll=e=>{if(e=e.replace(/\s+/g,""),!Il.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=Cl[e.charAt(o++)]<<18|Cl[e.charAt(o++)]<<12|(r=Cl[e.charAt(o++)])<<6|(n=Cl[e.charAt(o++)]),i+=64===r?kl(t>>16&255):64===n?kl(t>>16&255,t>>8&255):kl(t>>16&255,t>>8&255,255&t);return i},Fl=Dl;var Ul=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return Na(t,e),t}(Error),jl=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return Na(t,e),t}(Error),Bl=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return Da(this,void 0,void 0,function(){var r,n,i,o;return La(this,function(s){switch(s.label){case 0:return r=Fl(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"]=Fl(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 Ul(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}})})},e}(),zl=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return Da(this,void 0,void 0,function(){var t,r;return La(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"]=Fl(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}(),Vl="undefined"!=typeof globalThis?globalThis:global||self,ql=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},Wl=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=Vl.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(Vl.clearInterval(this.poller),this.poller=void 0)},e}(),Kl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Gl={},Zl={get exports(){return Gl},set exports(e){Gl=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",k="Browser",x="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"+k]],[/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 "+k],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 "+k]],[/fxios\/([-\w\.]+)/i],[d,[u,E]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+k]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+k],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,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,x+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[u,"Android "+k]],[/(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,x+"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,x+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],d],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,d],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,d]]},Z=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof Z))return new Z(e,t).getResult();var i=e||(typeof r!==o&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),f=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(G,t):G;return this.getBrowser=function(){var e={};return e[u]=n,e[d]=n,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};Z.VERSION="0.7.33",Z.BROWSER=j([u,d,"major"]),Z.CPU=j([p]),Z.DEVICE=j([l,h,c,f,g,v,m,y,b]),Z.ENGINE=Z.OS=j([u,d]),e.exports&&(t=e.exports=Z),t.UAParser=Z;var J=typeof r!==o&&(r.jQuery||r.Zepto);if(J&&!J.ua){var Y=new Z;J.ua=Y.getResult(),J.ua.get=function(){return Y.getUA()},J.ua.set=function(e){Y.setUA(e);var t=Y.getResult();for(var r in t)J.ua[r]=t[r]}}}("object"==typeof window?window:Kl)}(Zl,Gl);var Jl=function(){return Jl=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Jl.apply(this,arguments)};function Yl(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})}function Hl(e,t){var r,n,i,o={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 $l(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 Xl(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 Ql(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 eu=function(e,t){var r,n;void 0===t&&(t=!1);var i=tu(e,t),o=void 0,s=Vl.document.cookie.split("; ");try{for(var a=$l(s),l=a.next();!l.done;l=a.next()){var u=Xl(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}},tu=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))},ru=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 Yl(this,void 0,void 0,function(){return Hl(this,function(r){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener(function(){null==t||t.fetch()}),[2,this.waitForConnectorIdentity(this.timeoutMillis)]})})},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=eu(this.apiKey,!0);return(e||(e=eu(this.apiKey,!1))||(e=function(e){var t=tu(e,!0);try{var r=Vl.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=tu(e,!0);try{var r=Vl.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 Yl(this,void 0,void 0,function(){var t,r=this;return Hl(this,function(n){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise(function(e){var t=function(){e(),r.identityStore.removeIdentityListener(t)};r.identityStore.addIdentityListener(t)}),new Promise(function(t,r){Vl.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])]})})},e}();var nu,iu,ou,su=Vl.fetch||function(e,t){return t=t||{},new Promise(function(r,n){var i=new XMLHttpRequest,o=[],s=[],a={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return s},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,r){o.push(t=t.toLowerCase()),s.push([t,r]),a[t]=a[t]?a[t]+","+r:r}),r(l())},i.onerror=n,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)})},au=function(){function e(e){this.client=e}return e.prototype.request=function(e){return Yl(this,void 0,void 0,function(){return Hl(this,function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}})})},e}(),lu={request:function(e,t,r,n,i){return function(e,t){return null==t||t<=0?e:new Promise(function(r,n){Vl.setTimeout(function(){n(new jl("Request timeout after "+t+" milliseconds"))},t),e.then(r,n)})}(Yl(void 0,void 0,void 0,function(){var i,o;return Hl(this,function(s){switch(s.label){case 0:return[4,su(e,{method:t,headers:r,body:n})];case 1:return i=s.sent(),o={status:i.status},[4,i.text()];case 2:return o.body=s.sent(),[2,o]}})}),i)}};!function(e){e[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"}(nu||(nu={})),function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(iu||(iu={})),function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"}(ou||(ou={}));var uu=function(e){return!e||e===ou.FallbackInline||e===ou.FallbackConfig||e===ou.SecondaryInitialVariants},cu={debug:!1,logLevel:nu.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:iu.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:lu},hu="1.19.0",du=function(){function e(e,t){var r,n=this;this.isReady=new Promise(function(e){n.resolve=e}),this.config=e,this.client=t;var i=null!==(r=e.instanceName)&&void 0!==r?r:cu.instanceName;this.queue=new fu(i),this.cache=new pu(i)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()},function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e){if(this.cache.shouldTrack(e)){var t=this.getExposureEvent(e);this.queue.push(t)}},e.prototype.getExposureEvent=function(e){var t,r,n,i={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?i={eventType:null===(r=e.metadata)||void 0===r?void 0:r.exposureEvent,eventProperties:e}:"web"===(null===(n=e.metadata)||void 0===n?void 0:n.deliveryMethod)&&(i={eventType:"$impression",eventProperties:e}),i},e}(),pu=function(){function e(e){this.isSessionStorageAvailable=gu(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&Vl.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=Vl.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&Vl.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),fu=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=function(){var e=ql();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=Vl.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=$l(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&&(Vl.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=Vl.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)),Vl.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),gu=function(){var e=ql();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},mu=function(){function e(e,t){void 0===t&&(t=nu.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>=nu.Error&&(t=this.logger).error.apply(t,Ql([e],Xl(r),!1))},e.prototype.warn=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=nu.Warn&&(t=this.logger).warn.apply(t,Ql([e],Xl(r),!1))},e.prototype.info=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=nu.Info&&(t=this.logger).info.apply(t,Ql([e],Xl(r),!1))},e.prototype.debug=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=nu.Debug&&(t=this.logger).debug.apply(t,Ql([e],Xl(r),!1))},e.prototype.verbose=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=nu.Verbose&&(t=this.logger).verbose.apply(t,Ql([e],Xl(r),!1))},e}(),vu=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,Ql([e],Xl(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,Ql([e],Xl(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,Ql([e],Xl(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,Ql([e],Xl(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,Ql([e],Xl(t),!1))},e}(),yu=function(){function e(){this.globalScope=ql()}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}(),bu=function(){function e(e,t,r){this.cache={},this.namespace=e,this.storage=t,this.transformer=r}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return Jl({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=$l(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=$l(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}(),wu=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}},Su=function(){function e(){this.globalScope=ql()}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}(),Cu=function(e){return null==e},Iu=function(e){return!!Cu(e)||e&&0===Object.keys(e).length},ku=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},xu=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 Yl(this,void 0,void 0,function(){return Hl(this,function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}})})},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,r){return Yl(this,void 0,void 0,function(){var n=this;return Hl(this,function(i){return this.done||(this.timeoutHandle=Vl.setTimeout(function(){return Yl(n,void 0,void 0,function(){var n,i;return Hl(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(n=t+1)<this.attempts&&(i=Math.min(r*this.scalar,this.max),this.backoff(e,n,i)),[3,3];case 3:return[2]}})})},r)),[2]})})},e}(),Eu=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},Ou=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},Au=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}(),Pu=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}(),Tu=function(){function e(t,r){var n,i,o,s,a=this;this.engine=new vl,this.isRunning=!1,this.apiKey=t,r=function(e){var t,r;if(!e||"object"!=typeof e)return{};var n={};try{for(var i=$l(Object.entries(e)),o=i.next();!o.done;o=i.next()){var s=Xl(o.value,2),a=s[0],l=s[1];Cu(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=Jl(Jl(Jl({},cu),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":cu.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":cu.flagsServerUrl),flagConfigPollingIntervalMillis:r.flagConfigPollingIntervalMillis<6e4?6e4:null!==(o=r.flagConfigPollingIntervalMillis)&&void 0!==o?o:cu.flagConfigPollingIntervalMillis}),this.logger=new mu(this.config.loggerProvider||new vu,e.getLogLevel(r));var l=null===(s=this.config)||void 0===s?void 0:s.internalInstanceNameSuffix;if(this.isWebExperiment="web"===l,this.poller=new Wl(function(){return a.doFlags()},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var u in this.config.initialVariants)this.config.initialVariants[u]=wu(this.config.initialVariants[u]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new Au(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new Pu(this.config.exposureTrackingProvider)),this.integrationManager=new du(this.config,this);var c,h=new au(this.config.httpClient||lu);this.flagApi=new zl(this.apiKey,this.config.flagsServerUrl,h),this.evaluationApi=new Bl(this.apiKey,this.config.serverUrl,h);var d=l?"".concat(this.config.instanceName,"-").concat(l):this.config.instanceName;c=this.isWebExperiment?new Su:new yu,this.variants=function(e,t,r){var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n);return new bu(i,r,wu)}(this.apiKey,d,c),this.flags=function(e,t,r){void 0===r&&(r=new yu);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-flags");return new bu(i,r)}(this.apiKey,d,c);try{this.flags.load(),this.variants.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return Yl(this,void 0,void 0,function(){var t,r,n;return Hl(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 Yl(this,arguments,void 0,function(e,t){var r;return void 0===e&&(e=this.user),Hl(this,function(n){switch(n.label){case 0:this.setUser(e||{}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return n.sent(),[3,4];case 3:if(r=n.sent(),this.config.throwOnError)throw r;return r instanceof jl?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);ku(r)||delete e[t]}return Jl(Jl(Jl({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){var e;if(!this.user)return this.user;if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var t=Jl({},this.user.user_properties);return Jl(Jl({},this.user),{user_properties:t})}return Jl({},this.user)},e.prototype.setUser=function(e){var t;if(e)if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var r=Jl({},e.user_properties);this.user=Jl(Jl({},e),{user_properties:r})}else this.user=Jl({},e);else this.user=null},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach(function(t){e.flags.get(t.key)||e.flags.put(t.key,t)})},e.prototype.evaluate=function(e){var t,r,n=this.addContext(this.user),i=function(e,t){var r,n,i=_a({},e),o=[],s=t||Object.keys(i);try{for(var a=Fa(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=yl(u,i);c&&o.push.apply(o,ja([],Ua(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=ql();s&&(o.page={url:s.location.href});var a={};if(!e.groups)return o;try{for(var l=$l(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=$l(Object.keys(s)),u=l.next();!u.done;u=l.next()){var c=u.value;a[c]=Ou(s[c])}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return a},e.prototype.variantAndSource=function(e,t){var r={};this.config.source===iu.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===iu.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var n=this.flags.get(e);return(ku(n)||!r.variant&&n)&&(r=this.localEvaluationVariantAndSource(e,n,t)),r},e.prototype.localEvaluationVariantAndSource=function(e,t,r){var n,i={},o=this.evaluate([t.key])[e],s=ou.LocalEvaluation,a=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!Cu(o)&&!a)return{variant:Eu(o),source:s,hasDefaultVariant:!1};if(a&&(i={variant:Eu(o),source:s,hasDefaultVariant:!0}),!Cu(r))return{variant:Eu(r),source:ou.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!Cu(l))return{variant:Eu(l),source:ou.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=Eu(this.config.fallbackVariant),c={variant:u,source:ou.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return Iu(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(!Cu(i)&&!o)return{variant:Eu(i),source:ou.LocalStorage,hasDefaultVariant:!1};if(o&&(n={variant:Eu(i),source:ou.LocalStorage,hasDefaultVariant:!0}),!Cu(t))return{variant:Eu(t),source:ou.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=this.config.initialVariants[e];if(!Cu(s))return{variant:Eu(s),source:ou.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var a=Eu(this.config.fallbackVariant),l={variant:a,source:ou.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return Iu(a)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!Cu(i))return{variant:Eu(i),source:ou.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),s=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!Cu(o)&&!s)return{variant:Eu(o),source:ou.LocalStorage,hasDefaultVariant:!1};if(s&&(n={variant:Eu(o),source:ou.LocalStorage,hasDefaultVariant:!0}),!Cu(t))return{variant:Eu(t),source:ou.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var a=Eu(this.config.fallbackVariant),l={variant:a,source:ou.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return Iu(a)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return Yl(this,void 0,void 0,function(){var i,o;return Hl(this,function(s){switch(s.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.logger.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),s.label=1;case 1:return s.trys.push([1,4,,5]),[4,this.doFetch(e,t,n)];case 2:return i=s.sent(),[4,this.storeVariants(i,n)];case 3:return s.sent(),[2,i];case 4:throw o=s.sent(),r&&this.shouldRetryFetch(o)&&this.startRetries(e,n),o;case 5:return[2]}})})},e.prototype.cleanUserPropsForFetch=function(e){var t=Jl({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return Yl(this,void 0,void 0,function(){var n,i,o,s,a,l,u;return Hl(this,function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.logger.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,Jl({timeoutMillis:t},r))];case 2:n=c.sent(),i={};try{for(o=$l(Object.keys(n)),s=o.next();!s.done;s=o.next())a=s.value,i[a]=Ou(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 Yl(this,void 0,void 0,function(){var e,t,r;return Hl(this,function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:e=n.sent(),n.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:hu,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=n.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if(!((r=n.sent())instanceof jl))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 Yl(this,void 0,void 0,function(){var r,n,i,o;return Hl(this,function(s){for(o in 0===(r=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),n=function(t){r=r.filter(function(e){return e!==t}),i.variants.put(t,e[t])},i=this,e)n(o);for(o in r)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.logger.debug("[Experiment] Stored variants: ",e),[2]})})},e.prototype.startRetries=function(e,t){return Yl(this,void 0,void 0,function(){var r=this;return Hl(this,function(n){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new xu(8,500,1e4,1.5),this.retriesBackoff.start(function(){return Yl(r,void 0,void 0,function(){return Hl(this,function(r){switch(r.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return r.sent(),[2]}})})}),[2]})})},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,r=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),n=this.integrationManager.getUser(),i=Jl(Jl(Jl({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return Jl(Jl(Jl(Jl({library:"experiment-js-client/".concat(hu)},r),n),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return Yl(this,void 0,void 0,function(){return Hl(this,function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}})})},e.prototype.sourceVariants=function(){return this.config.source==iu.LocalStorage?this.variants.getAll():this.config.source==iu.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==iu.LocalStorage?this.config.initialVariants:this.config.source==iu.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){var r,n,i,o,s,a,l,u,c;if(null===(i=null===(n=null===(r=t.variant)||void 0===r?void 0:r.metadata)||void 0===n?void 0:n.trackExposure)||void 0===i||i){this.legacyExposureInternal(e,t.variant,t.source);var h={flag_key:e},d=uu(t.source);if(!d||t.hasDefaultVariant){(null===(o=t.variant)||void 0===o?void 0:o.expKey)&&(h.experiment_key=null===(s=t.variant)||void 0===s?void 0:s.expKey);var p=null===(a=t.variant)||void 0===a?void 0:a.metadata;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=ql();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);uu(r)||!(null==t?void 0:t.value)?null===(i=null===(n=this.analyticsProvider)||void 0===n?void 0:n.unsetUserProperty)||void 0===i||i.call(n,l):(null==t?void 0:t.value)&&(null===(s=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===s||s.call(o,l),null===(a=this.analyticsProvider)||void 0===a||a.track(l))}},e.getLogLevel=function(e){var t;return!0===e.debug?nu.Debug:null!==(t=e.logLevel)&&void 0!==t?t:nu.Error},e.prototype.shouldRetryFetch=function(e){return!(e instanceof Ul)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),Ru=function(){function e(e,t){var r,n,i;this.globalScope=ql(),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 Gl.UAParser(this.userAgent).getResult(),this.localStorage=new yu,this.sessionStorage=new Su,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(i=this.apiKey)||void 0===i?void 0:i.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,r,n,i,o=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return Jl({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(r=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==r?r:"desktop",referring_url:null===(i=null===(n=this.globalScope)||void 0===n?void 0:n.document)||void 0===i?void 0:i.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,r;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(r=e.browser)||void 0===r?void 0:r.major].filter(function(e){return null!=e}).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,r=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==r?void 0:r.includes("Chrom"))&&(r="Chrome"),(null==r?void 0:r.includes("Firefox"))&&(r="Firefox"),(null==r?void 0:r.includes("Safari"))&&(r="Safari"),(null==r?void 0:r.includes("Edge"))&&(r="Edge"),(null==r?void 0:r.includes("Opera"))&&(r="Opera"),r},e.prototype.getCookie=function(){var e,t,r,n,i;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===n?void 0:n.cookie)||void 0===i?void 0:i.split("; ").map(function(e){return e.split("=")}))},e.prototype.getLandingUrl=function(){var e,t;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){var e,t,r;if(this.globalScope){var n={};try{var i=new URL(this.globalScope.location.href);try{for(var o=$l(i.searchParams),s=o.next();!s.done;s=o.next()){var a=Xl(s.value,2),l=a[0],u=a[1];n[l]=Ql(Ql([],Xl(null!==(r=n[l])&&void 0!==r?r:[]),!1),Xl(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=Xl(t,2),n=r[0],i=r[1];return e[n]=1==i.length?i[0]:i,e},{})}},e}();Vl.experimentInstances={};var Mu=Vl.experimentInstances,Nu=function(e){return(null==e?void 0:e.instanceName)||cu.instanceName},_u=function(e,t,r){var n=function(e,t){var r=Nu(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)}(e,t),i=Mu[n];return i||(i=function(e,t){return new Tu(e,Jl(Jl({},t),{userProvider:new Ru(null==t?void 0:t.userProvider,e)}))}(e,t),r&&i.addPlugin(r()),Mu[n]=i,i)},Du=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 _u(e,t,function(){return new ru(e,ye.getInstance(Nu(t)),1e4)})}((null===(r=this.config)||void 0===r?void 0:r.deploymentKey)||e.apiKey,this.config),[2]})})},e.pluginName="@amplitude/experiment-analytics-plugin",e}(),Lu=function(e){return new Du(e)},Fu=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Uu(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),Uu=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},ju=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}(),Bu=function(){return Bu=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},Bu.apply(this,arguments)};function zu(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 Vu(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 qu=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=zu(["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(!qu(u,c))return!1;var h=!0;return Object.keys(e).forEach(function(r){qu(e[r],t[r])||(h=!1)}),h}for(var d=0;d<e.length;d++)if(!qu(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 Wu=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=Bu({},this.identity.userProperties),r=Bu(Bu({},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=zu(Object.entries(e)),c=u.next();!c.done;c=u.next()){var h=Vu(c.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(i=void 0,zu(Object.entries(p))),g=f.next();!g.done;g=f.next()){var m=Vu(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,zu(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 Bu({},this.identity)},e.prototype.setIdentity=function(e){var t=Bu({},this.identity);this.identity=Bu({},e),qu(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}(),Ku=typeof globalThis<"u"?globalThis:typeof window<"u"?window:self,Gu=function(){function e(){this.identityStore=new Wu,this.eventBridge=new ju,this.applicationContextProvider=new Fu}return e.getInstance=function(t){return Ku.analyticsConnectorInstances||(Ku.analyticsConnectorInstances={}),Ku.analyticsConnectorInstances[t]||(Ku.analyticsConnectorInstances[t]=new e),Ku.analyticsConnectorInstances[t]},e}(),Zu=["boot"];var Ju=(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))(Ju||{});var Yu=((e=>{if(typeof window<"u"&&window.opener)for(let t of Object.values(Ju))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(Zu.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=Gu.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)}}}):Zu.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))),Hu=e=>(typeof window<"u"&&!window.engagement&&(window.engagement=Yu),Yu.plugin(e)),$u=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(Du);return 0===e.length?void this.config.loggerProvider.debug("".concat(Du.pluginName," plugin is not found.")):1===e.length?e[0].experiment:void this.config.loggerProvider.debug("Multiple instances of ".concat(Du.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-zen-plus-zoning.1","-").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 Ra(u))).promise];case 2:return s.sent(),[4,e.prototype.add.call(this,Lu(o(o({},null==r?void 0:r.experiment),n))).promise];case 3:return s.sent(),void 0===(i=this.plugin(Ra.pluginName))?this.config.loggerProvider.debug("".concat(Ra.pluginName," plugin is not found.")):this._sessionReplay=i.sessionReplay,[4,e.prototype.add.call(this,Hu(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}(Qi),Xu=function(){var e=new $u;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"]))}},Qu=Xu(),ec=Qu._setDiagnosticsSampleRate,tc=Qu.initAll,rc=Qu.experiment,nc=Qu.sessionReplay,ic=Qu.add,oc=Qu.extendSession,sc=Qu.flush,ac=Qu.getDeviceId,lc=Qu.getSessionId,uc=Qu.getUserId,cc=Qu.groupIdentify,hc=Qu.identify,dc=Qu.logEvent,pc=Qu.remove,fc=Qu.reset,gc=Qu.revenue,mc=Qu.setDeviceId,vc=Qu.setGroup,yc=Qu.setOptOut,bc=Qu.setSessionId,wc=Qu.setTransport,Sc=Qu.setUserId,Cc=Qu.track,Ic=function(e,t){return Ic=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])},Ic(e,t)};var kc=function(){return kc=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},kc.apply(this,arguments)};function xc(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 Ec="is",Oc="is not",Ac="contains",Pc="does not contain",Tc="less",Rc="less or equal",Mc="greater",Nc="greater or equal",_c="version less",Dc="version less or equal",Lc="version greater",Fc="version greater or equal",Uc="set is",jc="set is not",Bc="set contains",zc="set does not contain",Vc="set contains any",qc="set does not contain any",Wc="regex match",Kc="regex does not match",Gc=-862048943,Zc=461845907,Jc=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=Xc(r,s<<2);o=Yc(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,Gc),u=$c(u,15),o^=u=Math.imul(u,Zc);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,Gc),u=$c(u,15),o^=u=Math.imul(u,Zc);break;case 1:u^=r[l],u=Math.imul(u,Gc),u=$c(u,15),o^=u=Math.imul(u,Zc)}return Hc(o^=n)>>>0},Yc=function(e,t){var r=e,n=t;return r=Math.imul(r,Gc),r=$c(r,15),r=Math.imul(r,Zc),n=$c(n^=r,13),(n=Math.imul(n,5))+-430675100|0},Hc=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},$c=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},Xc=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 Qc(r)},Qc=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},eh=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=xc(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}},th="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),rh=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(th).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}(),nh=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=xc(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=xc(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=kc(kc(kc({},t.metadata),a.metadata),i.metadata);i=kc(kc({},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=xc(r.conditions),l=a.next();!l.done;l=a.next()){var u,c=l.value,h=!0;try{for(var d=(o=void 0,xc(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=eh(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 Jc(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(eh(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=xc(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,xc(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 Ec:case Ac:case Tc:case Rc:case Mc:case Nc:case _c:case Dc:case Lc:case Fc:case Uc:case Bc:case Vc:return r;case Oc:case Pc:case zc:case qc:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Uc:return this.setEquals(e,r);case jc:return!this.setEquals(e,r);case Bc:return this.matchesSetContainsAll(e,r);case zc:return!this.matchesSetContainsAll(e,r);case Vc:return this.matchesSetContainsAny(e,r);case qc:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Ec:return this.matchesIs(e,r);case Oc:return!this.matchesIs(e,r);case Ac:return this.matchesContains(e,r);case Pc:return!this.matchesContains(e,r);case Tc:case Rc:case Mc:case Nc:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case _c:case Dc:case Lc:case Fc:return this.matchesComparable(e,t,r,function(e){return rh.parse(e)},this.versionComparator);case Wc:return this.matchesRegex(e,r);case Kc: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=xc(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 Tc:case _c:return e<r;case Rc:case Dc:return e<=r;case Mc:case Lc:return e>r;case Nc:case Fc:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Tc:case _c:return n<0;case Rc:case Dc:return n<=0;case Mc:case Lc:return n>0;case Nc:case Fc: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 Uc:case jc:case Bc:case zc:case Vc:case qc: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=xc(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=xc(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}Ic(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var ih,oh=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,ys(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]}})})}},sh=new oh,ah=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,sh.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 nh},lh=function(){var e=new ah;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,uh=Object.freeze({__proto__:null,evaluateTargeting:lh}),ch=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'}),hh=Object.defineProperty,dh=(e,t,r)=>((e,t,r)=>t in e?hh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),ph=Object.defineProperty,fh=(e,t,r)=>((e,t,r)=>t in e?ph(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),gh=Object.defineProperty,mh=(e,t,r)=>((e,t,r)=>t in e?gh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const vh={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},yh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},bh={};function wh(e){if(bh[e])return bh[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 vh?vh[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 yh?yh[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 bh[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?bh[e]=o:r}catch{return r}}const Sh={};function Ch(e,t,r){var n;const i=`${e}.${String(r)}`;if(Sh[i])return Sh[i].call(t);const o=wh(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Sh[i]=s,s.call(t)):t[r]}const Ih={};function kh(e,t,r){const n=`${e}.${String(r)}`;if(Ih[n])return Ih[n].bind(t);const i=wh(e)[r];return"function"!=typeof i?t[r]:(Ih[n]=i,i.bind(t))}const xh={childNodes:function(e){return Ch("Node",e,"childNodes")},parentNode:function(e){return Ch("Node",e,"parentNode")},parentElement:function(e){return Ch("Node",e,"parentElement")},textContent:function(e){return Ch("Node",e,"textContent")},contains:function(e,t){return kh("Node",e,"contains")(t)},getRootNode:function(e){return kh("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ch("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ch("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ch("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ch("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return wh("MutationObserver").constructor}};class Eh{constructor(){mh(this,"idNodeMap",new Map),mh(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 Oh(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Oh(xh.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Oh(xh.parentNode(e),t,r)}function Ah(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ph(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 Th={exports:{}},Rh=String,Mh=function(){return{isColorSupported:!1,reset:Rh,bold:Rh,dim:Rh,italic:Rh,underline:Rh,inverse:Rh,hidden:Rh,strikethrough:Rh,black:Rh,red:Rh,green:Rh,yellow:Rh,blue:Rh,magenta:Rh,cyan:Rh,white:Rh,gray:Rh,bgBlack:Rh,bgRed:Rh,bgGreen:Rh,bgYellow:Rh,bgBlue:Rh,bgMagenta:Rh,bgCyan:Rh,bgWhite:Rh}};Th.exports=Mh(),Th.exports.createColors=Mh;var Nh=Th.exports;const _h=Ph(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Dh=Nh,Lh=_h,Fh=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=Dh.isColorSupported),Lh&&e&&(t=Lh(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}=Dh.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 Uh=Fh;Fh.default=Fh;var jh={};jh.isClean=Symbol("isClean"),jh.my=Symbol("my");const Bh={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let zh=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 Bh[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=Bh[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 Vh=zh;zh.default=zh;let qh=Vh;function Wh(e,t){new qh(t).stringify(e)}var Kh=Wh;Wh.default=Wh;let{isClean:Gh,my:Zh}=jh,Jh=Uh,Yh=Vh,Hh=Kh;function $h(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=>$h(e,r)):("object"===o&&null!==i&&(i=$h(i)),r[n]=i)}return r}let Xh=class{constructor(e={}){this.raws={},this[Gh]=!1,this[Zh]=!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=$h(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 Jh(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[Gh]){this[Gh]=!1;let e=this;for(;e=e.parent;)e[Gh]=!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 Yh).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=Hh){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 Qh=Xh;Xh.default=Xh;let ed=Qh,td=class extends ed{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 rd=td;td.default=td;var nd={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:id,SourceMapGenerator:od}=_h,{existsSync:sd,readFileSync:ad}=_h,{dirname:ld,join:ud}=_h;let cd=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=ld(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new id(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=ld(e),sd(e))return this.mapFile=e,ad(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 id)return od.fromSourceMap(t).toString();if(t instanceof od)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=ud(ld(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 hd=cd;cd.default=cd;let{SourceMapConsumer:dd,SourceMapGenerator:pd}=_h,{fileURLToPath:fd,pathToFileURL:gd}=_h,{isAbsolute:md,resolve:vd}=_h,{nanoid:yd}=nd,bd=_h,wd=Uh,Sd=hd,Cd=Symbol("fromOffsetCache"),Id=Boolean(dd&&pd),kd=Boolean(vd&&md),xd=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&&(!kd||/^\w+:\/\//.test(t.from)||md(t.from)?this.file=t.from:this.file=vd(t.from)),kd&&Id){let e=new Sd(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 "+yd(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 wd(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 wd(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&&(gd&&(i.input.url=gd(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[Cd])r=this[Cd];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[Cd]=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:vd(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=md(a.source)?gd(a.source):new URL(a.source,this.map.consumer().sourceRoot||gd(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(!fd)throw new Error("file: protocol is not available in this PostCSS build");l.file=fd(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 Ed=xd;xd.default=xd,bd&&bd.registerInput&&bd.registerInput(xd);let{SourceMapConsumer:Od,SourceMapGenerator:Ad}=_h,{dirname:Pd,relative:Td,resolve:Rd,sep:Md}=_h,{pathToFileURL:Nd}=_h,_d=Ed,Dd=Boolean(Od&&Ad),Ld=Boolean(Pd&&Rd&&Td&&Md);var Fd=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||Pd(e.file);!1===this.mapOpts.sourcesContent?(t=new Od(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(),Ld&&Dd&&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=Ad.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Ad({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 Ad({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?Pd(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Pd(Rd(r,this.mapOpts.annotation)));let n=Td(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 _d(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(Nd){let t=Nd(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;"\\"===Md&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Ud=Qh,jd=class extends Ud{constructor(e){super(e),this.type="comment"}};var Bd=jd;jd.default=jd;let zd,Vd,qd,Wd,{isClean:Kd,my:Gd}=jh,Zd=rd,Jd=Bd,Yd=Qh;function Hd(e){return e.map(e=>(e.nodes&&(e.nodes=Hd(e.nodes)),delete e.source,e))}function $d(e){if(e[Kd]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)$d(t)}let Xd=class e extends Yd{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=Hd(zd(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 Zd(t)]}else if(t.selector)t=[new Vd(t)];else if(t.name)t=[new qd(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Jd(t)]}return t.map(t=>(t[Gd]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Kd]&&$d(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]}};Xd.registerParse=e=>{zd=e},Xd.registerRule=e=>{Vd=e},Xd.registerAtRule=e=>{qd=e},Xd.registerRoot=e=>{Wd=e};var Qd=Xd;Xd.default=Xd,Xd.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,qd.prototype):"rule"===e.type?Object.setPrototypeOf(e,Vd.prototype):"decl"===e.type?Object.setPrototypeOf(e,Zd.prototype):"comment"===e.type?Object.setPrototypeOf(e,Jd.prototype):"root"===e.type&&Object.setPrototypeOf(e,Wd.prototype),e[Gd]=!0,e.nodes&&e.nodes.forEach(e=>{Xd.rebuild(e)})};let ep,tp,rp=Qd,np=class extends rp{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new ep(new tp,this,e).stringify()}};np.registerLazyResult=e=>{ep=e},np.registerProcessor=e=>{tp=e};var ip=np;np.default=np;let op={};var sp=function(e){op[e]||(op[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let ap=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 lp=ap;ap.default=ap;let up=lp,cp=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 up(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var hp=cp;cp.default=cp;const dp="'".charCodeAt(0),pp='"'.charCodeAt(0),fp="\\".charCodeAt(0),gp="/".charCodeAt(0),mp="\n".charCodeAt(0),vp=" ".charCodeAt(0),yp="\f".charCodeAt(0),bp="\t".charCodeAt(0),wp="\r".charCodeAt(0),Sp="[".charCodeAt(0),Cp="]".charCodeAt(0),Ip="(".charCodeAt(0),kp=")".charCodeAt(0),xp="{".charCodeAt(0),Ep="}".charCodeAt(0),Op=";".charCodeAt(0),Ap="*".charCodeAt(0),Pp=":".charCodeAt(0),Tp="@".charCodeAt(0),Rp=/[\t\n\f\r "#'()/;[\\\]{}]/g,Mp=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Np=/.[\r\n"'(/\\]/,_p=/[\da-f]/i;let Dp=Qd,Lp=class extends Dp{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 Fp=Lp;Lp.default=Lp,Dp.registerAtRule(Lp);let Up,jp,Bp=Qd,zp=class extends Bp{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 Up(new jp,this,e).stringify()}};zp.registerLazyResult=e=>{Up=e},zp.registerProcessor=e=>{jp=e};var Vp=zp;zp.default=zp,Bp.registerRoot(zp);let qp={comma:e=>qp.split(e,[","],!0),space:e=>qp.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 Wp=qp;qp.default=qp;let Kp=Qd,Gp=Wp,Zp=class extends Kp{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Gp.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 Jp=Zp;Zp.default=Zp,Kp.registerRule(Zp);let Yp=rd,Hp=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 mp:case vp:case bp:case wp:case yp:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===vp||r===mp||r===bp||r===wp||r===yp);h=["space",d.slice(g,n)],g=n-1;break;case Sp:case Cp:case xp:case Ep:case Pp:case Op:case kp:{let e=String.fromCharCode(r);h=[e,e,g];break}case Ip:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==dp&&c!==pp&&c!==vp&&c!==mp&&c!==bp&&c!==yp&&c!==wp){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)===fp;)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||Np.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case dp:case pp:i=r===dp?"'":'"',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)===fp;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case Tp:Rp.lastIndex=g+1,Rp.test(d),n=0===Rp.lastIndex?d.length-1:Rp.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case fp:for(n=g,s=!0;d.charCodeAt(n+1)===fp;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==gp&&r!==vp&&r!==mp&&r!==bp&&r!==wp&&r!==yp&&(n+=1,_p.test(d.charAt(n)))){for(;_p.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===vp&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===gp&&d.charCodeAt(g+1)===Ap?(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):(Mp.lastIndex=g+1,Mp.test(d),n=0===Mp.lastIndex?d.length-1:Mp.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},$p=Bd,Xp=Fp,Qp=Vp,ef=Jp;const tf={empty:!0,space:!0};var rf=class{constructor(e){this.input=e,this.root=new Qp,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 Xp;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 $p;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=Hp(this.input)}decl(e,t){let r=new Yp;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 ef;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",tf[a]||tf[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 ef;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 nf=Qd,of=rf,sf=Ed;function af(e,t){let r=new sf(e,t),n=new of(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 lf=af;af.default=af,nf.registerParse(af);let{isClean:uf,my:cf}=jh,hf=Fd,df=Kh,pf=Qd,ff=ip,gf=sp,mf=hp,vf=lf,yf=Vp;const bf={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},wf={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},Sf={Once:!0,postcssPlugin:!0,prepare:!0};function Cf(e){return"object"==typeof e&&"function"==typeof e.then}function If(e){let t=!1,r=bf[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 kf(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:If(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function xf(e){return e[uf]=!1,e.nodes&&e.nodes.forEach(e=>xf(e)),e}let Ef={},Of=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 mf)i=xf(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=vf;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[cf]&&pf.rebuild(i)}else i=xf(r);this.result=new mf(t,i,n),this.helpers={...Ef,postcss:Ef,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(!wf[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Sf[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(Cf(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[uf];){e[uf]=!0;let t=[kf(e)];for(;t.length>0;){let e=this.visitTick(t);if(Cf(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 Cf(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=df;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new hf(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(Cf(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[uf];)e[uf]=!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||gf("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(Cf(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[uf])return n[uf]=!0,void e.push(kf(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[uf]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[uf]=!0;let t=If(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[uf]||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"}};Of.registerPostcss=e=>{Ef=e};var Af=Of;Of.default=Of,yf.registerLazyResult(Of),ff.registerLazyResult(Of);let Pf=Fd,Tf=Kh,Rf=sp,Mf=lf;const Nf=hp;let _f=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=Tf;this.result=new Nf(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new Pf(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||Rf("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=Mf;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 Df=_f;_f.default=_f;let Lf=Df,Ff=Af,Uf=ip,jf=Vp,Bf=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 Ff(this,e,t):new Lf(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var zf=Bf;Bf.default=Bf,jf.registerProcessor(Bf),Uf.registerProcessor(Bf);let Vf=rd,qf=hd,Wf=Bd,Kf=Fp,Gf=Ed,Zf=Vp,Jf=Jp;function Yf(e,t){if(Array.isArray(e))return e.map(e=>Yf(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Gf.prototype};r.map&&(r.map={...r.map,__proto__:qf.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Yf(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 Zf(n);if("decl"===n.type)return new Vf(n);if("rule"===n.type)return new Jf(n);if("comment"===n.type)return new Wf(n);if("atrule"===n.type)return new Kf(n);throw new Error("Unknown node type: "+e.type)}var Hf=Yf;Yf.default=Yf;let $f=Uh,Xf=rd,Qf=Af,eg=Qd,tg=zf,rg=Kh,ng=Hf,ig=ip,og=lp,sg=Bd,ag=Fp,lg=hp,ug=Ed,cg=lf,hg=Wp,dg=Jp,pg=Vp,fg=Qh;function gg(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new tg(e)}gg.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 tg).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return gg([i(r)]).process(e,t)},i},gg.stringify=rg,gg.parse=cg,gg.fromJSON=ng,gg.list=hg,gg.comment=e=>new sg(e),gg.atRule=e=>new ag(e),gg.decl=e=>new Xf(e),gg.rule=e=>new dg(e),gg.root=e=>new pg(e),gg.document=e=>new ig(e),gg.CssSyntaxError=$f,gg.Declaration=Xf,gg.Container=eg,gg.Processor=tg,gg.Document=ig,gg.Comment=sg,gg.Warning=og,gg.AtRule=ag,gg.Result=lg,gg.Input=ug,gg.Rule=dg,gg.Root=pg,gg.Node=fg,Qf.registerPostcss(gg);var mg=gg;gg.default=gg;const vg=Ah(mg);vg.stringify,vg.fromJSON,vg.plugin,vg.parse,vg.list,vg.document,vg.comment,vg.atRule,vg.rule,vg.decl,vg.root,vg.CssSyntaxError,vg.Declaration,vg.Container,vg.Processor,vg.Document,vg.Comment,vg.Warning,vg.AtRule,vg.Result,vg.Input,vg.Rule,vg.Root,vg.Node;var yg=Object.defineProperty,bg=(e,t,r)=>((e,t,r)=>t in e?yg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function wg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Sg(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 Cg={exports:{}},Ig=String,kg=function(){return{isColorSupported:!1,reset:Ig,bold:Ig,dim:Ig,italic:Ig,underline:Ig,inverse:Ig,hidden:Ig,strikethrough:Ig,black:Ig,red:Ig,green:Ig,yellow:Ig,blue:Ig,magenta:Ig,cyan:Ig,white:Ig,gray:Ig,bgBlack:Ig,bgRed:Ig,bgGreen:Ig,bgYellow:Ig,bgBlue:Ig,bgMagenta:Ig,bgCyan:Ig,bgWhite:Ig}};Cg.exports=kg(),Cg.exports.createColors=kg;var xg=Cg.exports;const Eg=Sg(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Og=xg,Ag=Eg,Pg=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=Og.isColorSupported),Ag&&e&&(t=Ag(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}=Og.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 Tg=Pg;Pg.default=Pg;var Rg={};Rg.isClean=Symbol("isClean"),Rg.my=Symbol("my");const Mg={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Ng=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 Mg[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=Mg[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 _g=Ng;Ng.default=Ng;let Dg=_g;function Lg(e,t){new Dg(t).stringify(e)}var Fg=Lg;Lg.default=Lg;let{isClean:Ug,my:jg}=Rg,Bg=Tg,zg=_g,Vg=Fg;function qg(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=>qg(e,r)):("object"===o&&null!==i&&(i=qg(i)),r[n]=i)}return r}let Wg=class{constructor(e={}){this.raws={},this[Ug]=!1,this[jg]=!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=qg(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 Bg(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[Ug]){this[Ug]=!1;let e=this;for(;e=e.parent;)e[Ug]=!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 zg).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=Vg){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 Kg=Wg;Wg.default=Wg;let Gg=Kg,Zg=class extends Gg{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 Jg=Zg;Zg.default=Zg;var Yg={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:Hg,SourceMapGenerator:$g}=Eg,{existsSync:Xg,readFileSync:Qg}=Eg,{dirname:em,join:tm}=Eg;let rm=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=em(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Hg(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=em(e),Xg(e))return this.mapFile=e,Qg(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 Hg)return $g.fromSourceMap(t).toString();if(t instanceof $g)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=tm(em(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 nm=rm;rm.default=rm;let{SourceMapConsumer:im,SourceMapGenerator:om}=Eg,{fileURLToPath:sm,pathToFileURL:am}=Eg,{isAbsolute:lm,resolve:um}=Eg,{nanoid:cm}=Yg,hm=Eg,dm=Tg,pm=nm,fm=Symbol("fromOffsetCache"),gm=Boolean(im&&om),mm=Boolean(um&&lm),vm=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&&(!mm||/^\w+:\/\//.test(t.from)||lm(t.from)?this.file=t.from:this.file=um(t.from)),mm&&gm){let e=new pm(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 "+cm(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 dm(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 dm(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&&(am&&(i.input.url=am(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[fm])r=this[fm];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[fm]=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:um(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=lm(a.source)?am(a.source):new URL(a.source,this.map.consumer().sourceRoot||am(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(!sm)throw new Error("file: protocol is not available in this PostCSS build");l.file=sm(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 ym=vm;vm.default=vm,hm&&hm.registerInput&&hm.registerInput(vm);let{SourceMapConsumer:bm,SourceMapGenerator:wm}=Eg,{dirname:Sm,relative:Cm,resolve:Im,sep:km}=Eg,{pathToFileURL:xm}=Eg,Em=ym,Om=Boolean(bm&&wm),Am=Boolean(Sm&&Im&&Cm&&km);var Pm=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||Sm(e.file);!1===this.mapOpts.sourcesContent?(t=new bm(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(),Am&&Om&&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=wm.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new wm({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 wm({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?Sm(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Sm(Im(r,this.mapOpts.annotation)));let n=Cm(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 Em(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(xm){let t=xm(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;"\\"===km&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Tm=Kg,Rm=class extends Tm{constructor(e){super(e),this.type="comment"}};var Mm=Rm;Rm.default=Rm;let Nm,_m,Dm,Lm,{isClean:Fm,my:Um}=Rg,jm=Jg,Bm=Mm,zm=Kg;function Vm(e){return e.map(e=>(e.nodes&&(e.nodes=Vm(e.nodes)),delete e.source,e))}function qm(e){if(e[Fm]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)qm(t)}let Wm=class e extends zm{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=Vm(Nm(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 jm(t)]}else if(t.selector)t=[new _m(t)];else if(t.name)t=[new Dm(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Bm(t)]}return t.map(t=>(t[Um]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Fm]&&qm(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]}};Wm.registerParse=e=>{Nm=e},Wm.registerRule=e=>{_m=e},Wm.registerAtRule=e=>{Dm=e},Wm.registerRoot=e=>{Lm=e};var Km=Wm;Wm.default=Wm,Wm.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Dm.prototype):"rule"===e.type?Object.setPrototypeOf(e,_m.prototype):"decl"===e.type?Object.setPrototypeOf(e,jm.prototype):"comment"===e.type?Object.setPrototypeOf(e,Bm.prototype):"root"===e.type&&Object.setPrototypeOf(e,Lm.prototype),e[Um]=!0,e.nodes&&e.nodes.forEach(e=>{Wm.rebuild(e)})};let Gm,Zm,Jm=Km,Ym=class extends Jm{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Gm(new Zm,this,e).stringify()}};Ym.registerLazyResult=e=>{Gm=e},Ym.registerProcessor=e=>{Zm=e};var Hm=Ym;Ym.default=Ym;let $m={};var Xm=function(e){$m[e]||($m[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Qm=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 ev=Qm;Qm.default=Qm;let tv=ev,rv=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 tv(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var nv=rv;rv.default=rv;const iv="'".charCodeAt(0),ov='"'.charCodeAt(0),sv="\\".charCodeAt(0),av="/".charCodeAt(0),lv="\n".charCodeAt(0),uv=" ".charCodeAt(0),cv="\f".charCodeAt(0),hv="\t".charCodeAt(0),dv="\r".charCodeAt(0),pv="[".charCodeAt(0),fv="]".charCodeAt(0),gv="(".charCodeAt(0),mv=")".charCodeAt(0),vv="{".charCodeAt(0),yv="}".charCodeAt(0),bv=";".charCodeAt(0),wv="*".charCodeAt(0),Sv=":".charCodeAt(0),Cv="@".charCodeAt(0),Iv=/[\t\n\f\r "#'()/;[\\\]{}]/g,kv=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,xv=/.[\r\n"'(/\\]/,Ev=/[\da-f]/i;let Ov=Km,Av=class extends Ov{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 Pv=Av;Av.default=Av,Ov.registerAtRule(Av);let Tv,Rv,Mv=Km,Nv=class extends Mv{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 Tv(new Rv,this,e).stringify()}};Nv.registerLazyResult=e=>{Tv=e},Nv.registerProcessor=e=>{Rv=e};var _v=Nv;Nv.default=Nv,Mv.registerRoot(Nv);let Dv={comma:e=>Dv.split(e,[","],!0),space:e=>Dv.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 Lv=Dv;Dv.default=Dv;let Fv=Km,Uv=Lv,jv=class extends Fv{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Uv.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 Bv=jv;jv.default=jv,Fv.registerRule(jv);let zv=Jg,Vv=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 lv:case uv:case hv:case dv:case cv:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===uv||r===lv||r===hv||r===dv||r===cv);h=["space",d.slice(g,n)],g=n-1;break;case pv:case fv:case vv:case yv:case Sv:case bv:case mv:{let e=String.fromCharCode(r);h=[e,e,g];break}case gv:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==iv&&c!==ov&&c!==uv&&c!==lv&&c!==hv&&c!==cv&&c!==dv){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)===sv;)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||xv.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case iv:case ov:i=r===iv?"'":'"',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)===sv;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case Cv:Iv.lastIndex=g+1,Iv.test(d),n=0===Iv.lastIndex?d.length-1:Iv.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case sv:for(n=g,s=!0;d.charCodeAt(n+1)===sv;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==av&&r!==uv&&r!==lv&&r!==hv&&r!==dv&&r!==cv&&(n+=1,Ev.test(d.charAt(n)))){for(;Ev.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===uv&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===av&&d.charCodeAt(g+1)===wv?(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):(kv.lastIndex=g+1,kv.test(d),n=0===kv.lastIndex?d.length-1:kv.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},qv=Mm,Wv=Pv,Kv=_v,Gv=Bv;const Zv={empty:!0,space:!0};var Jv=class{constructor(e){this.input=e,this.root=new Kv,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 Wv;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 qv;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=Vv(this.input)}decl(e,t){let r=new zv;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 Gv;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",Zv[a]||Zv[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 Gv;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 Yv=Km,Hv=Jv,$v=ym;function Xv(e,t){let r=new $v(e,t),n=new Hv(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 Qv=Xv;Xv.default=Xv,Yv.registerParse(Xv);let{isClean:ey,my:ty}=Rg,ry=Pm,ny=Fg,iy=Km,oy=Hm,sy=Xm,ay=nv,ly=Qv,uy=_v;const cy={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},hy={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},dy={Once:!0,postcssPlugin:!0,prepare:!0};function py(e){return"object"==typeof e&&"function"==typeof e.then}function fy(e){let t=!1,r=cy[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 gy(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:fy(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function my(e){return e[ey]=!1,e.nodes&&e.nodes.forEach(e=>my(e)),e}let vy={},yy=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 ay)i=my(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=ly;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[ty]&&iy.rebuild(i)}else i=my(r);this.result=new ay(t,i,n),this.helpers={...vy,postcss:vy,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(!hy[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!dy[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(py(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ey];){e[ey]=!0;let t=[gy(e)];for(;t.length>0;){let e=this.visitTick(t);if(py(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 py(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=ny;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new ry(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(py(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ey];)e[ey]=!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||sy("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(py(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[ey])return n[ey]=!0,void e.push(gy(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[ey]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[ey]=!0;let t=fy(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[ey]||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"}};yy.registerPostcss=e=>{vy=e};var by=yy;yy.default=yy,uy.registerLazyResult(yy),oy.registerLazyResult(yy);let wy=Pm,Sy=Fg,Cy=Xm,Iy=Qv;const ky=nv;let xy=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=Sy;this.result=new ky(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new wy(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||Cy("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=Iy;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 Ey=xy;xy.default=xy;let Oy=Ey,Ay=by,Py=Hm,Ty=_v,Ry=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 Ay(this,e,t):new Oy(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var My=Ry;Ry.default=Ry,Ty.registerProcessor(Ry),Py.registerProcessor(Ry);let Ny=Jg,_y=nm,Dy=Mm,Ly=Pv,Fy=ym,Uy=_v,jy=Bv;function By(e,t){if(Array.isArray(e))return e.map(e=>By(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Fy.prototype};r.map&&(r.map={...r.map,__proto__:_y.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>By(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 Uy(n);if("decl"===n.type)return new Ny(n);if("rule"===n.type)return new jy(n);if("comment"===n.type)return new Dy(n);if("atrule"===n.type)return new Ly(n);throw new Error("Unknown node type: "+e.type)}var zy=By;By.default=By;let Vy=Tg,qy=Jg,Wy=by,Ky=Km,Gy=My,Zy=Fg,Jy=zy,Yy=Hm,Hy=ev,$y=Mm,Xy=Pv,Qy=nv,eb=ym,tb=Qv,rb=Lv,nb=Bv,ib=_v,ob=Kg;function sb(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Gy(e)}sb.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 Gy).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return sb([i(r)]).process(e,t)},i},sb.stringify=Zy,sb.parse=tb,sb.fromJSON=Jy,sb.list=rb,sb.comment=e=>new $y(e),sb.atRule=e=>new Xy(e),sb.decl=e=>new qy(e),sb.rule=e=>new nb(e),sb.root=e=>new ib(e),sb.document=e=>new Yy(e),sb.CssSyntaxError=Vy,sb.Declaration=qy,sb.Container=Ky,sb.Processor=Gy,sb.Document=Yy,sb.Comment=$y,sb.Warning=Hy,sb.AtRule=Xy,sb.Result=Qy,sb.Input=eb,sb.Rule=nb,sb.Root=ib,sb.Node=ob,Wy.registerPostcss(sb);var ab=sb;sb.default=sb;const lb=wg(ab);lb.stringify,lb.fromJSON,lb.plugin,lb.parse,lb.list,lb.document,lb.comment,lb.atRule,lb.rule,lb.decl,lb.root,lb.CssSyntaxError,lb.Declaration,lb.Container,lb.Processor,lb.Document,lb.Comment,lb.Warning,lb.AtRule,lb.Result,lb.Input,lb.Rule,lb.Root,lb.Node;class ub{constructor(...e){bg(this,"parentElement",null),bg(this,"parentNode",null),bg(this,"ownerDocument"),bg(this,"firstChild",null),bg(this,"lastChild",null),bg(this,"previousSibling",null),bg(this,"nextSibling",null),bg(this,"ELEMENT_NODE",1),bg(this,"TEXT_NODE",3),bg(this,"nodeType"),bg(this,"nodeName"),bg(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 ub))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 cb={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},hb={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},db={};function pb(e){if(db[e])return db[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 cb?cb[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 hb?hb[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 db[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?db[e]=o:r}catch{return r}}const fb={};function gb(e,t,r){var n;const i=`${e}.${String(r)}`;if(fb[i])return fb[i].call(t);const o=pb(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(fb[i]=s,s.call(t)):t[r]}const mb={};function vb(e,t,r){const n=`${e}.${String(r)}`;if(mb[n])return mb[n].bind(t);const i=pb(e)[r];return"function"!=typeof i?t[r]:(mb[n]=i,i.bind(t))}const yb={childNodes:function(e){return gb("Node",e,"childNodes")},parentNode:function(e){return gb("Node",e,"parentNode")},parentElement:function(e){return gb("Node",e,"parentElement")},textContent:function(e){return gb("Node",e,"textContent")},contains:function(e,t){return vb("Node",e,"contains")(t)},getRootNode:function(e){return vb("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?gb("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?gb("Element",e,"shadowRoot"):null},querySelector:function(e,t){return gb("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return gb("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return pb("MutationObserver").constructor}};const bb="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 wb={map:{},getId:()=>(console.error(bb),-1),getNode:()=>(console.error(bb),null),removeNodeFromMap(){console.error(bb)},has:()=>(console.error(bb),!1),reset(){console.error(bb)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(wb=new Proxy(wb,{get:(e,t,r)=>("map"===t&&console.error(bb),Reflect.get(e,t,r))}));let Sb=Date.now;function Cb(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:yb.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Sb=()=>(new Date).getTime());function Ib(e){var t;let r=null;return"getRootNode"in e&&(null==(t=yb.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&yb.host(yb.getRootNode(e))&&(r=yb.host(yb.getRootNode(e))),r}function kb(e){let t,r=e;for(;t=Ib(r);)r=t;return r}function xb(e){const t=e.ownerDocument;if(!t)return!1;const r=kb(e);return yb.contains(t,r)}const Eb=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){fh(this,"id",1),fh(this,"styleIDMap",new WeakMap),fh(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 wb},closestElementOfNode:Cb,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:kb,getShadowHost:Ib,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=yb.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=yb.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 ub&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(yb.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&&(yb.contains(t,e)||xb(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&xh.host(e)||null;return Boolean(t&&"shadowRoot"in t&&xh.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const i=yb.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=Cb(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(Oh(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 Sb},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:xb,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 Ob="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ab="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Pb=0;Pb<64;Pb++)Ab[Ob.charCodeAt(Pb)]=Pb;var Tb,Rb,Mb;"undefined"!=typeof window&&window.Blob&&new Blob([(Tb="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Uint8Array.from(atob(Tb),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==(ih=e.contentWindow)?void 0:ih.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}new Eh,(Mb=Rb||(Rb={}))[Mb.NotStarted=0]="NotStarted",Mb[Mb.Running=1]="Running",Mb[Mb.Stopped=2]="Stopped";class Nb{constructor(e){dh(this,"fileName"),dh(this,"functionName"),dh(this,"lineNumber"),dh(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 _b=/(^|@)\S+:\d+/,Db=/^\s*at .*(\S+:\d+|\(native\))/m,Lb=/^(eval@)?(\[native code])?$/,Fb={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Db)?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(Db)},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 Nb({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(Lb)},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 Nb({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Nb({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 Nb({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 Nb({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(_b)&&!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 Nb({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Ub(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 jb(e){return"[object Object]"===Object.prototype.toString.call(e)}function Bb(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(jb(e[n])&&Bb(e[n],t-1))return!0;return!1}function zb(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(jb(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(jb(e)&&Bb(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]=Ub(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 Vb={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 qb(e,t,r){const n=r?Object.assign({},Vb,r):Vb,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=Fb.parse(i).map(e=>e.toString()),s=[zb(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=[zb(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,i=[zb("Uncaught (in promise)",n.stringifyOptions),zb(t.reason,n.stringifyOptions)]);const o=Fb.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]?Eb.patch(t,r,t=>(...i)=>{if(t.apply(this,i),!("assert"===r&&i[0]||a)){a=!0;try{const t=Fb.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?i.slice(1):i).map(e=>zb(e,n.stringifyOptions));s++,s<n.lengthThreshold?e({level:r,trace:t,payload:o}):s===n.lengthThreshold&&e({level:"warn",trace:[],payload:[zb("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...i)}finally{a=!1}}}):()=>{}}}const Wb="rrweb/console@1";var Kb,Gb=Object.freeze({__proto__:null,PLUGIN_NAME:Wb,getRecordConsolePlugin:e=>({name:Wb,observer:qb,options:e})}),Zb=Object.defineProperty,Jb=(e,t,r)=>((e,t,r)=>t in e?Zb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Yb=Object.defineProperty,Hb=(e,t,r)=>((e,t,r)=>t in e?Yb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),$b=(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))($b||{});const Xb={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Qb={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ew={};function tw(e){if(ew[e])return ew[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 Xb?Xb[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 Qb?Qb[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 ew[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?ew[e]=o:r}catch{return r}}const rw={};function nw(e,t,r){var n;const i=`${e}.${String(r)}`;if(rw[i])return rw[i].call(t);const o=tw(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(rw[i]=s,s.call(t)):t[r]}const iw={};function ow(e,t,r){const n=`${e}.${String(r)}`;if(iw[n])return iw[n].bind(t);const i=tw(e)[r];return"function"!=typeof i?t[r]:(iw[n]=i,i.bind(t))}const sw={childNodes:function(e){return nw("Node",e,"childNodes")},parentNode:function(e){return nw("Node",e,"parentNode")},parentElement:function(e){return nw("Node",e,"parentElement")},textContent:function(e){return nw("Node",e,"textContent")},contains:function(e,t){return ow("Node",e,"contains")(t)},getRootNode:function(e){return ow("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?nw("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?nw("Element",e,"shadowRoot"):null},querySelector:function(e,t){return nw("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return nw("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return tw("MutationObserver").constructor}};function aw(e){return e.nodeType===e.ELEMENT_NODE}function lw(e){const t=e&&"host"in e&&"mode"in e&&sw.host(e)||null;return Boolean(t&&"shadowRoot"in t&&sw.shadowRoot(t)===e)}function uw(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function cw(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=>hw(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 hw(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=cw(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?Cw(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?Cw(r,t):r}}class dw{constructor(){Hb(this,"idNodeMap",new Map),Hb(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 pw({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"";const a=n&&fw(n);return(t[r.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function fw(e){return e.toLowerCase()}const gw="__rrweb_original__";function mw(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?fw(t):null}function vw(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 yw=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,bw=/^(?:[a-z+]+:)?\/\//i,ww=/^www\..*/i,Sw=/^(data:)([^,]*),(.*)/i;function Cw(e,t){return(e||"").replace(yw,(e,r,n,i,o,s)=>{const a=n||o||s,l=r||i||"";if(!a)return e;if(bw.test(a)||ww.test(a))return`url(${l}${a}${l})`;if(Sw.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 Iw(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function kw(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=Iw(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=Iw(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=Iw(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=Iw(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 xw="lightgrey";let Ew=1;const Ow=new RegExp("[^a-z0-9-_:]");function Aw(){return Ew++}let Pw,Tw;const Rw=/^[^ \t\n\r\u000c]+/,Mw=/^[, \t\n\r\u000c]+/;const Nw=new WeakMap;function _w(e,t){return t&&""!==t.trim()?Lw(e,t):t}function Dw(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Lw(e,t){let r=Nw.get(e);if(r||(r=e.createElement("a"),Nw.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Fw(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?_w(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(Mw),!(r>=t.length);){let o=n(Rw);if(","===o.slice(-1))o=_w(e,o.substring(0,o.length-1)),i.push(o);else{let n="";o=_w(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?Cw(n,Lw(e)):"object"===t&&"data"===r?_w(e,n):n:_w(e,n):n}function Uw(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function jw(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&jw(sw.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&jw(sw.parentNode(e),t,r)}function Bw(e,t,r,n){let i;if(aw(e)){if(i=e,!sw.childNodes(i).length)return!1}else{if(null===sw.parentElement(e))return!1;i=sw.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(jw(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 zw(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:$b.Document,childNodes:[],compatMode:e.compatMode}:{type:$b.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:$b.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=fw(e.tagName);return Ow.test(t)?"div":t}(e);let v={};const y=e.attributes.length;for(let t=0;t<y;t++){const n=e.attributes[t];Uw(m,n.name,n.value)||(v[n.name]=Fw(r,m,fw(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=cw(t)),n&&(delete v.rel,delete v.href,v._cssText=n)}if("style"===m&&e.sheet){let t=cw(e.sheet);t&&(e.childNodes.length>1&&(t=kw(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=pw({element:e,type:mw(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=gw in i?i[gw]: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){Pw||(Pw=r.createElement("canvas"),Tw=Pw.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",i=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{Pw.width=t.naturalWidth,Pw.height=t.naturalHeight,Tw.drawImage(t,0,0),v.rr_dataURL=Pw.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:xw}:{}}}"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:$b.Element,tagName:m,attributes:v,childNodes:[],isSVG:Dw(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=sw.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=sw.textContent(e),u&&l&&(l=Cw(l,Lw(t.doc))));!u&&!c&&l&&r&&(l=n?n(l,sw.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:$b.Text,textContent:l||"",rootId:i}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:y,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:$b.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:$b.Comment,textContent:sw.textContent(e)||"",rootId:y};default:return!1}}function Vw(e){return null==e?"":e.toLowerCase()}function qw(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:k=!1,applyBackgroundColorToBlockedElements:x=!1}=t;let{needsMask:E}=t,{preserveWhiteSpace:O=!0}=t;if(!E){E=Bw(e,s,a,void 0===E)}const A=zw(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:k,applyBackgroundColorToBlockedElements:x});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===$b.Comment)return!0;if(e.type===$b.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"===vw(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Vw(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Vw(e.attributes.name)||"icon"===Vw(e.attributes.rel)||"apple-touch-icon"===Vw(e.attributes.rel)||"shortcut icon"===Vw(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Vw(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Vw(e.attributes.property).match(/^(og|twitter|fb):/)||Vw(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Vw(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Vw(e.attributes.name)||"googlebot"===Vw(e.attributes.name)||"bingbot"===Vw(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Vw(e.attributes.name)||"generator"===Vw(e.attributes.name)||"framework"===Vw(e.attributes.name)||"publisher"===Vw(e.attributes.name)||"progid"===Vw(e.attributes.name)||Vw(e.attributes.property).match(/^article:/)||Vw(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Vw(e.attributes.name)||"yandex-verification"===Vw(e.attributes.name)||"csrf-token"===Vw(e.attributes.name)||"p:domain_verify"===Vw(e.attributes.name)||"verify-v1"===Vw(e.attributes.name)||"verification"===Vw(e.attributes.name)||"shopify-checkout-api-token"===Vw(e.attributes.name)))return!0}}return!1}(A,p)||!O&&A.type===$b.Text&&!A.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Aw();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===$b.Element){R=R&&!T.needBlock,delete T.needBlock;const t=sw.shadowRoot(e);t&&uw(t)&&(T.isShadowHost=!0)}if((T.type===$b.Document||T.type===$b.Element)&&R){p.headWhitespace&&T.type===$b.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:x};if(T.type===$b.Element&&"textarea"===T.tagName&&void 0!==T.attributes.value);else{T.type===$b.Element&&void 0!==T.attributes._cssText&&"string"==typeof T.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(sw.childNodes(e))){const e=qw(r,t);e&&T.childNodes.push(e)}}let I=null;if(aw(e)&&(I=sw.shadowRoot(e)))for(const e of Array.from(sw.childNodes(I))){const r=qw(e,t);r&&(uw(I)&&(r.isShadow=!0),T.childNodes.push(r))}}const M=sw.parentNode(e);return M&&lw(M)&&uw(M)&&(T.isShadow=!0),T.type===$b.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=qw(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===$b.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===vw(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=qw(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 Ww(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Kw(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 Gw={exports:{}},Zw=String,Jw=function(){return{isColorSupported:!1,reset:Zw,bold:Zw,dim:Zw,italic:Zw,underline:Zw,inverse:Zw,hidden:Zw,strikethrough:Zw,black:Zw,red:Zw,green:Zw,yellow:Zw,blue:Zw,magenta:Zw,cyan:Zw,white:Zw,gray:Zw,bgBlack:Zw,bgRed:Zw,bgGreen:Zw,bgYellow:Zw,bgBlue:Zw,bgMagenta:Zw,bgCyan:Zw,bgWhite:Zw}};Gw.exports=Jw(),Gw.exports.createColors=Jw;var Yw=Gw.exports;const Hw=Kw(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let $w=Yw,Xw=Hw,Qw=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=$w.isColorSupported),Xw&&e&&(t=Xw(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}=$w.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 eS=Qw;Qw.default=Qw;var tS={};tS.isClean=Symbol("isClean"),tS.my=Symbol("my");const rS={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let nS=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 rS[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=rS[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 iS=nS;nS.default=nS;let oS=iS;function sS(e,t){new oS(t).stringify(e)}var aS=sS;sS.default=sS;let{isClean:lS,my:uS}=tS,cS=eS,hS=iS,dS=aS;function pS(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=>pS(e,r)):("object"===o&&null!==i&&(i=pS(i)),r[n]=i)}return r}let fS=class{constructor(e={}){this.raws={},this[lS]=!1,this[uS]=!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=pS(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 cS(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[lS]){this[lS]=!1;let e=this;for(;e=e.parent;)e[lS]=!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 hS).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=dS){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 gS=fS;fS.default=fS;let mS=gS,vS=class extends mS{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 yS=vS;vS.default=vS;var bS={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:wS,SourceMapGenerator:SS}=Hw,{existsSync:CS,readFileSync:IS}=Hw,{dirname:kS,join:xS}=Hw;let ES=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=kS(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new wS(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=kS(e),CS(e))return this.mapFile=e,IS(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 wS)return SS.fromSourceMap(t).toString();if(t instanceof SS)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=xS(kS(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 OS=ES;ES.default=ES;let{SourceMapConsumer:AS,SourceMapGenerator:PS}=Hw,{fileURLToPath:TS,pathToFileURL:RS}=Hw,{isAbsolute:MS,resolve:NS}=Hw,{nanoid:_S}=bS,DS=Hw,LS=eS,FS=OS,US=Symbol("fromOffsetCache"),jS=Boolean(AS&&PS),BS=Boolean(NS&&MS),zS=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&&(!BS||/^\w+:\/\//.test(t.from)||MS(t.from)?this.file=t.from:this.file=NS(t.from)),BS&&jS){let e=new FS(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 "+_S(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 LS(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 LS(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&&(RS&&(i.input.url=RS(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[US])r=this[US];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[US]=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:NS(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=MS(a.source)?RS(a.source):new URL(a.source,this.map.consumer().sourceRoot||RS(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(!TS)throw new Error("file: protocol is not available in this PostCSS build");l.file=TS(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 VS=zS;zS.default=zS,DS&&DS.registerInput&&DS.registerInput(zS);let{SourceMapConsumer:qS,SourceMapGenerator:WS}=Hw,{dirname:KS,relative:GS,resolve:ZS,sep:JS}=Hw,{pathToFileURL:YS}=Hw,HS=VS,$S=Boolean(qS&&WS),XS=Boolean(KS&&ZS&&GS&&JS);var QS=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||KS(e.file);!1===this.mapOpts.sourcesContent?(t=new qS(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(),XS&&$S&&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=WS.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new WS({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 WS({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?KS(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=KS(ZS(r,this.mapOpts.annotation)));let n=GS(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 HS(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(YS){let t=YS(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;"\\"===JS&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let eC=gS,tC=class extends eC{constructor(e){super(e),this.type="comment"}};var rC=tC;tC.default=tC;let nC,iC,oC,sC,{isClean:aC,my:lC}=tS,uC=yS,cC=rC,hC=gS;function dC(e){return e.map(e=>(e.nodes&&(e.nodes=dC(e.nodes)),delete e.source,e))}function pC(e){if(e[aC]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)pC(t)}let fC=class e extends hC{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=dC(nC(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 uC(t)]}else if(t.selector)t=[new iC(t)];else if(t.name)t=[new oC(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new cC(t)]}return t.map(t=>(t[lC]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[aC]&&pC(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]}};fC.registerParse=e=>{nC=e},fC.registerRule=e=>{iC=e},fC.registerAtRule=e=>{oC=e},fC.registerRoot=e=>{sC=e};var gC=fC;fC.default=fC,fC.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,oC.prototype):"rule"===e.type?Object.setPrototypeOf(e,iC.prototype):"decl"===e.type?Object.setPrototypeOf(e,uC.prototype):"comment"===e.type?Object.setPrototypeOf(e,cC.prototype):"root"===e.type&&Object.setPrototypeOf(e,sC.prototype),e[lC]=!0,e.nodes&&e.nodes.forEach(e=>{fC.rebuild(e)})};let mC,vC,yC=gC,bC=class extends yC{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new mC(new vC,this,e).stringify()}};bC.registerLazyResult=e=>{mC=e},bC.registerProcessor=e=>{vC=e};var wC=bC;bC.default=bC;let SC={};var CC=function(e){SC[e]||(SC[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let IC=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 kC=IC;IC.default=IC;let xC=kC,EC=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 xC(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var OC=EC;EC.default=EC;const AC="'".charCodeAt(0),PC='"'.charCodeAt(0),TC="\\".charCodeAt(0),RC="/".charCodeAt(0),MC="\n".charCodeAt(0),NC=" ".charCodeAt(0),_C="\f".charCodeAt(0),DC="\t".charCodeAt(0),LC="\r".charCodeAt(0),FC="[".charCodeAt(0),UC="]".charCodeAt(0),jC="(".charCodeAt(0),BC=")".charCodeAt(0),zC="{".charCodeAt(0),VC="}".charCodeAt(0),qC=";".charCodeAt(0),WC="*".charCodeAt(0),KC=":".charCodeAt(0),GC="@".charCodeAt(0),ZC=/[\t\n\f\r "#'()/;[\\\]{}]/g,JC=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,YC=/.[\r\n"'(/\\]/,HC=/[\da-f]/i;let $C=gC,XC=class extends $C{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 QC=XC;XC.default=XC,$C.registerAtRule(XC);let eI,tI,rI=gC,nI=class extends rI{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 eI(new tI,this,e).stringify()}};nI.registerLazyResult=e=>{eI=e},nI.registerProcessor=e=>{tI=e};var iI=nI;nI.default=nI,rI.registerRoot(nI);let oI={comma:e=>oI.split(e,[","],!0),space:e=>oI.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 sI=oI;oI.default=oI;let aI=gC,lI=sI,uI=class extends aI{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return lI.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 cI=uI;uI.default=uI,aI.registerRule(uI);let hI=yS,dI=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 MC:case NC:case DC:case LC:case _C:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===NC||r===MC||r===DC||r===LC||r===_C);h=["space",d.slice(g,n)],g=n-1;break;case FC:case UC:case zC:case VC:case KC:case qC:case BC:{let e=String.fromCharCode(r);h=[e,e,g];break}case jC:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==AC&&c!==PC&&c!==NC&&c!==MC&&c!==DC&&c!==_C&&c!==LC){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)===TC;)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||YC.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case AC:case PC:i=r===AC?"'":'"',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)===TC;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case GC:ZC.lastIndex=g+1,ZC.test(d),n=0===ZC.lastIndex?d.length-1:ZC.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case TC:for(n=g,s=!0;d.charCodeAt(n+1)===TC;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==RC&&r!==NC&&r!==MC&&r!==DC&&r!==LC&&r!==_C&&(n+=1,HC.test(d.charAt(n)))){for(;HC.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===NC&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===RC&&d.charCodeAt(g+1)===WC?(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):(JC.lastIndex=g+1,JC.test(d),n=0===JC.lastIndex?d.length-1:JC.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},pI=rC,fI=QC,gI=iI,mI=cI;const vI={empty:!0,space:!0};var yI=class{constructor(e){this.input=e,this.root=new gI,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 fI;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 pI;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=dI(this.input)}decl(e,t){let r=new hI;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 mI;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",vI[a]||vI[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 mI;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 bI=gC,wI=yI,SI=VS;function CI(e,t){let r=new SI(e,t),n=new wI(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 II=CI;CI.default=CI,bI.registerParse(CI);let{isClean:kI,my:xI}=tS,EI=QS,OI=aS,AI=gC,PI=wC,TI=CC,RI=OC,MI=II,NI=iI;const _I={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},DI={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},LI={Once:!0,postcssPlugin:!0,prepare:!0};function FI(e){return"object"==typeof e&&"function"==typeof e.then}function UI(e){let t=!1,r=_I[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 jI(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:UI(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function BI(e){return e[kI]=!1,e.nodes&&e.nodes.forEach(e=>BI(e)),e}let zI={},VI=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 RI)i=BI(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=MI;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[xI]&&AI.rebuild(i)}else i=BI(r);this.result=new RI(t,i,n),this.helpers={...zI,postcss:zI,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(!DI[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!LI[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(FI(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[kI];){e[kI]=!0;let t=[jI(e)];for(;t.length>0;){let e=this.visitTick(t);if(FI(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 FI(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=OI;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new EI(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(FI(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[kI];)e[kI]=!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||TI("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(FI(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[kI])return n[kI]=!0,void e.push(jI(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[kI]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[kI]=!0;let t=UI(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[kI]||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"}};VI.registerPostcss=e=>{zI=e};var qI=VI;VI.default=VI,NI.registerLazyResult(VI),PI.registerLazyResult(VI);let WI=QS,KI=aS,GI=CC,ZI=II;const JI=OC;let YI=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=KI;this.result=new JI(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new WI(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||GI("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=ZI;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 HI=YI;YI.default=YI;let $I=HI,XI=qI,QI=wC,ek=iI,tk=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 XI(this,e,t):new $I(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var rk=tk;tk.default=tk,ek.registerProcessor(tk),QI.registerProcessor(tk);let nk=yS,ik=OS,ok=rC,sk=QC,ak=VS,lk=iI,uk=cI;function ck(e,t){if(Array.isArray(e))return e.map(e=>ck(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:ak.prototype};r.map&&(r.map={...r.map,__proto__:ik.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>ck(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 lk(n);if("decl"===n.type)return new nk(n);if("rule"===n.type)return new uk(n);if("comment"===n.type)return new ok(n);if("atrule"===n.type)return new sk(n);throw new Error("Unknown node type: "+e.type)}var hk=ck;ck.default=ck;let dk=eS,pk=yS,fk=qI,gk=gC,mk=rk,vk=aS,yk=hk,bk=wC,wk=kC,Sk=rC,Ck=QC,Ik=OC,kk=VS,xk=II,Ek=sI,Ok=cI,Ak=iI,Pk=gS;function Tk(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new mk(e)}Tk.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 mk).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return Tk([i(r)]).process(e,t)},i},Tk.stringify=vk,Tk.parse=xk,Tk.fromJSON=yk,Tk.list=Ek,Tk.comment=e=>new Sk(e),Tk.atRule=e=>new Ck(e),Tk.decl=e=>new pk(e),Tk.rule=e=>new Ok(e),Tk.root=e=>new Ak(e),Tk.document=e=>new bk(e),Tk.CssSyntaxError=dk,Tk.Declaration=pk,Tk.Container=gk,Tk.Processor=mk,Tk.Document=bk,Tk.Comment=Sk,Tk.Warning=wk,Tk.AtRule=Ck,Tk.Result=Ik,Tk.Input=kk,Tk.Rule=Ok,Tk.Root=Ak,Tk.Node=Pk,fk.registerPostcss(Tk);var Rk=Tk;Tk.default=Tk;const Mk=Ww(Rk);Mk.stringify,Mk.fromJSON,Mk.plugin,Mk.parse,Mk.list,Mk.document,Mk.comment,Mk.atRule,Mk.rule,Mk.decl,Mk.root,Mk.CssSyntaxError,Mk.Declaration,Mk.Container,Mk.Processor,Mk.Document,Mk.Comment,Mk.Warning,Mk.AtRule,Mk.Result,Mk.Input,Mk.Rule,Mk.Root,Mk.Node;var Nk=Object.defineProperty,_k=(e,t,r)=>((e,t,r)=>t in e?Nk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Dk(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Lk(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 Fk={exports:{}},Uk=String,jk=function(){return{isColorSupported:!1,reset:Uk,bold:Uk,dim:Uk,italic:Uk,underline:Uk,inverse:Uk,hidden:Uk,strikethrough:Uk,black:Uk,red:Uk,green:Uk,yellow:Uk,blue:Uk,magenta:Uk,cyan:Uk,white:Uk,gray:Uk,bgBlack:Uk,bgRed:Uk,bgGreen:Uk,bgYellow:Uk,bgBlue:Uk,bgMagenta:Uk,bgCyan:Uk,bgWhite:Uk}};Fk.exports=jk(),Fk.exports.createColors=jk;var Bk=Fk.exports;const zk=Lk(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Vk=Bk,qk=zk,Wk=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=Vk.isColorSupported),qk&&e&&(t=qk(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}=Vk.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 Kk=Wk;Wk.default=Wk;var Gk={};Gk.isClean=Symbol("isClean"),Gk.my=Symbol("my");const Zk={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Jk=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 Zk[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=Zk[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 Yk=Jk;Jk.default=Jk;let Hk=Yk;function $k(e,t){new Hk(t).stringify(e)}var Xk=$k;$k.default=$k;let{isClean:Qk,my:ex}=Gk,tx=Kk,rx=Yk,nx=Xk;function ix(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=>ix(e,r)):("object"===o&&null!==i&&(i=ix(i)),r[n]=i)}return r}let ox=class{constructor(e={}){this.raws={},this[Qk]=!1,this[ex]=!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=ix(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 tx(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[Qk]){this[Qk]=!1;let e=this;for(;e=e.parent;)e[Qk]=!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 rx).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=nx){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 sx=ox;ox.default=ox;let ax=sx,lx=class extends ax{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 ux=lx;lx.default=lx;var cx={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:hx,SourceMapGenerator:dx}=zk,{existsSync:px,readFileSync:fx}=zk,{dirname:gx,join:mx}=zk;let vx=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=gx(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new hx(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=gx(e),px(e))return this.mapFile=e,fx(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 hx)return dx.fromSourceMap(t).toString();if(t instanceof dx)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=mx(gx(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 yx=vx;vx.default=vx;let{SourceMapConsumer:bx,SourceMapGenerator:wx}=zk,{fileURLToPath:Sx,pathToFileURL:Cx}=zk,{isAbsolute:Ix,resolve:kx}=zk,{nanoid:xx}=cx,Ex=zk,Ox=Kk,Ax=yx,Px=Symbol("fromOffsetCache"),Tx=Boolean(bx&&wx),Rx=Boolean(kx&&Ix),Mx=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&&(!Rx||/^\w+:\/\//.test(t.from)||Ix(t.from)?this.file=t.from:this.file=kx(t.from)),Rx&&Tx){let e=new Ax(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 "+xx(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 Ox(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 Ox(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&&(Cx&&(i.input.url=Cx(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[Px])r=this[Px];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[Px]=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:kx(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=Ix(a.source)?Cx(a.source):new URL(a.source,this.map.consumer().sourceRoot||Cx(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(!Sx)throw new Error("file: protocol is not available in this PostCSS build");l.file=Sx(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 Nx=Mx;Mx.default=Mx,Ex&&Ex.registerInput&&Ex.registerInput(Mx);let{SourceMapConsumer:_x,SourceMapGenerator:Dx}=zk,{dirname:Lx,relative:Fx,resolve:Ux,sep:jx}=zk,{pathToFileURL:Bx}=zk,zx=Nx,Vx=Boolean(_x&&Dx),qx=Boolean(Lx&&Ux&&Fx&&jx);var Wx=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||Lx(e.file);!1===this.mapOpts.sourcesContent?(t=new _x(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(),qx&&Vx&&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=Dx.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Dx({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 Dx({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?Lx(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Lx(Ux(r,this.mapOpts.annotation)));let n=Fx(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 zx(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(Bx){let t=Bx(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;"\\"===jx&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Kx=sx,Gx=class extends Kx{constructor(e){super(e),this.type="comment"}};var Zx=Gx;Gx.default=Gx;let Jx,Yx,Hx,$x,{isClean:Xx,my:Qx}=Gk,eE=ux,tE=Zx,rE=sx;function nE(e){return e.map(e=>(e.nodes&&(e.nodes=nE(e.nodes)),delete e.source,e))}function iE(e){if(e[Xx]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)iE(t)}let oE=class e extends rE{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=nE(Jx(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 eE(t)]}else if(t.selector)t=[new Yx(t)];else if(t.name)t=[new Hx(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new tE(t)]}return t.map(t=>(t[Qx]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Xx]&&iE(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]}};oE.registerParse=e=>{Jx=e},oE.registerRule=e=>{Yx=e},oE.registerAtRule=e=>{Hx=e},oE.registerRoot=e=>{$x=e};var sE=oE;oE.default=oE,oE.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Hx.prototype):"rule"===e.type?Object.setPrototypeOf(e,Yx.prototype):"decl"===e.type?Object.setPrototypeOf(e,eE.prototype):"comment"===e.type?Object.setPrototypeOf(e,tE.prototype):"root"===e.type&&Object.setPrototypeOf(e,$x.prototype),e[Qx]=!0,e.nodes&&e.nodes.forEach(e=>{oE.rebuild(e)})};let aE,lE,uE=sE,cE=class extends uE{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new aE(new lE,this,e).stringify()}};cE.registerLazyResult=e=>{aE=e},cE.registerProcessor=e=>{lE=e};var hE=cE;cE.default=cE;let dE={};var pE=function(e){dE[e]||(dE[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let fE=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 gE=fE;fE.default=fE;let mE=gE,vE=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 mE(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var yE=vE;vE.default=vE;const bE="'".charCodeAt(0),wE='"'.charCodeAt(0),SE="\\".charCodeAt(0),CE="/".charCodeAt(0),IE="\n".charCodeAt(0),kE=" ".charCodeAt(0),xE="\f".charCodeAt(0),EE="\t".charCodeAt(0),OE="\r".charCodeAt(0),AE="[".charCodeAt(0),PE="]".charCodeAt(0),TE="(".charCodeAt(0),RE=")".charCodeAt(0),ME="{".charCodeAt(0),NE="}".charCodeAt(0),_E=";".charCodeAt(0),DE="*".charCodeAt(0),LE=":".charCodeAt(0),FE="@".charCodeAt(0),UE=/[\t\n\f\r "#'()/;[\\\]{}]/g,jE=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,BE=/.[\r\n"'(/\\]/,zE=/[\da-f]/i;let VE=sE,qE=class extends VE{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 WE=qE;qE.default=qE,VE.registerAtRule(qE);let KE,GE,ZE=sE,JE=class extends ZE{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 KE(new GE,this,e).stringify()}};JE.registerLazyResult=e=>{KE=e},JE.registerProcessor=e=>{GE=e};var YE=JE;JE.default=JE,ZE.registerRoot(JE);let HE={comma:e=>HE.split(e,[","],!0),space:e=>HE.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 $E=HE;HE.default=HE;let XE=sE,QE=$E,eO=class extends XE{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return QE.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 tO=eO;eO.default=eO,XE.registerRule(eO);let rO=ux,nO=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 IE:case kE:case EE:case OE:case xE:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===kE||r===IE||r===EE||r===OE||r===xE);h=["space",d.slice(g,n)],g=n-1;break;case AE:case PE:case ME:case NE:case LE:case _E:case RE:{let e=String.fromCharCode(r);h=[e,e,g];break}case TE:if(u=m.length?m.pop()[1]:"",c=d.charCodeAt(g+1),"url"===u&&c!==bE&&c!==wE&&c!==kE&&c!==IE&&c!==EE&&c!==xE&&c!==OE){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)===SE;)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||BE.test(o)?h=["(","(",g]:(h=["brackets",o,g,n],g=n);break;case bE:case wE:i=r===bE?"'":'"',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)===SE;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case FE:UE.lastIndex=g+1,UE.test(d),n=0===UE.lastIndex?d.length-1:UE.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case SE:for(n=g,s=!0;d.charCodeAt(n+1)===SE;)n+=1,s=!s;if(r=d.charCodeAt(n+1),s&&r!==CE&&r!==kE&&r!==IE&&r!==EE&&r!==OE&&r!==xE&&(n+=1,zE.test(d.charAt(n)))){for(;zE.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===kE&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===CE&&d.charCodeAt(g+1)===DE?(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):(jE.lastIndex=g+1,jE.test(d),n=0===jE.lastIndex?d.length-1:jE.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}},iO=Zx,oO=WE,sO=YE,aO=tO;const lO={empty:!0,space:!0};var uO=class{constructor(e){this.input=e,this.root=new sO,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 oO;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 iO;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=nO(this.input)}decl(e,t){let r=new rO;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 aO;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",lO[a]||lO[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 aO;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 cO=sE,hO=uO,dO=Nx;function pO(e,t){let r=new dO(e,t),n=new hO(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 fO=pO;pO.default=pO,cO.registerParse(pO);let{isClean:gO,my:mO}=Gk,vO=Wx,yO=Xk,bO=sE,wO=hE,SO=pE,CO=yE,IO=fO,kO=YE;const xO={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},EO={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},OO={Once:!0,postcssPlugin:!0,prepare:!0};function AO(e){return"object"==typeof e&&"function"==typeof e.then}function PO(e){let t=!1,r=xO[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 TO(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:PO(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function RO(e){return e[gO]=!1,e.nodes&&e.nodes.forEach(e=>RO(e)),e}let MO={},NO=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 CO)i=RO(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=IO;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[mO]&&bO.rebuild(i)}else i=RO(r);this.result=new CO(t,i,n),this.helpers={...MO,postcss:MO,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(!EO[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!OO[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(AO(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[gO];){e[gO]=!0;let t=[TO(e)];for(;t.length>0;){let e=this.visitTick(t);if(AO(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 AO(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=yO;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new vO(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(AO(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[gO];)e[gO]=!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||SO("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(AO(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[gO])return n[gO]=!0,void e.push(TO(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[gO]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[gO]=!0;let t=PO(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[gO]||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"}};NO.registerPostcss=e=>{MO=e};var _O=NO;NO.default=NO,kO.registerLazyResult(NO),wO.registerLazyResult(NO);let DO=Wx,LO=Xk,FO=pE,UO=fO;const jO=yE;let BO=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=LO;this.result=new jO(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let s=new DO(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||FO("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=UO;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 zO=BO;BO.default=BO;let VO=zO,qO=_O,WO=hE,KO=YE,GO=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 qO(this,e,t):new VO(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var ZO=GO;GO.default=GO,KO.registerProcessor(GO),WO.registerProcessor(GO);let JO=ux,YO=yx,HO=Zx,$O=WE,XO=Nx,QO=YE,eA=tO;function tA(e,t){if(Array.isArray(e))return e.map(e=>tA(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:XO.prototype};r.map&&(r.map={...r.map,__proto__:YO.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>tA(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 QO(n);if("decl"===n.type)return new JO(n);if("rule"===n.type)return new eA(n);if("comment"===n.type)return new HO(n);if("atrule"===n.type)return new $O(n);throw new Error("Unknown node type: "+e.type)}var rA=tA;tA.default=tA;let nA=Kk,iA=ux,oA=_O,sA=sE,aA=ZO,lA=Xk,uA=rA,cA=hE,hA=gE,dA=Zx,pA=WE,fA=yE,gA=Nx,mA=fO,vA=$E,yA=tO,bA=YE,wA=sx;function SA(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new aA(e)}SA.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 aA).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return SA([i(r)]).process(e,t)},i},SA.stringify=lA,SA.parse=mA,SA.fromJSON=uA,SA.list=vA,SA.comment=e=>new dA(e),SA.atRule=e=>new pA(e),SA.decl=e=>new iA(e),SA.rule=e=>new yA(e),SA.root=e=>new bA(e),SA.document=e=>new cA(e),SA.CssSyntaxError=nA,SA.Declaration=iA,SA.Container=sA,SA.Processor=aA,SA.Document=cA,SA.Comment=dA,SA.Warning=hA,SA.AtRule=pA,SA.Result=fA,SA.Input=gA,SA.Rule=yA,SA.Root=bA,SA.Node=wA,oA.registerPostcss(SA);var CA=SA;SA.default=SA;const IA=Dk(CA);IA.stringify,IA.fromJSON,IA.plugin,IA.parse,IA.list,IA.document,IA.comment,IA.atRule,IA.rule,IA.decl,IA.root,IA.CssSyntaxError,IA.Declaration,IA.Container,IA.Processor,IA.Document,IA.Comment,IA.Warning,IA.AtRule,IA.Result,IA.Input,IA.Rule,IA.Root,IA.Node;class kA{constructor(...e){_k(this,"parentElement",null),_k(this,"parentNode",null),_k(this,"ownerDocument"),_k(this,"firstChild",null),_k(this,"lastChild",null),_k(this,"previousSibling",null),_k(this,"nextSibling",null),_k(this,"ELEMENT_NODE",1),_k(this,"TEXT_NODE",3),_k(this,"nodeType"),_k(this,"nodeName"),_k(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 kA))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 xA={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},EA={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},OA={};function AA(e){if(OA[e])return OA[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 xA?xA[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 EA?EA[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 OA[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?OA[e]=o:r}catch{return r}}const PA={};function TA(e,t,r){var n;const i=`${e}.${String(r)}`;if(PA[i])return PA[i].call(t);const o=AA(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(PA[i]=s,s.call(t)):t[r]}const RA={};function MA(e,t,r){const n=`${e}.${String(r)}`;if(RA[n])return RA[n].bind(t);const i=AA(e)[r];return"function"!=typeof i?t[r]:(RA[n]=i,i.bind(t))}function NA(){return AA("MutationObserver").constructor}const _A={childNodes:function(e){return TA("Node",e,"childNodes")},parentNode:function(e){return TA("Node",e,"parentNode")},parentElement:function(e){return TA("Node",e,"parentElement")},textContent:function(e){return TA("Node",e,"textContent")},contains:function(e,t){return MA("Node",e,"contains")(t)},getRootNode:function(e){return MA("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?TA("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?TA("Element",e,"shadowRoot"):null},querySelector:function(e,t){return TA("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return TA("Element",e,"querySelectorAll")(t)},mutationObserver:NA};function DA(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const LA="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 FA={map:{},getId:()=>(console.error(LA),-1),getNode:()=>(console.error(LA),null),removeNodeFromMap(){console.error(LA)},has:()=>(console.error(LA),!1),reset(){console.error(LA)}};function UA(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 jA(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)}}),()=>jA(e,t,o||{},!0)}function BA(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&&(FA=new Proxy(FA,{get:(e,t,r)=>("map"===t&&console.error(LA),Reflect.get(e,t,r))}));let zA=Date.now;function VA(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=_A.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=_A.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function qA(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function WA(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function KA(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:_A.parentElement(e)}function GA(e,t,r,n){if(!e)return!1;const i=KA(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(jw(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 ZA(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function JA(e,t){if(lw(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=_A.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||JA(n,t))}function YA(e){return Boolean(e.changedTouches)}function HA(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function $A(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function XA(e){return!!e&&(e instanceof kA&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(_A.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(zA=()=>(new Date).getTime());class QA{constructor(){Jb(this,"id",1),Jb(this,"styleIDMap",new WeakMap),Jb(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 eP(e){var t;let r=null;return"getRootNode"in e&&(null==(t=_A.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&_A.host(_A.getRootNode(e))&&(r=_A.host(_A.getRootNode(e))),r}function tP(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=eP(r);)r=t;return r}(e);return _A.contains(t,r)}function rP(e){const t=e.ownerDocument;return!!t&&(_A.contains(t,e)||tP(e))}var nP=(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))(nP||{}),iP=(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))(iP||{}),oP=(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))(oP||{}),sP=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(sP||{}),aP=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(aP||{}),lP=(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))(lP||{}),uP=(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))(uP||{});function cP(e){return"__ln"in e}class hP{constructor(){Jb(this,"length",0),Jb(this,"head",null),Jb(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&&cP(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&&cP(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 dP=(e,t)=>`${e}@${t}`;class pP{constructor(){Jb(this,"frozen",!1),Jb(this,"locked",!1),Jb(this,"texts",[]),Jb(this,"attributes",[]),Jb(this,"attributeMap",new WeakMap),Jb(this,"removes",[]),Jb(this,"mapRemoves",[]),Jb(this,"movedMap",{}),Jb(this,"addedSet",new Set),Jb(this,"movedSet",new Set),Jb(this,"droppedSet",new Set),Jb(this,"removesSubTreeCache",new Set),Jb(this,"mutationCb"),Jb(this,"blockClass"),Jb(this,"blockSelector"),Jb(this,"maskTextClass"),Jb(this,"maskTextSelector"),Jb(this,"inlineStylesheet"),Jb(this,"maskInputOptions"),Jb(this,"maskTextFn"),Jb(this,"maskInputFn"),Jb(this,"keepIframeSrcFn"),Jb(this,"recordCanvas"),Jb(this,"inlineImages"),Jb(this,"slimDOMOptions"),Jb(this,"dataURLOptions"),Jb(this,"doc"),Jb(this,"mirror"),Jb(this,"iframeManager"),Jb(this,"stylesheetManager"),Jb(this,"shadowDomManager"),Jb(this,"canvasManager"),Jb(this,"processedNodeManager"),Jb(this,"unattachedDoc"),Jb(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Jb(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new hP,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=_A.parentNode(i);if(!o||!rP(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=lw(o)?this.mirror.getId(eP(i)):this.mirror.getId(o),l=n(i);if(-1===a||-1===l)return r.addNode(i);const u=qw(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=>{HA(e,this.mirror)&&this.iframeManager.addIframe(e),$A(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),XA(i)&&this.shadowDomManager.addShadowRoot(_A.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)gP(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(_A.parentNode(e))||i(e);for(const e of this.addedSet)mP(this.droppedSet,e)||gP(this.removesSubTreeCache,e,this.mirror)?mP(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(_A.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(_A.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=_A.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=_A.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=_A.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))}),Jb(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(_A.childNodes(e),e=>_A.textContent(e)||"").join("");t.attributes.value=pw({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:mw(e),value:r,maskInputFn:this.maskInputFn})}),Jb(this,"processMutation",e=>{if(!ZA(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=_A.textContent(e.target);GA(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Bw(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,KA(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=mw(t);n=pw({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(GA(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"),!Uw(t.tagName,r))if(i.attributes[r]=Fw(this.doc,fw(t.tagName),fw(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(GA(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=lw(e.target)?this.mirror.getId(_A.host(e.target)):this.mirror.getId(e.target);GA(e.target,this.blockClass,this.blockSelector,!1)||ZA(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(fP(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||JA(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[dP(r,n)]?fP(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!lw(e.target)||!uw(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),_A.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Jb(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(ZA(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[dP(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);GA(e,this.blockClass,this.blockSelector,!1)||(_A.childNodes(e).forEach(e=>this.genAdds(e)),XA(e)&&_A.childNodes(_A.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 fP(e,t){e.delete(t),_A.childNodes(t).forEach(t=>fP(e,t))}function gP(e,t,r){return 0!==e.size&&function(e,t){const r=_A.parentNode(t);return!!r&&e.has(r)}(e,t)}function mP(e,t){return 0!==e.size&&vP(e,t)}function vP(e,t){const r=_A.parentNode(t);return!!r&&(!!e.has(r)||vP(e,r))}let yP;const bP=e=>{if(!yP)return e;return(...t)=>{try{return e(...t)}catch(e){if(yP&&!0===yP(e))return;throw e}}};function wP(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const SP=[];function CP(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 IP(e,t){const r=new pP;SP.push(r),r.init(e);const n=new(NA())(bP(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function kP({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(oP).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(o=>{let s=fw(o);const u=(t=>o=>{const s=CP(o);if(GA(s,n,i,!0))return;let a=null,u=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=sP.Mouse;break;case"touch":a=sP.Touch;break;case"pen":a=sP.Pen}a===sP.Touch?oP[t]===oP.MouseDown?u="TouchStart":oP[t]===oP.MouseUp&&(u="TouchEnd"):sP.Pen}else YA(o)&&(a=sP.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===sP.Touch||u.startsWith("Mouse")&&a===sP.Mouse)&&(a=null)):oP[t]===oP.Click&&(a=l,l=null);const c=YA(o)?o.changedTouches[0]:o;if(!c)return;const h=r.getId(s),{clientX:d,clientY:p}=c;bP(e)({type:oP[u],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(oP[o]){case oP.MouseDown:case oP.MouseUp:s=s.replace("mouse","pointer");break;case oP.TouchStart:case oP.TouchEnd:return}a.push(DA(s,u,t))}),bP(()=>{a.forEach(e=>e())})}function xP({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const s=bP(UA(bP(o=>{const s=CP(o);if(!s||GA(s,n,i,!0))return;const a=r.getId(s);if(s===t&&t.defaultView){const r=VA(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 DA("scroll",s,t)}const EP=["INPUT","TEXTAREA","SELECT"],OP=new WeakMap;function AP(e){return function(e,t){if(MP("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||MP("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||MP("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||MP("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 PP(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function TP({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(_A.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}}),bP(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function RP(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=IP(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=UA(bP(t=>{const r=Date.now()-s;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],s=null}),o),u=bP(UA(bP(e=>{const t=CP(e),{clientX:r,clientY:i}=YA(e)?e.changedTouches[0]:e;s||(s=zA()),a.push({x:r,y:i,id:n.getId(t),timeOffset:zA()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?iP.Drag:e instanceof MouseEvent?iP.MouseMove:iP.TouchMove)}),i,{trailing:!1})),c=[DA("mousemove",u,r),DA("touchmove",u,r),DA("drag",u,r)];return bP(()=>{c.forEach(e=>e())})}(e),o=kP(e),s=xP(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return DA("resize",bP(UA(bP(()=>{const t=qA(),i=WA();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=CP(e);const u=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=_A.parentElement(r)),!r||!h||EP.indexOf(h)<0||GA(r,n,i,!0))return;if(r.classList.contains(o)||s&&r.matches(s))return;let p=r.value,f=!1;const g=mw(r)||"";"radio"===g||"checkbox"===g?f=r.checked:(a[h.toLowerCase()]||a[g])&&(p=pw({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=OP.get(t);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){OP.set(t,n);const i=r.getId(t);bP(e)({...n,id:i})}}const p=("last"===u.input?["change"]:["input","change"]).map(e=>DA(e,bP(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=>jA(e[0],e[1],{set(){bP(h)({target:this,isTrusted:!1})}},!1,f))),bP(()=>{p.forEach(e=>e())})}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const s=bP(o=>UA(bP(i=>{const s=CP(i);if(!s||GA(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=[DA("play",s(lP.Play),o),DA("pause",s(lP.Pause),o),DA("seeked",s(lP.Seeked),o),DA("volumechange",s(lP.VolumeChange),o),DA("ratechange",s(lP.RateChange),o)];return bP(()=>{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:bP((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=PP(i,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:a}]}),wP(()=>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:bP((n,i,o)=>{const[s]=o,{id:a,styleId:l}=PP(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),wP(()=>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:bP((n,i,o)=>{const[s]=o,{id:a,styleId:l}=PP(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:bP((n,i,o)=>{const[s]=o,{id:a,styleId:l}=PP(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),n.apply(i,o)})}));const l={};NP("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(NP("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),NP("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),NP("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:bP((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=PP(i.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:[...AP(i),a||0]}]}),n.apply(i,o)})}),i.prototype.deleteRule=new Proxy(u[n].deleteRule,{apply:bP((n,i,o)=>{const[s]=o,{id:a,styleId:l}=PP(i.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...AP(i),s]}]}),n.apply(i,o)})})}),bP(()=>{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=TP(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:bP((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}=PP(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:AP(s.parentRule)}),i.apply(s,a)})});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:bP((i,o,a)=>{var l;const[u]=a;if(r.has(u))return s.apply(o,[u]);const{id:c,styleId:h}=PP(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:AP(o.parentRule)}),i.apply(o,a)})}),bP(()=>{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=BA(t.fonts,"add",function(t){return function(r){return setTimeout(bP(()=>{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),bP(()=>{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=bP(()=>{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;GA(s,n,i,!0)||GA(u,n,i,!0)||a.push({start:r.getId(s),startOffset:l,end:r.getId(u),endOffset:c})}o({ranges:a})});return a(),DA("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?BA(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 bP(()=>{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 MP(e){return void 0!==window[e]}function NP(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class _P{constructor(e){Jb(this,"iframeIdToRemoteIdMap",new WeakMap),Jb(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 DP{constructor(e){Jb(this,"iframes",new WeakMap),Jb(this,"crossOriginIframeMap",new WeakMap),Jb(this,"crossOriginIframeMirror",new _P(Aw)),Jb(this,"crossOriginIframeStyleMirror"),Jb(this,"crossOriginIframeRootIdMap",new WeakMap),Jb(this,"mirror"),Jb(this,"mutationCb"),Jb(this,"wrappedEmit"),Jb(this,"loadListener"),Jb(this,"stylesheetManager"),Jb(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new _P(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 nP.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:nP.IncrementalSnapshot,data:{source:iP.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case nP.Meta:case nP.Load:case nP.DomContentLoaded:return!1;case nP.Plugin:return t;case nP.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case nP.IncrementalSnapshot:switch(t.data.source){case iP.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 iP.Drag:case iP.TouchMove:case iP.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case iP.ViewportResize:return!1;case iP.MediaInteraction:case iP.MouseInteraction:case iP.Scroll:case iP.CanvasMutation:case iP.Input:return this.replaceIds(t.data,e,["id"]),t;case iP.StyleSheetRule:case iP.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case iP.Font:return t;case iP.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case iP.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===uP.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class LP{constructor(e){Jb(this,"shadowDoms",new WeakSet),Jb(this,"mutationCb"),Jb(this,"scrollCb"),Jb(this,"bypassOptions"),Jb(this,"mirror"),Jb(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(!uw(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=IP({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(xP({...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(_A.host(e))),this.restoreHandlers.push(TP({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(BA(e.prototype,"attachShadow",function(e){return function(n){const i=e.call(this,n),o=_A.shadowRoot(this);return o&&rP(this)&&r.addShadowRoot(o,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var FP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",UP="undefined"==typeof Uint8Array?[]:new Uint8Array(256),jP=0;jP<64;jP++)UP[FP.charCodeAt(jP)]=jP;const BP=new Map;const zP=(e,t,r)=>{if(!e||!WP(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=BP.get(e);return r||(r=new Map,BP.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 VP(e,t,r){if(e instanceof Array)return e.map(e=>VP(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+=FP[r[t]>>2],i+=FP[(3&r[t])<<4|r[t+1]>>4],i+=FP[(15&r[t+1])<<2|r[t+2]>>6],i+=FP[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:[VP(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:[VP(e.data,t,r),e.width,e.height]}}if(WP(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:zP(e,t,r)}}return e}const qP=(e,t,r)=>e.map(e=>VP(e,t,r)),WP=(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 KP(e,t,r,n){const i=[];try{const o=BA(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(i,...o){if(!GA(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 GP(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=BA(e,l,function(e){return function(...s){const a=e.apply(this,s);if(zP(a,o,this),"tagName"in this.canvas&&!GA(this.canvas,n,i,!0)){const e=qP(s,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});s.push(a)}catch{const n=jA(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(n)}return s}const ZP="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",JP="undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0)))(ZP)],{type:"text/javascript;charset=utf-8"});function YP(e){let t;try{if(t=JP&&(window.URL||window.webkitURL).createObjectURL(JP),!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,"+ZP,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class HP{constructor(e){Jb(this,"pendingCanvasMutations",new Map),Jb(this,"rafStamps",{latestId:0,invokeId:null}),Jb(this,"mirror"),Jb(this,"mutationCb"),Jb(this,"resetObservers"),Jb(this,"frozen",!1),Jb(this,"locked",!1),Jb(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=KP(t,r,n,!0),s=new Map,a=new YP;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:aP["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=>{GA(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=KP(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=BA(t.CanvasRenderingContext2D.prototype,s,function(i){return function(...o){return GA(this.canvas,r,n,!0)||setTimeout(()=>{const r=qP(o,t,this);e(this.canvas,{type:aP["2D"],property:s,args:r})},0),i.apply(this,o)}});i.push(o)}catch{const r=jA(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:aP["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(...GP(t.WebGLRenderingContext.prototype,aP.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...GP(t.WebGL2RenderingContext.prototype,aP.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 $P{constructor(e){Jb(this,"trackedLinkElements",new WeakSet),Jb(this,"mutationCb"),Jb(this,"adoptedStyleSheetCb"),Jb(this,"styleMirror",new QA),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:hw(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 XP{constructor(){Jb(this,"nodeMap",new WeakMap),Jb(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 QP,eT,tT,rT=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Kb=e.contentWindow)?void 0:Kb.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const nT=new dw;function iT(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:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:E=!1,inlineImages:O=!1,plugins:A,keepIframeSrcFn:P=()=>!1,ignoreCSSAttributes:T=new Set([]),errorHandler:R,applyBackgroundColorToBlockedElements:M=!1}=e;yP=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),nT.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};QP=(e,i)=>{var o;const s=e;if(s.timestamp=zA(),!(null==(o=SP[0])?void 0:o.isFrozen())||s.type===nP.FullSnapshot||s.type===nP.IncrementalSnapshot&&s.data.source===iP.Mutation||SP.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===nP.FullSnapshot)F=s,U=0;else if(s.type===nP.IncrementalSnapshot){if(s.data.source===iP.Mutation&&s.data.isAttachIframe)return;U++;const e=n&&U>=n,t=r&&s.timestamp-F.timestamp>r;(e||t)&&eT(!0)}};const B=e=>{QP({type:nP.IncrementalSnapshot,data:{source:iP.Mutation,...e}})},z=e=>QP({type:nP.IncrementalSnapshot,data:{source:iP.Scroll,...e}}),V=e=>QP({type:nP.IncrementalSnapshot,data:{source:iP.CanvasMutation,...e}}),q=new $P({mutationCb:B,adoptedStyleSheetCb:e=>QP({type:nP.IncrementalSnapshot,data:{source:iP.AdoptedStyleSheet,...e}})}),W=new DP({mirror:nT,mutationCb:B,stylesheetManager:q,recordCrossOriginIframes:I,wrappedEmit:QP});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:nT,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});const K=new XP;tT=new HP({recordCanvas:C,mutationCb:V,win:window,blockClass:i,blockSelector:o,mirror:nT,sampling:y.canvas,dataURLOptions:b});const G=new LP({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:tT,keepIframeSrcFn:P,processedNodeManager:K},mirror:nT});eT=(e=!1)=>{if(!S)return;QP({type:nP.Meta,data:{href:window.location.href,width:WA(),height:qA()}},e),q.reset(),G.init(),SP.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new dw,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 qw(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:nT,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=>{HA(e,nT)&&W.addIframe(e),$A(e,nT)&&q.trackLinkElement(e),XA(e)&&G.addShadowRoot(_A.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");QP({type:nP.FullSnapshot,data:{node:t,initialOffset:VA(window)}},e),SP.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&q.adoptStyleSheets(document.adoptedStyleSheets,nT.getId(document))};try{const e=[],t=e=>{var t;return bP(RP)({mutationCb:B,mousemoveCb:(e,t)=>QP({type:nP.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>QP({type:nP.IncrementalSnapshot,data:{source:iP.MouseInteraction,...e}}),scrollCb:z,viewportResizeCb:e=>QP({type:nP.IncrementalSnapshot,data:{source:iP.ViewportResize,...e}}),inputCb:e=>QP({type:nP.IncrementalSnapshot,data:{source:iP.Input,...e}}),mediaInteractionCb:e=>QP({type:nP.IncrementalSnapshot,data:{source:iP.MediaInteraction,...e}}),styleSheetRuleCb:e=>QP({type:nP.IncrementalSnapshot,data:{source:iP.StyleSheetRule,...e}}),styleDeclarationCb:e=>QP({type:nP.IncrementalSnapshot,data:{source:iP.StyleDeclaration,...e}}),canvasMutationCb:V,fontCb:e=>QP({type:nP.IncrementalSnapshot,data:{source:iP.Font,...e}}),selectionCb:e=>{QP({type:nP.IncrementalSnapshot,data:{source:iP.Selection,...e}})},customElementCb:e=>{QP({type:nP.IncrementalSnapshot,data:{source:iP.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:x,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:P,blockSelector:o,slimDOMOptions:L,dataURLOptions:b,mirror:nT,iframeManager:W,stylesheetManager:q,shadowDomManager:G,processedNodeManager:K,canvasManager:tT,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=>QP({type:nP.Plugin,data:{plugin:e.name,payload:t}})})))||[]},m)};W.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{eT(),e.push(t(document)),rT=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(DA("DOMContentLoaded",()=>{QP({type:nP.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&r()})),e.push(DA("load",()=>{QP({type:nP.Load,data:{}}),"load"===k&&r()},window))),()=>{e.forEach(e=>e()),K.destroy(),rT=!1,yP=void 0}}catch(e){console.warn(e)}}var oT;iT.addCustomEvent=(e,t)=>{if(!rT)throw new Error("please add custom event after start recording");QP({type:nP.Custom,data:{tag:e,payload:t}})},iT.freezePage=()=>{SP.forEach(e=>e.freeze())},iT.takeFullSnapshot=e=>{if(!rT)throw new Error("please take full snapshot after start recording");eT(e)},iT.mirror=nT,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(oT||(oT={}));var sT=Object.freeze({__proto__:null,record:iT}),aT=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}(),lT=Object.freeze({__proto__:null,NetworkObservers:aT});e.Identify=N,e.Revenue=K,e.Types=eo,e._setDiagnosticsSampleRate=ec,e.add=ic,e.createInstance=Xu,e.experiment=rc,e.extendSession=oc,e.flush=sc,e.getDeviceId=ac,e.getSessionId=lc,e.getUserId=uc,e.groupIdentify=cc,e.identify=hc,e.initAll=tc,e.logEvent=dc,e.remove=pc,e.reset=fc,e.revenue=gc,e.sessionReplay=nc,e.setDeviceId=mc,e.setGroup=vc,e.setOptOut=yc,e.setSessionId=bc,e.setTransport=wc,e.setUserId=Sc,e.track=Cc,Object.defineProperty(e,"__esModule",{value:!0})});
|