@amplitude/unified 1.0.0-feat-zoning-1223.0 → 1.0.0-feat-zoning-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +2 -2
- 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 +2 -2
- 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/library.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 +18 -19
|
@@ -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",x="li_fat_id",k="msclkid",C="rdt_cid",E="ttclid",O="twclid",I="wbraid",P={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},T=["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"],R=["authorization","cookie","set-cookie"],M=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var r=e[t];if(!A(t,r))return!1}return!0},A=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&&M(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 M(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},_=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||A(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 N,L=[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"}(N||(N={}));var D,U=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=N.Unknown),{event:e,code:t,message:r}},F=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=F();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("")},q=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,x,k,C;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&&(x=a.return)&&x.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(),k={error:y},[3,16];case 15:try{g&&!g.done&&(C=f.return)&&C.call(f)}finally{if(k)throw k.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 U(t,0,String(e))})}),Promise.all(w).then(function(e){var t=c(e,1)[0]||U(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}(),z=function(e,t){return o(o({},t),{event_type:i.IDENTIFY,user_properties:e.getUserProperties()})},V=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 q(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 V(this.dispatch(n))},e.prototype.identify=function(e,t){var r=z(e,t);return V(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 V(this.dispatch(s))},e.prototype.setGroup=function(e,t,r){var n=function(e,t,r){var n,s=new _;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 V(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 V(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),V())},e.prototype._addPlugin=function(e){return V(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)),V())},e.prototype._removePlugin=function(e){return V(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(U(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])}),L.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,U(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=U(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 V(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}(),$=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 M(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?o({},this.properties):{};return e[D.REVENUE_PRODUCT_ID]=this.productId,e[D.REVENUE_QUANTITY]=this.quantity,e[D.REVENUE_PRICE]=this.price,e[D.REVENUE_TYPE]=this.revenueType,e[D.REVENUE_CURRENCY]=this.currency,e[D.REVENUE]=this.revenue,e[D.RECEIPT]=this.receipt,e[D.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"}(D||(D={}));var K;!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"}(K||(K={}));var H="Amplitude Logger ",J=function(){function e(){this.logLevel=K.None}return e.prototype.disable=function(){this.logLevel=K.None},e.prototype.enable=function(e){void 0===e&&(e=K.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<K.Verbose||console.log("".concat(H,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<K.Warn||console.warn("".concat(H,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<K.Error||console.error("".concat(H,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<K.Debug||console.log("".concat(H,"[Debug]: ").concat(e.join(" ")))},e}(),G=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:g,logLevel:K.Warn,loggerProvider:new J,offline:!1,optOut:!1,serverUrl:m,serverZone:"US",useBatch:!1}},Y=function(){function e(e){var t,r,n,i;this._optOut=!1;var o=G();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=Q(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}(),X=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},Q=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=G().serverZone),void 0===r&&(r=G().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:G().serverZone;return{serverZone:n,serverUrl:X(n,r)}},Z=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function 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<K.Debug||!u||!l)return e.apply(i,o);var c={type:"invoke public method",name:t,args:o,stacktrace:te(1),time:{start:(new Date).toISOString()},states:{}};n&&c.states&&(c.states.before=n());var h=e.apply(i,o);return h&&h.promise?h.promise.then(function(){n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))}):(n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))),h}};function se(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var ae=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return a(this,void 0,void 0,function(){var r,n=this;return l(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(f,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(r=i.sent())&&r.length>0&&Promise.all(r.map(function(e){return n.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=B()),new Promise(function(r){var n={event:e,attempts:0,callback:function(e){return r(e)},timeout:0};t.queue.push(n),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter(function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)})},e.prototype.scheduleEvents=function(e){var t=this;e.forEach(function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)})},e.prototype.schedule=function(e){var t=this;if(!this.config.offline)return null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout?(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,void(this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e))):void 0},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),a(this,void 0,void 0,function(){var t,r,n,i=this;return l(this,function(o){switch(o.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],r=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):r.push(e)}),s=t,u=this.config.flushQueueSize,c=Math.max(u,1),n=s.reduce(function(e,t,r){var n=Math.floor(r/c);return e[n]||(e[n]=[]),e[n].push(t),e},[]),[4,n.reduce(function(t,r){return a(i,void 0,void 0,function(){return l(this,function(n){switch(n.label){case 0:return[4,t];case 1:return n.sent(),[4,this.send(r,e)];case 2:return[2,n.sent()]}})})},Promise.resolve())]);case 1:return o.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}var s,u,c})})},e.prototype.send=function(e,t){var r;return void 0===t&&(t=!0),a(this,void 0,void 0,function(){var n,i,o,a,u;return l(this,function(l){switch(l.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];n={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;return t.extra,s(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new Z,l.label=1;case 1:return l.trys.push([1,3,,4]),i=Q(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,n)];case 2:return null===(o=l.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleResponse(o,e),[3,4]):("body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(se(o))):this.fulfillRequest(e,o.statusCode,o.status),[2]);case 3:return a=l.sent(),u=(c=a)instanceof Error?c.message:String(c),this.config.loggerProvider.error(u),null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:u,stack_trace:te()}),this.handleResponse({status:N.Failed,statusCode:0},e),[3,4];case 4:return[2]}var c})})},e.prototype.handleResponse=function(e,t){var r;ee(e.statusCode)||null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:se(e),stack_trace:te()});var n=e.status;switch(n){case N.Success:this.handleSuccessResponse(e,t);break;case N.Invalid:this.handleInvalidResponse(e,t);break;case N.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case N.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(U(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},xe=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[p,t,e.substring(0,r)].filter(Boolean).join("_")},ke=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:""},Ce=function(){var e,t=F();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=Ee(r[0]),i=Ee(r[1]);return i?(e[n]=i,e):e},{}):{}},Ee=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},Oe=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},Ie=function(e,t){var r=e;try{r=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return r},Pe=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},Te=function(e,t){var r=Pe(e.toString());return 31*Math.abs(r)%1e5/1e5<t},Re=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}(),Me=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(!F())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=Ae(r))&&void 0!==t?t:_e(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=F(),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=F())&&(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}(),Ae=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},_e=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},Ne=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[p,t,e.substring(0,r)].filter(Boolean).join("_")},Le=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return a(this,void 0,void 0,function(){var t,r,n;return l(this,function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return i.sent(),[4,r.get(n)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return a(this,void 0,void 0,function(){var t;return l(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=r.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return r.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return a(this,void 0,void 0,function(){return l(this,function(r){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var r;return a(this,void 0,void 0,function(){return l(this,function(n){try{null===(r=this.storage)||void 0===r||r.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return a(this,void 0,void 0,function(){return l(this,function(r){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return a(this,void 0,void 0,function(){return l(this,function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]})})},e}(),De="tags",Ue="counters",Fe="histograms",je="events",Be="internal",qe="last_flush_timestamp",ze=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=F())||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(De)||e.createObjectStore(De,{keyPath:"key"}),e.objectStoreNames.contains(Ue)||e.createObjectStore(Ue,{keyPath:"key"}),e.objectStoreNames.contains(Fe)||e.createObjectStore(Fe,{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([De],"readwrite"),n=r.objectStore(De),[2,new Promise(function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tags",e),t()},i.forEach(function(e){var t=c(e,2),r=t[0],i=t[1];n.put({key:r,value:i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tag",r,i,e)}})})];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",i),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return a(this,void 0,void 0,function(){var t,r,n,i,o=this;return l(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([Ue],"readwrite"),n=r.objectStore(Ue),[2,new Promise(function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to increment counters",e),t()},i.forEach(function(e){var t=c(e,2),r=t[0],i=t[1],s=n.get(r);s.onsuccess=function(){var e=s.result,t=e?e.value:0;n.put({key:r,value:t+i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to update counter",r,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing counter",r,e)}})})];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",i),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return a(this,void 0,void 0,function(){var t,r,n,i,o=this;return l(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),r=t.transaction([Fe],"readwrite"),n=r.objectStore(Fe),[2,new Promise(function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set 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(qe)];case 1:return[2,(e=r.sent())?parseInt(e.value,10):void 0];case 2:return t=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(e){return a(this,void 0,void 0,function(){var t;return l(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.setInternal(qe,e.toString())];case 1:return r.sent(),[3,3];case 2:return t=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(e,t){return new Promise(function(r,n){var i=e.objectStore(t).clear();i.onsuccess=function(){return r()},i.onerror=function(){return n(new Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return a(this,void 0,void 0,function(){var e,t,r,n,i,o,s,a;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=l.sent(),t=e.transaction([De,Ue,Fe,je],"readwrite"),[4,Promise.all([this.getAllFromStore(t,De),this.getAllFromStore(t,Ue),this.getAllFromStore(t,Fe),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,Ue),this.clearTable(t,Fe),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}(),Ve=function(e){var t,r=null==(t=F())?void 0:t.__AMPLITUDE_SCRIPT_URL__;if(r)return e.filename&&e.filename.includes(r)?"filename":e.stack&&e.stack.includes(r)?"stack":void 0},We=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},$e=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},Ke=3e5,He=1e4,Je=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=Te(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,ze.isSupported()?this.storage=new ze(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),function(e){var t=F();if(t&&"function"==typeof t.addEventListener){var r=function(t){e.recordEvent("sdk.error.uncaught",o({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",function(e){var t=e.error instanceof Error?e.error:void 0,n=null==t?void 0:t.stack,i=Ve({filename:e.filename,stack:n});i&&r({type:"error",message:e.message,stack:n,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})},!0),t.addEventListener("unhandledrejection",function(e){var t,n=e.reason instanceof Error?e.reason:void 0,i=null==n?void 0:n.stack,o=We(i),s=Ve({filename:o,stack:i});s&&r({type:"unhandledrejection",message:null!==(t=null==n?void 0:n.message)&&void 0!==t?t:$e(e.reason),stack:i,filename:o,errorName:null==n?void 0:n.name,metadata:{isTrusted:e.isTrusted,matchReason:s}})},!0)}}(this))}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>=He?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>=He?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>=He)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})},Ke))},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]),!F())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(Ke),[2]):(r=e-t)>=Ke?(this._flush(),[2]):(this._setFlushTimer(Ke-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=Te(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,x;if("object"!=typeof e)return null;var k=e.code||0,C=this.buildStatus(k);switch(C){case N.Success:return{status:C,statusCode:k,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 N.Invalid:return{status:C,statusCode:k,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 N.PayloadTooLarge:return{status:C,statusCode:k,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case N.RateLimit:return{status:C,statusCode:k,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!==(x=e.throttled_events)&&void 0!==x?x:[]}};case N.Timeout:default:return{status:C,statusCode:k}}},e.prototype.buildStatus=function(e){return ee(e)?N.Success:429===e?N.RateLimit:413===e?N.PayloadTooLarge:408===e?N.Timeout:e>=400&&e<500?N.Invalid:e>=500?N.Failed:N.Unknown},e}(),Ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,function(){var r,n,i;return l(this,function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=o.sent()).text()];case 2:i=o.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}})})},t}(Ge),Xe=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}(),Qe=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new Xe(e,t)}return e.prototype.subscribe=function(e,t,r){var n=B(),i={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),n},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return a(this,void 0,void 0,function(){var e,t=this;return l(this,function(r){switch(r.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise||(this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null})),this.fetchPromise},e.prototype.subscribeAll=function(e){return a(this,void 0,void 0,function(){var t,r,n,i=this;return l(this,function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return a(this,void 0,void 0,function(){var r,n;return l(this,function(i){switch(i.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(n=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),a(this,void 0,void 0,function(){var r,n,i,o,s,a,u=this;return l(this,function(c){switch(c.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},i=function(n){var i,s,a,c,h;return l(this,function(l){switch(l.label){case 0:i=new AbortController,s=setTimeout(function(){return i.abort()},t),l.label=1;case 1:return l.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:return(a=l.sent()).ok?[3,4]:[4,a.text()];case 3:return c=l.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(a.status,": ").concat(c)),[3,6];case 4:return[4,a.json()];case 5:return[2,{value:{remoteConfig:l.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(h=l.sent())instanceof Error&&"AbortError"===h.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),h),[3,9];case 8:return clearTimeout(s),[7];case 9:return n<e-1?[4,new Promise(function(e){return setTimeout(e,u.getJitterDelay(r))})]:[3,11];case 10:l.sent(),l.label=11;case 11:return[2]}})},o=this,s=0,c.label=1;case 1:return s<e?[5,i(s)]:[3,4];case 2:if("object"==typeof(a=c.sent()))return[2,a.value];c.label=3;case 3:return s++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}();!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(ge||(ge={}));var Ze=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],et="data-amp-track-",tt=["div","span","h1","h2","h3","h4","h5","h6"],rt=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),nt=["*"];function it(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function ot(e,t,r){e&&st({json:e,allowlist:t.map(at),excludelist:r.map(at),ancestors:[]})}function st(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);it(i[m])?ut(v,o)&&!ut(v,s)||delete i[m]:st({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 at(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function lt(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(lt(e,t,o,n+1))return!0;return!1}return("*"===i||i===e[r])&<(e,t,r+1,n+1)}function ut(e,t){return t.some(function(t){return lt(e,t)})}var ct=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 yt(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=F();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=dt(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,mt(this.body,e,t)]})})},e}(),ht=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),yt(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return dt(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,mt(this.body,e,t)]})})},e}();function dt(e,t){var r,n,i,o=F(),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 pt,ft=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}),yt(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,mt(r.sent(),e,t)]}})})},e}(),gt=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 yt(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())?(ot(r,e,t),[2,r]):[2,null]})})},e}();function mt(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return ot(n,t,r),n}catch(e){return null}}!function(e){e.REDACT="redact",e.REMOVE="remove"}(pt||(pt={}));var vt="[REDACTED]",yt=function(e,t){var r,n,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?pt.REMOVE:s,l=h([],c(R),!1),d={},p=function(t){var r=t.toLowerCase();l.find(function(e){return e.toLowerCase()===r})?a===pt.REDACT&&(d[t]=vt):o.find(function(e){return e.toLowerCase()===r})?d[t]=e[t]:a===pt.REDACT&&(d[t]=vt)};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},bt=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(T),!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(T),!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 wt=function(e,t){void 0===t&&(t=B()),this.callback=e,this.id=t},St=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=F();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=F();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 bt(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 ct(n):void 0,i?new ft(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 gt(i.status,t,r?parseInt(r,10):void 0,o),u=i.$$AmplitudeAnalyticsEvent.headers,c=new ht(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}(),xt=new St,kt=function(){function e(){}return e.prototype.parse=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return[2,o(o(o(o({},P),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=Ce();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=Ce();return(e={})[v]=t[v],e[y]=t[y],e[b]=t[b],e[w]=t[w],e[S]=t[S],e[x]=t[x],e[k]=t[k],e[C]=t[C],e[E]=t[E],e[O]=t[O],e[I]=t[I],e},e}(),Ct="data-amp-mask",Et="*****",Ot=/\b(?:\d[ -]*?){13,16}\b/,It=/(\d{3}-?\d{2}-?\d{4})/g,Pt=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Tt=function(e,t){var r,n;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var i=e;i=(i=(i=i.replace(Ot,Et)).replace(It,Et)).replace(Pt,Et);try{for(var o=u(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,Et)}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},Rt=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(Ct)?Et:e?e(document.title):document.title};function Mt(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 At(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 At(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 At(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 _t(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 Nt(e,t,r){return t&&_t(e.prototype,t),r&&_t(e,r),e}var Lt=function(){return"function"==typeof Symbol},Dt=function(e){return Lt()&&Boolean(Symbol[e])},Ut=function(e){return Dt(e)?Symbol[e]:"@@"+e};Lt()&&!Dt("observable")&&(Symbol.observable=Symbol("observable"));var Ft=Ut("iterator"),jt=Ut("observable"),Bt=Ut("species");function qt(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function zt(e){var t=e.constructor;return void 0!==t&&null===(t=t[Bt])&&(t=void 0),void 0!==t?t:Qt}function Vt(e){return e instanceof Qt}function Wt(e){Wt.log?Wt.log(e):setTimeout(function(){throw e})}function $t(e){Promise.resolve().then(function(){try{e()}catch(e){Wt(e)}})}function Kt(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=qt(t,"unsubscribe");r&&r.call(t)}}catch(e){Wt(e)}}function Ht(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Jt(e,t,r){e._state="running";var n=e._observer;try{var i=qt(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(Ht(e),!i)throw r;i.call(n,r);break;case"complete":Ht(e),i&&i.call(n)}}catch(e){Wt(e)}"closed"===e._state?Kt(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 $t(function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(Jt(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)})):void Jt(e,t,r);e._queue.push({type:t,value:r})}}var Yt=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var r=new Xt(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&&(Ht(this),Kt(this))},Nt(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),Xt=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")},Nt(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),Qt=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 Yt(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(zt(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(zt(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=zt(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=zt(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=zt(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[jt]=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=qt(t,jt);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return Vt(i)&&i.constructor===r?i:new r(function(e){return i.subscribe(e)})}if(Dt("iterator")&&(n=qt(t,Ft)))return new r(function(e){$t(function(){if(!e.closed){for(var r,i=Mt(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){$t(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){$t(function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}})})},Nt(e,null,[{key:Bt,get:function(){return this}}]),e}();function Zt(e,t){return new Qt(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 er(e,t){return new Qt(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 tr(e){var t=new Set,r=null;function n(){null==r||r.unsubscribe(),r=null,t.clear()}return new Qt(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)}})}Lt()&&Object.defineProperty(Qt,Symbol("extensions"),{value:{symbol:jt,hostReportError:Wt},configurable:!0});var rr=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},nr=function(e){return rr(e,"attribution")},ir=function(e){return rr(e,"pageViews")},or=function(e){return rr(e,"sessions")},sr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},ar=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},lr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},ur=function(e){if(ar(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},cr=function(e){if(lr(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},hr=function(e){var t;if(sr(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})})}},dr=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return ir(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}},pr=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},fr=function(e){return e&&void 0!==e._q},gr="2.32.3-feat-zoning-1223.0",mr="amplitude-ts",vr=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(mr,"/").concat(gr),"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:ke()}),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}(),yr=1e3,br=function(e){function t(t){var r,n,i,o=this;try{i=null===(r=F())||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>yr?(i=r.length-yr,[4,e.prototype.set.call(this,t,r.slice(0,yr))]):[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(yr,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,r)];case 3:o.sent(),o.label=4;case 4:return[2]}})})},t}(Le),wr=function(e){function t(){var t;return e.call(this,null===(t=F())||void 0===t?void 0:t.sessionStorage)||this}return r(t,e),t}(Le),Sr=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),xr=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=F();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),kr=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:Er(a),sessionId:Cr(h),lastEventId:Cr(f),lastEventTime:Cr(d),optOut:Boolean(u)}]}})})},Cr=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Er=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},Or="[Amplitude]",Ir="".concat(Or," Form Started"),Pr="".concat(Or," Form Submitted"),Tr="".concat(Or," File Downloaded"),Rr="session_start",Mr="session_end",Ar="".concat(Or," File Extension"),_r="".concat(Or," File Name"),Nr="".concat(Or," Link ID"),Lr="".concat(Or," Link Text"),Dr="".concat(Or," Link URL"),Ur="".concat(Or," Form ID"),Fr="".concat(Or," Form Name"),jr="".concat(Or," Form Destination"),Br="cookie",qr=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,x,k,C,E,O,I,P,T,R,M,A,_,N,L,D,U,F,j,B){void 0===n&&(n=new Re),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=Br),void 0===m&&(m=new J),void 0===v&&(v=K.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===k&&(k=""),void 0===C&&(C="US"),void 0===O&&(O=18e5),void 0===I&&(I=new br({loggerProvider:m})),void 0===P&&(P={ipAddress:!0,language:!0,platform:!0}),void 0===T&&(T="fetch"),void 0===R&&(R=!1),void 0===M&&(M=!0),void 0===U&&(U=!0),void 0===F&&(F=0);var q,z=e.call(this,{apiKey:t,storageProvider:I,transportProvider:Wr(T)})||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=x,z.serverUrl=k,z.serverZone=C,z.sessionTimeout=O,z.storageProvider=I,z.trackingOptions=P,z.transport=T,z.useBatch=R,z.fetchRemoteConfig=M,z.networkTrackingOptions=L,z.identify=D,z.enableDiagnostics=U,z.diagnosticsSampleRate=F,z.diagnosticsClient=j,z.remoteConfig=B,z.version=gr,z._optOut=!1,z._cookieStorage=n,z.deviceId=a,z.lastEventId=f,z.lastEventTime=g,z.optOut=w,z.sessionId=E,z.pageCounter=_,z.userId=A,z.debugLogsEnabled=N,z.loggerProvider.enable(N?K.Debug:z.logLevel),z.networkTrackingOptions=L,z.identify=D,z.enableDiagnostics=U,z.diagnosticsSampleRate=F,z.diagnosticsClient=j,q=!0===(null==B?void 0:B.fetchRemoteConfig)||!1!==(null==B?void 0:B.fetchRemoteConfig)&&!1!==M,z.remoteConfig=z.remoteConfig||{},z.remoteConfig.fetchRemoteConfig=q,z.fetchRemoteConfig=q,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(xe(this.apiKey),e)},t}(Y),zr=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,x,k,C,E,O,I,P,T,R,M,A,_,N,L,D,U,F,j,q,z,V,W,$,K,H,J,G,Y;return l(this,function(l){switch(l.label){case 0:return n=t.identityStorage||Br,E={},n===Br?[3,1]:(s="",[3,5]);case 1:return null===(I=null===(O=t.cookieOptions)||void 0===O?void 0:O.domain)||void 0===I?[3,2]:(a=I,[3,4]);case 2:return[4,$r()];case 3:a=l.sent(),l.label=4;case 4:s=a,l.label=5;case 5:return i=o.apply(void 0,[(E.domain=s,E.expiration=365,E.sameSite="Lax",E.secure=!1,E.upgrade=!0,E),t.cookieOptions]),u=Vr(t.identityStorage,i),[4,kr(e,u,null===(T=null===(P=t.cookieOptions)||void 0===P?void 0:P.upgrade)||void 0===T||T)];case 6:return c=l.sent(),[4,u.get(xe(e))];case 7:return h=l.sent(),d=Ce(),p=d.ampTimestamp?Number(d.ampTimestamp):void 0,f=!p||Date.now()<p,g=null!==(N=null!==(_=null!==(A=null!==(R=t.deviceId)&&void 0!==R?R:f?null!==(M=d.ampDeviceId)&&void 0!==M?M:d.deviceId:void 0)&&void 0!==A?A:null==h?void 0:h.deviceId)&&void 0!==_?_:c.deviceId)&&void 0!==N?N:B(),m=null!==(L=null==h?void 0:h.lastEventId)&&void 0!==L?L:c.lastEventId,v=null!==(D=null==h?void 0:h.lastEventTime)&&void 0!==D?D:c.lastEventTime,y=null!==(F=null!==(U=t.optOut)&&void 0!==U?U:null==h?void 0:h.optOut)&&void 0!==F?F:c.optOut,b=null!==(j=null==h?void 0:h.sessionId)&&void 0!==j?j:c.sessionId,w=null!==(z=null!==(q=t.userId)&&void 0!==q?q:null==h?void 0:h.userId)&&void 0!==z?z:c.userId,r.previousSessionDeviceId=null!==(V=null==h?void 0:h.deviceId)&&void 0!==V?V:c.deviceId,r.previousSessionUserId=null!==(W=null==h?void 0:h.userId)&&void 0!==W?W:c.userId,S={ipAddress:null===(K=null===($=t.trackingOptions)||void 0===$?void 0:$.ipAddress)||void 0===K||K,language:null===(J=null===(H=t.trackingOptions)||void 0===H?void 0:H.language)||void 0===J||J,platform:null===(Y=null===(G=t.trackingOptions)||void 0===G?void 0:G.platform)||void 0===Y||Y},x=null==h?void 0:h.pageCounter,k=null==h?void 0:h.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(C=new qr(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,x,k,t.networkTrackingOptions,t.identify,t.enableDiagnostics,r._diagnosticsSampleRate,void 0,t.remoteConfig)).storageProvider.isEnabled()];case 8:return l.sent()||(C.loggerProvider.warn("Storage provider ".concat(C.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),C.storageProvider=new Re),[2,C]}})})},Vr=function(e,t){switch(void 0===e&&(e=Br),void 0===t&&(t={}),e){case"localStorage":return new br;case"sessionStorage":return new wr;case"none":return new Re;default:return new Me(o(o({},t),{expirationDays:t.expiration}))}},Wr=function(e){return"xhr"===e?new Sr:"beacon"===e?new xr:new Ye},$r=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 Me).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 Me({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,""]}})})},Kr=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},Hr="AMP_PAGE_VIEW",Jr=function(e){var t;void 0===e&&(e={});var r,n,i=F(),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":Rt(Tt),"[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=Xr(d,e,y||"")&&v(),y=e,r?(i=void 0,n&&(i=B(),n.set(Hr,{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 Le(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(Hr,{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&&Yr(e)?(null==s||s.log("Enriching campaign event to page view event with campaign parameters"),t=void 0,n?[4,n.get(Hr)]:[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=Kr,[4,(new kt).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},Yr=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(P).every(function(e){return o.includes(e)})}return!1},Xr=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},Qr=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=en(e);t||n.track(Ir,((r={})[Ur]=Zr(e.id),r[Fr]=Zr(e.name),r[jr]=i,r)),t=!0}),r(e,"submit",function(){var r,i,o=en(e);t||n.track(Ir,((r={})[Ur]=Zr(e.id),r[Fr]=Zr(e.name),r[jr]=o,r)),n.track(Pr,((i={})[Ur]=Zr(e.id),i[Fr]=Zr(e.name),i[jr]=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=F())?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]})})}}},Zr=function(e){if("string"==typeof e)return e},en=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},tn=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(Tr,((t={})[Ar]=s,t[_r]=r.pathname,t[Nr]=e.id,t[Lr]=e.text,t[Dr]=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=F())?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]})})}}},rn=!1,nn=function(){var e=F(),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 on(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),on(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 x=S.value;try{for(var k=(o=void 0,u(["responseHeaders","requestHeaders"])),C=k.next();!C.done;C=k.next()){var E=C.value,O=null!==(p=x[E])&&void 0!==p?p:{},I=O.captureSafeHeaders,P=O.allowlist;(I||P)&&(void 0===P||Array.isArray(P)?x[E]=h(h([],c(I?T:[]),!1),c(null!=P?P:[]),!1):delete x[E])}}catch(e){o={error:e}}finally{try{C&&!C.done&&(s=k.return)&&s.call(k)}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 R=null===(f=e.autocapture)||void 0===f?void 0:f.frustrationInteractions;R&&(R.rageClick&&(R.rageClicks=R.rageClick,delete R.rageClick),R.deadClick&&(R.deadClicks=R.deadClick,delete R.deadClick))}}function sn(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 an(e,t){var r,n,i,s,a,l,c;if(e){on(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=sn(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=sn(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 ln="1.19.0-feat-zoning-1223.0",un="[Amplitude] Element Clicked",cn="[Amplitude] Element Tag",hn="[Amplitude] Element Text",dn="[Amplitude] Page URL",pn="[Amplitude] Viewport Height",fn="[Amplitude] Viewport Width",gn="[Amplitude] Page View ID",mn="https://app.amplitude.com",vn={US:mn,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},yn="data-amp-mask-attributes",bn=["input","select","textarea"],wn=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},Sn=function(e,t,r){return void 0===r&&(r=!1),function(n,i){var o,s,a=e.pageUrlAllowlist,l=e.pageUrlExcludelist,u=e.shouldTrackEventResolver,c=null===(s=null===(o=null==i?void 0:i.tagName)||void 0===o?void 0:o.toLowerCase)||void 0===s?void 0:s.call(o);if(!c)return!1;if(u)return u(n,i);if(!Oe(window.location.href,a))return!1;if(l&&l.length>0&&Oe(window.location.href,l))return!1;var h=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof h)switch(h.toLowerCase()){case"hidden":case"password":return!1}var d=wn(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}}},xn=function(e){return e?e.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[]},kn=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},{})},Cn=function(){var e;try{var t=F(),r=null===(e=null==t?void 0:t.sessionStorage)||void 0===e?void 0:e.getItem("AMP_PAGE_VIEW");if(!r)return;var n=JSON.parse(r);if("string"==typeof n.pageViewId)return n.pageViewId}catch(e){}},En=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:En(null==e?void 0:e.parentElement,t):null};var On=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};var In=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",yn,Ct]),Pn=["type"],Tn=["svg","path","g"],Rn=["password","hidden"];function Mn(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!In.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!bn.includes(i)&&!o}(e);if(!Rn.includes(String(e.getAttribute("type")))&&!Tn.includes(l))try{for(var y=u(m),b=y.next();!b.done;b=y.next()){var w=b.value;v&&!Pn.includes(w.name)||(t.has(w.name)?g[w.name]=Et: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 An=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}})},_n=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),Nn=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 _n(h(o),!0);var s=e.tagName.toLowerCase();if("body"===s||"head"===s||"html"===s)return new _n(s,!0)}var a=e.tagName.toLowerCase();if(o)return new _n(a+h(o),!0);var l=e.parentNode;if(!l||l.nodeType===Node.DOCUMENT_NODE)return new _n(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),x=0;x<S.length;++x){var k=S[x];if(w.has(k)&&(w.delete(k),!w.size)){f=!0;break}}else f=!0}}else g=m}var C=a;if(r&&"input"===a.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(C+="[type="+CSS.escape(e.getAttribute("type")||"")+"]"),f)C+=":nth-child("+String(g+1)+")";else if(p)try{for(var E=u(d),O=E.next();!O.done;O=E.next()){var I=O.value;C+="."+CSS.escape(I.slice(1))}}catch(e){n={error:e}}finally{try{O&&!O.done&&(i=E.return)&&i.call(E)}finally{if(n)throw n.error}}return new _n(C,!1)},Ln=function(e,t){var r,n,i,o=this;this.replaceSensitiveString=function(e){return Tt(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=xn(f.getAttribute(yn)),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 Mn(e,null!==(t=d.get(e))&&void 0!==t?t:new Set)});var y=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var r=c(t,2),n=r[0],i=r[1];e.attrs&&(e.attrs[n]=o.replaceSensitiveString(i))})};try{for(var b=u(s),w=b.next();!w.done;w=b.next())y(w.value)}catch(e){t={error:e}}finally{try{w&&!w.done&&(r=b.return)&&r.call(b)}finally{if(t)throw t.error}}var S=performance.now();return null===(i=o.diagnosticsClient)||void 0===i||i.recordHistogram("autocapturePlugin.getHierarchy",S-a),s},this.getNearestLabel=function(e){var t,r=e.parentElement;if(!r)return"";try{t=r.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?o.getText(t):o.getNearestLabel(r)},this.getElementPath=function(e){var t;if(!e)return"";var r=performance.now(),n=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var r=[],n=e;n;){var i=Nn(n,Boolean(t),n===e);if(!i)break;if(r.push(i),i.optimized)break;n=n.parentElement}return r.reverse(),r.join(" > ")}(e),i=performance.now();return null===(t=o.diagnosticsClient)||void 0===t||t.recordHistogram("autocapturePlugin.getElementPath",i-r),n},this.getEventProperties=function(e,t,r){var n,i,s,a,l,u,h=null===(s=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===s?void 0:s.call(i),d="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},p=o.getHierarchy(t),f=null===(a=p[0])||void 0===a?void 0:a.attrs,g=o.getNearestLabel(t),m=(l=null!=f?f:{},u=r,Object.entries(l).reduce(function(e,t){var r=c(t,2),n=r[0],i=r[1];if(n.startsWith(u)){var o=n.replace(u,"");o&&(e[o]=i||"")}return e},{})),v=((n={})["[Amplitude] Element Hierarchy"]=p,n[cn]=h,n[hn]=o.getText(t),n["[Amplitude] Element Position Left"]=null==d.left?null:Math.round(d.left),n["[Amplitude] Element Position Top"]=null==d.top?null:Math.round(d.top),n["[Amplitude] Element Attributes"]=m,n["[Amplitude] Element Path"]=o.getElementPath(t),n["[Amplitude] Element Parent Label"]=g,n[dn]=Ie(window.location.href.split("?")[0]),n["[Amplitude] Page Title"]=Rt(o.replaceSensitiveString),n[pn]=window.innerHeight,n[fn]=window.innerWidth,n),y=Cn();if(y&&(v[gn]=y),v["[Amplitude] Element ID"]=t.getAttribute("id")||"",v["[Amplitude] Element Class"]=t.getAttribute("class"),v["[Amplitude] Element Aria Label"]=null==f?void 0:f["aria-label"],"a"===h&&"click"===e&&t instanceof HTMLAnchorElement){var b=t.href.substring(0,128);v["[Amplitude] Element Href"]=o.replaceSensitiveString(b)}return kn(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&&wn(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,n),s;var a=En(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(Ct,"]")))return Et;var t="";if(e.querySelector("[".concat(Ct,"], [contenteditable]"))){var r=e.cloneNode(!0);r.querySelectorAll("[".concat(Ct,"], [contenteditable]")).forEach(function(e){e.innerText=Et}),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={})[cn]=i,t[hn]=o.getText(e),t[dn]=window.location.href.split("?")[0],t);return kn(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},Dn=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?mn:t,n=this;this.endpoint=mn,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};return 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)})},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 Ln({})}: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===mn&&(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:ln}}}),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 Un,Fn=function(){return new Qt(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()}})},jn=function(e){return void 0===e&&(e="click"),new Qt(function(t){var r,n=function(e){t.next(e)};return null===(r=F())||void 0===r||r.document.addEventListener(e,n,{capture:!0}),function(){var t;null===(t=F())||void 0===t||t.document.removeEventListener(e,n,{capture:!0})}})},Bn={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},qn=function(e){var t,r,n,i,o=Object.values(Bn).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=Bn[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},zn=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},Vn=function(e,t){return t.filter(function(t){return t.definition.some(function(t){return Bn[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)})})})},Wn=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=Vn(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;An(l.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=r},e}();!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.ScrollObservable="scrollObservable",e.ExposureObservable="exposureObservable"}(Un||(Un={}));var $n=function(e,t){var r,n,i,s,d,p,f,g;void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",ln);var m=e.dataAttributePrefix,v=void 0===m?et:m,y=e.visualTaggingOptions,b=void 0===y?{enabled:!0,messenger:new Dn}:y;e.cssSelectorAllowlist=null!==(r=e.cssSelectorAllowlist)&&void 0!==r?r:Ze,e.actionClickAllowlist=null!==(n=e.actionClickAllowlist)&&void 0!==n?n:tt,e.debounceTime=null!==(i=e.debounceTime)&&void 0!==i?i:0,e.pageUrlExcludelist=null===(s=e.pageUrlExcludelist)||void 0===s?void 0:s.reduce(function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(r){return console.warn("Invalid regex pattern: ".concat(t.pattern),r),e}return e},[]);var w,S="@amplitude/plugin-autocapture-browser",x=[],k=new Ln(e,t),C=new Set,E=new Set,O=function(){var t,r,n=tr(jn().map(function(t){return k.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,v)})),i=tr(new Qt(function(t){var r,n=function(r){var n=k.addAdditionalEventProperties(r,"change",e.cssSelectorAllowlist,v);t.next(n)};return null===(r=F())||void 0===r||r.document.addEventListener("change",n,{capture:!0}),function(){var e;return null===(e=F())||void 0===e?void 0:e.document.removeEventListener("change",n)}}));window.navigation&&(r=tr(new Qt(function(t){var r=function(r){var n=k.addAdditionalEventProperties(r,"navigate",e.cssSelectorAllowlist,v);t.next(n)};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}})));var o=tr(Fn().map(function(t){return k.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,v)})),s=new Qt(function(e){var t,r=function(t){e.next(t)};return null===(t=F())||void 0===t||t.window.addEventListener("scroll",r),function(){var e;null===(e=F())||void 0===e||e.window.removeEventListener("scroll",r)}}),a=function(e,t){return new Qt(function(r){var n,i=F();if(!(null==i?void 0:i.IntersectionObserver))return console.log("IntersectionObserver not supported"),function(){};var o=new IntersectionObserver(function(e){e.forEach(function(e){r.next(e)})},{root:null,rootMargin:"0px",threshold:1}),s=t.join(",");return(null!==(n=null==i?void 0:i.document.querySelectorAll(s))&&void 0!==n?n:[]).forEach(function(e){o.observe(e)}),e.subscribe(function(e){return e.event.forEach(function(e){return e.addedNodes.forEach(function(e){return e instanceof Element&&o.observe(e)})})}),function(){o.disconnect()}})}(o,e.cssSelectorAllowlist);return(t={})[Un.ChangeObservable]=i,t[Un.ClickObservable]=n,t[Un.MutationObservable]=o,t[Un.NavigateObservable]=r,t[Un.ScrollObservable]=s,t[Un.ExposureObservable]=a,t},I=qn(Object.values(null!==(p=null===(d=e.pageActions)||void 0===d?void 0:d.labeledEvents)&&void 0!==p?p:{})),P=zn(null!==(g=null===(f=e.pageActions)||void 0===f?void 0:f.triggers)&&void 0!==g?g:[]),T=function(e,t,r,n){return new Wn(e,t,r,n)}(I,P,k,e);return{name:S,type:"enrichment",setup:function(t,r){return a(void 0,void 0,void 0,function(){var n,i,s,a,u,d,p,f,g,m,y,R,M,A,_,N,L,D,U,j,B;return l(this,function(l){return"undefined"==typeof document||(n=!1,i={maxX:void 0,maxY:void 0},t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("analyticsSDK.pageActions","all",function(t){!function(t){var r,n;t&&(e.pageActions=o(o({},e.pageActions),t),I=qn(Object.values(null!==(r=e.pageActions.labeledEvents)&&void 0!==r?r:{})),P=zn(null!==(n=e.pageActions.triggers)&&void 0!==n?n:[]),T.update(I,P,e))}(t)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),s=Sn(e,e.cssSelectorAllowlist),a=Sn(e,e.actionClickAllowlist),u=O(),d=function(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackEvent,i=e.evaluateTriggers;return r.clickObservable.filter(On).filter(function(e){return n("click",e.closestTrackedAncestor)}).map(function(e){return i(e)}).subscribe(function(e){null==t||t.track(un,e.targetElementProperties)})}({allObservables:u,amplitude:r,shouldTrackEvent:s,evaluateTriggers:T.evaluate.bind(T)}),x.push(d),p=function(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return r.changeObservable.filter(On).filter(function(e){return i("change",e.closestTrackedAncestor)}).map(function(e){return o(e)}).subscribe(function(e){null==t||t.track("[Amplitude] Element Changed",n("change",e.closestTrackedAncestor))})}({allObservables:u,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return k.getEventProperties.apply(k,h(h([],c(e),!1),[v],!1))},amplitude:r,shouldTrackEvent:s,evaluateTriggers:T.evaluate.bind(T)}),x.push(p),f=function(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,s=e.shouldTrackActionClick,a=r.clickObservable,l=r.mutationObservable,u=r.navigateObservable,c=a.filter(function(e){return!o("click",e.closestTrackedAncestor)}).map(function(e){var t=En(e.event.target,n.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e}).filter(On).filter(function(e){return s("click",e.closestTrackedAncestor)}),h=u?er(l,u):l,d=er(c,h),p=null,f=null;return Zt(d,function(e){if(p&&(clearTimeout(p),p=null),"click"===e.type)return f=e,p=setTimeout(function(){p=null,f=null},500),Promise.resolve(null);if(f){var t=f;return f=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==t||t.track(un,i("click",e.closestTrackedAncestor)))})}({allObservables:u,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return k.getEventProperties.apply(k,h(h([],c(e),!1),[v],!1))},amplitude:r,shouldTrackEvent:s,shouldTrackActionClick:a}),f&&x.push(f),g=function(e){e.amplitude;var t=e.allObservables.scrollObservable,r={maxX:0,maxY:0},n=t.subscribe(function(){var e,t,n,i,o=F(),s=Math.floor(null!==(t=null!==(e=null==o?void 0:o.scrollX)&&void 0!==e?e:null==o?void 0:o.pageXOffset)&&void 0!==t?t:0),a=Math.floor(null!==(i=null!==(n=null==o?void 0:o.scrollY)&&void 0!==n?n:null==o?void 0:o.pageYOffset)&&void 0!==i?i:0);r.maxX=Math.max(r.maxX,s),r.maxY=Math.max(r.maxY,a)});return{unsubscribe:function(){n.unsubscribe()},getState:function(){return r},reset:function(){r.maxX=0,r.maxY=0}}}({allObservables:u,amplitude:r}),x.push(g),m={},y=F(),R=function(e){e&&n||(setTimeout(function(){n=!1},100),n=!0,function(e){var t,r,n,i,o=e.amplitude,s=e.scrollTracker,a=e.currentElementExposed,l=e.elementExposedForPage,u=e.exposureTracker,c=e.isPageEnd,h=e.lastScroll,d=s.getState(),p=F(),f=null!==(r=null==p?void 0:p.innerWidth)&&void 0!==r?r:0,g=null!==(n=null==p?void 0:p.innerHeight)&&void 0!==n?n:0,m=((t={})[dn]=null===(i=null==p?void 0:p.location)||void 0===i?void 0:i.href,t["[Amplitude] Max Page X"]=d.maxX+f,t["[Amplitude] Max Page Y"]=d.maxY+g,t[pn]=g,t[fn]=f,t["[Amplitude] Element Exposed"]=Array.from(a),t),v=Cn();v&&(m[gn]=v),0===a.size&&d.maxX===h.maxX&&d.maxY===h.maxY||(null==o||o.track("[Amplitude] Viewport Content Updated",m),h={maxX:d.maxX,maxY:d.maxY},a.clear(),c&&(s.reset(),l.clear(),null==u||u.reset()))}({amplitude:r,scrollTracker:g,currentElementExposed:E,elementExposedForPage:C,exposureTracker:m.exposure,isPageEnd:e,lastScroll:i}))},M=function(e){!function(e,t,r,n){if(!t.has(e)){t.add(e),r.add(e);var i=Array.from(r);JSON.stringify(i).length>=18e3&&n(!1)}}(e,C,E,R)},m.exposure=function(e){var t=e.allObservables,r=e.onExposure,n=e.dataExtractor,i=new Map,o=new Map,s=t.exposureObservable.subscribe(function(e){var t=e,s=t.target;if(t.isIntersecting){if(!i.get(s)){var a=setTimeout(function(){i.set(s,!0);var e=n.getElementPath(s);r(e),o.set(s,null)},1e3);o.set(s,a)}}else!t.isIntersecting&&t.intersectionRatio<1&&(a=o.get(s))&&(clearTimeout(a),o.set(s,null))});return{unsubscribe:function(){s.unsubscribe()},reset:function(){o.forEach(function(e){e&&clearTimeout(e)}),o.clear(),i.clear()}}}({allObservables:u,onExposure:M,dataExtractor:k}),m.exposure&&x.push(m.exposure),A=function(){console.log("amp: beforeUnload"),R(!0)},null==y||y.addEventListener("beforeunload",A),w=function(){null==y||y.removeEventListener("beforeunload",A)},x.push({unsubscribe:function(){return w()}}),(_=u[Un.NavigateObservable])?x.push(_.subscribe(function(){console.log("amp: navigate"),R(!0)})):y&&(N=function(){console.log("amp: popstate"),R(!0)},y.addEventListener("popstate",N),L=y.history.pushState,y.history&&L&&(y.history.pushState=new Proxy(L,{apply:function(e,t,r){var n=c(r,3),i=n[0],o=n[1],s=n[2];console.log("amp: pushState"),e.apply(t,[i,o,s]),R(!0)}})),x.push({unsubscribe:function(){y.removeEventListener("popstate",N),y.history&&L&&(y.history.pushState=L)}})),null===(j=null==t?void 0:t.loggerProvider)||void 0===j||j.log("".concat(S," has been successfully added.")),window.opener&&b.enabled&&(D=e.cssSelectorAllowlist,U=e.actionClickAllowlist,null===(B=b.messenger)||void 0===B||B.setup(o(o({dataExtractor:k,logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:vn[t.serverZone]}),{isElementSelectable:Sn(e,h(h([],c(D),!1),c(U),!1)),cssSelectorAllowlist:D,actionClickAllowlist:U})))),[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(x),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]})})}}},Kn=["mutation","navigate"];function Hn(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 Jn(e){if(0===e.length)return null;var t=e[0],r=e[e.length-1];return{rageClickEvent:o({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(r.timestamp).toISOString(),"[Amplitude] Duration":r.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.clientX,Y:e.event.clientY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}function Gn(e){var t=this,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,o=n.clickObservable,s=[],u={},c=null;return Zt(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 Hn(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=Jn(s)),function(e){s=[],u={},e&&(Hn(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(Jn(s))},1e3)}})]:[2,null]})})}).subscribe(function(e){null!==e&&r.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})})}var Yn,Xn,Qn=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:nt,g=null!==(i=null===(n=e.deadClicks)||void 0===n?void 0:n.cssSelectorAllowlist)&&void 0!==i?i:rt,m=null!==(s=e.dataAttributePrefix)&&void 0!==s?s:et,v=new Ln(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=Sn(e,f),i=Sn(e,g),s=function(){var e,t,r=tr(jn("pointerdown").map(function(e){return v.addAdditionalEventProperties(e,"click",y,m,!0)})),n=tr(Fn().map(function(e){return v.addAdditionalEventProperties(e,"mutation",y,m)}));return window.navigation&&(t=tr(new Qt(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={})[Un.ClickObservable]=r,e[Un.MutationObservable]=n,e[Un.NavigateObservable]=t,e}(),a=Gn({allObservables:s,amplitude:r,shouldTrackRageClick:n}),p.push(a),u=function(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackDeadClick,s=r.clickObservable,a=r.mutationObservable,l=r.navigateObservable,u=s.filter(function(e){return On(e)&&i("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')}),c=l?er(a,l):a,h=er(u,c),d=null;return Zt(h,function(e){return d&&Kn.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)}).subscribe(function(e){if(e){var r={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};t.track("[Amplitude] Dead Click",o(o({},n("click",e.closestTrackedAncestor)),r),{time:e.timestamp})}})}({amplitude:r,allObservables:s,getEventProperties:function(e,t){return v.getEventProperties(e,t,m)},shouldTrackDeadClick:i}),p.push(u),null===(c=null==t?void 0:t.loggerProvider)||void 0===c||c.log("".concat(d," has been successfully added."))),[2]})})},execute:function(e){return a(void 0,void 0,void 0,function(){return l(this,function(t){return[2,e]})})},teardown:function(){return a(void 0,void 0,void 0,function(){var e,t,r,n;return l(this,function(i){try{for(e=u(p),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(n=e.return)&&n.call(e)}finally{if(r)throw r.error}}return[2]})})}}},Zn="[Amplitude] Network Request",ei="500-599";function ti(e,t){var r="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(r).test(e)}function ri(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 ni(e){var t;if(e)try{var r=null===(t=F())||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 ii(e){if("object"==typeof e&&null!==e){if(0!==e.length)return e}else{if(e)return h([],c(T),!1);if(void 0===e){return}}}function oi(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 si(e,t){var r;void 0===t&&(t={});var n=ni(e.url);if(!n)return!1;var i,o=n.host;if(!1!==t.ignoreAmplitudeRequests&&(ti(o,"*.amplitude.com")||ti(o,"amplitude.com")))return!1;if(null===(r=t.ignoreHosts)||void 0===r?void 0:r.find(function(e){return ti(o,e)}))return!1;if(!t.captureRules&&void 0!==e.status&&!ri(e.status,ei))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 ti(t,e)}))&&(!n||!e.urls||Oe(n,e.urls))&&(!i||!e.methods||e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))return!((r||0===r)&&!ri(r,e.statusCodeRange||ei))}(t,o,e.status,e.url,e.method),i){var r=ii(t.responseHeaders);if(e.responseWrapper&&r){var n=e.responseWrapper.headers(r);n&&(e.responseHeaders=n)}var s=ii(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}e.responseWrapper&&t.responseBody&&!oi(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!oi(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===Zn}))return!0}catch(e){}return!1}(o,e.requestWrapper)}function ai(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude,i=e.loggerProvider;return t.networkObservable.filter(function(e){return si(e.event,r)}).subscribe(function(e){var t,r,o,s=e.event,u=ni(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(Zn,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"}(Yn||(Yn={}));var li=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=function(){var e,r=new Qt(function(e){var r=new wt(function(t){var r=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(r)});return xt.subscribe(r,t),function(){xt.unsubscribe(r)}});return(e={})[Yn.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,Xn=ai({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 Xn.unsubscribe(),[2]})})}}};let ui=-1;const ci=e=>{addEventListener("pageshow",t=>{t.persisted&&(ui=t.timeStamp,e(t))},!0)},hi=(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)))}},di=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},pi=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},fi=()=>{const e=pi();return e?.activationStart??0},gi=(e,t=-1)=>{const r=pi();let n="navigate";return ui>=0?n="back-forward-cache":r&&(document.prerendering||fi()>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}},mi=new WeakMap;function vi(e,t){return mi.get(e)||mi.set(e,new t),mi.get(e)}class yi{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 bi=(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{}},wi=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let Si=-1;const xi=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,ki=e=>{"hidden"===document.visibilityState&&Si>-1&&(Si="visibilitychange"===e.type?e.timeStamp:0,Ei())},Ci=()=>{addEventListener("visibilitychange",ki,!0),addEventListener("prerenderingchange",ki,!0)},Ei=()=>{removeEventListener("visibilitychange",ki,!0),removeEventListener("prerenderingchange",ki,!0)},Oi=()=>{if(Si<0){const e=fi(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;Si=t??xi(),Ci(),ci(()=>{setTimeout(()=>{Si=xi(),Ci()})})}return{get firstHiddenTime(){return Si}}},Ii=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Pi=[1800,3e3],Ti=(e,t={})=>{Ii(()=>{const r=Oi();let n,i=gi("FCP");const o=bi("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-fi(),0),i.entries.push(t),n(!0)))});o&&(n=hi(e,i,Pi,t.reportAllChanges),ci(r=>{i=gi("FCP"),n=hi(e,i,Pi,t.reportAllChanges),di(()=>{i.value=performance.now()-r.timeStamp,n(!0)})}))})},Ri=[.1,.25];let Mi=0,Ai=1/0,_i=0;const Ni=e=>{for(const t of e)t.interactionId&&(Ai=Math.min(Ai,t.interactionId),_i=Math.max(_i,t.interactionId),Mi=_i?(_i-Ai)/7+1:0)};let Li;const Di=()=>Li?Mi:performance.interactionCount??0;let Ui=0;class Fi{u=[];l=new Map;m;p;v(){Ui=Di(),this.u.length=0,this.l.clear()}P(){const e=Math.min(this.u.length-1,Math.floor((Di()-Ui)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let r=this.l.get(e.interactionId);if(r||this.u.length<10||e.duration>t.T){if(r?e.duration>r.T?(r.entries=[e],r.T=e.duration):e.duration===r.T&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],T:e.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort((e,t)=>t.T-e.T),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(r)}}}const ji=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(t(e=wi(e)),document.addEventListener("visibilitychange",e,{once:!0}))},Bi=[200,500],qi=(e,t={})=>{globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype&&Ii(()=>{"interactionCount"in performance||Li||(Li=bi("event",Ni,{type:"event",buffered:!0,durationThreshold:0}));let r,n=gi("INP");const i=vi(t,Fi),o=e=>{ji(()=>{for(const t of e)i.h(t);const t=i.P();t&&t.T!==n.value&&(n.value=t.T,n.entries=t.entries,r())})},s=bi("event",o,{durationThreshold:t.durationThreshold??40});r=hi(e,n,Bi,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(o(s.takeRecords()),r(!0))}),ci(()=>{i.v(),n=gi("INP"),r=hi(e,n,Bi,t.reportAllChanges)}))})};class zi{m;h(e){this.m?.(e)}}const Vi=[2500,4e3],Wi=[800,1800],$i=e=>{document.prerendering?Ii(()=>$i(e)):"complete"!==document.readyState?addEventListener("load",()=>$i(e),!0):setTimeout(e)};function Ki(e){var t,r=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+r}function Hi(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(Ki(e)),navigationStart:Math.floor(performance.timeOrigin)}}var Ji,Gi=function(){var e=null,t=F(),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=Ie((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":Ie((null==n?void 0:n.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":Ie(o.split("?")[0],t.loggerProvider)},((e,t={})=>{Ii(()=>{const r=Oi();let n,i=gi("LCP");const o=vi(t,zi),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-fi(),0),i.entries=[t],n())},a=bi("largest-contentful-paint",s);if(a){n=hi(e,i,Vi,t.reportAllChanges);const r=wi(()=>{s(a.takeRecords()),a.disconnect(),n(!0)});for(const e of["keydown","click","visibilitychange"])addEventListener(e,()=>ji(r),{capture:!0,once:!0});ci(r=>{i=gi("LCP"),n=hi(e,i,Vi,t.reportAllChanges),di(()=>{i.value=performance.now()-r.timeStamp,n(!0)})})}})})(function(e){s["[Amplitude] LCP"]=Hi(e)}),Ti(function(e){s["[Amplitude] FCP"]=Hi(e)}),qi(function(e){s["[Amplitude] INP"]=Hi(e)}),((e,t={})=>{Ti(wi(()=>{let r,n=gi("CLS",0);const i=vi(t,yi),o=e=>{for(const t of e)i.h(t);i.i>n.value&&(n.value=i.i,n.entries=i.o,r())},s=bi("layout-shift",o);s&&(r=hi(e,n,Ri,t.reportAllChanges),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(o(s.takeRecords()),r(!0))}),ci(()=>{i.i=0,n=gi("CLS",0),r=hi(e,n,Ri,t.reportAllChanges),di(()=>r())}),setTimeout(r))}))})(function(e){s["[Amplitude] CLS"]=Hi(e)}),((e,t={})=>{let r=gi("TTFB"),n=hi(e,r,Wi,t.reportAllChanges);$i(()=>{const i=pi();i&&(r.value=Math.max(i.responseStart-fi(),0),r.entries=[i],n(!0),ci(()=>{r=gi("TTFB",0),n=hi(e,r,Wi,t.reportAllChanges),n(!0)}))})})(function(e){s["[Amplitude] TTFB"]=Hi(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]})})}}},Yi=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},Xi=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(Qi(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=Yi(o||"")!==Yi(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},Qi=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})},Zi=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=Ne(t.apiKey,"MKTG"),this.webExpStorageKey=Ne(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=P,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return a(this,void 0,void 0,function(){var e,t;return l(this,function(r){switch(r.label){case 0:return[4,this.fetchCampaign()];case 1:return t=c.apply(void 0,[r.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||Se(this.sessionTimeout,this.lastEventTime),Xi(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 kt).parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,r,n,i,s=(t=this.currentCampaign,r=this.options,n=o(o({},P),t),i=Object.entries(n).reduce(function(e,t){var n,i=c(t,2),o=i[0],s=i[1];return e.setOnce("initial_".concat(o),null!==(n=null!=s?s:r.initialEmptyValue)&&void 0!==n?n:"EMPTY"),s?e.set(o,s):e.unset(o)},new _),z(i));return e&&(s.event_id=e),s},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),eo="AMP_CURRENT_PAGE",to="AMP_PREVIOUS_PAGE",ro="AMP_URL_INFO";!function(e){e.Direct="direct",e.Internal="internal",e.External="external"}(Ji||(Ji={}));var no=new Set([i.IDENTIFY,i.GROUP_IDENTIFY,i.REVENUE]),io=function(e){var t=(void 0===e?{}:e).internalDomains,r=void 0===t?[]:t,n=F(),i=void 0,s=!1,u=void 0,h=!1,d=!1,p=function(e){var t="undefined"!=typeof location&&location.hostname||"",n=e?function(e){var t;try{var r=Ie(e,u);t=new URL(r).hostname}catch(e){null==u||u.error("Could not parse URL: ",e)}return t}(e):void 0;if(!n)return Ji.Direct;var i=r.some(function(e){return-1!==t.indexOf(e)}),o=r.some(function(e){return-1!==n.indexOf(e)});return t===n||o&&i?Ji.Internal:Ji.External},f=function(){a(void 0,void 0,void 0,function(){var e,t,r,n,o;return l(this,function(a){switch(a.label){case 0:return i&&s?[4,i.get(ro)]:[3,3];case 1:return e=a.sent(),t=Ie("undefined"!=typeof location&&location.href||""),r=(null==e?void 0:e[eo])||"",n=void 0,n=t===r?(null==e?void 0:e[to])||"":r||document.referrer||"",[4,i.set(ro,(o={},o[eo]=t,o[to]=n,o))];case 2:a.sent(),a.label=3;case 3:return[2]}})})},g={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return a(void 0,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return(u=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),d=!0,n?[4,(i=new Le(n.sessionStorage)).isEnabled()]:[3,2];case 1:s=t.sent(),n.addEventListener("popstate",f),h||(n.history.pushState=new Proxy(n.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]),d&&f()}}),n.history.replaceState=new Proxy(n.history.replaceState,{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]),d&&f()}}),h=!0),t.label=2;case 2:return[2]}})})},execute:function(e){return a(void 0,void 0,void 0,function(){var t,r,n,a,u;return l(this,function(l){switch(l.label){case 0:return t=Ie("undefined"!=typeof location&&location.href||""),i&&s?[4,i.get(ro)]:[3,5];case 1:return(null==(r=l.sent())?void 0:r[eo])?[3,3]:[4,i.set(ro,(u={},u[eo]=t,u[to]=document.referrer||"",u))];case 2:l.sent(),l.label=3;case 3:return[4,i.get(ro)];case 4:if(n=l.sent(),a="",n&&(a=n[to]||""),no.has(e.event_type))return[2,e];e.event_properties=o(o({},e.event_properties||{}),{"[Amplitude] Page Domain":oo(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":oo(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":oo(e,"[Amplitude] Page Path","undefined"!=typeof location&&Ie(location.pathname)||""),"[Amplitude] Page Title":oo(e,"[Amplitude] Page Title",Rt(Tt)),"[Amplitude] Page URL":oo(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":a,"[Amplitude] Previous Page Type":p(a)}),l.label=5;case 5:return[2,e]}})})},teardown:function(){return a(void 0,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return n&&(n.removeEventListener("popstate",f),d=!1),i&&s?[4,i.set(ro,{})]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})}};return g};function oo(e,t,r){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?r:e.event_properties[t]}var so,ao=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),V(this._init(o(o({},i),{userId:n,apiKey:e})))},t.prototype._init=function(t){var r,n,i,u;return a(this,void 0,void 0,function(){var a,c,h,d,p,f,g,m,v,y=this;return l(this,function(l){switch(l.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,zr(t.apiKey,t,this)]);case 1:return a=l.sent(),a.remoteConfig&&a.remoteConfig.fetchRemoteConfig?(c=new Qe(a.apiKey,a.loggerProvider,a.serverZone,null===(r=a.remoteConfig)||void 0===r?void 0:r.serverUrl),[4,new Promise(function(e){null==c||c.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&&an(t,a),e()})})]):[3,4];case 2:return l.sent(),[4,new Promise(function(e){null==c||c.subscribe("configs.diagnostics.browserSDK","all",function(t,r,n){if(a.loggerProvider.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(a.diagnosticsSampleRate=i);var o=t.enabled;"boolean"==typeof o&&(a.enableDiagnostics=o)}e()})})];case 3:l.sent(),l.label=4;case 4:return(h=new Je(a.apiKey,a.loggerProvider,a.serverZone,{enabled:a.enableDiagnostics,sampleRate:a.diagnosticsSampleRate})).setTag("library","".concat(mr,"/").concat(gr)),h.setTag("user_agent",navigator.userAgent),[4,e.prototype._init.call(this,a)];case 5:return l.sent(),this.logBrowserOptions(a),this.config.diagnosticsClient=h,this.config.remoteConfigClient=c,nr(this.config.defaultTracking)?(d=function(e){return nr(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 Zi(d,this.config),[4,this.webAttribution.init()]):[3,7];case 6:l.sent(),l.label=7;case 7:return p=Ce(),f=p.ampTimestamp?Number(p.ampTimestamp):void 0,g=!f||Date.now()<f,m=g&&!Number.isNaN(Number(p.ampSessionId))?Number(p.ampSessionId):void 0,this.setSessionId(null!==(u=null!==(i=null!==(n=t.sessionId)&&void 0!==n?n:m)&&void 0!==i?i:this.config.sessionId)&&void 0!==u?u:Date.now()),(v=be(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline?[3,9]:[4,this.add(nn()).promise];case 8:l.sent(),l.label=9;case 9:return[4,this.add(new ae({diagnosticsClient:h})).promise];case 10:return l.sent(),[4,this.add(new vr).promise];case 11:return l.sent(),[4,this.add(new we).promise];case 12:return l.sent(),function(e){rn||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."),rn=!0)}(this.config),b=this.config.defaultTracking,rr(b,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(tn()).promise]):[3,14];case 13:l.sent(),l.label=14;case 14:return function(e){return rr(e,"formInteractions")}(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Qr()).promise]):[3,16];case 15:l.sent(),l.label=16;case 16:return ir(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Jr(dr(this.config))).promise]):[3,18];case 17:l.sent(),l.label=18;case 18:return ar(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add($n(ur(this.config),{diagnosticsClient:h})).promise]):[3,20];case 19:l.sent(),l.label=20;case 20:return lr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(Qn(cr(this.config))).promise]):[3,22];case 21:l.sent(),l.label=22;case 22:return sr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(li(hr(this.config))).promise]):[3,24];case 23:l.sent(),l.label=24;case 24:return function(e){return"boolean"==typeof e?e:"object"==typeof e&&!0===e.webVitals}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(Gi()).promise]):[3,26];case 25:l.sent(),l.label=26;case 26:return function(e){return rr(e,"pageUrlEnrichment")}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(io()).promise]):[3,28];case 27:l.sent(),l.label=28;case 28:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 29:return l.sent(),v.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},r=t.time,n=s(t,["time"]),i="number"==typeof r?{time:r}:void 0;y.track(e.eventType,n,i)}),[2]}var b})})},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)),V(Promise.resolve());if(e===this.config.sessionId)return V(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,or(this.config.defaultTracking)&&(n&&i&&r.push(this.track(Mr,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 this.config.identify&&r.push(this.track(z(this.config.identify)).promise),or(this.config.defaultTracking)&&r.push(this.track(Rr,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,V(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=Wr(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,r){if(fr(t)){var n=t._q;t._q=[],t=pr(new _,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(fr(n)){var o=n._q;n._q=[],n=pr(new _,o)}return e.prototype.groupIdentify.call(this,t,r,n,i)},t.prototype.revenue=function(t,r){if(fr(t)){var n=t._q;t._q=[],t=pr(new $,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===Rr||t.event_type===Mr||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),lo=Object.freeze({__proto__:null,get IdentifyOperation(){return n},get SpecialEventType(){return i},get RevenueProperty(){return D},get LogLevel(){return K},get ServerZone(){return ge},OfflineDisabled:null,DEFAULT_CSS_SELECTOR_ALLOWLIST:Ze,DEFAULT_DATA_ATTRIBUTE_PREFIX:et,DEFAULT_ACTION_CLICK_ALLOWLIST:tt}),uo="[Amplitude]",co="".concat(uo," Session Replay ID"),ho=ge.US,po={enabled:!0},fo="".concat(uo," Session Replay Debug"),go="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"}(so||(so={}));var mo=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}(),vo="medium";var yo=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 yo(e,vo,r)}},bo=function(e,t){return function(r,n){return function(e,t,r){var n,i,o;if(void 0===t&&(t={defaultMaskLevel:vo}),r){if(r.closest("."+go))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 yo(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:vo,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},wo=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")},So=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},xo=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=So(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},ko=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=F())?[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:""}]}})})},Co=function(e){var t=o({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},Eo=function(){return{flushMaxRetries:2,logLevel:K.Warn,loggerProvider:new J,transportProvider:new Ye}},Oo=function(e){function t(t,r){var n,i,s,a,l,u,c=this,h=Eo();if((c=e.call(this,o(o({transportProvider:h.transportProvider,loggerProvider:new mo(r.loggerProvider||h.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=h.flushMaxRetries?r.flushMaxRetries:h.flushMaxRetries,c.apiKey=t,c.sampleRate=r.sampleRate||0,c.serverZone=r.serverZone||ho,c.configServerUrl=r.configServerUrl,c.trackServerUrl=r.trackServerUrl,c.shouldInlineStylesheet=r.shouldInlineStylesheet,c.version=r.version,c.performanceConfig=r.performanceConfig||po,c.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",c.applyBackgroundColorToBlockedElements=null!==(i=r.applyBackgroundColorToBlockedElements)&&void 0!==i&&i,c.enableUrlChangePolling=null!==(s=r.enableUrlChangePolling)&&void 0!==s&&s,c.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:1e3,c.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,r.privacyConfig&&(c.privacyConfig=r.privacyConfig),r.interactionConfig&&(c.interactionConfig=r.interactionConfig,c.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")}(c.interactionConfig.ugcFilterRules)),r.debugMode&&(c.debugMode=r.debugMode),void 0!==r.useWebWorker)c.useWebWorker=r.useWebWorker;else{var d=r;void 0!==(null===(u=d.experimental)||void 0===u?void 0:u.useWebWorker)&&(c.useWebWorker=d.experimental.useWebWorker)}return r.omitElementTags&&(c.omitElementTags=r.omitElementTags),c}return r(t,e),t}(Y),Io=(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))(Io||{}),Po=(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))(Po||{}),To=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,x,k,C=this;return l(this,function(l){switch(l.label){case 0:(n=o({},this.localConfig)).optOut=this.localConfig.optOut,n.captureEnabled=!0,l.label=1;case 1:return l.trys.push([1,3,,4]),[4,new Promise(function(e,t){C.remoteConfigClient.subscribe("configs.sessionReplay","all",function(r,o){var s;if(C.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(o,":"),JSON.stringify(r,null,2)),r){var a=r,l=a.sr_sampling_config,u=a.sr_privacy_config,c=a.sr_targeting_config,h=null===(s=n.interactionConfig)||void 0===s?void 0:s.ugcFilterRules;n.interactionConfig=a.sr_interaction_config,n.interactionConfig&&h&&(n.interactionConfig.ugcFilterRules=h),n.loggingConfig=a.sr_logging_config,(l||u||c)&&(i={},l&&(i.sr_sampling_config=l),u&&(i.sr_privacy_config=u),c&&(i.sr_targeting_config=c)),e()}else t(new Error("No remote config received"))})})];case 2:return l.sent(),[3,4];case 3:return s=l.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",s),n.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:void 0}];case 4:if(!i)return[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:i}];if(a=i.sr_sampling_config,h=i.sr_privacy_config,d=i.sr_targeting_config,a&&Object.keys(a).length>0?(Object.prototype.hasOwnProperty.call(a,"capture_enabled")?n.captureEnabled=a.capture_enabled:n.captureEnabled=!1,Object.prototype.hasOwnProperty.call(a,"sample_rate")&&(n.sampleRate=a.sample_rate)):(n.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),h){p=null!==(e=n.privacyConfig)&&void 0!==e?e:{},f={defaultMaskLevel:null!==(r=null!==(t=h.defaultMaskLevel)&&void 0!==t?t:p.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},g=function(e){var t,r,n,i,o,s,a,l,c,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=u(null!==(a=e.blockSelector)&&void 0!==a?a:[]),p=d.next();!p.done;p=d.next()){h[p.value]="block"}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}try{for(var f=u(null!==(l=e.maskSelector)&&void 0!==l?l:[]),g=f.next();!g.done;g=f.next()){h[g.value]="mask"}}catch(e){n={error:e}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}try{for(var m=u(null!==(c=e.unmaskSelector)&&void 0!==c?c:[]),v=m.next();!v.done;v=m.next()){h[v.value]="unmask"}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}return h},m=o(o({},g(p)),g(h));try{for(v=u(Object.entries(m)),y=v.next();!y.done;y=v.next())b=c(y.value,2),w=b[0],"mask"===(S=b[1])?f.maskSelector.push(w):"block"===S?f.blockSelector.push(w):"unmask"===S&&f.unmaskSelector.push(w)}catch(e){x={error:e}}finally{try{y&&!y.done&&(k=v.return)&&k.call(v)}finally{if(x)throw x.error}}n.privacyConfig=(E=f,O=this.localConfig.loggerProvider,I=document.createDocumentFragment(),P=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter(function(e){try{I.querySelector(e)}catch(t){return O.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0}),0!==e.length)return e},E.blockSelector=P(E.blockSelector),E.maskSelector=P(E.maskSelector),E.unmaskSelector=P(E.unmaskSelector),E)}return d&&Object.keys(d).length>0&&(n.targetingConfig=d),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:Co(n)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:i}]}var E,O,I,P})})},e}(),Ro=function(e,t){return a(void 0,void 0,void 0,function(){var r,n;return l(this,function(i){return r=new Oo(e,t),n=new Qe(e,r.loggerProvider,r.serverZone,t.configServerUrl),[2,new To(n,r)]})})},Mo=Uint8Array,Ao=Uint16Array,_o=Uint32Array,No=new Mo([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]),Lo=new Mo([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]),Do=new Mo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Uo=function(e,t){for(var r=new Ao(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new _o(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]},Fo=Uo(No,2),jo=Fo[0],Bo=Fo[1];jo[28]=258,Bo[258]=28;for(var qo=Uo(Lo,0)[1],zo=new Ao(32768),Vo=0;Vo<32768;++Vo){var Wo=(43690&Vo)>>>1|(21845&Vo)<<1;Wo=(61680&(Wo=(52428&Wo)>>>2|(13107&Wo)<<2))>>>4|(3855&Wo)<<4,zo[Vo]=((65280&Wo)>>>8|(255&Wo)<<8)>>>1}var $o=function(e,t,r){for(var n=e.length,i=0,o=new Ao(t);i<n;++i)++o[e[i]-1];var s,a=new Ao(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new Ao(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[zo[h]>>>l]=u}else for(s=new Ao(n),i=0;i<n;++i)s[i]=zo[a[e[i]-1]++]>>>15-e[i];return s},Ko=new Mo(288);for(Vo=0;Vo<144;++Vo)Ko[Vo]=8;for(Vo=144;Vo<256;++Vo)Ko[Vo]=9;for(Vo=256;Vo<280;++Vo)Ko[Vo]=7;for(Vo=280;Vo<288;++Vo)Ko[Vo]=8;var Ho=new Mo(32);for(Vo=0;Vo<32;++Vo)Ho[Vo]=5;var Jo=$o(Ko,9,0),Go=$o(Ho,5,0),Yo=function(e){return(e/8|0)+(7&e&&1)},Xo=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof Ao?Ao:e instanceof _o?_o:Mo)(r-t);return n.set(e.subarray(t,r)),n},Qo=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},Zo=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},es=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 Mo(0),0];if(1==i){var s=new Mo(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 Ao(d+1),f=ts(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 Mo(p),f]},ts=function(e,t,r){return-1==e.s?Math.max(ts(e.l,t,r+1),ts(e.r,t,r+1)):t[e.s]=r},rs=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Ao(++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]},ns=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},is=function(e,t,r){var n=r.length,i=Yo(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)},os=function(e,t,r,n,i,o,s,a,l,u,c){Qo(t,c++,r),++i[256];for(var h=es(i,15),d=h[0],p=h[1],f=es(o,15),g=f[0],m=f[1],v=rs(d),y=v[0],b=v[1],w=rs(g),S=w[0],x=w[1],k=new Ao(19),C=0;C<y.length;++C)k[31&y[C]]++;for(C=0;C<S.length;++C)k[31&S[C]]++;for(var E=es(k,7),O=E[0],I=E[1],P=19;P>4&&!O[Do[P-1]];--P);var T,R,M,A,_=u+5<<3,N=ns(i,Ko)+ns(o,Ho)+s,L=ns(i,d)+ns(o,g)+s+14+3*P+ns(k,O)+(2*k[16]+3*k[17]+7*k[18]);if(_<=N&&_<=L)return is(t,c,e.subarray(l,l+u));if(Qo(t,c,1+(L<N)),c+=2,L<N){T=$o(d,p,0),R=d,M=$o(g,m,0),A=g;var D=$o(O,I,0);Qo(t,c,b-257),Qo(t,c+5,x-1),Qo(t,c+10,P-4),c+=14;for(C=0;C<P;++C)Qo(t,c+3*C,O[Do[C]]);c+=3*P;for(var U=[y,S],F=0;F<2;++F){var j=U[F];for(C=0;C<j.length;++C){var B=31&j[C];Qo(t,c,D[B]),c+=O[B],B>15&&(Qo(t,c,j[C]>>>5&127),c+=j[C]>>>12)}}}else T=Jo,R=Ko,M=Go,A=Ho;for(C=0;C<a;++C)if(n[C]>255){B=n[C]>>>18&31;Zo(t,c,T[B+257]),c+=R[B+257],B>7&&(Qo(t,c,n[C]>>>23&31),c+=No[B]);var q=31&n[C];Zo(t,c,M[q]),c+=A[q],q>3&&(Zo(t,c,n[C]>>>5&8191),c+=Lo[q])}else Zo(t,c,T[n[C]]),c+=R[n[C]];return Zo(t,c,T[256]),c+R[256]},ss=new _o([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),as=function(e,t,r,n,i){return function(e,t,r,n,i,o){var s=e.length,a=new Mo(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=is(l,u,e.subarray(c,h)):(l[c]=o,u=is(l,u,e.subarray(c,s)))}else{for(var d=ss[t-1],p=d>>>13,f=8191&d,g=(1<<r)-1,m=new Ao(32768),v=new Ao(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 _o(25e3),x=new Ao(288),k=new Ao(32),C=0,E=0,O=(c=0,0),I=0,P=0;c<s;++c){var T=w(c),R=32767&c,M=v[T];if(m[R]=M,v[T]=R,I<=c){var A=s-c;if((C>7e3||O>24576)&&A>423){u=os(e,l,0,S,x,k,E,O,P,c-P,u),O=C=E=0,P=c;for(var _=0;_<286;++_)x[_]=0;for(_=0;_<30;++_)k[_]=0}var N=2,L=0,D=f,U=R-M&32767;if(A>2&&T==w(c-U))for(var F=Math.min(p,A)-1,j=Math.min(32767,c),B=Math.min(258,A);U<=j&&--D&&R!=M;){if(e[c+N]==e[c+N-U]){for(var q=0;q<B&&e[c+q]==e[c+q-U];++q);if(q>N){if(N=q,L=U,q>F)break;var z=Math.min(U,q-2),V=0;for(_=0;_<z;++_){var W=c-U+_+32768&32767,$=W-m[W]+32768&32767;$>V&&(V=$,M=W)}}}U+=(R=M)-(M=m[R])+32768&32767}if(L){S[O++]=268435456|Bo[N]<<18|qo[L];var K=31&Bo[N],H=31&qo[L];E+=No[K]+Lo[H],++x[257+K],++k[H],I=c+N,++C}else S[O++]=e[c],++x[e[c]]}}u=os(e,l,o,S,x,k,E,O,P,c-P,u)}return Xo(a,0,n+Yo(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,!0)};function ls(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=as(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 us=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}(ls(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Mo(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 Mo(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 Xo(n,0,i)}(JSON.stringify(t))),!0)};var cs=function(){function e(e,t,r,n){var i,o=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=us(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=F();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("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}(),hs="Failed to store session replay events in IndexedDB",ds="1.30.3",ps=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=F(),s=(null==y?void 0:y.location)?y.location.href:"",a=ds,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(wo(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 N.Success:this.handleSuccessResponse(t);break;case N.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 fs=(e,t)=>t.some(t=>e instanceof t);let gs,ms;const vs=new WeakMap,ys=new WeakMap,bs=new WeakMap;let ws={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return vs.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Cs(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Ss(e){ws=e(ws)}function xs(e){return(ms||(ms=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Es(this),t),Cs(this.request)}:function(...t){return Cs(e.apply(Es(this),t))}}function ks(e){return"function"==typeof e?xs(e):(e instanceof IDBTransaction&&function(e){if(vs.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)});vs.set(e,t)}(e),fs(e,gs||(gs=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,ws):e)}function Cs(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(Cs(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",o)});return bs.set(t,e),t}(e);if(ys.has(e))return ys.get(e);const t=ks(e);return t!==e&&(ys.set(e,t),bs.set(t,e)),t}const Es=e=>bs.get(e);function Os(e,t,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=Cs(s);return n&&s.addEventListener("upgradeneeded",e=>{n(Cs(s.result),e.oldVersion,e.newVersion,Cs(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 Is=["get","getKey","getAll","getAllKeys","count"],Ps=["put","add","delete","clear"],Ts=new Map;function Rs(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Ts.get(t))return Ts.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,i=Ps.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!Is.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 Ts.set(t,o),o}Ss(e=>({...e,get:(t,r,n)=>Rs(t,r)||e.get(t,r,n),has:(t,r)=>!!Rs(t,r)||e.has(t,r)}));const Ms=["continue","continuePrimaryKey","advance"],As={},_s=new WeakMap,Ns=new WeakMap,Ls={get(e,t){if(!Ms.includes(t))return e[t];let r=As[t];return r||(r=As[t]=function(...e){_s.set(this,Ns.get(this)[t](...e))}),r}};async function*Ds(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,Ls);for(Ns.set(r,t),bs.set(r,Es(t));t;)yield r,t=await(_s.get(r)||t.continue()),_s.delete(r)}function Us(e,t){return t===Symbol.asyncIterator&&fs(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&fs(e,[IDBIndex,IDBObjectStore])}Ss(e=>({...e,get:(t,r,n)=>Us(t,r)?Ds:e.get(t,r,n),has:(t,r)=>Us(t,r)||e.has(t,r)}));var Fs,js=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"}(Fs||(Fs={}));var Bs,qs,zs,Vs="sessionCurrentSequence",Ws="sequencesToSend",$s=function(){var e=F();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"),i=!1;n.onupgradeneeded=function(){1===n.result.version&&(i=!0)},n.onsuccess=function(){if(i){try{n.result.close()}catch(e){}try{e.indexedDB.deleteDatabase("keyval-store")}catch(e){}t()}else t(n.result)},n.onerror=function(e){var i;if("AbortError"===(null===(i=n.error)||void 0===i?void 0:i.name))return e.preventDefault(),void t();r(n.error)}}catch(e){r(e)}})},Ks=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]}})})},Hs=function(e){var t,r;return e.objectStoreNames.contains(Vs)||(r=e.createObjectStore(Vs,{keyPath:"sessionId"})),e.objectStoreNames.contains(Ws)||(t=e.createObjectStore(Ws,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},Js=function(e){return a(void 0,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return[4,Os(e,1,{upgrade:Hs})];case 1:return[2,t.sent()]}})})},Gs=function(e){function t(t){var r=e.call(this,t)||this;return r.getSequencesToSend=function(){return a(r,void 0,void 0,function(){var e,t,r,n,i,o;return l(this,function(s){switch(s.label){case 0:return s.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=s.sent(),s.label=2;case 2:return t?(r=t.value,n=r.sessionId,i=r.events,e.push({events:i,sequenceId:t.key,sessionId:n}),[4,t.continue()]):[3,4];case 3:return t=s.sent(),[3,2];case 4:return[2,e];case 5:return o=s.sent(),this.loggerProvider.warn("".concat(hs,": ").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(Vs,e)];case 1:return(t=i.sent())?[4,this.db.put(Ws,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=i.sent(),[4,this.db.put(Vs,{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(hs,": ").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(Vs,"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(hs,": ").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(Ws,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(hs,": ").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(Ws,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(hs,": ").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!==Fs.SENT&&n.push(i.storeSendingEvents(e,u.events))}),[4,Ks(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!==Fs.SENT&&s.push(a.storeSendingEvents(n,l[t].events))})}}),[4,Ks(s)]):[3,2];case 1:l.sent(),l.label=2;case 2:return t(),[2]}})})}}),[4,o];case 3:return g.sent(),(s=F())&&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,Js(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(hs,": ").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}(js),Ys=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}(js),Xs=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 ps(o(o({},t),{loggerProvider:t.loggerProvider,payloadBatcher:u})),d=function(){return new Ys({loggerProvider:t.loggerProvider,maxInterval:i,minInterval:n})},p=function(){return a(void 0,void 0,void 0,function(){var e;return l(this,function(o){switch(o.label){case 0:return[4,Gs.new(s,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:i,apiKey:t.apiKey},r)];case 1:return e=o.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,null!=e?e:d()]}})})},"idb"!==c?[3,2]:[4,p()];case 1:return g=w.sent(),[3,3];case 2:g=d(),w.label=3;case 3:return f=g,m=function(e){var r=e.events,n=e.sessionId,i=e.deviceId,o=e.sequenceId;t.debugMode&&ko().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}]}})})},Qs=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 Zs(e,t){if(zs=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};Bs=o(o({},r),t),qs=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Bs.root,r);var n=ea(e,"all",function(){return ea(e,"two",function(){return ea(e,"one",function(){return ea(e,"none")})})});if(n){var i=ca(ha(n,e));return i.length>0&&(n=i[0]),ra(n)}throw new Error("Selector was not found.")}function ea(e,t,r){for(var n=null,i=[],o=e,s=0,a=function(){var e,a,l=(new Date).getTime()-zs.getTime();if(void 0!==Bs.timeoutMs&&l>Bs.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var d=aa(function(e){var t=e.getAttribute("id");if(t&&Bs.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||aa.apply(void 0,h([],c(function(e){var t=Array.from(e.attributes).filter(function(e){return Bs.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))||aa.apply(void 0,h([],c(function(e){var t=Array.from(e.classList).filter(Bs.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(o)),!1))||aa(function(e){var t=e.tagName.toLowerCase();if(Bs.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(sa).map(function(e){return oa(e,p)})));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(sa).map(function(e){return oa(e,p)})));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&sa(f)&&(d=[oa(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[oa(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>=Bs.seedMinLength&&(n=ta(i,r)))return"break";o=o.parentElement,s++};o;){if("break"===a())break}return n||(n=ta(i,r)),!n&&r?r():n}function ta(e,t){var r,n,i=ca(ua(e));if(i.length>Bs.threshold)return t?t():null;try{for(var o=u(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(ia(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 ra(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 na(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function ia(e){var t=ra(e);switch(qs.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 oa(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function sa(e){return"html"!==e.name&&!e.name.startsWith("#")}function aa(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(la);return r.length>0?r:null}function la(e){return null!=e}function ua(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(ua(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 ca(e){return h([],c(e),!1).sort(function(e,t){return na(e)-na(t)})}function ha(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>Bs.optimizedMinLength))return[3,5];n=1,s.label=1;case 1:return n<e.length-1?r.counter>Bs.maxNumberOfTries?[2]:(r.counter+=1,(i=h([],c(e),!1)).splice(n,1),o=ra(i),r.visited.has(o)?[2]:ia(i)&&function(e,t){return qs.querySelector(ra(e))===t}(i,t)?[4,i]:[3,4]):[3,5];case 2:return s.sent(),r.visited.set(o,!0),[5,u(ha(i,t,r))];case 3:s.sent(),s.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var da=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}},pa=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)}},fa=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,a=e.performanceOptions;return function(e){if(e.type===Po.Click){var l=F();if(l){var u=l.location,c=l.innerHeight,h=l.innerWidth;if(u){var d=e.x,p=e.y;if(void 0!==d&&void 0!==p){var f,g=o.getNode(e.id);if(g)try{f=Zs(g,a)}catch(e){r.logger.debug("error resolving selector from finder")}var m=xo(u.href,s),v={x:d+r.scrollWatcher.currentScrollX,y:p+r.scrollWatcher.currentScrollY,selector:f,viewportHeight:c,viewportWidth:h,pageUrl:m,timestamp:Date.now(),type:"click"},y=i();y&&t.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(v)},deviceId:y})}}}}}},this.logger=e,this.scrollWatcher=t};function ga(){var e=F();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function ma(){var e=F();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}var va=function(){function e(e,t){var r=F();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=wo(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}(),ya=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=F();s&&o&&r.transport.send(o,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:ga(),viewportWidth:ma(),pageUrl:xo(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=ma(),this._maxScrollHeight=ga(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new va(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=ma();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=ga();this._maxScrollY=e.y;var o=e.y+i;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),ba=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))},wa=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,Os(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]}})})}},Sa=new wa,xa=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,Sa.clearStoreOfOldSessions({loggerProvider:n,apiKey:i,currentSessionId:t})];case 1:return l.sent(),[4,Sa.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 bh})];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),Sa.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 ka(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?xo(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),x=r.history.replaceState.bind(r.history);return r.history.pushState[f]||(r.history.pushState=y(S),r.history.replaceState=y(x)),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}}ka();var Ca,Ea,Oa,Ia=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=F();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,xa({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!==so.METADATA?(e={config:Co(i),version:ds},n?[4,ko()]:[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 mo(new J)}return e.prototype.init=function(e,t){return V(this._init(e,t))},e.prototype._init=function(e,t){var r,n,i,o,s,u;return a(this,void 0,void 0,function(){var a,d,p,f,g,m,v,y,b,w,S,x,k,C,E,O,I;return l(this,function(l){switch(l.label){case 0:return this.loggerProvider=new mo(t.loggerProvider||new J),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new ba({sessionId:t.sessionId,deviceId:t.deviceId}),a=this,[4,Ro(e,t)];case 1:return a.joinedConfigGenerator=l.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:d=l.sent(),p=d.joinedConfig,f=d.localConfig,g=d.remoteConfig,this.config=p,this.setMetadata(t.sessionId,p,f,g,null===(r=t.version)||void 0===r?void 0:r.version,ds,null===(n=t.version)||void 0===n?void 0:n.type),t.sessionId&&(null===(i=this.config.interactionConfig)||void 0===i?void 0:i.enabled)&&(m=ya.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[m.send(this.getDeviceId.bind(this)).bind(m)],this.scrollHook=m.hook.bind(m),this.clickHandler=new fa(this.loggerProvider,m)),v=[],"idb"!==(y=this.config.storeType)||(null===(o=F())||void 0===o?void 0:o.indexedDB)||(y="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(y," for event storage.")),l.label=3;case 3:return l.trys.push([3,5,,6]),[4,Xs({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:y})];case 4:return b=l.sent(),v.push({name:"replay",manager:b}),[3,6];case 5:return w=l.sent(),C=w,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(C.toString())),[3,6];case 6:if(!(null===(s=this.config.interactionConfig)||void 0===s?void 0:s.enabled))return[3,10];S=this.config.interactionConfig.batch?pa:da,l.label=7;case 7:return l.trys.push([7,9,,10]),[4,Xs({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!==(u=this.config.interactionConfig.trackEveryNms)&&void 0!==u?u:3e4,maxInterval:6e4,payloadBatcher:S,storeType:y})];case 8:return x=l.sent(),v.push({name:"interaction",manager:x}),[3,10];case 9:return k=l.sent(),C=k,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(C.toString())),[3,10];case 10:return this.eventsManager=new(Qs.bind.apply(Qs,h([void 0],c(v),!1))),this.eventCompressor&&this.eventCompressor.terminate(),E=void 0,O=F(),this.config.useWebWorker&&O&&O.Worker?[4,Promise.resolve().then(function(){return wh})]:[3,12];case 11:I=l.sent().compressionScript,E=I,l.label=12;case 12:return this.eventCompressor=new cs(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 V(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 ba({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={})[co]=r.sessionReplayId?r.sessionReplayId:null,i=e,t.debugMode&&(i[fo]=JSON.stringify({appHash:Pe(t.apiKey).toString()}))),this.addCustomRRWebEvent(so.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=Pe(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(so.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=ka({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 Lg})];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 MS})];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,u;return void 0===e&&(e=!0),a(this,void 0,void 0,function(){var a,c,h,d,p,f,g,m,v,y,b,w,S,x=this;return l(this,function(l){switch(l.label){case 0:return a=this.config,c=this.getShouldRecord(),h=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,c&&h&&a?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(d=l.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:l.sent(),null===(r=this.networkObservers)||void 0===r||r.start(function(e){x.addCustomRRWebEvent(so.FETCH_REQUEST,e)}),p=a.privacyConfig,f=a.interactionConfig,g=a.loggingConfig,m=(null==f?void 0:f.enabled)?{mouseInteraction:this.eventsManager&&(null===(n=this.clickHandler)||void 0===n?void 0:n.createHook({eventsManager:this.eventsManager,sessionId:h,deviceIdFn:this.getDeviceId.bind(this),mirror:d.mirror,ugcFilterRules:null!==(i=f.ugcFilterRules)&&void 0!==i?i:[],performanceOptions:null===(o=a.performanceConfig)||void 0===o?void 0:o.interaction})),scroll:this.scrollHook}:{},v=(null==f?void 0:f.enabled)&&f.ugcFilterRules?f.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(h,".")),l.label=3;case 3:return l.trys.push([3,5,,6]),y=this,b=d,S={emit:function(e){if(x.shouldOptOut())return x.loggerProvider.log("Opting session ".concat(h," out of recording due to optOut config.")),x.stopRecordingEvents(),void x.sendEvents();e.type===Io.Meta&&(e.data.href=xo(e.data.href,v)),x.eventCompressor&&x.eventCompressor.enqueueEvent(e,h)},inlineStylesheet:a.shouldInlineStylesheet,hooks:m,maskAllInputs:!0,maskTextClass:go,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:a.applyBackgroundColorToBlockedElements,maskInputFn:bo("input",p),maskTextFn:bo("text",p),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:null===(s=a.omitElementTags)||void 0===s?void 0:s.script,comment:null===(u=a.omitElementTags)||void 0===u?void 0:u.comment},errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return x.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(g)];case 4:return y.recordCancelCallback=b.apply(void 0,[(S.plugins=l.sent(),S)]),this.addCustomRRWebEvent(so.DEBUG_INFO),e&&this.addCustomRRWebEvent(so.METADATA,this.metadata),[3,6];case 5:return w=l.sent(),this.loggerProvider.warn("Failed to initialize session replay:",w),[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())?Pe(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 _S})];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}(),Pa=function(e){return function(){var t=e.config||Eo();return{logger:t.loggerProvider,logLevel:t.logLevel}}},Ta=function(){var e=new Ia;return{init:oe(e.init.bind(e),"init",Pa(e)),evaluateTargetingAndCapture:oe(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",Pa(e)),setSessionId:oe(e.setSessionId.bind(e),"setSessionId",Pa(e)),getSessionId:oe(e.getSessionId.bind(e),"getSessionId",Pa(e)),getSessionReplayProperties:oe(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",Pa(e)),flush:oe(e.flush.bind(e),"flush",Pa(e)),shutdown:oe(e.shutdown.bind(e),"shutdown",Pa(e))}}(),Ra=Ta.init,Ma=Ta.setSessionId,Aa=Ta.getSessionId,_a=Ta.getSessionReplayProperties,Na=Ta.flush,La=Ta.shutdown,Da=Ta.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"}(Ca||(Ca={})),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"}(Ea||(Ea={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(Oa||(Oa={}));var Ua=[Ca.SET,Ca.SET_ONCE,Ca.ADD,Ca.APPEND,Ca.PREPEND,Ca.POSTINSERT],Fa="1.25.4-feat-zoning-1223.0",ja="".concat("[Amplitude]"," Session Replay ID"),Ba=function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:Na,getSessionId:Aa,getSessionReplayProperties:_a,init:Ra,setSessionId:Ma,shutdown:La,evaluateTargetingAndCapture:Da},this.options=o({forceSessionTracking:!1},t),this.srInitOptions=this.options}return e.prototype.setup=function(e,t){var r,n,i,s,u,c,h,d;return a(this,void 0,void 0,function(){var t,a,p;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(Fa,".")),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=(f=this.config.instanceName,void 0===f&&(f="$default_instance"),ye.getInstance(f)).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:Fa},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:null!==(h=this.options.useWebWorker)&&void 0!==h?h:null===(d=this.options.experimental)||void 0===d?void 0:d.useWebWorker,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 p=l.sent(),null==e||e.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(p.message)),[3,3];case 3:return[2]}var f})})},e.prototype.onSessionIdChanged=function(e){var t;return a(this,void 0,void 0,function(){return l(this,function(r){switch(r.label){case 0:return null===(t=this.config)||void 0===t||t.loggerProvider.debug("Analytics session id is changed to ".concat(e,", SR session id is ").concat(String(this.sessionReplay.getSessionId()),".")),[4,this.sessionReplay.setSessionId(e).promise];case 1:return r.sent(),[2]}})})},e.prototype.onOptOutChanged=function(e){var t;return a(this,void 0,void 0,function(){return l(this,function(r){switch(r.label){case 0:return null===(t=this.config)||void 0===t||t.loggerProvider.debug("optOut is changed to ".concat(String(e),", calling ").concat(e?"sessionReplay.shutdown()":"sessionReplay.init()",".")),e?(this.sessionReplay.shutdown(),[3,4]):[3,1];case 1:return null!=this.config?[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise]:[3,3];case 2:r.sent(),r.label=3;case 3:r.label=4;case 4:return[2]}})})},e.prototype.execute=function(e){var t,r;return a(this,void 0,void 0,function(){var n,s,a,u;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,9,,10]),this.options.customSessionId?(n=this.options.customSessionId(e))?n===this.sessionReplay.getSessionId()?[3,2]:[4,this.sessionReplay.setSessionId(n).promise]:[3,3]:[3,4];case 1:l.sent(),l.label=2;case 2:a=this.sessionReplay.getSessionReplayProperties(),e.event_properties=o(o({},e.event_properties),a),l.label=3;case 3:return[3,8];case 4:return(n=null===(t=this.config)||void 0===t?void 0:t.sessionId)&&n!==this.sessionReplay.getSessionId()?[4,this.sessionReplay.setSessionId(n).promise]:[3,6];case 5:l.sent(),l.label=6;case 6:return n&&n===e.session_id?(s=void 0,e.event_type===i.IDENTIFY&&(s=function(e){if(e.user_properties){var t={};return Object.keys(e.user_properties).forEach(function(r){if(Ua.includes(r)){var n=e.user_properties&&e.user_properties[r];t=o(o({},t),n)}}),t}}(e)),[4,this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:s})]):[3,8];case 7:l.sent(),a=this.sessionReplay.getSessionReplayProperties(),e.event_properties=o(o({},e.event_properties),a),l.label=8;case 8:return e.event_type===i.IDENTIFY&&e.event_properties&&delete e.event_properties[ja],[2,Promise.resolve(e)];case 9:return u=l.sent(),null===(r=this.config)||void 0===r||r.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(u.message)),[2,Promise.resolve(e)];case 10:return[2]}})})},e.prototype.teardown=function(){var e;return a(this,void 0,void 0,function(){return l(this,function(t){try{this.sessionReplay.shutdown(),this.config=null}catch(t){null===(e=this.config)||void 0===e||e.loggerProvider.error("Session Replay: teardown failed due to ".concat(t.message))}return[2]})})},e.prototype.getSessionReplayProperties=function(){return this.sessionReplay.getSessionReplayProperties()},e.pluginName="@amplitude/plugin-session-replay-browser",e}(),qa=function(e,t){return qa=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])},qa(e,t)};function za(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}qa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var Va=function(){return Va=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},Va.apply(this,arguments)};function Wa(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 $a(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 Ka(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 Ha(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 Ga="is",Ya="is not",Xa="contains",Qa="does not contain",Za="less",el="less or equal",tl="greater",rl="greater or equal",nl="version less",il="version less or equal",ol="version greater",sl="version greater or equal",al="set is",ll="set is not",ul="set contains",cl="set does not contain",hl="set contains any",dl="set does not contain any",pl="regex match",fl="regex does not match",gl=-862048943,ml=461845907,vl=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=Sl(r,s<<2);o=yl(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,gl),u=wl(u,15),o^=u=Math.imul(u,ml);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,gl),u=wl(u,15),o^=u=Math.imul(u,ml);break;case 1:u^=r[l],u=Math.imul(u,gl),u=wl(u,15),o^=u=Math.imul(u,ml)}return bl(o^=n)>>>0},yl=function(e,t){var r=e,n=t;return r=Math.imul(r,gl),r=wl(r,15),r=Math.imul(r,ml),n=wl(n^=r,13),(n=Math.imul(n,5))+-430675100|0},bl=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},wl=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},Sl=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 xl(r)},xl=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},kl=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=Ka(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}},Cl="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),El=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(Cl).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}(),Ol=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=Ka(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=Ka(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=Va(Va(Va({},t.metadata),a.metadata),i.metadata);i=Va(Va({},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=Ka(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=!0;try{for(var c=(i=void 0,Ka(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=kl(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 vl(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(kl(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=Ka(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,Ka(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 Ga:case Xa:case Za:case el:case tl:case rl:case nl:case il:case ol:case sl:case al:case ul:case hl:return r;case Ya:case Qa:case cl:case dl:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case al:return this.setEquals(e,r);case ll:return!this.setEquals(e,r);case ul:return this.matchesSetContainsAll(e,r);case cl:return!this.matchesSetContainsAll(e,r);case hl:return this.matchesSetContainsAny(e,r);case dl:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Ga:return this.matchesIs(e,r);case Ya:return!this.matchesIs(e,r);case Xa:return this.matchesContains(e,r);case Qa:return!this.matchesContains(e,r);case Za:case el:case tl:case rl:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case nl:case il:case ol:case sl:return this.matchesComparable(e,t,r,function(e){return El.parse(e)},this.versionComparator);case pl:return this.matchesRegex(e,r);case fl: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=Ka(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 nl:return e<r;case el:case il:return e<=r;case tl:case ol:return e>r;case rl:case sl:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Za:case nl:return n<0;case el:case il:return n<=0;case tl:case ol:return n>0;case rl:case sl: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 al:case ll:case ul:case cl:case hl:case dl: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([],Ha(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=Ka(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=Ka(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(this.matchesIs(s,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e}(),Il=function(e,t,r){var n,i;void 0===r&&(r=[]);var o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];r.push(o.key);var s=[],a=function(e){if(r.some(function(t){return t===e}))throw Error("Detected a cycle between flags ".concat(r));var n=Il(e,t,r);n&&s.push.apply(s,Ja([],Ha(n),!1))};try{for(var l=Ka(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 Pl="function"==typeof Buffer,Tl=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),Rl=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Ml=(e=>{let t={};return e.forEach((e,r)=>t[e]=r),t})(Rl),Al=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,_l=String.fromCharCode.bind(String),Nl=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_")),Ll=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Dl=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+=Rl[t>>18&63]+Rl[t>>12&63]+Rl[t>>6&63]+Rl[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},Ul="function"==typeof btoa?e=>btoa(e):Pl?e=>Buffer.from(e,"binary").toString("base64"):Dl,Fl=Pl?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(_l.apply(null,e.subarray(r,r+4096)));return Ul(t.join(""))},jl=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?_l(192|t>>>6)+_l(128|63&t):_l(224|t>>>12&15)+_l(128|t>>>6&63)+_l(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return _l(240|t>>>18&7)+_l(128|t>>>12&63)+_l(128|t>>>6&63)+_l(128|63&t)},Bl=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,ql=e=>e.replace(Bl,jl),zl=Pl?e=>Buffer.from(e,"utf8").toString("base64"):Tl?e=>Fl(Tl.encode(e)):e=>Ul(ql(e)),Vl=(e,t=!1)=>t?Nl(zl(e)):zl(e),Wl=e=>Vl(e,!0),$l=e=>{if(e=e.replace(/\s+/g,""),!Al.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,n,i="";for(let o=0;o<e.length;)t=Ml[e.charAt(o++)]<<18|Ml[e.charAt(o++)]<<12|(r=Ml[e.charAt(o++)])<<6|(n=Ml[e.charAt(o++)]),i+=64===r?_l(t>>16&255):64===n?_l(t>>16&255,t>>8&255):_l(t>>16&255,t>>8&255,255&t);return i},Kl=Wl;var Hl=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return za(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 za(t,e),t}(Error),Gl=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return Wa(this,void 0,void 0,function(){var r,n,i,o;return $a(this,function(s){switch(s.label){case 0:return r=Kl(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"]=Kl(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 Hl(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}})})},e}(),Yl=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return Wa(this,void 0,void 0,function(){var t,r;return $a(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"]=Kl(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}(),Xl="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},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=Xl.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(Xl.clearInterval(this.poller),this.poller=void 0)},e}(),eu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},tu={},ru={get exports(){return tu},set exports(e){tu=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",x="ASUS",k="BlackBerry",C="Browser",E="Chrome",O="Firefox",I="Google",P="Huawei",T="LG",R="Microsoft",M="Motorola",A="Opera",_="Samsung",N="Sharp",L="Sony",D="Xiaomi",U="Zebra",F="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!==q(t).indexOf(q(e))},q=function(e){return e.toLowerCase()},z=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},V=function(e,t){for(var r,o,a,l,u,c,h=0;h<t.length&&!u;){var d=t[h],p=t[h+1];for(r=o=0;r<d.length&&!u;)if(u=d[r++].exec(e))for(a=0;a<p.length;a++)c=u[++o],typeof(l=p[a])===s&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):n:this[l[0]]=c?l[1].call(this,c,l[2]):n:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):n):this[l]=c||n;h+=2}},W=function(e,t){for(var r in t)if(typeof t[r]===s&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(B(t[r][i],e))return"?"===r?n:r}else if(B(t[r],e))return"?"===r?n:r;return e},$={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"},K={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,A+" Mini"]],[/\bopr\/([\w\.]+)/i],[d,[u,A]],[/(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"+C]],[/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 "+C],d],[/\bfocus\/([\w\.]+)/i],[d,[u,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[d,[u,A+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[u,A+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[u,"MIUI "+C]],[/fxios\/([-\w\.]+)/i],[d,[u,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+C]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+C],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,F],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,E+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,E+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[u,"Android "+C]],[/(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,O+" 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,q]],[/((?: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/,"",q]],[/(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,q]]],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,_],[c,m]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[h,_],[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,P],[c,m]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[h,P],[c,g]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[h,D],[c,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[h,D],[c,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[h,"OPPO"],[c,g]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[h,"Vivo"],[c,g]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[h,"Realme"],[c,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[h,M],[c,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[h,M],[c,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[h,T],[c,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[h,T],[c,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[h,"Lenovo"],[c,m]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[h,"Nokia"],[c,g]],[/(pixel c)\b/i],[l,[h,I],[c,m]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[h,I],[c,g]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[h,L],[c,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[h,L],[c,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[h,"OnePlus"],[c,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[h,w],[c,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[h,w],[c,g]],[/(playbook);[-\w\),; ]+(rim)/i],[l,h,[c,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[h,k],[c,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[h,x],[c,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[h,x],[c,g]],[/(nexus 9)/i],[l,[h,"HTC"],[c,m]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[l,/_/g," "],[c,g]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[h,"Acer"],[c,m]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[h,"Meizu"],[c,g]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[h,N],[c,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,l,[c,g]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,l,[c,m]],[/(surface duo)/i],[l,[h,R],[c,m]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[h,"Fairphone"],[c,g]],[/(u304aa)/i],[l,[h,"AT&T"],[c,g]],[/\bsie-(\w*)/i],[l,[h,"Siemens"],[c,g]],[/\b(rct\w+) b/i],[l,[h,"RCA"],[c,m]],[/\b(venue[\d ]{2,7}) b/i],[l,[h,"Dell"],[c,m]],[/\b(q(?:mv|ta)\w+) b/i],[l,[h,"Verizon"],[c,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[h,"Barnes & Noble"],[c,m]],[/\b(tm\d{3}\w+) b/i],[l,[h,"NuVision"],[c,m]],[/\b(k88) b/i],[l,[h,"ZTE"],[c,m]],[/\b(nx\d{3}j) b/i],[l,[h,"ZTE"],[c,g]],[/\b(gen\d{3}) b.+49h/i],[l,[h,"Swiss"],[c,g]],[/\b(zur\d{3}) b/i],[l,[h,"Swiss"],[c,m]],[/\b((zeki)?tb.*\b) b/i],[l,[h,"Zeki"],[c,m]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],l,[c,m]],[/\b(ns-?\w{0,9}) b/i],[l,[h,"Insignia"],[c,m]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[h,"NextBook"],[c,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],l,[c,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],l,[c,g]],[/\b(ph-1) /i],[l,[h,"Essential"],[c,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[h,"Envizen"],[c,m]],[/\b(trio[-\w\. ]+) b/i],[l,[h,"MachSpeed"],[c,m]],[/\btu_(1491) b/i],[l,[h,"Rotor"],[c,m]],[/(shield[\w ]+) b/i],[l,[h,"Nvidia"],[c,m]],[/(sprint) (\w+)/i],[h,l,[c,g]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[h,R],[c,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[h,U],[c,m]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[h,U],[c,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,l,[c,f]],[/droid.+; (shield) bui/i],[l,[h,"Nvidia"],[c,f]],[/(playstation [345portablevi]+)/i],[l,[h,L],[c,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[h,R],[c,f]],[/smart-tv.+(samsung)/i],[h,[c,v]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[h,_],[c,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,T],[c,v]],[/(apple) ?tv/i],[h,[l,S+" TV"],[c,v]],[/crkey/i],[[l,E+"cast"],[h,I],[c,v]],[/droid.+aft(\w)( bui|\))/i],[l,[h,w],[c,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[h,N],[c,v]],[/(bravia[\w ]+)( bui|\))/i],[l,[h,L],[c,v]],[/(mitv-\w{5}) bui/i],[l,[h,D],[c,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,z],[l,z],[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,I],[c,y]],[/droid.+; (wt63?0{2,3})\)/i],[l,[h,U],[c,y]],[/(quest( 2)?)/i],[l,[h,F],[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,$]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[d,W,$]],[/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,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[u,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[u,E+"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]]},H=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof H))return new H(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}(K,t):K;return this.getBrowser=function(){var e={};return e[u]=n,e[d]=n,V.call(e,i,f.browser),e.major=function(e){return typeof e===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n}(e.version),e},this.getCPU=function(){var e={};return e[p]=n,V.call(e,i,f.cpu),e},this.getDevice=function(){var e={};return e[h]=n,e[l]=n,e[c]=n,V.call(e,i,f.device),e},this.getEngine=function(){var e={};return e[u]=n,e[d]=n,V.call(e,i,f.engine),e},this.getOS=function(){var e={};return e[u]=n,e[d]=n,V.call(e,i,f.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===a&&e.length>350?z(e,350):e,this},this.setUA(i),this};H.VERSION="0.7.33",H.BROWSER=j([u,d,"major"]),H.CPU=j([p]),H.DEVICE=j([l,h,c,f,g,v,m,y,b]),H.ENGINE=H.OS=j([u,d]),e.exports&&(t=e.exports=H),t.UAParser=H;var J=typeof r!==o&&(r.jQuery||r.Zepto);if(J&&!J.ua){var G=new H;J.ua=G.getResult(),J.ua.get=function(){return G.getUA()},J.ua.set=function(e){G.setUA(e);var t=G.getResult();for(var r in t)J.ua[r]=t[r]}}}("object"==typeof window?window:eu)}(ru,tu);var nu=function(){return nu=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},nu.apply(this,arguments)};function iu(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})}function ou(e,t){var r,n,i,o={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 su(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 au(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 lu(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 uu=function(e,t){var r,n;void 0===t&&(t=!1);var i=cu(e,t),o=void 0,s=Xl.document.cookie.split("; ");try{for(var a=su(s),l=a.next();!l.done;l=a.next()){var u=au(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}},cu=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))},hu=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 iu(this,void 0,void 0,function(){return ou(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=uu(this.apiKey,!0);return(e||(e=uu(this.apiKey,!1))||(e=function(e){var t=cu(e,!0);try{var r=Xl.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=cu(e,!0);try{var r=Xl.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 iu(this,void 0,void 0,function(){var t,r=this;return ou(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){Xl.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])]})})},e}();var du,pu,fu,gu=Xl.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)})},mu=function(){function e(e){this.client=e}return e.prototype.request=function(e){return iu(this,void 0,void 0,function(){return ou(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}(),vu={request:function(e,t,r,n,i){return function(e,t){return null==t||t<=0?e:new Promise(function(r,n){Xl.setTimeout(function(){n(new Jl("Request timeout after "+t+" milliseconds"))},t),e.then(r,n)})}(iu(void 0,void 0,void 0,function(){var i,o;return ou(this,function(s){switch(s.label){case 0:return[4,gu(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"}(du||(du={})),function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(pu||(pu={})),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"}(fu||(fu={}));var yu=function(e){return!e||e===fu.FallbackInline||e===fu.FallbackConfig||e===fu.SecondaryInitialVariants},bu={debug:!1,logLevel:du.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:pu.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:vu},wu="1.20.0",Su=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:bu.instanceName;this.queue=new ku(i),this.cache=new xu(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}(),xu=function(){function e(e){this.isSessionStorageAvailable=Cu(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&Xl.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=Xl.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&Xl.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),ku=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=Xl.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=su(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&&(Xl.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=Xl.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)),Xl.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),Cu=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},Eu=function(){function e(e,t){void 0===t&&(t=du.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>=du.Error&&(t=this.logger).error.apply(t,lu([e],au(r),!1))},e.prototype.warn=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=du.Warn&&(t=this.logger).warn.apply(t,lu([e],au(r),!1))},e.prototype.info=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=du.Info&&(t=this.logger).info.apply(t,lu([e],au(r),!1))},e.prototype.debug=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=du.Debug&&(t=this.logger).debug.apply(t,lu([e],au(r),!1))},e.prototype.verbose=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=du.Verbose&&(t=this.logger).verbose.apply(t,lu([e],au(r),!1))},e}(),Ou=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,lu([e],au(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,lu([e],au(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,lu([e],au(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,lu([e],au(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,lu([e],au(t),!1))},e}(),Iu=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}(),Pu=function(){function e(e,t){this.namespace=e,this.storage=t}return e.prototype.get=function(){return this.value},e.prototype.put=function(e){this.value=e},e.prototype.load=function(){var e=this.storage.get(this.namespace);e&&(this.value=JSON.parse(e))},e.prototype.store=function(){void 0===this.value?this.storage.delete(this.namespace):this.storage.put(this.namespace,JSON.stringify(this.value))},e}(),Tu=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 nu({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=su(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=su(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}(),Ru=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}},Mu=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}(),Au=function(e){return null==e},_u=function(e){return!!Au(e)||e&&0===Object.keys(e).length},Nu=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},Lu=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 iu(this,void 0,void 0,function(){return ou(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 iu(this,void 0,void 0,function(){var n=this;return ou(this,function(i){return this.done||(this.timeoutHandle=Xl.setTimeout(function(){return iu(n,void 0,void 0,function(){var n,i;return ou(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}(),Du=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},Uu=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},Fu=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}(),ju=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}(),Bu=function(){function e(t,r){var n,i,o,s,a=this;this.engine=new Ol,this.isRunning=!1,this.apiKey=t,r=function(e){var t,r;if(!e||"object"!=typeof e)return{};var n={};try{for(var i=su(Object.entries(e)),o=i.next();!o.done;o=i.next()){var s=au(o.value,2),a=s[0],l=s[1];Au(l)||(n[a]=l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}(r),this.config=nu(nu(nu({},bu),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":bu.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":bu.flagsServerUrl),flagConfigPollingIntervalMillis:r.flagConfigPollingIntervalMillis<6e4?6e4:null!==(o=r.flagConfigPollingIntervalMillis)&&void 0!==o?o:bu.flagConfigPollingIntervalMillis}),this.logger=new Eu(this.config.loggerProvider||new Ou,e.getLogLevel(r));var l=null===(s=this.config)||void 0===s?void 0:s.internalInstanceNameSuffix;if(this.isWebExperiment="web"===l,this.poller=new Zl(function(){return a.doFlags()},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var u in this.config.initialVariants)this.config.initialVariants[u]=Ru(this.config.initialVariants[u]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new Fu(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new ju(this.config.exposureTrackingProvider)),this.integrationManager=new Su(this.config,this);var c,h=new mu(this.config.httpClient||vu);this.flagApi=new Yl(this.apiKey,this.config.flagsServerUrl,h),this.evaluationApi=new Gl(this.apiKey,this.config.serverUrl,h);var d=l?"".concat(this.config.instanceName,"-").concat(l):this.config.instanceName;c=this.isWebExperiment?new Mu:new Iu,this.variants=function(e,t,r){var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n);return new Tu(i,r,Ru)}(this.apiKey,d,c),this.flags=function(e,t,r){void 0===r&&(r=new Iu);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-flags");return new Tu(i,r)}(this.apiKey,d,c),this.fetchVariantsOptions=function(e,t,r){void 0===r&&(r=new Iu);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-variants-options");return new Pu(i,r)}(this.apiKey,d,c);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return iu(this,void 0,void 0,function(){var t,r,n;return ou(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 iu(this,arguments,void 0,function(e,t){var r;return void 0===e&&(e=this.user),ou(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);Nu(r)||delete e[t]}return nu(nu(nu({},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=nu({},this.user.user_properties);return nu(nu({},this.user),{user_properties:t})}return nu({},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=nu({},e.user_properties);this.user=nu(nu({},e),{user_properties:r})}else this.user=nu({},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=Va({},e),o=[],s=t||Object.keys(i);try{for(var a=Ka(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=Il(u,i);c&&o.push.apply(o,Ja([],Ha(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=su(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=su(Object.keys(s)),u=l.next();!u.done;u=l.next()){var c=u.value;a[c]=Uu(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===pu.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===pu.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var n=this.flags.get(e);return(Nu(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=fu.LocalEvaluation,a=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!Au(o)&&!a)return{variant:Du(o),source:s,hasDefaultVariant:!1};if(a&&(i={variant:Du(o),source:s,hasDefaultVariant:!0}),!Au(r))return{variant:Du(r),source:fu.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!Au(l))return{variant:Du(l),source:fu.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=Du(this.config.fallbackVariant),c={variant:u,source:fu.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return _u(u)?i:c},e.prototype.localStorageVariantAndSource=function(e,t){var r,n={},i=this.variants.get(e),o=null===(r=null==i?void 0:i.metadata)||void 0===r?void 0:r.default;if(!Au(i)&&!o)return{variant:Du(i),source:fu.LocalStorage,hasDefaultVariant:!1};if(o&&(n={variant:Du(i),source:fu.LocalStorage,hasDefaultVariant:!0}),!Au(t))return{variant:Du(t),source:fu.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=this.config.initialVariants[e];if(!Au(s))return{variant:Du(s),source:fu.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var a=Du(this.config.fallbackVariant),l={variant:a,source:fu.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return _u(a)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!Au(i))return{variant:Du(i),source:fu.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),s=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!Au(o)&&!s)return{variant:Du(o),source:fu.LocalStorage,hasDefaultVariant:!1};if(s&&(n={variant:Du(o),source:fu.LocalStorage,hasDefaultVariant:!0}),!Au(t))return{variant:Du(t),source:fu.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var a=Du(this.config.fallbackVariant),l={variant:a,source:fu.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return _u(a)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return iu(this,void 0,void 0,function(){var i,o,s;return ou(this,function(a){switch(a.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.logger.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.doFetch(e,t,nu({trackingOption:null===(s=this.fetchVariantsOptions.get())||void 0===s?void 0:s.trackingOption},n))];case 2:return i=a.sent(),[4,this.storeVariants(i,n)];case 3:return a.sent(),[2,i];case 4:throw o=a.sent(),r&&this.shouldRetryFetch(o)&&this.startRetries(e,n),o;case 5:return[2]}})})},e.prototype.setTracksAssignment=function(e){return iu(this,void 0,void 0,function(){return ou(this,function(t){return this.fetchVariantsOptions.put(nu(nu({},this.fetchVariantsOptions.get()||{}),{trackingOption:e?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]})})},e.prototype.cleanUserPropsForFetch=function(e){var t=nu({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return iu(this,void 0,void 0,function(){var n,i,o,s,a,l,u;return ou(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,nu({timeoutMillis:t},r))];case 2:n=c.sent(),i={};try{for(o=su(Object.keys(n)),s=o.next();!s.done;s=o.next())a=s.value,i[a]=Uu(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 iu(this,void 0,void 0,function(){var e,t,r;return ou(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:wu,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 iu(this,void 0,void 0,function(){var r,n,i,o;return ou(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 iu(this,void 0,void 0,function(){var r=this;return ou(this,function(n){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new Lu(8,500,1e4,1.5),this.retriesBackoff.start(function(){return iu(r,void 0,void 0,function(){return ou(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=nu(nu(nu({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return nu(nu(nu(nu({library:"experiment-js-client/".concat(wu)},r),n),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return iu(this,void 0,void 0,function(){return ou(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==pu.LocalStorage?this.variants.getAll():this.config.source==pu.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==pu.LocalStorage?this.config.initialVariants:this.config.source==pu.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=yu(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);yu(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?du.Debug:null!==(t=e.logLevel)&&void 0!==t?t:du.Error},e.prototype.shouldRetryFetch=function(e){return!(e instanceof Hl)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),qu=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 tu.UAParser(this.userAgent).getResult(),this.localStorage=new Iu,this.sessionStorage=new Mu,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 nu({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=su(i.searchParams),s=o.next();!s.done;s=o.next()){var a=au(s.value,2),l=a[0],u=a[1];n[l]=lu(lu([],au(null!==(r=n[l])&&void 0!==r?r:[]),!1),au(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=au(t,2),n=r[0],i=r[1];return e[n]=1==i.length?i[0]:i,e},{})}},e}();Xl.experimentInstances={};var zu=Xl.experimentInstances,Vu=function(e){return(null==e?void 0:e.instanceName)||bu.instanceName},Wu=function(e,t,r){var n=function(e,t){var r=Vu(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)}(e,t),i=zu[n];return i||(i=function(e,t){return new Bu(e,nu(nu({},t),{userProvider:new qu(null==t?void 0:t.userProvider,e)}))}(e,t),r&&i.addPlugin(r()),zu[n]=i,i)},$u=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 Wu(e,t,function(){return new hu(e,ye.getInstance(Vu(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}(),Ku=function(e){return new $u(e)},Hu=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Ju(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),Ju=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Gu=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}(),Yu=function(){return Yu=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},Yu.apply(this,arguments)};function Xu(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 Qu(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}var Zu=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=Xu(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next()){if(s.value===i)return e===t}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var u=Object.keys(e).sort(),c=Object.keys(t).sort();if(!Zu(u,c))return!1;var h=!0;return Object.keys(e).forEach(function(r){Zu(e[r],t[r])||(h=!1)}),h}for(var d=0;d<e.length;d++)if(!Zu(e[d],t[d]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var ec=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=Yu({},this.identity.userProperties),r=Yu(Yu({},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=Xu(Object.entries(e)),c=u.next();!c.done;c=u.next()){var h=Qu(c.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(i=void 0,Xu(Object.entries(p))),g=f.next();!g.done;g=f.next()){var m=Qu(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,Xu(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 Yu({},this.identity)},e.prototype.setIdentity=function(e){var t=Yu({},this.identity);this.identity=Yu({},e),Zu(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),tc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:self,rc=function(){function e(){this.identityStore=new ec,this.eventBridge=new Gu,this.applicationContextProvider=new Hu}return e.getInstance=function(t){return tc.analyticsConnectorInstances||(tc.analyticsConnectorInstances={}),tc.analyticsConnectorInstances[t]||(tc.analyticsConnectorInstances[t]=new e),tc.analyticsConnectorInstances[t]},e}(),nc=["boot"];var ic=(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))(ic||{});var oc=((e=>{if(typeof window<"u"&&window.opener)for(let t of Object.values(ic))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(nc.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=rc.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)}}}):nc.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))),sc=e=>(typeof window<"u"&&!window.engagement&&(window.engagement=oc),oc.plugin(e)),ac=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($u);return 0===e.length?void this.config.loggerProvider.debug("".concat($u.pluginName," plugin is not found.")):1===e.length?e[0].experiment:void this.config.loggerProvider.debug("Multiple instances of ".concat($u.pluginName," are found."))}},t.prototype.initAll=function(t,r){return a(this,void 0,void 0,function(){var n,i;return l(this,function(s){switch(s.label){case 0:return n={serverZone:null==r?void 0:r.serverZone,instanceName:null==r?void 0:r.instanceName},e.prototype.add.call(this,{type:"enrichment",name:"@amplitude/unified-library-plugin",execute:function(e){var t;return a(this,void 0,void 0,function(){return l(this,function(r){return e.library="".concat("amplitude-ts-unified","/").concat("1.0.0-feat-zoning-1223.0","-").concat(null!==(t=e.library)&&void 0!==t?t:""),[2,e]})})}}),[4,e.prototype.init.call(this,t,o(o({},null==r?void 0:r.analytics),n)).promise];case 1:return s.sent(),[4,e.prototype.add.call(this,(u=o(o({},null==r?void 0:r.sessionReplay),n),new Ba(u))).promise];case 2:return s.sent(),[4,e.prototype.add.call(this,Ku(o(o({},null==r?void 0:r.experiment),n))).promise];case 3:return s.sent(),void 0===(i=this.plugin(Ba.pluginName))?this.config.loggerProvider.debug("".concat(Ba.pluginName," plugin is not found.")):this._sessionReplay=i.sessionReplay,[4,e.prototype.add.call(this,sc(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}(ao),lc=function(){var e=new ac;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"]))}},uc=lc(),cc=uc._setDiagnosticsSampleRate,hc=uc.initAll,dc=uc.experiment,pc=uc.sessionReplay,fc=uc.add,gc=uc.extendSession,mc=uc.flush,vc=uc.getDeviceId,yc=uc.getSessionId,bc=uc.getUserId,wc=uc.groupIdentify,Sc=uc.identify,xc=uc.logEvent,kc=uc.remove,Cc=uc.reset,Ec=uc.revenue,Oc=uc.setDeviceId,Ic=uc.setGroup,Pc=uc.setOptOut,Tc=uc.setSessionId,Rc=uc.setTransport,Mc=uc.setUserId,Ac=uc.track,_c=function(e,t){return _c=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])},_c(e,t)};var Nc=function(){return Nc=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},Nc.apply(this,arguments)};function Lc(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 Dc="is",Uc="is not",Fc="contains",jc="does not contain",Bc="less",qc="less or equal",zc="greater",Vc="greater or equal",Wc="version less",$c="version less or equal",Kc="version greater",Hc="version greater or equal",Jc="set is",Gc="set is not",Yc="set contains",Xc="set does not contain",Qc="set contains any",Zc="set does not contain any",eh="regex match",th="regex does not match",rh=-862048943,nh=461845907,ih=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=lh(r,s<<2);o=oh(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,rh),u=ah(u,15),o^=u=Math.imul(u,nh);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,rh),u=ah(u,15),o^=u=Math.imul(u,nh);break;case 1:u^=r[l],u=Math.imul(u,rh),u=ah(u,15),o^=u=Math.imul(u,nh)}return sh(o^=n)>>>0},oh=function(e,t){var r=e,n=t;return r=Math.imul(r,rh),r=ah(r,15),r=Math.imul(r,nh),n=ah(n^=r,13),(n=Math.imul(n,5))+-430675100|0},sh=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},ah=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},lh=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 uh(r)},uh=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},ch=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=Lc(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}},hh="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),dh=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(hh).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}(),ph=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=Lc(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=Lc(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=Nc(Nc(Nc({},t.metadata),a.metadata),i.metadata);i=Nc(Nc({},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=Lc(r.conditions),l=a.next();!l.done;l=a.next()){var u,c=l.value,h=!0;try{for(var d=(o=void 0,Lc(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=ch(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 ih(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(ch(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=Lc(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,Lc(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 Dc:case Fc:case Bc:case qc:case zc:case Vc:case Wc:case $c:case Kc:case Hc:case Jc:case Yc:case Qc:return r;case Uc:case jc:case Xc:case Zc:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Jc:return this.setEquals(e,r);case Gc:return!this.setEquals(e,r);case Yc:return this.matchesSetContainsAll(e,r);case Xc:return!this.matchesSetContainsAll(e,r);case Qc:return this.matchesSetContainsAny(e,r);case Zc:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Dc:return this.matchesIs(e,r);case Uc:return!this.matchesIs(e,r);case Fc:return this.matchesContains(e,r);case jc:return!this.matchesContains(e,r);case Bc:case qc:case zc:case Vc:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case Wc:case $c:case Kc:case Hc:return this.matchesComparable(e,t,r,function(e){return dh.parse(e)},this.versionComparator);case eh:return this.matchesRegex(e,r);case th: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=Lc(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 Bc:case Wc:return e<r;case qc:case $c:return e<=r;case zc:case Kc:return e>r;case Vc:case Hc:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Bc:case Wc:return n<0;case qc:case $c:return n<=0;case zc:case Kc:return n>0;case Vc:case Hc: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 Jc:case Gc:case Yc:case Xc:case Qc:case Zc:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}(n),!1).every(function(e){return r.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var i=Lc(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=Lc(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}_c(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var fh,gh=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,Os(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]}})})}},mh=new gh,vh=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,mh.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 ph},yh=function(){var e=new vh;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,bh=Object.freeze({__proto__:null,evaluateTargeting:yh}),wh=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,!0)};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'}),Sh=Object.defineProperty,xh=(e,t,r)=>((e,t,r)=>t in e?Sh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),kh=Object.defineProperty,Ch=(e,t,r)=>((e,t,r)=>t in e?kh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Eh=Object.defineProperty,Oh=(e,t,r)=>((e,t,r)=>t in e?Eh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const Ih={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ph={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Th={};function Rh(e){if(Th[e])return Th[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in Ih?Ih[e]:void 0,i=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in Ph?Ph[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 Th[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?Th[e]=o:r}catch{return r}}const Mh={};function Ah(e,t,r){var n;const i=`${e}.${String(r)}`;if(Mh[i])return Mh[i].call(t);const o=Rh(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Mh[i]=s,s.call(t)):t[r]}const _h={};function Nh(e,t,r){const n=`${e}.${String(r)}`;if(_h[n])return _h[n].bind(t);const i=Rh(e)[r];return"function"!=typeof i?t[r]:(_h[n]=i,i.bind(t))}const Lh={childNodes:function(e){return Ah("Node",e,"childNodes")},parentNode:function(e){return Ah("Node",e,"parentNode")},parentElement:function(e){return Ah("Node",e,"parentElement")},textContent:function(e){return Ah("Node",e,"textContent")},contains:function(e,t){return Nh("Node",e,"contains")(t)},getRootNode:function(e){return Nh("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ah("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ah("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ah("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ah("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Rh("MutationObserver").constructor}};class Dh{constructor(){Oh(this,"idNodeMap",new Map),Oh(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 Uh(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Uh(Lh.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Uh(Lh.parentNode(e),t,r)}function Fh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jh(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 Bh,qh={exports:{}};function zh(){if(Bh)return qh.exports;Bh=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return qh.exports=t(),qh.exports.createColors=t,qh.exports}const Vh=jh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Wh,$h;function Kh(){if($h)return Wh;$h=1;let e=zh(),t=Vh;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Wh=r,r.default=r,Wh}var Hh,Jh,Gh,Yh,Xh,Qh,Zh,ed,td,rd,nd,id,od,sd,ad,ld,ud,cd,hd,dd,pd,fd,gd,md,vd,yd,bd,wd,Sd,xd,kd,Cd,Ed,Od,Id,Pd,Td,Rd,Md,Ad,_d,Nd,Ld,Dd,Ud,Fd,jd,Bd,qd,zd,Vd,Wd,$d,Kd={};function Hd(){return Hh||(Hh=1,Kd.isClean=Symbol("isClean"),Kd.my=Symbol("my")),Kd}function Jd(){if(Gh)return Jh;Gh=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}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)}}return Jh=t,t.default=t,Jh}function Gd(){if(Xh)return Yh;Xh=1;let e=Jd();function t(t,r){new e(r).stringify(t)}return Yh=t,t.default=t,Yh}function Yd(){if(Zh)return Qh;Zh=1;let{isClean:e,my:t}=Hd(),r=Kh(),n=Jd(),i=Gd();function o(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],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=i){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}}return Qh=s,s.default=s,Qh}function Xd(){if(td)return ed;td=1;let e=Yd();class t extends e{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]}}return ed=t,t.default=t,ed}function Qd(){if(nd)return rd;nd=1;return rd={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}},rd}function Zd(){if(od)return id;od=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Vh,{existsSync:r,readFileSync:n}=Vh,{dirname:i,join:o}=Vh;class s{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=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return id=s,s.default=s,id}function ep(){if(ad)return sd;ad=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Vh,{fileURLToPath:r,pathToFileURL:n}=Vh,{isAbsolute:i,resolve:o}=Vh,{nanoid:s}=Qd(),a=Vh,l=Kh(),u=Zd(),c=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&i);class p{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&&(!d||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new u(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,i={}){let o,s,a;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);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];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[c]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=u.sourceContentFor(c.source);return d&&(h.source=d),h}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}}return sd=p,p.default=p,a&&a.registerInput&&a.registerInput(p),sd}function tp(){if(ud)return ld;ud=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Vh,{dirname:r,relative:n,resolve:i,sep:o}=Vh,{pathToFileURL:s}=Vh,a=ep(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return ld=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 t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}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(),u&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.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?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}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 a(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(s){let t=s(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},ld}function rp(){if(hd)return cd;hd=1;let e=Yd();class t extends e{constructor(e){super(e),this.type="comment"}}return cd=t,t.default=t,cd}function np(){if(pd)return dd;pd=1;let e,t,r,n,{isClean:i,my:o}=Hd(),s=Xd(),a=rp(),l=Yd();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class h extends l{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(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},dd=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},dd}function ip(){if(gd)return fd;gd=1;let e,t,r=np();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},fd=n,n.default=n,fd}function op(){if(vd)return md;vd=1;let e={};return md=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function sp(){if(bd)return yd;bd=1;class e{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}}return yd=e,e.default=e,yd}function ap(){if(Sd)return wd;Sd=1;let e=sp();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return wd=t,t.default=t,wd}function lp(){if(Ed)return Cd;Ed=1;let e=np();class t extends e{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)}}return Cd=t,t.default=t,e.registerAtRule(t),Cd}function up(){if(Id)return Od;Id=1;let e,t,r=np();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Od=n,n.default=n,r.registerRoot(n),Od}function cp(){if(Td)return Pd;Td=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return Pd=e,e.default=e,Pd}function hp(){if(Md)return Rd;Md=1;let e=np(),t=cp();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return Rd=r,r.default=r,e.registerRule(r),Rd}function dp(){if(_d)return Ad;_d=1;let e=Xd(),t=function(){if(kd)return xd;kd=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),m="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,x=/[\da-f]/i;return xd=function(k,C={}){let E,O,I,P,T,R,M,A,_,N,L=k.css.valueOf(),D=C.ignoreErrors,U=L.length,F=0,j=[],B=[];function q(e){throw k.error("Unclosed "+e,F)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&F>=U},nextToken:function(k){if(B.length)return B.pop();if(F>=U)return;let C=!!k&&k.ignoreUnclosed;switch(E=L.charCodeAt(F),E){case i:case o:case a:case l:case s:O=F;do{O+=1,E=L.charCodeAt(O)}while(E===o||E===i||E===a||E===l||E===s);N=["space",L.slice(F,O)],F=O-1;break;case u:case c:case p:case f:case v:case g:case d:{let e=String.fromCharCode(E);N=[e,e,F];break}case h:if(A=j.length?j.pop()[1]:"",_=L.charCodeAt(F+1),"url"===A&&_!==e&&_!==t&&_!==o&&_!==i&&_!==a&&_!==s&&_!==l){O=F;do{if(R=!1,O=L.indexOf(")",O+1),-1===O){if(D||C){O=F;break}q("bracket")}for(M=O;L.charCodeAt(M-1)===r;)M-=1,R=!R}while(R);N=["brackets",L.slice(F,O+1),F,O],F=O}else O=L.indexOf(")",F+1),P=L.slice(F,O+1),-1===O||S.test(P)?N=["(","(",F]:(N=["brackets",P,F,O],F=O);break;case e:case t:I=E===e?"'":'"',O=F;do{if(R=!1,O=L.indexOf(I,O+1),-1===O){if(D||C){O=F+1;break}q("string")}for(M=O;L.charCodeAt(M-1)===r;)M-=1,R=!R}while(R);N=["string",L.slice(F,O+1),F,O],F=O;break;case y:b.lastIndex=F+1,b.test(L),O=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(F,O+1),F,O],F=O;break;case r:for(O=F,T=!0;L.charCodeAt(O+1)===r;)O+=1,T=!T;if(E=L.charCodeAt(O+1),T&&E!==n&&E!==o&&E!==i&&E!==a&&E!==l&&E!==s&&(O+=1,x.test(L.charAt(O)))){for(;x.test(L.charAt(O+1));)O+=1;L.charCodeAt(O+1)===o&&(O+=1)}N=["word",L.slice(F,O+1),F,O],F=O;break;default:E===n&&L.charCodeAt(F+1)===m?(O=L.indexOf("*/",F+2)+1,0===O&&(D||C?O=L.length:q("comment")),N=["comment",L.slice(F,O+1),F,O],F=O):(w.lastIndex=F+1,w.test(L),O=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(F,O+1),F,O],j.push(N),F=O)}return F++,N},position:function(){return F}}}}(),r=rp(),n=lp(),i=up(),o=hp();const s={empty:!0,space:!0};return Ad=class{constructor(e){this.input=e,this.root=new i,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,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,u=r.length,c="",h=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?h=!1:c+=i[1]):c+=i[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;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})}},Ad}function pp(){if(Ld)return Nd;Ld=1;let e=np(),t=dp(),r=ep();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return Nd=n,n.default=n,e.registerParse(n),Nd}function fp(){if(Ud)return Dd;Ud=1;let{isClean:e,my:t}=Hd(),r=tp(),n=Gd(),i=np(),o=ip(),s=op(),a=ap(),l=pp(),u=up();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[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 g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>m(e)),t}let v={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=m(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=m(r);this.result=new a(e,o,n),this.helpers={...v,postcss:v,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return y.registerPostcss=e=>{v=e},Dd=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),Dd}function gp(){if(qd)return Bd;qd=1;let e=function(){if(jd)return Fd;jd=1;let e=tp(),t=Gd(),r=op(),n=pp();const i=ap();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.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||r("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=n;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"}}return Fd=o,o.default=o,Fd}(),t=fp(),r=ip(),n=up();class i{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Bd=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),Bd}const mp=Fh(function(){if($d)return Wd;$d=1;let e=Kh(),t=Xd(),r=fp(),n=np(),i=gp(),o=Gd(),s=function(){if(Vd)return zd;Vd=1;let e=Xd(),t=Zd(),r=rp(),n=lp(),i=ep(),o=up(),s=hp();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...h}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,u))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=u[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new s(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return zd=a,a.default=a,zd}(),a=ip(),l=sp(),u=rp(),c=lp(),h=ap(),d=ep(),p=pp(),f=cp(),g=hp(),m=up(),v=Yd();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new m(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=h,y.Input=d,y.Rule=g,y.Root=m,y.Node=v,r.registerPostcss(y),Wd=y,y.default=y,Wd}());mp.stringify,mp.fromJSON,mp.plugin,mp.parse,mp.list,mp.document,mp.comment,mp.atRule,mp.rule,mp.decl,mp.root,mp.CssSyntaxError,mp.Declaration,mp.Container,mp.Processor,mp.Document,mp.Comment,mp.Warning,mp.AtRule,mp.Result,mp.Input,mp.Rule,mp.Root,mp.Node;var vp=Object.defineProperty,yp=(e,t,r)=>((e,t,r)=>t in e?vp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function bp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function wp(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 Sp,xp={exports:{}};function kp(){if(Sp)return xp.exports;Sp=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return xp.exports=t(),xp.exports.createColors=t,xp.exports}const Cp=wp(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ep,Op;function Ip(){if(Op)return Ep;Op=1;let e=kp(),t=Cp;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Ep=r,r.default=r,Ep}var Pp,Tp,Rp,Mp,Ap,_p,Np,Lp,Dp,Up,Fp,jp,Bp,qp,zp,Vp,Wp,$p,Kp,Hp,Jp,Gp,Yp,Xp,Qp,Zp,ef,tf,rf,nf,of,sf,af,lf,uf,cf,hf,df,pf,ff,gf,mf,vf,yf,bf,wf,Sf,xf,kf,Cf,Ef,Of,If,Pf={};function Tf(){return Pp||(Pp=1,Pf.isClean=Symbol("isClean"),Pf.my=Symbol("my")),Pf}function Rf(){if(Rp)return Tp;Rp=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}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)}}return Tp=t,t.default=t,Tp}function Mf(){if(Ap)return Mp;Ap=1;let e=Rf();function t(t,r){new e(r).stringify(t)}return Mp=t,t.default=t,Mp}function Af(){if(Np)return _p;Np=1;let{isClean:e,my:t}=Tf(),r=Ip(),n=Rf(),i=Mf();function o(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],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=i){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}}return _p=s,s.default=s,_p}function _f(){if(Dp)return Lp;Dp=1;let e=Af();class t extends e{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]}}return Lp=t,t.default=t,Lp}function Nf(){if(Fp)return Up;Fp=1;return Up={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}},Up}function Lf(){if(Bp)return jp;Bp=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Cp,{existsSync:r,readFileSync:n}=Cp,{dirname:i,join:o}=Cp;class s{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=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return jp=s,s.default=s,jp}function Df(){if(zp)return qp;zp=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Cp,{fileURLToPath:r,pathToFileURL:n}=Cp,{isAbsolute:i,resolve:o}=Cp,{nanoid:s}=Nf(),a=Cp,l=Ip(),u=Lf(),c=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&i);class p{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&&(!d||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new u(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,i={}){let o,s,a;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);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];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[c]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=u.sourceContentFor(c.source);return d&&(h.source=d),h}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}}return qp=p,p.default=p,a&&a.registerInput&&a.registerInput(p),qp}function Uf(){if(Wp)return Vp;Wp=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Cp,{dirname:r,relative:n,resolve:i,sep:o}=Cp,{pathToFileURL:s}=Cp,a=Df(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return Vp=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 t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}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(),u&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.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?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}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 a(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(s){let t=s(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Vp}function Ff(){if(Kp)return $p;Kp=1;let e=Af();class t extends e{constructor(e){super(e),this.type="comment"}}return $p=t,t.default=t,$p}function jf(){if(Jp)return Hp;Jp=1;let e,t,r,n,{isClean:i,my:o}=Tf(),s=_f(),a=Ff(),l=Af();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class h extends l{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(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},Hp=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},Hp}function Bf(){if(Yp)return Gp;Yp=1;let e,t,r=jf();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Gp=n,n.default=n,Gp}function qf(){if(Qp)return Xp;Qp=1;let e={};return Xp=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function zf(){if(ef)return Zp;ef=1;class e{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}}return Zp=e,e.default=e,Zp}function Vf(){if(rf)return tf;rf=1;let e=zf();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return tf=t,t.default=t,tf}function Wf(){if(af)return sf;af=1;let e=jf();class t extends e{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)}}return sf=t,t.default=t,e.registerAtRule(t),sf}function $f(){if(uf)return lf;uf=1;let e,t,r=jf();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},lf=n,n.default=n,r.registerRoot(n),lf}function Kf(){if(hf)return cf;hf=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return cf=e,e.default=e,cf}function Hf(){if(pf)return df;pf=1;let e=jf(),t=Kf();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return df=r,r.default=r,e.registerRule(r),df}function Jf(){if(gf)return ff;gf=1;let e=_f(),t=function(){if(of)return nf;of=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),m="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,x=/[\da-f]/i;return nf=function(k,C={}){let E,O,I,P,T,R,M,A,_,N,L=k.css.valueOf(),D=C.ignoreErrors,U=L.length,F=0,j=[],B=[];function q(e){throw k.error("Unclosed "+e,F)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&F>=U},nextToken:function(k){if(B.length)return B.pop();if(F>=U)return;let C=!!k&&k.ignoreUnclosed;switch(E=L.charCodeAt(F),E){case i:case o:case a:case l:case s:O=F;do{O+=1,E=L.charCodeAt(O)}while(E===o||E===i||E===a||E===l||E===s);N=["space",L.slice(F,O)],F=O-1;break;case u:case c:case p:case f:case v:case g:case d:{let e=String.fromCharCode(E);N=[e,e,F];break}case h:if(A=j.length?j.pop()[1]:"",_=L.charCodeAt(F+1),"url"===A&&_!==e&&_!==t&&_!==o&&_!==i&&_!==a&&_!==s&&_!==l){O=F;do{if(R=!1,O=L.indexOf(")",O+1),-1===O){if(D||C){O=F;break}q("bracket")}for(M=O;L.charCodeAt(M-1)===r;)M-=1,R=!R}while(R);N=["brackets",L.slice(F,O+1),F,O],F=O}else O=L.indexOf(")",F+1),P=L.slice(F,O+1),-1===O||S.test(P)?N=["(","(",F]:(N=["brackets",P,F,O],F=O);break;case e:case t:I=E===e?"'":'"',O=F;do{if(R=!1,O=L.indexOf(I,O+1),-1===O){if(D||C){O=F+1;break}q("string")}for(M=O;L.charCodeAt(M-1)===r;)M-=1,R=!R}while(R);N=["string",L.slice(F,O+1),F,O],F=O;break;case y:b.lastIndex=F+1,b.test(L),O=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(F,O+1),F,O],F=O;break;case r:for(O=F,T=!0;L.charCodeAt(O+1)===r;)O+=1,T=!T;if(E=L.charCodeAt(O+1),T&&E!==n&&E!==o&&E!==i&&E!==a&&E!==l&&E!==s&&(O+=1,x.test(L.charAt(O)))){for(;x.test(L.charAt(O+1));)O+=1;L.charCodeAt(O+1)===o&&(O+=1)}N=["word",L.slice(F,O+1),F,O],F=O;break;default:E===n&&L.charCodeAt(F+1)===m?(O=L.indexOf("*/",F+2)+1,0===O&&(D||C?O=L.length:q("comment")),N=["comment",L.slice(F,O+1),F,O],F=O):(w.lastIndex=F+1,w.test(L),O=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(F,O+1),F,O],j.push(N),F=O)}return F++,N},position:function(){return F}}}}(),r=Ff(),n=Wf(),i=$f(),o=Hf();const s={empty:!0,space:!0};return ff=class{constructor(e){this.input=e,this.root=new i,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,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,u=r.length,c="",h=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?h=!1:c+=i[1]):c+=i[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;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})}},ff}function Gf(){if(vf)return mf;vf=1;let e=jf(),t=Jf(),r=Df();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return mf=n,n.default=n,e.registerParse(n),mf}function Yf(){if(bf)return yf;bf=1;let{isClean:e,my:t}=Tf(),r=Uf(),n=Mf(),i=jf(),o=Bf(),s=qf(),a=Vf(),l=Gf(),u=$f();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[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 g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>m(e)),t}let v={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=m(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=m(r);this.result=new a(e,o,n),this.helpers={...v,postcss:v,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return y.registerPostcss=e=>{v=e},yf=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),yf}function Xf(){if(kf)return xf;kf=1;let e=function(){if(Sf)return wf;Sf=1;let e=Uf(),t=Mf(),r=qf(),n=Gf();const i=Vf();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.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||r("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=n;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"}}return wf=o,o.default=o,wf}(),t=Yf(),r=Bf(),n=$f();class i{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return xf=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),xf}const Qf=bp(function(){if(If)return Of;If=1;let e=Ip(),t=_f(),r=Yf(),n=jf(),i=Xf(),o=Mf(),s=function(){if(Ef)return Cf;Ef=1;let e=_f(),t=Lf(),r=Ff(),n=Wf(),i=Df(),o=$f(),s=Hf();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...h}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,u))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=u[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new s(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return Cf=a,a.default=a,Cf}(),a=Bf(),l=zf(),u=Ff(),c=Wf(),h=Vf(),d=Df(),p=Gf(),f=Kf(),g=Hf(),m=$f(),v=Af();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new m(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=h,y.Input=d,y.Rule=g,y.Root=m,y.Node=v,r.registerPostcss(y),Of=y,y.default=y,Of}());Qf.stringify,Qf.fromJSON,Qf.plugin,Qf.parse,Qf.list,Qf.document,Qf.comment,Qf.atRule,Qf.rule,Qf.decl,Qf.root,Qf.CssSyntaxError,Qf.Declaration,Qf.Container,Qf.Processor,Qf.Document,Qf.Comment,Qf.Warning,Qf.AtRule,Qf.Result,Qf.Input,Qf.Rule,Qf.Root,Qf.Node;class Zf{constructor(...e){yp(this,"parentElement",null),yp(this,"parentNode",null),yp(this,"ownerDocument"),yp(this,"firstChild",null),yp(this,"lastChild",null),yp(this,"previousSibling",null),yp(this,"nextSibling",null),yp(this,"ELEMENT_NODE",1),yp(this,"TEXT_NODE",3),yp(this,"nodeType"),yp(this,"nodeName"),yp(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 Zf))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 eg={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},tg={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},rg={};function ng(e){if(rg[e])return rg[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 eg?eg[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 tg?tg[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 rg[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?rg[e]=o:r}catch{return r}}const ig={};function og(e,t,r){var n;const i=`${e}.${String(r)}`;if(ig[i])return ig[i].call(t);const o=ng(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(ig[i]=s,s.call(t)):t[r]}const sg={};function ag(e,t,r){const n=`${e}.${String(r)}`;if(sg[n])return sg[n].bind(t);const i=ng(e)[r];return"function"!=typeof i?t[r]:(sg[n]=i,i.bind(t))}const lg={childNodes:function(e){return og("Node",e,"childNodes")},parentNode:function(e){return og("Node",e,"parentNode")},parentElement:function(e){return og("Node",e,"parentElement")},textContent:function(e){return og("Node",e,"textContent")},contains:function(e,t){return ag("Node",e,"contains")(t)},getRootNode:function(e){return ag("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?og("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?og("Element",e,"shadowRoot"):null},querySelector:function(e,t){return og("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return og("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ng("MutationObserver").constructor}};const ug="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 cg={map:{},getId:()=>(console.error(ug),-1),getNode:()=>(console.error(ug),null),removeNodeFromMap(){console.error(ug)},has:()=>(console.error(ug),!1),reset(){console.error(ug)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(cg=new Proxy(cg,{get:(e,t,r)=>("map"===t&&console.error(ug),Reflect.get(e,t,r))}));let hg=Date.now;function dg(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:lg.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(hg=()=>(new Date).getTime());function pg(e){var t;let r=null;return"getRootNode"in e&&(null==(t=lg.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&lg.host(lg.getRootNode(e))&&(r=lg.host(lg.getRootNode(e))),r}function fg(e){let t,r=e;for(;t=pg(r);)r=t;return r}function gg(e){const t=e.ownerDocument;if(!t)return!1;const r=fg(e);return lg.contains(t,r)}const mg=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Ch(this,"id",1),Ch(this,"styleIDMap",new WeakMap),Ch(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 cg},closestElementOfNode:dg,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:fg,getShadowHost:pg,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=lg.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=lg.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 Zf&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(lg.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&&(lg.contains(t,e)||gg(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&Lh.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Lh.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const i=lg.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=dg(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(Uh(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 hg},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:gg,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 vg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",yg="undefined"==typeof Uint8Array?[]:new Uint8Array(256),bg=0;bg<64;bg++)yg[vg.charCodeAt(bg)]=bg;"undefined"!=typeof self&&self.Blob&&new Blob(['(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n'],{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==(fh=e.contentWindow)?void 0:fh.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var wg,Sg;new Dh,(Sg=wg||(wg={}))[Sg.NotStarted=0]="NotStarted",Sg[Sg.Running=1]="Running",Sg[Sg.Stopped=2]="Stopped";class xg{constructor(e){xh(this,"fileName"),xh(this,"functionName"),xh(this,"lineNumber"),xh(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 kg=/(^|@)\S+:\d+/,Cg=/^\s*at .*(\S+:\d+|\(native\))/m,Eg=/^(eval@)?(\[native code])?$/,Og={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Cg)?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(Cg)},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 xg({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(Eg)},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 xg({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new xg({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 xg({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 xg({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(kg)&&!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 xg({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Ig(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 Pg(e){return"[object Object]"===Object.prototype.toString.call(e)}function Tg(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Pg(e[n])&&Tg(e[n],t-1))return!0;return!1}function Rg(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(Pg(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Pg(e)&&Tg(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]=Ig(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 Mg={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 Ag(e,t,r){const n=r?Object.assign({},Mg,r):Mg,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=Og.parse(i).map(e=>e.toString()),s=[Rg(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=[Rg(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,i=[Rg("Uncaught (in promise)",n.stringifyOptions),Rg(t.reason,n.stringifyOptions)]);const o=Og.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]?mg.patch(t,r,t=>(...i)=>{if(t.apply(this,i),!("assert"===r&&i[0]||a)){a=!0;try{const t=Og.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?i.slice(1):i).map(e=>Rg(e,n.stringifyOptions));s++,s<n.lengthThreshold?e({level:r,trace:t,payload:o}):s===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Rg("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...i)}finally{a=!1}}}):()=>{}}}const _g="rrweb/console@1";var Ng,Lg=Object.freeze({__proto__:null,PLUGIN_NAME:_g,getRecordConsolePlugin:e=>({name:_g,observer:Ag,options:e})}),Dg=Object.defineProperty,Ug=(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),Fg=Object.defineProperty,jg=(e,t,r)=>((e,t,r)=>t in e?Fg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Bg=(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))(Bg||{});const qg={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},zg={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Vg={};function Wg(e){if(Vg[e])return Vg[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 qg?qg[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 zg?zg[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 Vg[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?Vg[e]=o:r}catch{return r}}const $g={};function Kg(e,t,r){var n;const i=`${e}.${String(r)}`;if($g[i])return $g[i].call(t);const o=Wg(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?($g[i]=s,s.call(t)):t[r]}const Hg={};function Jg(e,t,r){const n=`${e}.${String(r)}`;if(Hg[n])return Hg[n].bind(t);const i=Wg(e)[r];return"function"!=typeof i?t[r]:(Hg[n]=i,i.bind(t))}const Gg={childNodes:function(e){return Kg("Node",e,"childNodes")},parentNode:function(e){return Kg("Node",e,"parentNode")},parentElement:function(e){return Kg("Node",e,"parentElement")},textContent:function(e){return Kg("Node",e,"textContent")},contains:function(e,t){return Jg("Node",e,"contains")(t)},getRootNode:function(e){return Jg("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Kg("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Kg("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Kg("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Kg("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Wg("MutationObserver").constructor}};function Yg(e){return e.nodeType===e.ELEMENT_NODE}function Xg(e){const t=e&&"host"in e&&"mode"in e&&Gg.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Gg.shadowRoot(t)===e)}function Qg(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Zg(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=>em(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 em(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Zg(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?hm(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?hm(r,t):r}}class tm{constructor(){jg(this,"idNodeMap",new Map),jg(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 rm({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"";const a=n&&nm(n);return(t[r.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function nm(e){return e.toLowerCase()}const im="__rrweb_original__";function om(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?nm(t):null}function sm(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 am=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,lm=/^(?:[a-z+]+:)?\/\//i,um=/^www\..*/i,cm=/^(data:)([^,]*),(.*)/i;function hm(e,t){return(e||"").replace(am,(e,r,n,i,o,s)=>{const a=n||o||s,l=r||i||"";if(!a)return e;if(lm.test(a)||um.test(a))return`url(${l}${a}${l})`;if(cm.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 dm(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function pm(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=dm(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=dm(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=dm(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=dm(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 fm="lightgrey";let gm=1;const mm=new RegExp("[^a-z0-9-_:]");function vm(){return gm++}let ym,bm;const wm=/^[^ \t\n\r\u000c]+/,Sm=/^[, \t\n\r\u000c]+/;const xm=new WeakMap;function km(e,t){return t&&""!==t.trim()?Em(e,t):t}function Cm(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Em(e,t){let r=xm.get(e);if(r||(r=e.createElement("a"),xm.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Om(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?km(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(Sm),!(r>=t.length);){let o=n(wm);if(","===o.slice(-1))o=km(e,o.substring(0,o.length-1)),i.push(o);else{let n="";o=km(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?hm(n,Em(e)):"object"===t&&"data"===r?km(e,n):n:km(e,n):n}function Im(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Pm(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Pm(Gg.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Pm(Gg.parentNode(e),t,r)}function Tm(e,t,r,n){let i;if(Yg(e)){if(i=e,!Gg.childNodes(i).length)return!1}else{if(null===Gg.parentElement(e))return!1;i=Gg.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(Pm(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 Rm(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:Bg.Document,childNodes:[],compatMode:e.compatMode}:{type:Bg.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Bg.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=nm(e.tagName);return mm.test(t)?"div":t}(e);let v={};const y=e.attributes.length;for(let t=0;t<y;t++){const n=e.attributes[t];Im(m,n.name,n.value)||(v[n.name]=Om(r,m,nm(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=Zg(t)),n&&(delete v.rel,delete v.href,v._cssText=n)}if("style"===m&&e.sheet){let t=Zg(e.sheet);t&&(e.childNodes.length>1&&(t=pm(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=rm({element:e,type:om(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=im in i?i[im]: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){ym||(ym=r.createElement("canvas"),bm=ym.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",i=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{ym.width=t.naturalWidth,ym.height=t.naturalHeight,bm.drawImage(t,0,0),v.rr_dataURL=ym.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:fm}:{}}}"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:Bg.Element,tagName:m,attributes:v,childNodes:[],isSVG:Cm(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=Gg.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=Gg.textContent(e),u&&l&&(l=hm(l,Em(t.doc))));!u&&!c&&l&&r&&(l=n?n(l,Gg.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Bg.Text,textContent:l||"",rootId:i}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:y,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:Bg.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:Bg.Comment,textContent:Gg.textContent(e)||"",rootId:y};default:return!1}}function Mm(e){return null==e?"":e.toLowerCase()}function Am(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:x=()=>!1,newlyAddedElement:k=!1,cssCaptured:C=!1,applyBackgroundColorToBlockedElements:E=!1}=t;let{needsMask:O}=t,{preserveWhiteSpace:I=!0}=t;if(!O){O=Tm(e,s,a,void 0===O)}const P=Rm(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:O,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:x,newlyAddedElement:k,cssCaptured:C,applyBackgroundColorToBlockedElements:E});if(!P)return console.warn(e,"not serialized"),null;let T;T=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===Bg.Comment)return!0;if(e.type===Bg.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"===sm(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Mm(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Mm(e.attributes.name)||"icon"===Mm(e.attributes.rel)||"apple-touch-icon"===Mm(e.attributes.rel)||"shortcut icon"===Mm(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Mm(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Mm(e.attributes.property).match(/^(og|twitter|fb):/)||Mm(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Mm(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Mm(e.attributes.name)||"googlebot"===Mm(e.attributes.name)||"bingbot"===Mm(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Mm(e.attributes.name)||"generator"===Mm(e.attributes.name)||"framework"===Mm(e.attributes.name)||"publisher"===Mm(e.attributes.name)||"progid"===Mm(e.attributes.name)||Mm(e.attributes.property).match(/^article:/)||Mm(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Mm(e.attributes.name)||"yandex-verification"===Mm(e.attributes.name)||"csrf-token"===Mm(e.attributes.name)||"p:domain_verify"===Mm(e.attributes.name)||"verify-v1"===Mm(e.attributes.name)||"verification"===Mm(e.attributes.name)||"shopify-checkout-api-token"===Mm(e.attributes.name)))return!0}}return!1}(P,p)||!I&&P.type===Bg.Text&&!P.textContent.replace(/^\s+|\s+$/gm,"").length?-2:vm();const R=Object.assign(P,{id:T});if(n.add(e,R),-2===T)return null;v&&v(e);let M=!l;if(R.type===Bg.Element){M=M&&!R.needBlock,delete R.needBlock;const t=Gg.shadowRoot(e);t&&Qg(t)&&(R.isShadowHost=!0)}if((R.type===Bg.Document||R.type===Bg.Element)&&M){p.headWhitespace&&R.type===Bg.Element&&"head"===R.tagName&&(I=!1);const t={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:O,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:x,cssCaptured:!1,applyBackgroundColorToBlockedElements:E};if(R.type===Bg.Element&&"textarea"===R.tagName&&void 0!==R.attributes.value);else{R.type===Bg.Element&&void 0!==R.attributes._cssText&&"string"==typeof R.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(Gg.childNodes(e))){const e=Am(r,t);e&&R.childNodes.push(e)}}let k=null;if(Yg(e)&&(k=Gg.shadowRoot(e)))for(const e of Array.from(Gg.childNodes(k))){const r=Am(e,t);r&&(Qg(k)&&(r.isShadow=!0),R.childNodes.push(r))}}const A=Gg.parentNode(e);return A&&Xg(A)&&Qg(A)&&(R.isShadow=!0),R.type===Bg.Element&&"iframe"===R.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let i,o=!1;try{i=n.document.readyState}catch(e){return}if("complete"!==i){const n=setTimeout(()=>{o||(t(),o=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(n),o=!0,t()})}const s="about:blank";if(n.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&y){const r=Am(t,{doc:t,mirror:n,blockClass:i,blockSelector:o,needsMask:O,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:x});r&&y(e,r)}},b),R.type===Bg.Element&&"link"===R.tagName&&"string"==typeof R.attributes.rel&&("stylesheet"===R.attributes.rel||"preload"===R.attributes.rel&&"string"==typeof R.attributes.href&&"css"===sm(R.attributes.href))&&function(e,t,r){let n,i=!1;try{n=e.sheet}catch(e){return}if(n)return;const o=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),i=!0,t()})}(e,()=>{if(w){const t=Am(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:O,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:x});t&&w(e,t)}},S),R}function _m(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Nm(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 Lm,Dm={exports:{}};function Um(){if(Lm)return Dm.exports;Lm=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Dm.exports=t(),Dm.exports.createColors=t,Dm.exports}const Fm=Nm(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var jm,Bm;function qm(){if(Bm)return jm;Bm=1;let e=Um(),t=Fm;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return jm=r,r.default=r,jm}var zm,Vm,Wm,$m,Km,Hm,Jm,Gm,Ym,Xm,Qm,Zm,ev,tv,rv,nv,iv,ov,sv,av,lv,uv,cv,hv,dv,pv,fv,gv,mv,vv,yv,bv,wv,Sv,xv,kv,Cv,Ev,Ov,Iv,Pv,Tv,Rv,Mv,Av,_v,Nv,Lv,Dv,Uv,Fv,jv,Bv,qv={};function zv(){return zm||(zm=1,qv.isClean=Symbol("isClean"),qv.my=Symbol("my")),qv}function Vv(){if(Wm)return Vm;Wm=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}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)}}return Vm=t,t.default=t,Vm}function Wv(){if(Km)return $m;Km=1;let e=Vv();function t(t,r){new e(r).stringify(t)}return $m=t,t.default=t,$m}function $v(){if(Jm)return Hm;Jm=1;let{isClean:e,my:t}=zv(),r=qm(),n=Vv(),i=Wv();function o(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],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=i){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}}return Hm=s,s.default=s,Hm}function Kv(){if(Ym)return Gm;Ym=1;let e=$v();class t extends e{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]}}return Gm=t,t.default=t,Gm}function Hv(){if(Qm)return Xm;Qm=1;return Xm={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}},Xm}function Jv(){if(ev)return Zm;ev=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Fm,{existsSync:r,readFileSync:n}=Fm,{dirname:i,join:o}=Fm;class s{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=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Zm=s,s.default=s,Zm}function Gv(){if(rv)return tv;rv=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Fm,{fileURLToPath:r,pathToFileURL:n}=Fm,{isAbsolute:i,resolve:o}=Fm,{nanoid:s}=Hv(),a=Fm,l=qm(),u=Jv(),c=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&i);class p{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&&(!d||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new u(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,i={}){let o,s,a;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);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];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[c]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=u.sourceContentFor(c.source);return d&&(h.source=d),h}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}}return tv=p,p.default=p,a&&a.registerInput&&a.registerInput(p),tv}function Yv(){if(iv)return nv;iv=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Fm,{dirname:r,relative:n,resolve:i,sep:o}=Fm,{pathToFileURL:s}=Fm,a=Gv(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return nv=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 t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}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(),u&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.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?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}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 a(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(s){let t=s(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},nv}function Xv(){if(sv)return ov;sv=1;let e=$v();class t extends e{constructor(e){super(e),this.type="comment"}}return ov=t,t.default=t,ov}function Qv(){if(lv)return av;lv=1;let e,t,r,n,{isClean:i,my:o}=zv(),s=Kv(),a=Xv(),l=$v();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class h extends l{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(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},av=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},av}function Zv(){if(cv)return uv;cv=1;let e,t,r=Qv();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},uv=n,n.default=n,uv}function ey(){if(dv)return hv;dv=1;let e={};return hv=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function ty(){if(fv)return pv;fv=1;class e{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}}return pv=e,e.default=e,pv}function ry(){if(mv)return gv;mv=1;let e=ty();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return gv=t,t.default=t,gv}function ny(){if(wv)return bv;wv=1;let e=Qv();class t extends e{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)}}return bv=t,t.default=t,e.registerAtRule(t),bv}function iy(){if(xv)return Sv;xv=1;let e,t,r=Qv();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Sv=n,n.default=n,r.registerRoot(n),Sv}function oy(){if(Cv)return kv;Cv=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return kv=e,e.default=e,kv}function sy(){if(Ov)return Ev;Ov=1;let e=Qv(),t=oy();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return Ev=r,r.default=r,e.registerRule(r),Ev}function ay(){if(Pv)return Iv;Pv=1;let e=Kv(),t=function(){if(yv)return vv;yv=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),m="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,x=/[\da-f]/i;return vv=function(k,C={}){let E,O,I,P,T,R,M,A,_,N,L=k.css.valueOf(),D=C.ignoreErrors,U=L.length,F=0,j=[],B=[];function q(e){throw k.error("Unclosed "+e,F)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&F>=U},nextToken:function(k){if(B.length)return B.pop();if(F>=U)return;let C=!!k&&k.ignoreUnclosed;switch(E=L.charCodeAt(F),E){case i:case o:case a:case l:case s:O=F;do{O+=1,E=L.charCodeAt(O)}while(E===o||E===i||E===a||E===l||E===s);N=["space",L.slice(F,O)],F=O-1;break;case u:case c:case p:case f:case v:case g:case d:{let e=String.fromCharCode(E);N=[e,e,F];break}case h:if(A=j.length?j.pop()[1]:"",_=L.charCodeAt(F+1),"url"===A&&_!==e&&_!==t&&_!==o&&_!==i&&_!==a&&_!==s&&_!==l){O=F;do{if(R=!1,O=L.indexOf(")",O+1),-1===O){if(D||C){O=F;break}q("bracket")}for(M=O;L.charCodeAt(M-1)===r;)M-=1,R=!R}while(R);N=["brackets",L.slice(F,O+1),F,O],F=O}else O=L.indexOf(")",F+1),P=L.slice(F,O+1),-1===O||S.test(P)?N=["(","(",F]:(N=["brackets",P,F,O],F=O);break;case e:case t:I=E===e?"'":'"',O=F;do{if(R=!1,O=L.indexOf(I,O+1),-1===O){if(D||C){O=F+1;break}q("string")}for(M=O;L.charCodeAt(M-1)===r;)M-=1,R=!R}while(R);N=["string",L.slice(F,O+1),F,O],F=O;break;case y:b.lastIndex=F+1,b.test(L),O=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(F,O+1),F,O],F=O;break;case r:for(O=F,T=!0;L.charCodeAt(O+1)===r;)O+=1,T=!T;if(E=L.charCodeAt(O+1),T&&E!==n&&E!==o&&E!==i&&E!==a&&E!==l&&E!==s&&(O+=1,x.test(L.charAt(O)))){for(;x.test(L.charAt(O+1));)O+=1;L.charCodeAt(O+1)===o&&(O+=1)}N=["word",L.slice(F,O+1),F,O],F=O;break;default:E===n&&L.charCodeAt(F+1)===m?(O=L.indexOf("*/",F+2)+1,0===O&&(D||C?O=L.length:q("comment")),N=["comment",L.slice(F,O+1),F,O],F=O):(w.lastIndex=F+1,w.test(L),O=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(F,O+1),F,O],j.push(N),F=O)}return F++,N},position:function(){return F}}}}(),r=Xv(),n=ny(),i=iy(),o=sy();const s={empty:!0,space:!0};return Iv=class{constructor(e){this.input=e,this.root=new i,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,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,u=r.length,c="",h=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?h=!1:c+=i[1]):c+=i[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;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})}},Iv}function ly(){if(Rv)return Tv;Rv=1;let e=Qv(),t=ay(),r=Gv();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return Tv=n,n.default=n,e.registerParse(n),Tv}function uy(){if(Av)return Mv;Av=1;let{isClean:e,my:t}=zv(),r=Yv(),n=Wv(),i=Qv(),o=Zv(),s=ey(),a=ry(),l=ly(),u=iy();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[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 g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>m(e)),t}let v={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=m(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=m(r);this.result=new a(e,o,n),this.helpers={...v,postcss:v,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return y.registerPostcss=e=>{v=e},Mv=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),Mv}function cy(){if(Dv)return Lv;Dv=1;let e=function(){if(Nv)return _v;Nv=1;let e=Yv(),t=Wv(),r=ey(),n=ly();const i=ry();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.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||r("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=n;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"}}return _v=o,o.default=o,_v}(),t=uy(),r=Zv(),n=iy();class i{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Lv=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),Lv}var hy=function(){if(Bv)return jv;Bv=1;let e=qm(),t=Kv(),r=uy(),n=Qv(),i=cy(),o=Wv(),s=function(){if(Fv)return Uv;Fv=1;let e=Kv(),t=Jv(),r=Xv(),n=ny(),i=Gv(),o=iy(),s=sy();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...h}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,u))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=u[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new s(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return Uv=a,a.default=a,Uv}(),a=Zv(),l=ty(),u=Xv(),c=ny(),h=ry(),d=Gv(),p=ly(),f=oy(),g=sy(),m=iy(),v=$v();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new m(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=h,y.Input=d,y.Rule=g,y.Root=m,y.Node=v,r.registerPostcss(y),jv=y,y.default=y,jv}();const dy=_m(hy);dy.stringify,dy.fromJSON,dy.plugin,dy.parse,dy.list,dy.document,dy.comment,dy.atRule,dy.rule,dy.decl,dy.root,dy.CssSyntaxError,dy.Declaration,dy.Container,dy.Processor,dy.Document,dy.Comment,dy.Warning,dy.AtRule,dy.Result,dy.Input,dy.Rule,dy.Root,dy.Node;var py=Object.defineProperty,fy=(e,t,r)=>((e,t,r)=>t in e?py(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function gy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function my(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 vy,yy={exports:{}};function by(){if(vy)return yy.exports;vy=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return yy.exports=t(),yy.exports.createColors=t,yy.exports}const wy=my(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Sy,xy;function ky(){if(xy)return Sy;xy=1;let e=by(),t=wy;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Sy=r,r.default=r,Sy}var Cy,Ey,Oy,Iy,Py,Ty,Ry,My,Ay,_y,Ny,Ly,Dy,Uy,Fy,jy,By,qy,zy,Vy,Wy,$y,Ky,Hy,Jy,Gy,Yy,Xy,Qy,Zy,eb,tb,rb,nb,ib,ob,sb,ab,lb,ub,cb,hb,db,pb,fb,gb,mb,vb,yb,bb,wb,Sb,xb,kb={};function Cb(){return Cy||(Cy=1,kb.isClean=Symbol("isClean"),kb.my=Symbol("my")),kb}function Eb(){if(Oy)return Ey;Oy=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}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)}}return Ey=t,t.default=t,Ey}function Ob(){if(Py)return Iy;Py=1;let e=Eb();function t(t,r){new e(r).stringify(t)}return Iy=t,t.default=t,Iy}function Ib(){if(Ry)return Ty;Ry=1;let{isClean:e,my:t}=Cb(),r=ky(),n=Eb(),i=Ob();function o(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],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=i){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}}return Ty=s,s.default=s,Ty}function Pb(){if(Ay)return My;Ay=1;let e=Ib();class t extends e{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]}}return My=t,t.default=t,My}function Tb(){if(Ny)return _y;Ny=1;return _y={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}},_y}function Rb(){if(Dy)return Ly;Dy=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=wy,{existsSync:r,readFileSync:n}=wy,{dirname:i,join:o}=wy;class s{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=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Ly=s,s.default=s,Ly}function Mb(){if(Fy)return Uy;Fy=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=wy,{fileURLToPath:r,pathToFileURL:n}=wy,{isAbsolute:i,resolve:o}=wy,{nanoid:s}=Tb(),a=wy,l=ky(),u=Rb(),c=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&i);class p{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&&(!d||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new u(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,i={}){let o,s,a;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);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];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[c]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=u.sourceContentFor(c.source);return d&&(h.source=d),h}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}}return Uy=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Uy}function Ab(){if(By)return jy;By=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=wy,{dirname:r,relative:n,resolve:i,sep:o}=wy,{pathToFileURL:s}=wy,a=Mb(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return jy=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 t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}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(),u&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.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?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}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 a(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(s){let t=s(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},jy}function _b(){if(zy)return qy;zy=1;let e=Ib();class t extends e{constructor(e){super(e),this.type="comment"}}return qy=t,t.default=t,qy}function Nb(){if(Wy)return Vy;Wy=1;let e,t,r,n,{isClean:i,my:o}=Cb(),s=Pb(),a=_b(),l=Ib();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class h extends l{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(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},Vy=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},Vy}function Lb(){if(Ky)return $y;Ky=1;let e,t,r=Nb();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},$y=n,n.default=n,$y}function Db(){if(Jy)return Hy;Jy=1;let e={};return Hy=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Ub(){if(Yy)return Gy;Yy=1;class e{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}}return Gy=e,e.default=e,Gy}function Fb(){if(Qy)return Xy;Qy=1;let e=Ub();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return Xy=t,t.default=t,Xy}function jb(){if(rb)return tb;rb=1;let e=Nb();class t extends e{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)}}return tb=t,t.default=t,e.registerAtRule(t),tb}function Bb(){if(ib)return nb;ib=1;let e,t,r=Nb();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},nb=n,n.default=n,r.registerRoot(n),nb}function qb(){if(sb)return ob;sb=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return ob=e,e.default=e,ob}function zb(){if(lb)return ab;lb=1;let e=Nb(),t=qb();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return ab=r,r.default=r,e.registerRule(r),ab}function Vb(){if(cb)return ub;cb=1;let e=Pb(),t=function(){if(eb)return Zy;eb=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),m="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,x=/[\da-f]/i;return Zy=function(k,C={}){let E,O,I,P,T,R,M,A,_,N,L=k.css.valueOf(),D=C.ignoreErrors,U=L.length,F=0,j=[],B=[];function q(e){throw k.error("Unclosed "+e,F)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&F>=U},nextToken:function(k){if(B.length)return B.pop();if(F>=U)return;let C=!!k&&k.ignoreUnclosed;switch(E=L.charCodeAt(F),E){case i:case o:case a:case l:case s:O=F;do{O+=1,E=L.charCodeAt(O)}while(E===o||E===i||E===a||E===l||E===s);N=["space",L.slice(F,O)],F=O-1;break;case u:case c:case p:case f:case v:case g:case d:{let e=String.fromCharCode(E);N=[e,e,F];break}case h:if(A=j.length?j.pop()[1]:"",_=L.charCodeAt(F+1),"url"===A&&_!==e&&_!==t&&_!==o&&_!==i&&_!==a&&_!==s&&_!==l){O=F;do{if(R=!1,O=L.indexOf(")",O+1),-1===O){if(D||C){O=F;break}q("bracket")}for(M=O;L.charCodeAt(M-1)===r;)M-=1,R=!R}while(R);N=["brackets",L.slice(F,O+1),F,O],F=O}else O=L.indexOf(")",F+1),P=L.slice(F,O+1),-1===O||S.test(P)?N=["(","(",F]:(N=["brackets",P,F,O],F=O);break;case e:case t:I=E===e?"'":'"',O=F;do{if(R=!1,O=L.indexOf(I,O+1),-1===O){if(D||C){O=F+1;break}q("string")}for(M=O;L.charCodeAt(M-1)===r;)M-=1,R=!R}while(R);N=["string",L.slice(F,O+1),F,O],F=O;break;case y:b.lastIndex=F+1,b.test(L),O=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(F,O+1),F,O],F=O;break;case r:for(O=F,T=!0;L.charCodeAt(O+1)===r;)O+=1,T=!T;if(E=L.charCodeAt(O+1),T&&E!==n&&E!==o&&E!==i&&E!==a&&E!==l&&E!==s&&(O+=1,x.test(L.charAt(O)))){for(;x.test(L.charAt(O+1));)O+=1;L.charCodeAt(O+1)===o&&(O+=1)}N=["word",L.slice(F,O+1),F,O],F=O;break;default:E===n&&L.charCodeAt(F+1)===m?(O=L.indexOf("*/",F+2)+1,0===O&&(D||C?O=L.length:q("comment")),N=["comment",L.slice(F,O+1),F,O],F=O):(w.lastIndex=F+1,w.test(L),O=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(F,O+1),F,O],j.push(N),F=O)}return F++,N},position:function(){return F}}}}(),r=_b(),n=jb(),i=Bb(),o=zb();const s={empty:!0,space:!0};return ub=class{constructor(e){this.input=e,this.root=new i,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,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,u=r.length,c="",h=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?h=!1:c+=i[1]):c+=i[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;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})}},ub}function Wb(){if(db)return hb;db=1;let e=Nb(),t=Vb(),r=Mb();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return hb=n,n.default=n,e.registerParse(n),hb}function $b(){if(fb)return pb;fb=1;let{isClean:e,my:t}=Cb(),r=Ab(),n=Ob(),i=Nb(),o=Lb(),s=Db(),a=Fb(),l=Wb(),u=Bb();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[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 g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>m(e)),t}let v={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=m(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=m(r);this.result=new a(e,o,n),this.helpers={...v,postcss:v,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return y.registerPostcss=e=>{v=e},pb=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),pb}function Kb(){if(yb)return vb;yb=1;let e=function(){if(mb)return gb;mb=1;let e=Ab(),t=Ob(),r=Db(),n=Wb();const i=Fb();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.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||r("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=n;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"}}return gb=o,o.default=o,gb}(),t=$b(),r=Lb(),n=Bb();class i{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return vb=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),vb}var Hb=function(){if(xb)return Sb;xb=1;let e=ky(),t=Pb(),r=$b(),n=Nb(),i=Kb(),o=Ob(),s=function(){if(wb)return bb;wb=1;let e=Pb(),t=Rb(),r=_b(),n=jb(),i=Mb(),o=Bb(),s=zb();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...h}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,u))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=u[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new s(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return bb=a,a.default=a,bb}(),a=Lb(),l=Ub(),u=_b(),c=jb(),h=Fb(),d=Mb(),p=Wb(),f=qb(),g=zb(),m=Bb(),v=Ib();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new m(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=h,y.Input=d,y.Rule=g,y.Root=m,y.Node=v,r.registerPostcss(y),Sb=y,y.default=y,Sb}();const Jb=gy(Hb);Jb.stringify,Jb.fromJSON,Jb.plugin,Jb.parse,Jb.list,Jb.document,Jb.comment,Jb.atRule,Jb.rule,Jb.decl,Jb.root,Jb.CssSyntaxError,Jb.Declaration,Jb.Container,Jb.Processor,Jb.Document,Jb.Comment,Jb.Warning,Jb.AtRule,Jb.Result,Jb.Input,Jb.Rule,Jb.Root,Jb.Node;class Gb{constructor(...e){fy(this,"parentElement",null),fy(this,"parentNode",null),fy(this,"ownerDocument"),fy(this,"firstChild",null),fy(this,"lastChild",null),fy(this,"previousSibling",null),fy(this,"nextSibling",null),fy(this,"ELEMENT_NODE",1),fy(this,"TEXT_NODE",3),fy(this,"nodeType"),fy(this,"nodeName"),fy(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Gb))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Yb={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Xb={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Qb={};function Zb(e){if(Qb[e])return Qb[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 Yb?Yb[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 Xb?Xb[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 Qb[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?Qb[e]=o:r}catch{return r}}const ew={};function tw(e,t,r){var n;const i=`${e}.${String(r)}`;if(ew[i])return ew[i].call(t);const o=Zb(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(ew[i]=s,s.call(t)):t[r]}const rw={};function nw(e,t,r){const n=`${e}.${String(r)}`;if(rw[n])return rw[n].bind(t);const i=Zb(e)[r];return"function"!=typeof i?t[r]:(rw[n]=i,i.bind(t))}function iw(){return Zb("MutationObserver").constructor}const ow={childNodes:function(e){return tw("Node",e,"childNodes")},parentNode:function(e){return tw("Node",e,"parentNode")},parentElement:function(e){return tw("Node",e,"parentElement")},textContent:function(e){return tw("Node",e,"textContent")},contains:function(e,t){return nw("Node",e,"contains")(t)},getRootNode:function(e){return nw("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?tw("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?tw("Element",e,"shadowRoot"):null},querySelector:function(e,t){return tw("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return tw("Element",e,"querySelectorAll")(t)},mutationObserver:iw};function sw(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const aw="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 lw={map:{},getId:()=>(console.error(aw),-1),getNode:()=>(console.error(aw),null),removeNodeFromMap(){console.error(aw)},has:()=>(console.error(aw),!1),reset(){console.error(aw)}};function uw(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 cw(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)}}),()=>cw(e,t,o||{},!0)}function hw(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&&(lw=new Proxy(lw,{get:(e,t,r)=>("map"===t&&console.error(aw),Reflect.get(e,t,r))}));let dw=Date.now;function pw(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=ow.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=ow.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function fw(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function gw(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function mw(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:ow.parentElement(e)}function vw(e,t,r,n){if(!e)return!1;const i=mw(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(Pm(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 yw(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function bw(e,t){if(Xg(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=ow.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||bw(n,t))}function ww(e){return Boolean(e.changedTouches)}function Sw(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function xw(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function kw(e){return!!e&&(e instanceof Gb&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ow.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(dw=()=>(new Date).getTime());class Cw{constructor(){Ug(this,"id",1),Ug(this,"styleIDMap",new WeakMap),Ug(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 Ew(e){var t;let r=null;return"getRootNode"in e&&(null==(t=ow.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ow.host(ow.getRootNode(e))&&(r=ow.host(ow.getRootNode(e))),r}function Ow(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=Ew(r);)r=t;return r}(e);return ow.contains(t,r)}function Iw(e){const t=e.ownerDocument;return!!t&&(ow.contains(t,e)||Ow(e))}var Pw=(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))(Pw||{}),Tw=(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))(Tw||{}),Rw=(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))(Rw||{}),Mw=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Mw||{}),Aw=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Aw||{}),_w=(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))(_w||{}),Nw=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Nw||{});function Lw(e){return"__ln"in e}class Dw{constructor(){Ug(this,"length",0),Ug(this,"head",null),Ug(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&&Lw(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&&Lw(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 Uw=(e,t)=>`${e}@${t}`;class Fw{constructor(){Ug(this,"frozen",!1),Ug(this,"locked",!1),Ug(this,"texts",[]),Ug(this,"attributes",[]),Ug(this,"attributeMap",new WeakMap),Ug(this,"removes",[]),Ug(this,"mapRemoves",[]),Ug(this,"movedMap",{}),Ug(this,"addedSet",new Set),Ug(this,"movedSet",new Set),Ug(this,"droppedSet",new Set),Ug(this,"removesSubTreeCache",new Set),Ug(this,"mutationCb"),Ug(this,"blockClass"),Ug(this,"blockSelector"),Ug(this,"maskTextClass"),Ug(this,"maskTextSelector"),Ug(this,"inlineStylesheet"),Ug(this,"maskInputOptions"),Ug(this,"maskTextFn"),Ug(this,"maskInputFn"),Ug(this,"keepIframeSrcFn"),Ug(this,"recordCanvas"),Ug(this,"inlineImages"),Ug(this,"slimDOMOptions"),Ug(this,"dataURLOptions"),Ug(this,"doc"),Ug(this,"mirror"),Ug(this,"iframeManager"),Ug(this,"stylesheetManager"),Ug(this,"shadowDomManager"),Ug(this,"canvasManager"),Ug(this,"processedNodeManager"),Ug(this,"unattachedDoc"),Ug(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Ug(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Dw,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=ow.parentNode(i);if(!o||!Iw(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=Xg(o)?this.mirror.getId(Ew(i)):this.mirror.getId(o),l=n(i);if(-1===a||-1===l)return r.addNode(i);const u=Am(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=>{Sw(e,this.mirror)&&this.iframeManager.addIframe(e),xw(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),kw(i)&&this.shadowDomManager.addShadowRoot(ow.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)Bw(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(ow.parentNode(e))||i(e);for(const e of this.addedSet)qw(this.droppedSet,e)||Bw(this.removesSubTreeCache,e,this.mirror)?qw(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(ow.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(ow.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=ow.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=ow.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=ow.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))}),Ug(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(ow.childNodes(e),e=>ow.textContent(e)||"").join("");t.attributes.value=rm({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:om(e),value:r,maskInputFn:this.maskInputFn})}),Ug(this,"processMutation",e=>{if(!yw(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=ow.textContent(e.target);vw(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Tm(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,mw(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=om(t);n=rm({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(vw(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"),!Im(t.tagName,r))if(i.attributes[r]=Om(this.doc,nm(t.tagName),nm(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(vw(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=Xg(e.target)?this.mirror.getId(ow.host(e.target)):this.mirror.getId(e.target);vw(e.target,this.blockClass,this.blockSelector,!1)||yw(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(jw(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||bw(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Uw(r,n)]?jw(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!Xg(e.target)||!Qg(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),ow.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Ug(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(yw(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[Uw(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);vw(e,this.blockClass,this.blockSelector,!1)||(ow.childNodes(e).forEach(e=>this.genAdds(e)),kw(e)&&ow.childNodes(ow.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 jw(e,t){e.delete(t),ow.childNodes(t).forEach(t=>jw(e,t))}function Bw(e,t,r){return 0!==e.size&&function(e,t){const r=ow.parentNode(t);return!!r&&e.has(r)}(e,t)}function qw(e,t){return 0!==e.size&&zw(e,t)}function zw(e,t){const r=ow.parentNode(t);return!!r&&(!!e.has(r)||zw(e,r))}let Vw;const Ww=e=>{if(!Vw)return e;return(...t)=>{try{return e(...t)}catch(e){if(Vw&&!0===Vw(e))return;throw e}}};function $w(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const Kw=[];function Hw(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 Jw(e,t){const r=new Fw;Kw.push(r),r.init(e);const n=new(iw())(Ww(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function Gw({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(Rw).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(o=>{let s=nm(o);const u=(t=>o=>{const s=Hw(o);if(vw(s,n,i,!0))return;let a=null,u=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Mw.Mouse;break;case"touch":a=Mw.Touch;break;case"pen":a=Mw.Pen}a===Mw.Touch?Rw[t]===Rw.MouseDown?u="TouchStart":Rw[t]===Rw.MouseUp&&(u="TouchEnd"):Mw.Pen}else ww(o)&&(a=Mw.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===Mw.Touch||u.startsWith("Mouse")&&a===Mw.Mouse)&&(a=null)):Rw[t]===Rw.Click&&(a=l,l=null);const c=ww(o)?o.changedTouches[0]:o;if(!c)return;const h=r.getId(s),{clientX:d,clientY:p}=c;Ww(e)({type:Rw[u],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Rw[o]){case Rw.MouseDown:case Rw.MouseUp:s=s.replace("mouse","pointer");break;case Rw.TouchStart:case Rw.TouchEnd:return}a.push(sw(s,u,t))}),Ww(()=>{a.forEach(e=>e())})}function Yw({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const s=Ww(uw(Ww(o=>{const s=Hw(o);if(!s||vw(s,n,i,!0))return;const a=r.getId(s);if(s===t&&t.defaultView){const r=pw(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 sw("scroll",s,t)}const Xw=["INPUT","TEXTAREA","SELECT"],Qw=new WeakMap;function Zw(e){return function(e,t){if(nS("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||nS("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||nS("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||nS("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 eS(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function tS({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(ow.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}}),Ww(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function rS(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=Jw(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=uw(Ww(t=>{const r=Date.now()-s;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],s=null}),o),u=Ww(uw(Ww(e=>{const t=Hw(e),{clientX:r,clientY:i}=ww(e)?e.changedTouches[0]:e;s||(s=dw()),a.push({x:r,y:i,id:n.getId(t),timeOffset:dw()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Tw.Drag:e instanceof MouseEvent?Tw.MouseMove:Tw.TouchMove)}),i,{trailing:!1})),c=[sw("mousemove",u,r),sw("touchmove",u,r),sw("drag",u,r)];return Ww(()=>{c.forEach(e=>e())})}(e),o=Gw(e),s=Yw(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return sw("resize",Ww(uw(Ww(()=>{const t=fw(),i=gw();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=Hw(e);const u=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=ow.parentElement(r)),!r||!h||Xw.indexOf(h)<0||vw(r,n,i,!0))return;if(r.classList.contains(o)||s&&r.matches(s))return;let p=r.value,f=!1;const g=om(r)||"";"radio"===g||"checkbox"===g?f=r.checked:(a[h.toLowerCase()]||a[g])&&(p=rm({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=Qw.get(t);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){Qw.set(t,n);const i=r.getId(t);Ww(e)({...n,id:i})}}const p=("last"===u.input?["change"]:["input","change"]).map(e=>sw(e,Ww(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=>cw(e[0],e[1],{set(){Ww(h)({target:this,isTrusted:!1})}},!1,f))),Ww(()=>{p.forEach(e=>e())})}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const s=Ww(o=>uw(Ww(i=>{const s=Hw(i);if(!s||vw(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=[sw("play",s(_w.Play),o),sw("pause",s(_w.Pause),o),sw("seeked",s(_w.Seeked),o),sw("volumechange",s(_w.VolumeChange),o),sw("ratechange",s(_w.RateChange),o)];return Ww(()=>{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:Ww((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=eS(i,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:a}]}),$w(()=>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:Ww((n,i,o)=>{const[s]=o,{id:a,styleId:l}=eS(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),$w(()=>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:Ww((n,i,o)=>{const[s]=o,{id:a,styleId:l}=eS(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:Ww((n,i,o)=>{const[s]=o,{id:a,styleId:l}=eS(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),n.apply(i,o)})}));const l={};iS("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(iS("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),iS("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),iS("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:Ww((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=eS(i.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:[...Zw(i),a||0]}]}),n.apply(i,o)})}),i.prototype.deleteRule=new Proxy(u[n].deleteRule,{apply:Ww((n,i,o)=>{const[s]=o,{id:a,styleId:l}=eS(i.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...Zw(i),s]}]}),n.apply(i,o)})})}),Ww(()=>{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=tS(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:Ww((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}=eS(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:Zw(s.parentRule)}),i.apply(s,a)})});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Ww((i,o,a)=>{var l;const[u]=a;if(r.has(u))return s.apply(o,[u]);const{id:c,styleId:h}=eS(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:Zw(o.parentRule)}),i.apply(o,a)})}),Ww(()=>{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=hw(t.fonts,"add",function(t){return function(r){return setTimeout(Ww(()=>{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),Ww(()=>{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=Ww(()=>{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;vw(s,n,i,!0)||vw(u,n,i,!0)||a.push({start:r.getId(s),startOffset:l,end:r.getId(u),endOffset:c})}o({ranges:a})});return a(),sw("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?hw(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 Ww(()=>{Kw.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 nS(e){return void 0!==window[e]}function iS(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class oS{constructor(e){Ug(this,"iframeIdToRemoteIdMap",new WeakMap),Ug(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 sS{constructor(e){Ug(this,"iframes",new WeakMap),Ug(this,"crossOriginIframeMap",new WeakMap),Ug(this,"crossOriginIframeMirror",new oS(vm)),Ug(this,"crossOriginIframeStyleMirror"),Ug(this,"crossOriginIframeRootIdMap",new WeakMap),Ug(this,"mirror"),Ug(this,"mutationCb"),Ug(this,"wrappedEmit"),Ug(this,"loadListener"),Ug(this,"stylesheetManager"),Ug(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new oS(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 Pw.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:Pw.IncrementalSnapshot,data:{source:Tw.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Pw.Meta:case Pw.Load:case Pw.DomContentLoaded:return!1;case Pw.Plugin:return t;case Pw.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Pw.IncrementalSnapshot:switch(t.data.source){case Tw.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 Tw.Drag:case Tw.TouchMove:case Tw.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Tw.ViewportResize:return!1;case Tw.MediaInteraction:case Tw.MouseInteraction:case Tw.Scroll:case Tw.CanvasMutation:case Tw.Input:return this.replaceIds(t.data,e,["id"]),t;case Tw.StyleSheetRule:case Tw.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Tw.Font:return t;case Tw.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Tw.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===Nw.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class aS{constructor(e){Ug(this,"shadowDoms",new WeakSet),Ug(this,"mutationCb"),Ug(this,"scrollCb"),Ug(this,"bypassOptions"),Ug(this,"mirror"),Ug(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(!Qg(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Jw({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Yw({...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(ow.host(e))),this.restoreHandlers.push(tS({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(hw(e.prototype,"attachShadow",function(e){return function(n){const i=e.call(this,n),o=ow.shadowRoot(this);return o&&Iw(this)&&r.addShadowRoot(o,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var lS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uS="undefined"==typeof Uint8Array?[]:new Uint8Array(256),cS=0;cS<64;cS++)uS[lS.charCodeAt(cS)]=cS;const hS=new Map;const dS=(e,t,r)=>{if(!e||!gS(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=hS.get(e);return r||(r=new Map,hS.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 pS(e,t,r){if(e instanceof Array)return e.map(e=>pS(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+=lS[r[t]>>2],i+=lS[(3&r[t])<<4|r[t+1]>>4],i+=lS[(15&r[t+1])<<2|r[t+2]>>6],i+=lS[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:[pS(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:[pS(e.data,t,r),e.width,e.height]}}if(gS(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:dS(e,t,r)}}return e}const fS=(e,t,r)=>e.map(e=>pS(e,t,r)),gS=(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 mS(e,t,r,n){const i=[];try{const o=hw(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(i,...o){if(!vw(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 vS(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=hw(e,l,function(e){return function(...s){const a=e.apply(this,s);if(dS(a,o,this),"tagName"in this.canvas&&!vw(this.canvas,n,i,!0)){const e=fS(s,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});s.push(a)}catch{const n=cw(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(n)}return s}const yS='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',bS="undefined"!=typeof self&&self.Blob&&new Blob([yS],{type:"text/javascript;charset=utf-8"});function wS(e){let t;try{if(t=bS&&(self.URL||self.webkitURL).createObjectURL(bS),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(yS),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class SS{constructor(e){Ug(this,"pendingCanvasMutations",new Map),Ug(this,"rafStamps",{latestId:0,invokeId:null}),Ug(this,"mirror"),Ug(this,"mutationCb"),Ug(this,"resetObservers"),Ug(this,"frozen",!1),Ug(this,"locked",!1),Ug(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=mS(t,r,n,!0),s=new Map,a=new wS;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:Aw["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=>{vw(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=mS(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=hw(t.CanvasRenderingContext2D.prototype,s,function(i){return function(...o){return vw(this.canvas,r,n,!0)||setTimeout(()=>{const r=fS(o,t,this);e(this.canvas,{type:Aw["2D"],property:s,args:r})},0),i.apply(this,o)}});i.push(o)}catch{const r=cw(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:Aw["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(...vS(t.WebGLRenderingContext.prototype,Aw.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...vS(t.WebGL2RenderingContext.prototype,Aw.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 xS{constructor(e){Ug(this,"trackedLinkElements",new WeakSet),Ug(this,"mutationCb"),Ug(this,"adoptedStyleSheetCb"),Ug(this,"styleMirror",new Cw),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:em(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 kS{constructor(){Ug(this,"nodeMap",new WeakMap),Ug(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 CS,ES,OS,IS=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Ng=e.contentWindow)?void 0:Ng.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const PS=new tm;function TS(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:x=!1,recordCrossOriginIframes:k=!1,recordAfter:C=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:O=!1,inlineImages:I=!1,plugins:P,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:R=new Set([]),errorHandler:M,applyBackgroundColorToBlockedElements:A=!1}=e;Vw=M;const _=!k||window.parent===window;let N=!1;if(!_)try{window.parent.document&&(N=!1)}catch(e){N=!0}if(_&&!t)throw new Error("emit function is required");if(!_&&!N)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),PS.reset();const L=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==d?d:{password:!0},D=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let U;!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 F=0;const j=e=>{for(const t of P||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!N&&(e=v(e)),e};CS=(e,i)=>{var o;const s=e;if(s.timestamp=dw(),!(null==(o=Kw[0])?void 0:o.isFrozen())||s.type===Pw.FullSnapshot||s.type===Pw.IncrementalSnapshot&&s.data.source===Tw.Mutation||Kw.forEach(e=>e.unfreeze()),_)null==t||t(j(s),i);else if(N){const e={type:"rrweb",event:j(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,"*")}if(s.type===Pw.FullSnapshot)U=s,F=0;else if(s.type===Pw.IncrementalSnapshot){if(s.data.source===Tw.Mutation&&s.data.isAttachIframe)return;F++;const e=n&&F>=n,t=r&&s.timestamp-U.timestamp>r;(e||t)&&ES(!0)}};const B=e=>{CS({type:Pw.IncrementalSnapshot,data:{source:Tw.Mutation,...e}})},q=e=>CS({type:Pw.IncrementalSnapshot,data:{source:Tw.Scroll,...e}}),z=e=>CS({type:Pw.IncrementalSnapshot,data:{source:Tw.CanvasMutation,...e}}),V=new xS({mutationCb:B,adoptedStyleSheetCb:e=>CS({type:Pw.IncrementalSnapshot,data:{source:Tw.AdoptedStyleSheet,...e}})}),W=new sS({mirror:PS,mutationCb:B,stylesheetManager:V,recordCrossOriginIframes:k,wrappedEmit:CS});for(const e of P||[])e.getMirror&&e.getMirror({nodeMirror:PS,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});const $=new kS;OS=new SS({recordCanvas:x,mutationCb:z,win:window,blockClass:i,blockSelector:o,mirror:PS,sampling:y.canvas,dataURLOptions:b});const K=new aS({mutationCb:B,scrollCb:q,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:L,dataURLOptions:b,maskTextFn:g,maskInputFn:f,recordCanvas:x,inlineImages:I,sampling:y,slimDOMOptions:D,iframeManager:W,stylesheetManager:V,canvasManager:OS,keepIframeSrcFn:T,processedNodeManager:$},mirror:PS});ES=(e=!1)=>{if(!S)return;CS({type:Pw.Meta,data:{href:window.location.href,width:gw(),height:fw()}},e),V.reset(),K.init(),Kw.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new tm,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:x=!1}=t;return Am(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:x})}(document,{mirror:PS,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:L,maskTextFn:g,maskInputFn:f,slimDOM:D,dataURLOptions:b,recordCanvas:x,inlineImages:I,applyBackgroundColorToBlockedElements:A,onSerialize:e=>{Sw(e,PS)&&W.addIframe(e),xw(e,PS)&&V.trackLinkElement(e),kw(e)&&K.addShadowRoot(ow.shadowRoot(e),document)},onIframeLoad:(e,t)=>{W.attachIframe(e,t),K.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!t)return console.warn("Failed to snapshot the document");CS({type:Pw.FullSnapshot,data:{node:t,initialOffset:pw(window)}},e),Kw.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,PS.getId(document))};try{const e=[],t=e=>{var t;return Ww(rS)({mutationCb:B,mousemoveCb:(e,t)=>CS({type:Pw.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>CS({type:Pw.IncrementalSnapshot,data:{source:Tw.MouseInteraction,...e}}),scrollCb:q,viewportResizeCb:e=>CS({type:Pw.IncrementalSnapshot,data:{source:Tw.ViewportResize,...e}}),inputCb:e=>CS({type:Pw.IncrementalSnapshot,data:{source:Tw.Input,...e}}),mediaInteractionCb:e=>CS({type:Pw.IncrementalSnapshot,data:{source:Tw.MediaInteraction,...e}}),styleSheetRuleCb:e=>CS({type:Pw.IncrementalSnapshot,data:{source:Tw.StyleSheetRule,...e}}),styleDeclarationCb:e=>CS({type:Pw.IncrementalSnapshot,data:{source:Tw.StyleDeclaration,...e}}),canvasMutationCb:z,fontCb:e=>CS({type:Pw.IncrementalSnapshot,data:{source:Tw.Font,...e}}),selectionCb:e=>{CS({type:Pw.IncrementalSnapshot,data:{source:Tw.Selection,...e}})},customElementCb:e=>{CS({type:Pw.IncrementalSnapshot,data:{source:Tw.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:L,inlineStylesheet:c,sampling:y,recordDOM:S,recordCanvas:x,inlineImages:I,userTriggeredOnInput:E,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:T,blockSelector:o,slimDOMOptions:D,dataURLOptions:b,mirror:PS,iframeManager:W,stylesheetManager:V,shadowDomManager:K,processedNodeManager:$,canvasManager:OS,ignoreCSSAttributes:R,plugins:(null==(t=null==P?void 0:P.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>CS({type:Pw.Plugin,data:{plugin:e.name,payload:t}})})))||[]},m)};W.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{ES(),e.push(t(document)),IS=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(sw("DOMContentLoaded",()=>{CS({type:Pw.DomContentLoaded,data:{}}),"DOMContentLoaded"===C&&r()})),e.push(sw("load",()=>{CS({type:Pw.Load,data:{}}),"load"===C&&r()},window))),()=>{e.forEach(e=>e()),$.destroy(),IS=!1,Vw=void 0}}catch(e){console.warn(e)}}var RS;TS.addCustomEvent=(e,t)=>{if(!IS)throw new Error("please add custom event after start recording");CS({type:Pw.Custom,data:{tag:e,payload:t}})},TS.freezePage=()=>{Kw.forEach(e=>e.freeze())},TS.takeFullSnapshot=e=>{if(!IS)throw new Error("please take full snapshot after start recording");ES(e)},TS.mirror=PS,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(RS||(RS={}));var MS=Object.freeze({__proto__:null,record:TS}),AS=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=F();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}(),_S=Object.freeze({__proto__:null,NetworkObservers:AS});e.Identify=_,e.Revenue=$,e.Types=lo,e._setDiagnosticsSampleRate=cc,e.add=fc,e.createInstance=lc,e.experiment=dc,e.extendSession=gc,e.flush=mc,e.getDeviceId=vc,e.getSessionId=yc,e.getUserId=bc,e.groupIdentify=wc,e.identify=Sc,e.initAll=hc,e.logEvent=xc,e.remove=kc,e.reset=Cc,e.revenue=Ec,e.sessionReplay=pc,e.setDeviceId=Oc,e.setGroup=Ic,e.setOptOut=Pc,e.setSessionId=Tc,e.setTransport=Rc,e.setUserId=Mc,e.track=Ac,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",k="li_fat_id",x="msclkid",C="rdt_cid",E="ttclid",O="twclid",I="wbraid",P={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},T=["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"],R=["authorization","cookie","set-cookie"],A=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&&A(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 A(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},_=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 N,L=[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"}(N||(N={}));var D,U=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=N.Unknown),{event:e,code:t,message:r}},F=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=F();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("")},q=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,k,x,C;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&&(k=a.return)&&k.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(),x={error:y},[3,16];case 15:try{g&&!g.done&&(C=f.return)&&C.call(f)}finally{if(x)throw x.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 U(t,0,String(e))})}),Promise.all(w).then(function(e){var t=c(e,1)[0]||U(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}(),z=function(e,t){return o(o({},t),{event_type:i.IDENTIFY,user_properties:e.getUserProperties()})},V=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 q(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 V(this.dispatch(n))},e.prototype.identify=function(e,t){var r=z(e,t);return V(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 V(this.dispatch(s))},e.prototype.setGroup=function(e,t,r){var n=function(e,t,r){var n,s=new _;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 V(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 V(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),V())},e.prototype._addPlugin=function(e){return V(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)),V())},e.prototype._removePlugin=function(e){return V(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(U(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])}),L.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,U(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=U(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 V(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}(),$=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 A(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?o({},this.properties):{};return e[D.REVENUE_PRODUCT_ID]=this.productId,e[D.REVENUE_QUANTITY]=this.quantity,e[D.REVENUE_PRICE]=this.price,e[D.REVENUE_TYPE]=this.revenueType,e[D.REVENUE_CURRENCY]=this.currency,e[D.REVENUE]=this.revenue,e[D.RECEIPT]=this.receipt,e[D.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"}(D||(D={}));var K;!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"}(K||(K={}));var H="Amplitude Logger ",J=function(){function e(){this.logLevel=K.None}return e.prototype.disable=function(){this.logLevel=K.None},e.prototype.enable=function(e){void 0===e&&(e=K.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<K.Verbose||console.log("".concat(H,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<K.Warn||console.warn("".concat(H,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<K.Error||console.error("".concat(H,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<K.Debug||console.log("".concat(H,"[Debug]: ").concat(e.join(" ")))},e}(),G=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:g,logLevel:K.Warn,loggerProvider:new J,offline:!1,optOut:!1,serverUrl:m,serverZone:"US",useBatch:!1}},Y=function(){function e(e){var t,r,n,i;this._optOut=!1;var o=G();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=Q(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}(),X=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},Q=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=G().serverZone),void 0===r&&(r=G().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:G().serverZone;return{serverZone:n,serverUrl:X(n,r)}},Z=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function 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<K.Debug||!u||!l)return e.apply(i,o);var c={type:"invoke public method",name:t,args:o,stacktrace:te(1),time:{start:(new Date).toISOString()},states:{}};n&&c.states&&(c.states.before=n());var h=e.apply(i,o);return h&&h.promise?h.promise.then(function(){n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))}):(n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=(new Date).toISOString()),l.debug(JSON.stringify(c,null,2))),h}};function se(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var ae=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return a(this,void 0,void 0,function(){var r,n=this;return l(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(f,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(r=i.sent())&&r.length>0&&Promise.all(r.map(function(e){return n.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=B()),new Promise(function(r){var n={event:e,attempts:0,callback:function(e){return r(e)},timeout:0};t.queue.push(n),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter(function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)})},e.prototype.scheduleEvents=function(e){var t=this;e.forEach(function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)})},e.prototype.schedule=function(e){var t=this;if(!this.config.offline)return null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout?(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,void(this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e))):void 0},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),a(this,void 0,void 0,function(){var t,r,n,i=this;return l(this,function(o){switch(o.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],r=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):r.push(e)}),s=t,u=this.config.flushQueueSize,c=Math.max(u,1),n=s.reduce(function(e,t,r){var n=Math.floor(r/c);return e[n]||(e[n]=[]),e[n].push(t),e},[]),[4,n.reduce(function(t,r){return a(i,void 0,void 0,function(){return l(this,function(n){switch(n.label){case 0:return[4,t];case 1:return n.sent(),[4,this.send(r,e)];case 2:return[2,n.sent()]}})})},Promise.resolve())]);case 1:return o.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}var s,u,c})})},e.prototype.send=function(e,t){var r;return void 0===t&&(t=!0),a(this,void 0,void 0,function(){var n,i,o,a,u;return l(this,function(l){switch(l.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];n={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;return t.extra,s(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new Z,l.label=1;case 1:return l.trys.push([1,3,,4]),i=Q(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,n)];case 2:return null===(o=l.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleResponse(o,e),[3,4]):("body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(se(o))):this.fulfillRequest(e,o.statusCode,o.status),[2]);case 3:return a=l.sent(),u=(c=a)instanceof Error?c.message:String(c),this.config.loggerProvider.error(u),null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:u,stack_trace:te()}),this.handleResponse({status:N.Failed,statusCode:0},e),[3,4];case 4:return[2]}var c})})},e.prototype.handleResponse=function(e,t){var r;ee(e.statusCode)||null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:se(e),stack_trace:te()});var n=e.status;switch(n){case N.Success:this.handleSuccessResponse(e,t);break;case N.Invalid:this.handleInvalidResponse(e,t);break;case N.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case N.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(U(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=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}(),me="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,ve=function(){function e(){this.identityStore=new ge,this.eventBridge=new ce,this.applicationContextProvider=new le}return e.getInstance=function(t){return me.analyticsConnectorInstances||(me.analyticsConnectorInstances={}),me.analyticsConnectorInstances[t]||(me.analyticsConnectorInstances[t]=new e),me.analyticsConnectorInstances[t]},e}(),ye=function(e){return void 0===e&&(e=g),ve.getInstance(e)},be=function(){function e(){this.name="identity",this.type="before",this.identityStore=ye().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=ye(e.instanceName).identityStore),[2]})})},e}(),we=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},Se=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[p,t,e.substring(0,r)].filter(Boolean).join("_")},ke=function(){var e,t,r,n;if("undefined"==typeof navigator)return"";var i=navigator.userLanguage;return null!==(n=null!==(r=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==r?r:i)&&void 0!==n?n:""},xe=function(){var e,t=F();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var r=t.split("=",2),n=Ce(r[0]),i=Ce(r[1]);return i?(e[n]=i,e):e},{}):{}},Ce=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},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},Ie=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=Ie(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,t){void 0===t&&(t={}),this.options=o({},e),this.config=t}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(!F())return[2,!1];e.testValue=String(Date.now()),t=o(o({},this.options),{expirationDays:.003}),r=new e(t),n="AMP_TEST_".concat(B().substring(0,8)),i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,r.set(n,e.testValue)];case 2:return i.sent(),[4,r.get(n)];case 3:return[2,i.sent()===e.testValue];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,r;return l(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:if(!(t=n.sent()))return[2,void 0];try{return void 0===(r=Ae(t))?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)),[2,void 0]):[2,JSON.parse(r)]}catch(r){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t)),[2,void 0]}return[2]}})})},e.prototype.getRaw=function(e){var t,r,n,i;return a(this,void 0,void 0,function(){var o,s,a,c,h,d,p,f,g,m,v,y,b=this;return l(this,function(l){switch(l.label){case 0:o=F(),s=o,l.label=1;case 1:return l.trys.push([1,4,,5]),(a=null==s?void 0:s.cookieStore)?[4,a.getAll(e)]:[3,3];case 2:if(c=l.sent()){c.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:c.map(function(e){return e.domain})}),null===(r=this.config.diagnosticsClient)||void 0===r||r.increment("cookies.duplicate.occurrence.cookieStore"));try{for(h=u(c),d=h.next();!d.done;d=h.next())if(p=d.value,Me(p.domain,this.options.domain))return[2,p.value]}catch(e){v={error:e}}finally{try{d&&!d.done&&(y=h.return)&&y.call(h)}finally{if(v)throw v.error}}}l.label=3;case 3:return[3,5];case 4:return l.sent(),[3,5];case 5:return f=(null!==(i=null===(n=null==o?void 0:o.document)||void 0===n?void 0:n.cookie.split("; "))&&void 0!==i?i:[]).filter(function(t){return 0===t.indexOf(e+"=")}),g=void 0,"function"==typeof(m=this.config.duplicateResolverFn)&&f.length>1&&(g=f.find(function(t){var r;try{var n=m(t.substring(e.length+1));return n||null===(r=b.config.diagnosticsClient)||void 0===r||r.increment("cookies.duplicate.occurrence.document.cookie"),n}catch(e){return!1}})),g||(g=f[0]),g?[2,g.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=F())&&(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}(),Ae=function(e){var t;return null!==(t=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}}(e))&&void 0!==t?t:function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}}(e)},Me=function(e,t){if(!e||!t)return!1;var r=e.startsWith(".")?e.substring(1):e,n=t.startsWith(".")?t.substring(1):t;return r.toLowerCase()===n.toLowerCase()},_e=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[p,t,e.substring(0,r)].filter(Boolean).join("_")},Ne=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",De="counters",Ue="histograms",Fe="events",je="internal",Be="last_flush_timestamp",qe=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=F())||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(De)||e.createObjectStore(De,{keyPath:"key"}),e.objectStoreNames.contains(Ue)||e.createObjectStore(Ue,{keyPath:"key"}),e.objectStoreNames.contains(Fe))||e.createObjectStore(Fe,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1});e.objectStoreNames.contains(je)||e.createObjectStore(je,{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([De],"readwrite"),n=r.objectStore(De),[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([Fe],"readwrite"),n=r.objectStore(Fe),[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([je],"readwrite"),i=n.objectStore(je),[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([je],"readonly"),n=r.objectStore(je),[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(Be)];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(Be,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,De,Ue,Fe],"readwrite"),[4,Promise.all([this.getAllFromStore(t,Le),this.getAllFromStore(t,De),this.getAllFromStore(t,Ue),this.getAllFromStore(t,Fe)])];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,De),this.clearTable(t,Ue),this.clearTable(t,Fe)])];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}(),ze=function(e){var t,r=null==(t=F())?void 0:t.__AMPLITUDE_SCRIPT_URL__;if(r)return e.filename&&e.filename.includes(r)?"filename":e.stack&&e.stack.includes(r)?"stack":void 0},Ve=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},We=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},$e=3e5,Ke=1e4,He=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,qe.isSupported()?this.storage=new qe(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),function(e){var t=F();if(t&&"function"==typeof t.addEventListener){var r=function(t){e.recordEvent("sdk.error.uncaught",o({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",function(e){var t=e.error instanceof Error?e.error:void 0,n=null==t?void 0:t.stack,i=ze({filename:e.filename,stack:n});i&&r({type:"error",message:e.message,stack:n,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})},!0),t.addEventListener("unhandledrejection",function(e){var t,n=e.reason instanceof Error?e.reason:void 0,i=null==n?void 0:n.stack,o=Ve(i),s=ze({filename:o,stack:i});s&&r({type:"unhandledrejection",message:null!==(t=null==n?void 0:n.message)&&void 0!==t?t:We(e.reason),stack:i,filename:o,errorName:null==n?void 0:n.name,metadata:{isTrusted:e.isTrusted,matchReason:s}})},!0)}}(this))}return e.prototype.isStorageAndTrackEnabled=function(){return Boolean(this.storage)&&Boolean(this.shouldTrack)},e.prototype.setTag=function(e,t){this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryTags).length>=Ke?this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit"):(this.inMemoryTags[e]=t,this.startTimersIfNeeded()))},e.prototype.increment=function(e,t){void 0===t&&(t=1),this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryCounters).length>=Ke?this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit"):(this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()))},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled())if(Object.keys(this.inMemoryHistograms).length>=Ke)this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");else{var r=this.inMemoryHistograms[e];r?(r.count+=1,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){this.isStorageAndTrackEnabled()&&(this.inMemoryEvents.length>=10?this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit"):(this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()))},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)}).finally(function(){e.saveTimer=null})},1e3)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)}).finally(function(){e.flushTimer=null})},$e))},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]),!F())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($e),[2]):(r=e-t)>=$e?(this._flush(),[2]):(this._setFlushTimer($e-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}(),Je=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,i,o,s,a,l,u,c,h,d,p,f,g,m,v,y,b,w,S,k;if("object"!=typeof e)return null;var x=e.code||0,C=this.buildStatus(x);switch(C){case N.Success:return{status:C,statusCode:x,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case N.Invalid:return{status:C,statusCode:x,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(c=e.exceeded_daily_quota_devices)&&void 0!==c?c:{},silencedDevices:null!==(h=e.silenced_devices)&&void 0!==h?h:[],silencedEvents:null!==(d=e.silenced_events)&&void 0!==d?d:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(f=e.throttled_events)&&void 0!==f?f:[]}};case N.PayloadTooLarge:return{status:C,statusCode:x,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case N.RateLimit:return{status:C,statusCode:x,body:{error:null!==(m=e.error)&&void 0!==m?m:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(w=e.exceeded_daily_quota_devices)&&void 0!==w?w:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(k=e.throttled_events)&&void 0!==k?k:[]}};case N.Timeout:default:return{status:C,statusCode:x}}},e.prototype.buildStatus=function(e){return ee(e)?N.Success:429===e?N.RateLimit:413===e?N.PayloadTooLarge:408===e?N.Timeout:e>=400&&e<500?N.Invalid:e>=500?N.Failed:N.Unknown},e}(),Ge=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}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(s){switch(s.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:o({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=s.sent()).text()];case 2:i=s.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}})})},t}(Je),Ye=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),Xe=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new Ye(e,t)}return e.prototype.subscribe=function(e,t,r){var n=B(),i={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),n},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return a(this,void 0,void 0,function(){var e,t=this;return l(this,function(r){switch(r.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise||(this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null})),this.fetchPromise},e.prototype.subscribeAll=function(e){return a(this,void 0,void 0,function(){var t,r,n,i=this;return l(this,function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return a(this,void 0,void 0,function(){var r,n;return l(this,function(i){switch(i.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(n=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),a(this,void 0,void 0,function(){var r,n,i,o,s,a,u=this;return l(this,function(c){switch(c.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},i=function(n){var i,s,a,c,h;return l(this,function(l){switch(l.label){case 0:i=new AbortController,s=setTimeout(function(){return i.abort()},t),l.label=1;case 1:return l.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:return(a=l.sent()).ok?[3,4]:[4,a.text()];case 3:return c=l.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(a.status,": ").concat(c)),[3,6];case 4:return[4,a.json()];case 5:return[2,{value:{remoteConfig:l.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(h=l.sent())instanceof Error&&"AbortError"===h.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),h),[3,9];case 8:return clearTimeout(s),[7];case 9:return n<e-1?[4,new Promise(function(e){return setTimeout(e,u.getJitterDelay(r))})]:[3,11];case 10:l.sent(),l.label=11;case 11:return[2]}})},o=this,s=0,c.label=1;case 1:return s<e?[5,i(s)]:[3,4];case 2:if("object"==typeof(a=c.sent()))return[2,a.value];c.label=3;case 3:return s++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}(),Qe=F(),Ze=null==Qe?void 0:Qe.console,et={},tt={},rt=!1;var nt,it={addListener:function(e,t){var r,n=(r=e,!!Ze&&"function"==typeof Ze[r]&&(tt[r]||(tt[r]=Ze[r],Ze[r]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{if(et[r]&&!rt){rt=!0;var n=et[r];n&&n.forEach(function(t){try{t(r,e)}catch(e){}})}}catch(e){}return rt=!1,tt[r].apply(Ze,e)}),!0));if(!n)return new Error("Console override failed");et[e]?et[e].push(t):et[e]=[t]},removeListener:function(e){var t,r;try{for(var n=u(Object.values(et)),i=n.next();!i.done;i=n.next())for(var o=i.value,s=o.length-1;s>=0;s--)if(o[s]===e){o.splice(s,1);break}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},_restoreConsole:function(){var e,t;try{for(var r=u(Object.entries(tt)),n=r.next();!n.done;n=r.next()){var i=c(n.value,2),o=i[0],s=i[1];s&&(Ze[o]=s)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}tt={},et={}}};!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(nt||(nt={}));var ot=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],st="data-amp-track-",at=["div","span","h1","h2","h3","h4","h5","h6"],lt=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),ut=lt,ct=lt,ht=["*"];function dt(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function pt(e,t,r){e&&ft({json:e,allowlist:t.map(gt),excludelist:r.map(gt),ancestors:[]})}function ft(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);dt(i[m])?vt(v,o)&&!vt(v,s)||delete i[m]:ft({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 gt(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function mt(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(mt(e,t,o,n+1))return!0;return!1}return("*"===i||i===e[r])&&mt(e,t,r+1,n+1)}function vt(e,t){return t.some(function(t){return mt(e,t)})}var yt=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 Ot(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=F();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=wt(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,Ct(this.body,e,t)]})})},e}(),bt=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),Ot(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return wt(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,Ct(this.body,e,t)]})})},e}();function wt(e,t){var r,n,i,o=F(),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 St,kt=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}),Ot(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,Ct(r.sent(),e,t)]}})})},e}(),xt=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 Ot(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())?(pt(r,e,t),[2,r]):[2,null]})})},e}();function Ct(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return pt(n,t,r),n}catch(e){return null}}!function(e){e.REDACT="redact",e.REMOVE="remove"}(St||(St={}));var Et="[REDACTED]",Ot=function(e,t){var r,n,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?St.REMOVE:s,l=h([],c(R),!1),d={},p=function(t){var r=t.toLowerCase();l.find(function(e){return e.toLowerCase()===r})?a===St.REDACT&&(d[t]=Et):o.find(function(e){return e.toLowerCase()===r})?d[t]=e[t]:a===St.REDACT&&(d[t]=Et)};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},It=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(T),!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(T),!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 Pt=function(e,t){void 0===t&&(t=B()),this.callback=e,this.id=t},Tt=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=F();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=F();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 It(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 yt(n):void 0,i?new kt(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 xt(i.status,t,r?parseInt(r,10):void 0,o),u=i.$$AmplitudeAnalyticsEvent.headers,c=new bt(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}(),Rt=new Tt,At=function(){function e(){}return e.prototype.parse=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return[2,o(o(o(o({},P),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=xe();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=xe();return(e={})[v]=t[v],e[y]=t[y],e[b]=t[b],e[w]=t[w],e[S]=t[S],e[k]=t[k],e[x]=t[x],e[C]=t[C],e[E]=t[E],e[O]=t[O],e[I]=t[I],e},e}(),Mt="data-amp-mask",_t="*****",Nt=/\b(?:\d[ -]*?){13,16}\b/,Lt=/(\d{3}-?\d{2}-?\d{4})/g,Dt=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Ut=function(e,t){var r,n;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var i=e;i=(i=(i=i.replace(Nt,_t)).replace(Lt,_t)).replace(Dt,_t);try{for(var o=u(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,_t)}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},Ft=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(Mt)?_t:e?e(document.title):document.title};function jt(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 Bt(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 Bt(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 Bt(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 qt(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 zt(e,t,r){return t&&qt(e.prototype,t),r&&qt(e,r),e}var Vt=function(){return"function"==typeof Symbol},Wt=function(e){return Vt()&&Boolean(Symbol[e])},$t=function(e){return Wt(e)?Symbol[e]:"@@"+e};Vt()&&!Wt("observable")&&(Symbol.observable=Symbol("observable"));var Kt=$t("iterator"),Ht=$t("observable"),Jt=$t("species");function Gt(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function Yt(e){var t=e.constructor;return void 0!==t&&null===(t=t[Jt])&&(t=void 0),void 0!==t?t:sr}function Xt(e){return e instanceof sr}function Qt(e){Qt.log?Qt.log(e):setTimeout(function(){throw e})}function Zt(e){Promise.resolve().then(function(){try{e()}catch(e){Qt(e)}})}function er(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=Gt(t,"unsubscribe");r&&r.call(t)}}catch(e){Qt(e)}}function tr(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function rr(e,t,r){e._state="running";var n=e._observer;try{var i=Gt(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(tr(e),!i)throw r;i.call(n,r);break;case"complete":tr(e),i&&i.call(n)}}catch(e){Qt(e)}"closed"===e._state?er(e):"running"===e._state&&(e._state="ready")}function nr(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 Zt(function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(rr(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)})):void rr(e,t,r);e._queue.push({type:t,value:r})}}var ir=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var r=new or(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&&(tr(this),er(this))},zt(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),or=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){nr(this._subscription,"next",e)},t.error=function(e){nr(this._subscription,"error",e)},t.complete=function(){nr(this._subscription,"complete")},zt(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),sr=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 ir(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(Yt(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(Yt(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=Yt(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=Yt(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=Yt(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[Ht]=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=Gt(t,Ht);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return Xt(i)&&i.constructor===r?i:new r(function(e){return i.subscribe(e)})}if(Wt("iterator")&&(n=Gt(t,Kt)))return new r(function(e){Zt(function(){if(!e.closed){for(var r,i=jt(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){Zt(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){Zt(function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}})})},zt(e,null,[{key:Jt,get:function(){return this}}]),e}();function ar(e,t){return new sr(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 lr(e,t){return new sr(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 ur(e){var t=new Set,r=null;function n(){null==r||r.unsubscribe(),r=null,t.clear()}return new sr(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)}})}Vt()&&Object.defineProperty(sr,Symbol("extensions"),{value:{symbol:Ht,hostReportError:Qt},configurable:!0});var cr=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},hr=function(e){return cr(e,"attribution")},dr=function(e){return cr(e,"formInteractions")},pr=function(e){return cr(e,"pageViews")},fr=function(e){return cr(e,"sessions")},gr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},mr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},vr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},yr=function(e){if(mr(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},br=function(e){if(vr(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},wr=function(e){var t;if(gr(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})})}},Sr=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return pr(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}},kr=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},xr=function(e){return e&&void 0!==e._q},Cr="2.34.1-feat-zoning-alpha.0",Er="amplitude-ts",Or=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(Er,"/").concat(Cr),"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:ke()}),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}(),Ir=1e3,Pr=function(e){function t(t){var r,n,i,o=this;try{i=null===(r=F())||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>Ir?(i=r.length-Ir,[4,e.prototype.set.call(this,t,r.slice(0,Ir))]):[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(Ir,".")),[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}(Ne),Tr=function(e){function t(){var t;return e.call(this,null===(t=F())||void 0===t?void 0:t.sessionStorage)||this}return r(t,e),t}(Ne),Rr=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.state={done:4},r.customHeaders=t,r}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 s,a;"undefined"==typeof XMLHttpRequest&&i(new Error("XHRTransport is not supported."));var l=new XMLHttpRequest;l.open("POST",e,!0),l.onreadystatechange=function(){if(l.readyState===r.state.done){var e=l.responseText;try{n(r.buildResponse(JSON.parse(e)))}catch(e){n(r.buildResponse({code:l.status}))}}};var h=o({"Content-Type":"application/json",Accept:"*/*"},r.customHeaders);try{for(var d=u(Object.entries(h)),p=d.next();!p.done;p=d.next()){var f=c(p.value,2),g=f[0],m=f[1];l.setRequestHeader(g,m)}}catch(e){s={error:e}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(s)throw s.error}}l.send(JSON.stringify(t))})]})})},t}(Je),Ar=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=F();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return n(o.navigator.sendBeacon(e,JSON.stringify(t))?r.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):r.buildResponse({code:500}))}catch(e){i(e)}})]})})},t}(Je),Mr=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:Nr(a),sessionId:_r(h),lastEventId:_r(f),lastEventTime:_r(d),optOut:Boolean(u)}]}})})},_r=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Nr=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},Lr="[Amplitude]",Dr="".concat(Lr," Form Started"),Ur="".concat(Lr," Form Submitted"),Fr="".concat(Lr," File Downloaded"),jr="session_start",Br="session_end",qr="".concat(Lr," File Extension"),zr="".concat(Lr," File Name"),Vr="".concat(Lr," Link ID"),Wr="".concat(Lr," Link Text"),$r="".concat(Lr," Link URL"),Kr="".concat(Lr," Form ID"),Hr="".concat(Lr," Form Name"),Jr="".concat(Lr," Form Destination"),Gr="cookie",Yr=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,k,x,C,E,O,I,P,T,R,A,M,_,N,L,D,U,F,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=Gr),void 0===m&&(m=new J),void 0===v&&(v=K.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===x&&(x=""),void 0===C&&(C="US"),void 0===O&&(O=18e5),void 0===I&&(I=new Pr({loggerProvider:m})),void 0===P&&(P={ipAddress:!0,language:!0,platform:!0}),void 0===T&&(T="fetch"),void 0===R&&(R=!1),void 0===A&&(A=!0),void 0===U&&(U=!0),void 0===F&&(F=0);var q,z=this;(z=e.call(this,{apiKey:t,storageProvider:I,transportProvider:Zr(T)})||this).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=k,z.serverUrl=x,z.serverZone=C,z.sessionTimeout=O,z.storageProvider=I,z.trackingOptions=P,z.transport=T,z.useBatch=R,z.fetchRemoteConfig=A,z.networkTrackingOptions=L,z.identify=D,z.enableDiagnostics=U,z.diagnosticsSampleRate=F,z.diagnosticsClient=j,z.remoteConfig=B,z.version=Cr,z._optOut=!1,z._cookieStorage=n,z.deviceId=a,z.lastEventId=f,z.lastEventTime=g,z.optOut=w,z.sessionId=E,z.pageCounter=_,z.userId=M,z.debugLogsEnabled=N,z.loggerProvider.enable(N?K.Debug:z.logLevel),z.networkTrackingOptions=L,z.identify=D,z.enableDiagnostics=U,z.diagnosticsSampleRate=F,z.diagnosticsClient=j;var V=null!==(q=null==B?void 0:B.fetchRemoteConfig)&&void 0!==q?q:A;return z.remoteConfig=z.remoteConfig||{},z.remoteConfig.fetchRemoteConfig=V,z.fetchRemoteConfig=V,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,cookieDomain:void 0};this.cookieStorage instanceof Re&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(Se(this.apiKey),e)},t}(Y),Xr=function(e,t,r,n,i){return void 0===t&&(t={}),a(void 0,void 0,void 0,function(){var s,a,u,c,h,d,p,f,g,m,v,y,b,w,S,k,x,C,E,O,I,P,T,R,A,M,_,N,L,D,U,F,j,q,z,V,W,$,K,H,J,G,Y,X,Q,Z,ee,te,re,ne;return l(this,function(l){switch(l.label){case 0:return s=t.identityStorage||Gr,P={},s===Gr?[3,1]:(u="",[3,5]);case 1:return null===(R=null===(T=t.cookieOptions)||void 0===T?void 0:T.domain)||void 0===R?[3,2]:(c=R,[3,4]);case 2:return[4,en()];case 3:c=l.sent(),l.label=4;case 4:u=c,l.label=5;case 5:return a=o.apply(void 0,[(P.domain=u,P.expiration=365,P.sameSite="Lax",P.secure=!1,P.upgrade=!0,P),t.cookieOptions]),h={duplicateResolverFn:function(e){var t=Ae(e);if(!t)return!1;var r=JSON.parse(t);return Me(r.cookieDomain,a.domain)},diagnosticsClient:n},d=Qr(t.identityStorage,a,h),[4,Mr(e,d,null===(M=null===(A=t.cookieOptions)||void 0===A?void 0:A.upgrade)||void 0===M||M)];case 6:return p=l.sent(),[4,d.get(Se(e))];case 7:return f=l.sent(),g=xe(),m=g.ampTimestamp?Number(g.ampTimestamp):void 0,v=!m||Date.now()<m,y=null!==(U=null!==(D=null!==(L=null!==(_=t.deviceId)&&void 0!==_?_:v?null!==(N=g.ampDeviceId)&&void 0!==N?N:g.deviceId:void 0)&&void 0!==L?L:null==f?void 0:f.deviceId)&&void 0!==D?D:p.deviceId)&&void 0!==U?U:B(),b=null!==(F=null==f?void 0:f.lastEventId)&&void 0!==F?F:p.lastEventId,w=null!==(j=null==f?void 0:f.lastEventTime)&&void 0!==j?j:p.lastEventTime,S=null!==(z=null!==(q=t.optOut)&&void 0!==q?q:null==f?void 0:f.optOut)&&void 0!==z?z:p.optOut,k=null!==(V=null==f?void 0:f.sessionId)&&void 0!==V?V:p.sessionId,x=null!==($=null!==(W=t.userId)&&void 0!==W?W:null==f?void 0:f.userId)&&void 0!==$?$:p.userId,r.previousSessionDeviceId=null!==(K=null==f?void 0:f.deviceId)&&void 0!==K?K:p.deviceId,r.previousSessionUserId=null!==(H=null==f?void 0:f.userId)&&void 0!==H?H:p.userId,C={ipAddress:null===(G=null===(J=t.trackingOptions)||void 0===J?void 0:J.ipAddress)||void 0===G||G,language:null===(X=null===(Y=t.trackingOptions)||void 0===Y?void 0:Y.language)||void 0===X||X,platform:null===(Z=null===(Q=t.trackingOptions)||void 0===Q?void 0:Q.platform)||void 0===Z||Z},E=null==f?void 0:f.pageCounter,O=null==f?void 0:f.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(I=new Yr(e,t.appVersion,d,a,t.defaultTracking,t.autocapture,y,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,s,t.ingestionMetadata,t.instanceName,b,w,null!==(ee=null==i?void 0:i.loggerProvider)&&void 0!==ee?ee:t.loggerProvider,t.logLevel,t.minIdLength,t.offline,S,t.partnerId,t.plan,t.serverUrl,null!==(te=null==i?void 0:i.serverZone)&&void 0!==te?te:t.serverZone,k,t.sessionTimeout,t.storageProvider,C,t.transport,t.useBatch,t.fetchRemoteConfig,x,E,O,t.networkTrackingOptions,t.identify,null!==(re=null==i?void 0:i.enableDiagnostics)&&void 0!==re?re:t.enableDiagnostics,null!==(ne=null==i?void 0:i.diagnosticsSampleRate)&&void 0!==ne?ne:r._diagnosticsSampleRate,n,t.remoteConfig)).storageProvider.isEnabled()];case 8:return l.sent()||(I.loggerProvider.warn("Storage provider ".concat(I.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),I.storageProvider=new Te),[2,I]}})})},Qr=function(e,t,r){switch(void 0===e&&(e=Gr),void 0===t&&(t={}),e){case"localStorage":return new Pr;case"sessionStorage":return new Tr;case"none":return new Te;default:return new Re(o(o({},t),{expirationDays:t.expiration}),r)}},Zr=function(e){var t="object"==typeof e?e.type:e,r="object"==typeof e?e.headers:void 0;return"xhr"===t?new Rr(r):"beacon"===t?new Ar:new Ge(r)},en=function(e){return a(void 0,void 0,void 0,function(){var t,r,n,i,o,s,a,u;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=B(),o="AMP_TLDTEST_".concat(i.substring(0,8)),s=r.length-2;s>=0;--s)n.push(r.slice(s).join("."));s=0,l.label=2;case 2:return s<n.length?(a=n[s],[4,(u=new Re({domain:"."+a,expirationDays:.003})).set(o,1)]):[3,7];case 3:return l.sent(),[4,u.get(o)];case 4:return l.sent()?[4,u.remove(o)]:[3,6];case 5:return l.sent(),[2,"."+a];case 6:return s++,[3,2];case 7:return[2,""]}})})},tn=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},rn="AMP_PAGE_VIEW",nn=function(e){var t;void 0===e&&(e={});var r,n,i=F(),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,on()];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":Ft(Ut),"[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=an(d,e,y||"")&&v(),y=e,r?(i=void 0,n&&(i=B(),n.set(rn,{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 Ne(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(rn,{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&&sn(e)?(null==s||s.log("Enriching campaign event to page view event with campaign parameters"),t=void 0,n?[4,n.get(rn)]:[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},on=function(){return a(void 0,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return e=tn,[4,(new At).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},sn=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(P).every(function(e){return o.includes(e)})}return!1},an=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},ln=function(){var e,t,r=[],n=function(e,t,n){e.addEventListener(t,n),r.push({element:e,type:t,handler:n})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(r,i){return a(void 0,void 0,void 0,function(){var o,s;return l(this,function(a){return t=function(e){if(dr(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions}(r),o=function(){if(i){if("undefined"!=typeof document){var o=function(e){var o=!1;n(e,"change",function(){var t,r=cn(e);o||i.track(Dr,((t={})[Kr]=un(e.id),t[Hr]=un(e.name),t[Jr]=r,t)),o=!0}),n(e,"submit",function(n){var s,a,l=cn(e);if(o||i.track(Dr,((s={})[Kr]=un(e.id),s[Hr]=un(e.name),s[Jr]=l,s)),o=!0,void 0!==(null==t?void 0:t.shouldTrackSubmit))if("function"==typeof t.shouldTrackSubmit&&"undefined"!=typeof SubmitEvent&&n instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(n))return}catch(e){r.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else r.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");i.track(Ur,((a={})[Kr]=un(e.id),a[Hr]=un(e.name),a[Jr]=l,a)),o=!1})};Array.from(document.getElementsByTagName("form")).forEach(o),"undefined"!=typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&o(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(o)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}}else r.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")},"complete"===document.readyState?o():(s=F())?s.addEventListener("load",o):r.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(t){return null==e||e.disconnect(),r.forEach(function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)}),r=[],[2]})})}}},un=function(e){if("string"==typeof e)return e},cn=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},hn=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(Fr,((t={})[qr]=s,t[zr]=r.pathname,t[Vr]=e.id,t[Wr]=e.text,t[$r]=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=F())?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]})})}}},dn=!1,pn=function(){var e=F(),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 fn(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),fn(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 k=S.value;try{for(var x=(o=void 0,u(["responseHeaders","requestHeaders"])),C=x.next();!C.done;C=x.next()){var E=C.value,O=null!==(p=k[E])&&void 0!==p?p:{},I=O.captureSafeHeaders,P=O.allowlist;(I||P)&&(void 0===P||Array.isArray(P)?k[E]=h(h([],c(I?T:[]),!1),c(null!=P?P:[]),!1):delete k[E])}}catch(e){o={error:e}}finally{try{C&&!C.done&&(s=x.return)&&s.call(x)}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 R=null===(f=e.autocapture)||void 0===f?void 0:f.frustrationInteractions;R&&(R.rageClick&&(R.rageClicks=R.rageClick,delete R.rageClick),R.deadClick&&(R.deadClicks=R.deadClick,delete R.deadClick))}}function gn(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 mn(e,t){var r,n,i,s,a,l,c;if(e){fn(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=gn(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=gn(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 vn="1.20.0-feat-zoning-alpha.0",yn="[Amplitude] Element Clicked",bn="[Amplitude] Element Tag",wn="[Amplitude] Element Text",Sn="[Amplitude] Page URL",kn="[Amplitude] Viewport Height",xn="[Amplitude] Viewport Width",Cn="[Amplitude] Page View ID",En="https://app.amplitude.com",On={US:En,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},In="data-amp-mask-attributes",Pn=["input","select","textarea"],Tn=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},Rn=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=Tn(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}}},An=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},{})},_n=function(){var e;try{var t=F(),r=null===(e=null==t?void 0:t.sessionStorage)||void 0===e?void 0:e.getItem("AMP_PAGE_VIEW");if(!r)return;var n=JSON.parse(r);if("string"==typeof n.pageViewId)return n.pageViewId}catch(e){}},Nn=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:Nn(null==e?void 0:e.parentElement,t):null},Ln=function(e){return new Promise(function(t,r){var n;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),null===(n=document.head)||void 0===n||n.appendChild(i)}catch(e){r(e)}})};var Dn,Un=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};!function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"}(Dn||(Dn={}));var Fn=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",In,Mt]),jn=["type"],Bn=["svg","path","g"],qn=["password","hidden"];function zn(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!Fn.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(!qn.includes(String(e.getAttribute("type")))&&!Bn.includes(l))try{for(var y=u(m),b=y.next();!b.done;b=y.next()){var w=b.value;v&&!jn.includes(w.name)||(t.has(w.name)?g[w.name]=_t: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 Vn=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}})},Wn=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),$n=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 Wn(h(o),!0);var s=e.tagName.toLowerCase();if("body"===s||"head"===s||"html"===s)return new Wn(s,!0)}var a=e.tagName.toLowerCase();if(o)return new Wn(a+h(o),!0);var l=e.parentNode;if(!l||l.nodeType===Node.DOCUMENT_NODE)return new Wn(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),k=0;k<S.length;++k){var x=S[k];if(w.has(x)&&(w.delete(x),!w.size)){f=!0;break}}else f=!0}}else g=m}var C=a;if(r&&"input"===a.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(C+="[type="+CSS.escape(e.getAttribute("type")||"")+"]"),f)C+=":nth-child("+String(g+1)+")";else if(p)try{for(var E=u(d),O=E.next();!O.done;O=E.next()){var I=O.value;C+="."+CSS.escape(I.slice(1))}}catch(e){n={error:e}}finally{try{O&&!O.done&&(i=E.return)&&i.call(E)}finally{if(n)throw n.error}}return new Wn(C,!1)},Kn=function(e,t){var r,n,i,o=this;this.replaceSensitiveString=function(e){return Ut(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=An(f.getAttribute(In)),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 zn(e,null!==(t=d.get(e))&&void 0!==t?t:new Set)});var y=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var r=c(t,2),n=r[0],i=r[1];e.attrs&&(e.attrs[n]=o.replaceSensitiveString(i))})};try{for(var b=u(s),w=b.next();!w.done;w=b.next())y(w.value)}catch(e){t={error:e}}finally{try{w&&!w.done&&(r=b.return)&&r.call(b)}finally{if(t)throw t.error}}var S=performance.now();return null===(i=o.diagnosticsClient)||void 0===i||i.recordHistogram("autocapturePlugin.getHierarchy",S-a),s},this.getNearestLabel=function(e){var t,r=e.parentElement;if(!r)return"";try{t=r.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?o.getText(t):o.getNearestLabel(r)},this.getElementPath=function(e){var t;if(!e)return"";var r=performance.now(),n=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var r=[],n=e;n;){var i=$n(n,Boolean(t),n===e);if(!i)break;if(r.push(i),i.optimized)break;n=n.parentElement}return r.reverse(),r.join(" > ")}(e),i=performance.now();return null===(t=o.diagnosticsClient)||void 0===t||t.recordHistogram("autocapturePlugin.getElementPath",i-r),n},this.getEventProperties=function(e,t,r){var n,i,s,a,l,u,h=null===(s=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===s?void 0:s.call(i),d="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},p=o.getHierarchy(t),f=null===(a=p[0])||void 0===a?void 0:a.attrs,g=o.getNearestLabel(t),m=(l=null!=f?f:{},u=r,Object.entries(l).reduce(function(e,t){var r=c(t,2),n=r[0],i=r[1];if(n.startsWith(u)){var o=n.replace(u,"");o&&(e[o]=i||"")}return e},{})),v=((n={})["[Amplitude] Element Hierarchy"]=p,n[bn]=h,n[wn]=o.getText(t),n["[Amplitude] Element Position Left"]=null==d.left?null:Math.round(d.left),n["[Amplitude] Element Position Top"]=null==d.top?null:Math.round(d.top),n["[Amplitude] Element Attributes"]=m,n["[Amplitude] Element Path"]=o.getElementPath(t),n["[Amplitude] Element Parent Label"]=g,n[Sn]=Oe(window.location.href.split("?")[0]),n["[Amplitude] Page Title"]=Ft(o.replaceSensitiveString),n[kn]=window.innerHeight,n[xn]=window.innerWidth,n),y=_n();if(y&&(v[Cn]=y),v["[Amplitude] Element ID"]=t.getAttribute("id")||"",v["[Amplitude] Element Class"]=t.getAttribute("class"),v["[Amplitude] Element Aria Label"]=null==f?void 0:f["aria-label"],"a"===h&&"click"===e&&t instanceof HTMLAnchorElement){var b=t.href.substring(0,128);v["[Amplitude] Element Href"]=o.replaceSensitiveString(b)}return Mn(v)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,r,n,i){void 0===i&&(i=!1);var s=o.addTypeAndTimestamp(e,t);if(function(e){return"click"===e.type||"change"===e.type}(s)&&null!==s.event.target){if(i&&Tn(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,n),s;var a=Nn(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(Mt,"]")))return _t;var t="";if(e.querySelector("[".concat(Mt,"], [contenteditable]"))){var r=e.cloneNode(!0);r.querySelectorAll("[".concat(Mt,"], [contenteditable]")).forEach(function(e){e.innerText=_t}),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={})[bn]=i,t[wn]=o.getText(e),t[Sn]=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},Hn=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?En:t,n=this;this.endpoint=En,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.onBackgroundCapture=function(e,t){var r,i;"background-capture-complete"===e&&(null===(i=null===(r=n.logger)||void 0===r?void 0:r.debug)||void 0===i||i.call(r,"Background capture complete"),n.notify({action:"background-capture-complete",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};return 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)})},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,r,n=this,i=void 0===e?{dataExtractor:new Kn({})}:e,o=i.logger,s=i.endpoint,a=i.isElementSelectable,l=i.cssSelectorAllowlist,u=i.actionClickAllowlist,c=i.dataExtractor;this.logger=o,s&&this.endpoint===En&&(this.endpoint=s);var h=null,d=null;null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Setting up messenger"),window.addEventListener("message",function(e){var t,r,i,o,s,p,f,g;if(null===(r=null===(t=n.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message received: ",JSON.stringify(e)),n.endpoint===e.origin){var m=null==e?void 0:e.data,v=null==m?void 0:m.action;if(v)if("id"in m)null===(o=null===(i=n.logger)||void 0===i?void 0:i.debug)||void 0===o||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(m);else if("ping"===v)n.notify({action:"pong"});else if("initialize-visual-tagging-selector"===v){var y=null==m?void 0:m.data;Ln("https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz").then(function(){var e;h=null===(e=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===e?void 0:e.call(window,{getEventTagProps:c.getEventTagProps,isElementSelectable:function(e){return!a||a((null==y?void 0:y.actionType)||"click",e)},onTrack:n.onTrack,onSelect:n.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:n,cssSelectorAllowlist:l,actionClickAllowlist:u,extractDataFromDataSource:c.extractDataFromDataSource,dataExtractor:c,diagnostics:{autocapture:{version:vn}}}),n.notify({action:"selector-loaded"})}).catch(function(){var e;null===(e=n.logger)||void 0===e||e.warn("Failed to initialize visual tagging selector")})}else"initialize-background-capture"===v?(null===(p=null===(s=n.logger)||void 0===s?void 0:s.debug)||void 0===p||p.call(s,"Initializing background capture (external script)"),Ln(new URL("https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.1.js.gz",n.endpoint).toString()).then(function(){var e,t,r;null===(t=null===(e=n.logger)||void 0===e?void 0:e.debug)||void 0===t||t.call(e,"Background capture script loaded (external)"),d=null===(r=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===r?void 0:r.call(window,{messenger:n,onBackgroundCapture:n.onBackgroundCapture}),n.notify({action:"background-capture-loaded"})}).catch(function(){var e;null===(e=n.logger)||void 0===e||e.warn("Failed to initialize background capture")})):"close-visual-tagging-selector"===v?null===(f=null==h?void 0:h.close)||void 0===f||f.call(h):"close-background-capture"===v&&(null===(g=null==d?void 0:d.close)||void 0===g||g.call(d))}}),this.notify({action:"page-loaded"})},e}();var Jn,Gn=F(),Yn=function(){return new sr(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()}})},Xn=function(e){return void 0===e&&(e="click"),new sr(function(t){var r,n=function(e){t.next(e)};return null===(r=F())||void 0===r||r.document.addEventListener(e,n,{capture:!0}),function(){var t;null===(t=F())||void 0===t||t.document.removeEventListener(e,n,{capture:!0})}})},Qn=function(){var e=lr(new sr(function(e){var t=function(t){var r={kind:"error"};t.error instanceof Error?r=o(o({},r),{message:t.error.message,stack:t.error.stack,filename:t.filename,lineNumber:t.lineno,columnNumber:t.colno}):"string"==typeof t.error&&(r.message=t.error),e.next(r)};return Gn.addEventListener("error",t),function(){Gn.removeEventListener("error",t)}}),new sr(function(e){var t=function(t){var r={kind:"unhandledrejection"};t.reason instanceof Error?(r.message=t.reason.message,r.stack=t.reason.stack):"string"==typeof t.reason&&(r.message=t.reason),e.next(r)};return Gn.addEventListener("unhandledrejection",t),function(){Gn.removeEventListener("unhandledrejection",t)}}));return lr(e,new sr(function(e){var t=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=void 0;Array.isArray(r[0])&&"string"==typeof r[0][0]&&(i=r[0][0]),e.next({kind:"console",message:i})};return it.addListener("error",t),function(){it.removeListener(t)}}))},Zn={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},ei=function(e){var t,r,n,i,o=Object.values(Zn).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=Zn[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},ti=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},ri=function(e,t){return t.filter(function(t){return t.definition.some(function(t){return Zn[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)})})})},ni=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=ri(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;Vn(l.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=r},e}();!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.ScrollObservable="scrollObservable",e.ExposureObservable="exposureObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable"}(Jn||(Jn={}));var ii=function(e,t){var r,n,i,s,d,p,f,g,m;void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",vn);var v=e.dataAttributePrefix,y=void 0===v?st:v,b=e.visualTaggingOptions,w=void 0===b?{enabled:!0,messenger:new Hn}:b,S=e.backgroundCaptureOptions,k=void 0===S?{enabled:!0,messenger:new Hn}:S;e.cssSelectorAllowlist=null!==(r=e.cssSelectorAllowlist)&&void 0!==r?r:ot,e.actionClickAllowlist=null!==(n=e.actionClickAllowlist)&&void 0!==n?n:at,e.debounceTime=null!==(i=e.debounceTime)&&void 0!==i?i:0,e.exposureDuration=null!==(s=e.exposureDuration)&&void 0!==s?s:150,e.pageUrlExcludelist=null===(d=e.pageUrlExcludelist)||void 0===d?void 0:d.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 x,C="@amplitude/plugin-autocapture-browser",E=[],O=new Kn(e,t),I=new Set,P=new Set,T=function(){var t,r,n=ur(Xn().map(function(t){return O.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,y)})),i=ur(new sr(function(t){var r,n=function(r){var n=O.addAdditionalEventProperties(r,"change",e.cssSelectorAllowlist,y);t.next(n)};return null===(r=F())||void 0===r||r.document.addEventListener("change",n,{capture:!0}),function(){var e;return null===(e=F())||void 0===e?void 0:e.document.removeEventListener("change",n)}}));window.navigation&&(r=ur(new sr(function(t){var r=function(r){var n=O.addAdditionalEventProperties(r,"navigate",e.cssSelectorAllowlist,y);t.next(n)};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}})));var o=ur(Yn().map(function(t){return O.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,y)})),s=new sr(function(e){var t,r=function(t){e.next(t)};return null===(t=F())||void 0===t||t.window.addEventListener("scroll",r),function(){var e;null===(e=F())||void 0===e||e.window.removeEventListener("scroll",r)}}),a=function(e,t){return new sr(function(r){var n,i=F();if(!(null==i?void 0:i.IntersectionObserver))return console.log("IntersectionObserver not supported"),function(){};var o=new IntersectionObserver(function(e){e.forEach(function(e){r.next(e)})},{root:null,rootMargin:"0px",threshold:1}),s=t.join(",");return(null!==(n=null==i?void 0:i.document.querySelectorAll(s))&&void 0!==n?n:[]).forEach(function(e){o.observe(e)}),e.subscribe(function(e){return e.event.forEach(function(e){return e.addedNodes.forEach(function(e){return e instanceof Element&&o.observe(e)})})}),function(){o.disconnect()}})}(o,e.cssSelectorAllowlist);return(t={})[Jn.ChangeObservable]=i,t[Jn.ClickObservable]=n,t[Jn.MutationObservable]=o,t[Jn.NavigateObservable]=r,t[Jn.ScrollObservable]=s,t[Jn.ExposureObservable]=a,t},R=ei(Object.values(null!==(f=null===(p=e.pageActions)||void 0===p?void 0:p.labeledEvents)&&void 0!==f?f:{})),A=ti(null!==(m=null===(g=e.pageActions)||void 0===g?void 0:g.triggers)&&void 0!==m?m:[]),M=function(e,t,r,n){return new ni(e,t,r,n)}(R,A,O,e);return{name:C,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,v,b,S,_,N,L,D,U,j,B,q,z;return l(this,function(l){return"undefined"==typeof document||(n=!1,i={maxX:void 0,maxY:void 0},t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(t){!function(t){var r,n;t&&(e.pageActions=o(o({},e.pageActions),t),R=ei(Object.values(null!==(r=e.pageActions.labeledEvents)&&void 0!==r?r:{})),A=ti(null!==(n=e.pageActions.triggers)&&void 0!==n?n:[]),M.update(R,A,e))}(t)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),s=Rn(e,e.cssSelectorAllowlist),a=Rn(e,e.actionClickAllowlist),u=T(),d=function(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackEvent,i=e.evaluateTriggers;return r.clickObservable.filter(Un).filter(function(e){return n("click",e.closestTrackedAncestor)}).map(function(e){return i(e)}).subscribe(function(e){null==t||t.track(yn,e.targetElementProperties)})}({allObservables:u,amplitude:r,shouldTrackEvent:s,evaluateTriggers:M.evaluate.bind(M)}),E.push(d),p=function(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return r.changeObservable.filter(Un).filter(function(e){return i("change",e.closestTrackedAncestor)}).map(function(e){return o(e)}).subscribe(function(e){null==t||t.track("[Amplitude] Element Changed",n("change",e.closestTrackedAncestor))})}({allObservables:u,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return O.getEventProperties.apply(O,h(h([],c(e),!1),[y],!1))},amplitude:r,shouldTrackEvent:s,evaluateTriggers:M.evaluate.bind(M)}),E.push(p),f=function(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,s=e.shouldTrackActionClick,a=r.clickObservable,l=r.mutationObservable,u=r.navigateObservable,c=a.filter(function(e){return!o("click",e.closestTrackedAncestor)}).map(function(e){var t=Nn(e.event.target,n.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e}).filter(Un).filter(function(e){return s("click",e.closestTrackedAncestor)}),h=u?lr(l,u):l,d=lr(c,h),p=null,f=null;return ar(d,function(e){if(p&&(clearTimeout(p),p=null),"click"===e.type)return f=e,p=setTimeout(function(){p=null,f=null},500),Promise.resolve(null);if(f){var t=f;return f=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==t||t.track(yn,i("click",e.closestTrackedAncestor)))})}({allObservables:u,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return O.getEventProperties.apply(O,h(h([],c(e),!1),[y],!1))},amplitude:r,shouldTrackEvent:s,shouldTrackActionClick:a}),f&&E.push(f),g=function(e){e.amplitude;var t=e.allObservables.scrollObservable,r={maxX:0,maxY:0},n=t.subscribe(function(){var e,t,n,i,o=F(),s=Math.floor(null!==(t=null!==(e=null==o?void 0:o.scrollX)&&void 0!==e?e:null==o?void 0:o.pageXOffset)&&void 0!==t?t:0),a=Math.floor(null!==(i=null!==(n=null==o?void 0:o.scrollY)&&void 0!==n?n:null==o?void 0:o.pageYOffset)&&void 0!==i?i:0);r.maxX=Math.max(r.maxX,s),r.maxY=Math.max(r.maxY,a)});return{unsubscribe:function(){n.unsubscribe()},getState:function(){return r},reset:function(){r.maxX=0,r.maxY=0}}}({allObservables:u,amplitude:r}),E.push(g),m={},v=F(),b=function(e){e&&n||(setTimeout(function(){n=!1},100),n=!0,function(e){var t,r,n,i,o=e.amplitude,s=e.scrollTracker,a=e.currentElementExposed,l=e.elementExposedForPage,u=e.exposureTracker,c=e.isPageEnd,h=e.lastScroll,d=s.getState(),p=F(),f=null!==(r=null==p?void 0:p.innerWidth)&&void 0!==r?r:0,g=null!==(n=null==p?void 0:p.innerHeight)&&void 0!==n?n:0,m=((t={})[Sn]=null===(i=null==p?void 0:p.location)||void 0===i?void 0:i.href,t["[Amplitude] Max Page X"]=d.maxX+f,t["[Amplitude] Max Page Y"]=d.maxY+g,t[kn]=g,t[xn]=f,t["[Amplitude] Element Exposed"]=Array.from(a),t),v=_n();v&&(m[Cn]=v),0===a.size&&d.maxX===h.maxX&&d.maxY===h.maxY||(null==o||o.track("[Amplitude] Viewport Content Updated",m),h={maxX:d.maxX,maxY:d.maxY},a.clear(),c&&(s.reset(),l.clear(),null==u||u.reset()))}({amplitude:r,scrollTracker:g,currentElementExposed:P,elementExposedForPage:I,exposureTracker:m.exposure,isPageEnd:e,lastScroll:i}))},S=function(e){!function(e,t,r,n){if(!t.has(e)){t.add(e),r.add(e);var i=Array.from(r);JSON.stringify(i).length>=18e3&&n(!1)}}(e,I,P,b)},m.exposure=function(e){var t=e.allObservables,r=e.onExposure,n=e.dataExtractor,i=e.exposureDuration,o=void 0===i?150:i,s=new Map,a=new Map,l=t.exposureObservable.subscribe(function(e){var t=e,i=t.target;if(t.isIntersecting){if(!s.get(i)){var l=setTimeout(function(){s.set(i,!0);var e=n.getElementPath(i);r(e),a.set(i,null)},o);a.set(i,l)}}else!t.isIntersecting&&t.intersectionRatio<1&&(l=a.get(i))&&(clearTimeout(l),a.set(i,null))});return{unsubscribe:function(){l.unsubscribe()},reset:function(){a.forEach(function(e){e&&clearTimeout(e)}),a.clear(),s.clear()}}}({allObservables:u,onExposure:S,dataExtractor:O,exposureDuration:e.exposureDuration}),m.exposure&&E.push(m.exposure),_=function(){console.log("amp: beforeUnload"),b(!0)},null==v||v.addEventListener("beforeunload",_),x=function(){null==v||v.removeEventListener("beforeunload",_)},E.push({unsubscribe:function(){return x()}}),(N=u[Jn.NavigateObservable])?E.push(N.subscribe(function(){console.log("amp: navigate"),b(!0)})):v&&(L=function(){console.log("amp: popstate"),b(!0)},v.addEventListener("popstate",L),D=v.history.pushState,v.history&&D&&(v.history.pushState=new Proxy(D,{apply:function(e,t,r){var n=c(r,3),i=n[0],o=n[1],s=n[2];console.log("amp: pushState"),e.apply(t,[i,o,s]),b(!0)}})),E.push({unsubscribe:function(){v.removeEventListener("popstate",L),v.history&&D&&(v.history.pushState=D)}})),null===(B=null==t?void 0:t.loggerProvider)||void 0===B||B.log("".concat(C," has been successfully added.")),window.opener&&w.enabled&&(U=e.cssSelectorAllowlist,j=e.actionClickAllowlist,null===(q=w.messenger)||void 0===q||q.setup(o(o({dataExtractor:O,logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:On[t.serverZone]}),{isElementSelectable:Rn(e,h(h([],c(U),!1),c(j),!1)),cssSelectorAllowlist:U,actionClickAllowlist:j}))),window.opener&&k.enabled&&!w.messenger&&(null===(z=k.messenger)||void 0===z||z.setup({dataExtractor:O,logger:null==t?void 0:t.loggerProvider}))),[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(E),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]})})}}},oi=["mutation","navigate"];function si(e,t){var r,n,i,o,s=t.event,a=s.pageX,l=s.pageY;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 ai(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.pageX,Y:e.event.pageY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}function li(e){var t=this,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,o=n.clickObservable,s=n.selectionObservable,u=[],c={},h=null;function d(e){u=[],c={},e&&(si(c,e),u.push(e))}var p=ar(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 si(c,e),t=null,0===u.length||function(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}(u,e)||function(e,t){var r=e[Math.max(0,e.length-4+1)];return t.timestamp-r.timestamp>=1e3}(u,e)||c.isOutOfBounds?(h&&(t=ai(u)),d(e)):u.push(e),h&&(clearTimeout(h.timerId),h.resolve(t),h=null),u.length>=4?[2,new Promise(function(e){h={resolve:e,timerId:setTimeout(function(){e(ai(u))},1e3)}})]:[2,null]})})}),f=null==s?void 0:s.subscribe(function(){d()}),g=p.subscribe(function(e){null!==e&&r.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})});return{unsubscribe:function(){g.unsubscribe(),null==f||f.unsubscribe()}}}function ui(e,t,r,n){if(!n)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:r}var ci,hi,di=function(e){var t;void 0===e&&(e={});var r="@amplitude/plugin-frustration-browser",n=[],i=!1!==e.errorClicks;e.errorClicks||(i=!1);var s=!1!==e.deadClicks&&null!==e.deadClicks,d=!1!==e.rageClicks&&null!==e.rageClicks,p=ui(e,"rageClicks",ht,d),f=ui(e,"deadClicks",ut,s),g=ui(e,"errorClicks",ct,i),m=null!==(t=e.dataAttributePrefix)&&void 0!==t?t:st,v=new Kn(e),y=h([],c(new Set(h(h(h([],c(p),!1),c(f),!1),c(g),!1))),!1);return{name:r,type:"enrichment",setup:function(t,u){return a(void 0,void 0,void 0,function(){var a,c,h,b,w,S,k,x;return l(this,function(l){return"undefined"==typeof document||(a=function(){var e,t,r=ur(Xn("pointerdown").map(function(e){return v.addAdditionalEventProperties(e,"click",y,m,!0)})),n=ur(Qn().map(function(e){return v.addTypeAndTimestamp(e,"error")})),i=ur(Yn().map(function(e){return v.addAdditionalEventProperties(e,"mutation",y,m)}));window.navigation&&(t=ur(new sr(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)})));var s=ur(new sr(function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){try{if(t.selectionStart===t.selectionEnd)return}catch(e){return}return e.next()}var r=window.getSelection();if(r&&!r.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}}));return(e={})[Jn.ClickObservable]=r,e[Jn.MutationObservable]=i,e[Jn.NavigateObservable]=t,e[Jn.BrowserErrorObservable]=n,e[Jn.SelectionObservable]=s,e}(),d&&(c=Rn(e,p),h=li({allObservables:a,amplitude:u,shouldTrackRageClick:c}),n.push(h)),s&&(b=Rn(e,f),w=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 Un(e)&&i("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===Dn.LEFT_OR_TOUCH_CONTACT}),c=l?lr(a,l):a,h=lr(u,c),d=null;return ar(h,function(e){return d&&oi.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)}).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:u,allObservables:a,getEventProperties:function(e,t){return v.getEventProperties(e,t,m)},shouldTrackDeadClick:b}),n.push(w)),i&&(S=Rn(e,g),k=function(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackErrorClick,i=r.clickObservable,s=r.browserErrorObservable,a=i.filter(function(e){return Un(e)&&n("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===Dn.LEFT_OR_TOUCH_CONTACT}),l=null,u=null,c=function(){null!==l&&(clearTimeout(l),l=null),u=null};return lr(a,s).subscribe(function(e){var r;if("click"===e.type)return c(),u=e,void(l=setTimeout(c,2e3));"error"===e.type&&u&&(t.track("[Amplitude] Error Click",o(((r={})["[Amplitude] Kind"]=e.event.kind,r["[Amplitude] Message"]=e.event.message,r["[Amplitude] Stack"]=e.event.stack,r["[Amplitude] Filename"]=e.event.filename,r["[Amplitude] Line Number"]=e.event.lineNumber,r["[Amplitude] Column Number"]=e.event.columnNumber,r),u.targetElementProperties)),c())})}({amplitude:u,allObservables:a,shouldTrackErrorClick:S}),n.push(k)),null===(x=null==t?void 0:t.loggerProvider)||void 0===x||x.log("".concat(r," has been successfully added."))),[2]})})},execute:function(e){return a(void 0,void 0,void 0,function(){return l(this,function(t){return[2,e]})})},teardown:function(){return a(void 0,void 0,void 0,function(){var e,t,r,i;return l(this,function(o){try{for(e=u(n),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}return[2]})})}}},pi="[Amplitude] Network Request",fi="500-599";function gi(e,t){var r="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(r).test(e)}function mi(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 vi(e){var t;if(e)try{var r=null===(t=F())||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 yi(e){if("object"==typeof e&&null!==e){if(0!==e.length)return e}else{if(e)return h([],c(T),!1);if(void 0===e){return}}}function bi(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 wi(e,t){var r;void 0===t&&(t={});var n=vi(e.url);if(!n)return!1;var i,o=n.host;if(!1!==t.ignoreAmplitudeRequests&&(gi(o,"*.amplitude.com")||gi(o,"amplitude.com")))return!1;if(null===(r=t.ignoreHosts)||void 0===r?void 0:r.find(function(e){return gi(o,e)}))return!1;if(!t.captureRules&&void 0!==e.status&&!mi(e.status,fi))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 gi(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)&&!mi(r,e.statusCodeRange||fi))}(t,o,e.status,e.url,e.method),i){var r=yi(t.responseHeaders);if(e.responseWrapper&&r){var n=e.responseWrapper.headers(r);n&&(e.responseHeaders=n)}var s=yi(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}e.responseWrapper&&t.responseBody&&!bi(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!bi(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===pi}))return!0}catch(e){}return!1}(o,e.requestWrapper)}function Si(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude,i=e.loggerProvider;return t.networkObservable.filter(function(e){return wi(e.event,r)}).subscribe(function(e){var t,r,o,s=e.event,u=vi(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(pi,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"}(ci||(ci={}));var ki=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=function(){var e,r=new sr(function(e){var r=new Pt(function(t){var r=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(r)});return Rt.subscribe(r,t),function(){Rt.unsubscribe(r)}});return(e={})[ci.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,hi=Si({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 hi.unsubscribe(),[2]})})}}};let xi=-1;const Ci=e=>{addEventListener("pageshow",t=>{t.persisted&&(xi=t.timeStamp,e(t))},!0)},Ei=(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()))},Ii=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Pi=()=>{const e=Ii();return e?.activationStart??0},Ti=(e,t=-1)=>{const r=Ii();let n="navigate";return xi>=0?n="back-forward-cache":r&&(document.prerendering||Pi()>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}},Ri=new WeakMap;function Ai(e,t){return Ri.get(e)||Ri.set(e,new t),Ri.get(e)}class Mi{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 _i=(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{}},Ni=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let Li=-1;const Di=new Set,Ui=()=>"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(Li)||(Li="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Fi,!0))}},ji=()=>{if(Li<0){const e=Pi(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;Li=t??Ui(),addEventListener("visibilitychange",Fi,!0),addEventListener("prerenderingchange",Fi,!0),Ci(()=>{setTimeout(()=>{Li=Ui()})})}return{get firstHiddenTime(){return Li},onHidden(e){Di.add(e)}}},Bi=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},qi=[1800,3e3],zi=(e,t={})=>{Bi(()=>{const r=ji();let n,i=Ti("FCP");const o=_i("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-Pi(),0),i.entries.push(t),n(!0)))});o&&(n=Ei(e,i,qi,t.reportAllChanges),Ci(r=>{i=Ti("FCP"),n=Ei(e,i,qi,t.reportAllChanges),Oi(()=>{i.value=performance.now()-r.timeStamp,n(!0)})}))})},Vi=[.1,.25];let Wi=0,$i=1/0,Ki=0;const Hi=e=>{for(const t of e)t.interactionId&&($i=Math.min($i,t.interactionId),Ki=Math.max(Ki,t.interactionId),Wi=Ki?(Ki-$i)/7+1:0)};let Ji;const Gi=()=>Ji?Wi:performance.interactionCount??0;let Yi=0;class Xi{u=[];l=new Map;m;p;v(){Yi=Gi(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((Gi()-Yi)/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 Qi=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=Ni(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},Zi=[200,500],eo=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=ji();Bi(()=>{"interactionCount"in performance||Ji||(Ji=_i("event",Hi,{type:"event",buffered:!0,durationThreshold:0}));let n,i=Ti("INP");const o=Ai(t,Xi),s=e=>{Qi(()=>{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=_i("event",s,{durationThreshold:t.durationThreshold??40});n=Ei(e,i,Zi,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),r.onHidden(()=>{s(a.takeRecords()),n(!0)}),Ci(()=>{o.v(),i=Ti("INP"),n=Ei(e,i,Zi,t.reportAllChanges)}))})};class to{m;h(e){this.m?.(e)}}const ro=[2500,4e3],no=[800,1800],io=e=>{document.prerendering?Bi(()=>io(e)):"complete"!==document.readyState?addEventListener("load",()=>io(e),!0):setTimeout(e)};function oo(e){var t,r=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+r}function so(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(oo(e)),navigationStart:Math.floor(performance.timeOrigin)}}var ao,lo=function(){var e=null,t=F(),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=ji();let n,i=Ti("LCP");const o=Ai(t,to),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-Pi(),0),i.entries=[t],n())},a=_i("largest-contentful-paint",s);if(a){n=Ei(e,i,ro,t.reportAllChanges);const r=Ni(()=>{s(a.takeRecords()),a.disconnect(),n(!0)}),o=e=>{e.isTrusted&&(Qi(r),removeEventListener(e.type,o,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});Ci(r=>{i=Ti("LCP"),n=Ei(e,i,ro,t.reportAllChanges),Oi(()=>{i.value=performance.now()-r.timeStamp,n(!0)})})}})})(function(e){s["[Amplitude] LCP"]=so(e)}),zi(function(e){s["[Amplitude] FCP"]=so(e)}),eo(function(e){s["[Amplitude] INP"]=so(e)}),((e,t={})=>{const r=ji();zi(Ni(()=>{let n,i=Ti("CLS",0);const o=Ai(t,Mi),s=e=>{for(const t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},a=_i("layout-shift",s);a&&(n=Ei(e,i,Vi,t.reportAllChanges),r.onHidden(()=>{s(a.takeRecords()),n(!0)}),Ci(()=>{o.i=0,i=Ti("CLS",0),n=Ei(e,i,Vi,t.reportAllChanges),Oi(()=>n())}),setTimeout(n))}))})(function(e){s["[Amplitude] CLS"]=so(e)}),((e,t={})=>{let r=Ti("TTFB"),n=Ei(e,r,no,t.reportAllChanges);io(()=>{const i=Ii();i&&(r.value=Math.max(i.responseStart-Pi(),0),r.entries=[i],n(!0),Ci(()=>{r=Ti("TTFB",0),n=Ei(e,r,no,t.reportAllChanges),n(!0)}))})})(function(e){s["[Amplitude] TTFB"]=so(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]})})}}},uo=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},co=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(ho(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=uo(o||"")!==uo(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},ho=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})},po=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=P,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return a(this,void 0,void 0,function(){var e,t;return l(this,function(r){switch(r.label){case 0:return[4,this.fetchCampaign()];case 1:return t=c.apply(void 0,[r.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||we(this.sessionTimeout,this.lastEventTime),co(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 At).parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,r,n,i,s=(t=this.currentCampaign,r=this.options,n=o(o({},P),t),i=Object.entries(n).reduce(function(e,t){var n,i=c(t,2),o=i[0],s=i[1];return e.setOnce("initial_".concat(o),null!==(n=null!=s?s:r.initialEmptyValue)&&void 0!==n?n:"EMPTY"),s?e.set(o,s):e.unset(o)},new _),z(i));return e&&(s.event_id=e),s},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),fo="AMP_CURRENT_PAGE",go="AMP_PREVIOUS_PAGE",mo="AMP_URL_INFO";!function(e){e.Direct="direct",e.Internal="internal",e.External="external"}(ao||(ao={}));var vo=new Set([i.IDENTIFY,i.GROUP_IDENTIFY,i.REVENUE]),yo=function(e){var t=(void 0===e?{}:e).internalDomains,r=void 0===t?[]:t,n=F(),i=void 0,s=!1,u=void 0,h=!1,d=!1,p=function(e){var t="undefined"!=typeof location&&location.hostname||"",n=e?function(e){var t;try{var r=Oe(e,u);t=new URL(r).hostname}catch(e){null==u||u.error("Could not parse URL: ",e)}return t}(e):void 0;if(!n)return ao.Direct;var i=r.some(function(e){return-1!==t.indexOf(e)}),o=r.some(function(e){return-1!==n.indexOf(e)});return t===n||o&&i?ao.Internal:ao.External},f=function(){a(void 0,void 0,void 0,function(){var e,t,r,n,o;return l(this,function(a){switch(a.label){case 0:return i&&s?[4,i.get(mo)]:[3,3];case 1:return e=a.sent(),t=Oe("undefined"!=typeof location&&location.href||""),r=(null==e?void 0:e[fo])||"",n=void 0,n=t===r?(null==e?void 0:e[go])||"":r||document.referrer||"",[4,i.set(mo,(o={},o[fo]=t,o[go]=n,o))];case 2:a.sent(),a.label=3;case 3:return[2]}})})},g={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return a(void 0,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return(u=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),d=!0,n?[4,(i=new Ne(n.sessionStorage)).isEnabled()]:[3,2];case 1:s=t.sent(),n.addEventListener("popstate",f),h||(n.history.pushState=new Proxy(n.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]),d&&f()}}),n.history.replaceState=new Proxy(n.history.replaceState,{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]),d&&f()}}),h=!0),t.label=2;case 2:return[2]}})})},execute:function(e){return a(void 0,void 0,void 0,function(){var t,r,n,a,u;return l(this,function(l){switch(l.label){case 0:return t=Oe("undefined"!=typeof location&&location.href||""),i&&s?[4,i.get(mo)]:[3,5];case 1:return(null==(r=l.sent())?void 0:r[fo])?[3,3]:[4,i.set(mo,(u={},u[fo]=t,u[go]=document.referrer||"",u))];case 2:l.sent(),l.label=3;case 3:return[4,i.get(mo)];case 4:if(n=l.sent(),a="",n&&(a=n[go]||""),vo.has(e.event_type))return[2,e];e.event_properties=o(o({},e.event_properties||{}),{"[Amplitude] Page Domain":bo(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":bo(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":bo(e,"[Amplitude] Page Path","undefined"!=typeof location&&Oe(location.pathname)||""),"[Amplitude] Page Title":bo(e,"[Amplitude] Page Title",Ft(Ut)),"[Amplitude] Page URL":bo(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":a,"[Amplitude] Previous Page Type":p(a)}),l.label=5;case 5:return[2,e]}})})},teardown:function(){return a(void 0,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return n&&(n.removeEventListener("popstate",f),d=!1),i&&s?[4,i.set(mo,{})]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})}};return g};function bo(e,t,r){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?r:e.event_properties[t]}var wo,So=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),V(this._init(o(o({},i),{userId:n,apiKey:e})))},t.prototype._init=function(t){var r,n,i,u,c,h,d;return a(this,void 0,void 0,function(){var a,p,f,g,m,v,y,b,w,S,k,x,C,E,O=this;return l(this,function(l){switch(l.label){case 0:return this.initializing?[2]:(this.initializing=!0,a=function(e){var t,r;return void 0===e&&(e={}),!0===(null===(t=e.remoteConfig)||void 0===t?void 0:t.fetchRemoteConfig)||!1!==(null===(r=e.remoteConfig)||void 0===r?void 0:r.fetchRemoteConfig)&&!1!==e.fetchRemoteConfig}(t),p=null!==(r=t.loggerProvider)&&void 0!==r?r:new J,f=null!==(n=t.serverZone)&&void 0!==n?n:"US",m=this._diagnosticsSampleRate,v=null===(i=t.enableDiagnostics)||void 0===i||i,a?(g=new Xe(t.apiKey,p,f,null===(u=t.remoteConfig)||void 0===u?void 0:u.serverUrl),[4,new Promise(function(e){null==g||g.subscribe("configs.diagnostics.browserSDK","all",function(t,r,n){if(p.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(m=i);var o=t.enabled;"boolean"==typeof o&&(v=o)}e()})})]):[3,2]);case 1:l.sent(),l.label=2;case 2:return(y=new He(t.apiKey,p,f,{enabled:v,sampleRate:m})).setTag("library","".concat(Er,"/").concat(Cr)),"undefined"!=typeof navigator&&y.setTag("user_agent",navigator.userAgent),[4,Xr(t.apiKey,t,this,y,{loggerProvider:p,serverZone:f,enableDiagnostics:v,diagnosticsSampleRate:m})];case 3:return b=l.sent(),a&&g?[4,new Promise(function(e){null==g||g.subscribe("configs.analyticsSDK.browserSDK","all",function(t,r,n){b.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t&&mn(t,b),e()})})]:[3,5];case 4:l.sent(),l.label=5;case 5:return[4,e.prototype._init.call(this,b)];case 6:return l.sent(),this.logBrowserOptions(b),this.config.remoteConfigClient=g,hr(this.config.defaultTracking)?(w=function(e){return hr(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 po(w,this.config),[4,this.webAttribution.init()]):[3,8];case 7:l.sent(),l.label=8;case 8:return S=xe(),k=S.ampTimestamp?Number(S.ampTimestamp):void 0,x=!k||Date.now()<k,C=x&&!Number.isNaN(Number(S.ampSessionId))?Number(S.ampSessionId):void 0,this.setSessionId(null!==(d=null!==(h=null!==(c=t.sessionId)&&void 0!==c?c:C)&&void 0!==h?h:this.config.sessionId)&&void 0!==d?d:Date.now()),(E=ye(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline?[3,10]:[4,this.add(pn()).promise];case 9:l.sent(),l.label=10;case 10:return[4,this.add(new ae({diagnosticsClient:y})).promise];case 11:return l.sent(),[4,this.add(new Or).promise];case 12:return l.sent(),[4,this.add(new be).promise];case 13:return l.sent(),function(e){dn||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."),dn=!0)}(this.config),I=this.config.defaultTracking,cr(I,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(hn()).promise]):[3,15];case 14:l.sent(),l.label=15;case 15:return dr(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(ln()).promise]):[3,17];case 16:l.sent(),l.label=17;case 17:return pr(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(nn(Sr(this.config))).promise]):[3,19];case 18:l.sent(),l.label=19;case 19:return mr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(ii(yr(this.config),{diagnosticsClient:y})).promise]):[3,21];case 20:l.sent(),l.label=21;case 21:return vr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(di(br(this.config))).promise]):[3,23];case 22:l.sent(),l.label=23;case 23:return gr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(ki(wr(this.config))).promise]):[3,25];case 24:l.sent(),l.label=25;case 25: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(lo()).promise]):[3,27];case 26:l.sent(),l.label=27;case 27:return function(e){return cr(e,"pageUrlEnrichment")}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(yo()).promise]):[3,29];case 28:l.sent(),l.label=29;case 29:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 30:return l.sent(),E.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},r=t.time,n=s(t,["time"]),i="number"==typeof r?{time:r}:void 0;O.track(e.eventType,n,i)}),[2]}var I})})},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){ye(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){ye(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)),V(Promise.resolve());if(e===this.config.sessionId)return V(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,fr(this.config.defaultTracking)&&(n&&i&&r.push(this.track(Br,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 this.config.identify&&r.push(this.track(z(this.config.identify)).promise),fr(this.config.defaultTracking)&&r.push(this.track(jr,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,V(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(xr(t)){var n=t._q;t._q=[],t=kr(new _,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(xr(n)){var o=n._q;n._q=[],n=kr(new _,o)}return e.prototype.groupIdentify.call(this,t,r,n,i)},t.prototype.revenue=function(t,r){if(xr(t)){var n=t._q;t._q=[],t=kr(new $,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=we(this.config.sessionTimeout,this.config.lastEventTime),o=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===jr||t.event_type===Br||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),ko=Object.freeze({__proto__:null,get IdentifyOperation(){return n},get SpecialEventType(){return i},get RevenueProperty(){return D},get LogLevel(){return K},get ServerZone(){return nt},OfflineDisabled:null,DEFAULT_CSS_SELECTOR_ALLOWLIST:ot,DEFAULT_DATA_ATTRIBUTE_PREFIX:st,DEFAULT_ACTION_CLICK_ALLOWLIST:at}),xo="[Amplitude]",Co="".concat(xo," Session Replay ID"),Eo=nt.US,Oo={enabled:!0},Io="".concat(xo," Session Replay Debug"),Po="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"}(wo||(wo={}));var To=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}(),Ro="medium";var Ao=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 Ao(e,Ro,r)}},Mo=function(e,t){return function(r,n){return function(e,t,r){var n,i,o;if(void 0===t&&(t={defaultMaskLevel:Ro}),r){if(r.closest("."+Po))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 Ao(e,null!==(o=t.defaultMaskLevel)&&void 0!==o?o:Ro,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},_o=function(e,t){return t||(e===nt.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===nt.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},No=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},Lo=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=No(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},Do=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=F())?[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:""}]}})})},Uo=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:K.Warn,loggerProvider:new J,transportProvider:new Ge}},jo=function(e){function t(t,r){var n,i,s,a,l,u,c=this,h=Fo();if((c=e.call(this,o(o({transportProvider:h.transportProvider,loggerProvider:new To(r.loggerProvider||h.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=h.flushMaxRetries?r.flushMaxRetries:h.flushMaxRetries,c.apiKey=t,c.sampleRate=r.sampleRate||0,c.serverZone=r.serverZone||Eo,c.configServerUrl=r.configServerUrl,c.trackServerUrl=r.trackServerUrl,c.shouldInlineStylesheet=r.shouldInlineStylesheet,c.version=r.version,c.performanceConfig=r.performanceConfig||Oo,c.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",c.applyBackgroundColorToBlockedElements=null!==(i=r.applyBackgroundColorToBlockedElements)&&void 0!==i&&i,c.enableUrlChangePolling=null!==(s=r.enableUrlChangePolling)&&void 0!==s&&s,c.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:1e3,c.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,r.privacyConfig&&(c.privacyConfig=r.privacyConfig),r.interactionConfig&&(c.interactionConfig=r.interactionConfig,c.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")}(c.interactionConfig.ugcFilterRules)),r.debugMode&&(c.debugMode=r.debugMode),void 0!==r.useWebWorker)c.useWebWorker=r.useWebWorker;else{var d=r;void 0!==(null===(u=d.experimental)||void 0===u?void 0:u.useWebWorker)&&(c.useWebWorker=d.experimental.useWebWorker)}return r.omitElementTags&&(c.omitElementTags=r.omitElementTags),c}return r(t,e),t}(Y),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||{}),qo=(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))(qo||{}),zo=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,k,x,C=this;return l(this,function(l){switch(l.label){case 0:(n=o({},this.localConfig)).optOut=this.localConfig.optOut,n.captureEnabled=!0,l.label=1;case 1:return l.trys.push([1,3,,4]),[4,new Promise(function(e,t){C.remoteConfigClient.subscribe("configs.sessionReplay","all",function(r,o){var s;if(C.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(o,":"),JSON.stringify(r,null,2)),r){var a=r,l=a.sr_sampling_config,u=a.sr_privacy_config,c=a.sr_targeting_config,h=null===(s=n.interactionConfig)||void 0===s?void 0:s.ugcFilterRules;n.interactionConfig=a.sr_interaction_config,n.interactionConfig&&h&&(n.interactionConfig.ugcFilterRules=h),n.loggingConfig=a.sr_logging_config,(l||u||c)&&(i={},l&&(i.sr_sampling_config=l),u&&(i.sr_privacy_config=u),c&&(i.sr_targeting_config=c)),e()}else t(new Error("No remote config received"))})})];case 2:return l.sent(),[3,4];case 3:return s=l.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",s),n.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:void 0}];case 4:if(!i)return[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:i}];if(a=i.sr_sampling_config,h=i.sr_privacy_config,d=i.sr_targeting_config,a&&Object.keys(a).length>0?(Object.prototype.hasOwnProperty.call(a,"capture_enabled")?n.captureEnabled=a.capture_enabled:n.captureEnabled=!1,Object.prototype.hasOwnProperty.call(a,"sample_rate")&&(n.sampleRate=a.sample_rate)):(n.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),h){p=null!==(e=n.privacyConfig)&&void 0!==e?e:{},f={defaultMaskLevel:null!==(r=null!==(t=h.defaultMaskLevel)&&void 0!==t?t:p.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},g=function(e){var t,r,n,i,o,s,a,l,c,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=u(null!==(a=e.blockSelector)&&void 0!==a?a:[]),p=d.next();!p.done;p=d.next()){h[p.value]="block"}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}try{for(var f=u(null!==(l=e.maskSelector)&&void 0!==l?l:[]),g=f.next();!g.done;g=f.next()){h[g.value]="mask"}}catch(e){n={error:e}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}try{for(var m=u(null!==(c=e.unmaskSelector)&&void 0!==c?c:[]),v=m.next();!v.done;v=m.next()){h[v.value]="unmask"}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}return h},m=o(o({},g(p)),g(h));try{for(v=u(Object.entries(m)),y=v.next();!y.done;y=v.next())b=c(y.value,2),w=b[0],"mask"===(S=b[1])?f.maskSelector.push(w):"block"===S?f.blockSelector.push(w):"unmask"===S&&f.unmaskSelector.push(w)}catch(e){k={error:e}}finally{try{y&&!y.done&&(x=v.return)&&x.call(v)}finally{if(k)throw k.error}}n.privacyConfig=(E=f,O=this.localConfig.loggerProvider,I=document.createDocumentFragment(),P=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),e=e.filter(function(e){try{I.querySelector(e)}catch(t){return O.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0}),0!==e.length)return e},E.blockSelector=P(E.blockSelector),E.maskSelector=P(E.maskSelector),E.unmaskSelector=P(E.unmaskSelector),E)}return d&&Object.keys(d).length>0&&(n.targetingConfig=d),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:Uo(n)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:i}]}var E,O,I,P})})},e}(),Vo=function(e,t){return a(void 0,void 0,void 0,function(){var r,n;return l(this,function(i){return r=new jo(e,t),n=new Xe(e,r.loggerProvider,r.serverZone,t.configServerUrl),[2,new zo(n,r)]})})},Wo=Uint8Array,$o=Uint16Array,Ko=Uint32Array,Ho=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]),Jo=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]),Go=new Wo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Yo=function(e,t){for(var r=new $o(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new Ko(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]},Xo=Yo(Ho,2),Qo=Xo[0],Zo=Xo[1];Qo[28]=258,Zo[258]=28;for(var es=Yo(Jo,0)[1],ts=new $o(32768),rs=0;rs<32768;++rs){var ns=(43690&rs)>>>1|(21845&rs)<<1;ns=(61680&(ns=(52428&ns)>>>2|(13107&ns)<<2))>>>4|(3855&ns)<<4,ts[rs]=((65280&ns)>>>8|(255&ns)<<8)>>>1}var is=function(e,t,r){for(var n=e.length,i=0,o=new $o(t);i<n;++i)++o[e[i]-1];var s,a=new $o(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new $o(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[ts[h]>>>l]=u}else for(s=new $o(n),i=0;i<n;++i)s[i]=ts[a[e[i]-1]++]>>>15-e[i];return s},os=new Wo(288);for(rs=0;rs<144;++rs)os[rs]=8;for(rs=144;rs<256;++rs)os[rs]=9;for(rs=256;rs<280;++rs)os[rs]=7;for(rs=280;rs<288;++rs)os[rs]=8;var ss=new Wo(32);for(rs=0;rs<32;++rs)ss[rs]=5;var as=is(os,9,0),ls=is(ss,5,0),us=function(e){return(e/8|0)+(7&e&&1)},cs=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof $o?$o:e instanceof Ko?Ko:Wo)(r-t);return n.set(e.subarray(t,r)),n},hs=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},ds=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},ps=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 $o(d+1),f=fs(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]},fs=function(e,t,r){return-1==e.s?Math.max(fs(e.l,t,r+1),fs(e.r,t,r+1)):t[e.s]=r},gs=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new $o(++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]},ms=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},vs=function(e,t,r){var n=r.length,i=us(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)},ys=function(e,t,r,n,i,o,s,a,l,u,c){hs(t,c++,r),++i[256];for(var h=ps(i,15),d=h[0],p=h[1],f=ps(o,15),g=f[0],m=f[1],v=gs(d),y=v[0],b=v[1],w=gs(g),S=w[0],k=w[1],x=new $o(19),C=0;C<y.length;++C)x[31&y[C]]++;for(C=0;C<S.length;++C)x[31&S[C]]++;for(var E=ps(x,7),O=E[0],I=E[1],P=19;P>4&&!O[Go[P-1]];--P);var T,R,A,M,_=u+5<<3,N=ms(i,os)+ms(o,ss)+s,L=ms(i,d)+ms(o,g)+s+14+3*P+ms(x,O)+(2*x[16]+3*x[17]+7*x[18]);if(_<=N&&_<=L)return vs(t,c,e.subarray(l,l+u));if(hs(t,c,1+(L<N)),c+=2,L<N){T=is(d,p,0),R=d,A=is(g,m,0),M=g;var D=is(O,I,0);hs(t,c,b-257),hs(t,c+5,k-1),hs(t,c+10,P-4),c+=14;for(C=0;C<P;++C)hs(t,c+3*C,O[Go[C]]);c+=3*P;for(var U=[y,S],F=0;F<2;++F){var j=U[F];for(C=0;C<j.length;++C){var B=31&j[C];hs(t,c,D[B]),c+=O[B],B>15&&(hs(t,c,j[C]>>>5&127),c+=j[C]>>>12)}}}else T=as,R=os,A=ls,M=ss;for(C=0;C<a;++C)if(n[C]>255){B=n[C]>>>18&31;ds(t,c,T[B+257]),c+=R[B+257],B>7&&(hs(t,c,n[C]>>>23&31),c+=Ho[B]);var q=31&n[C];ds(t,c,A[q]),c+=M[q],q>3&&(ds(t,c,n[C]>>>5&8191),c+=Jo[q])}else ds(t,c,T[n[C]]),c+=R[n[C]];return ds(t,c,T[256]),c+R[256]},bs=new Ko([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ws=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=vs(l,u,e.subarray(c,h)):(l[c]=o,u=vs(l,u,e.subarray(c,s)))}else{for(var d=bs[t-1],p=d>>>13,f=8191&d,g=(1<<r)-1,m=new $o(32768),v=new $o(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 Ko(25e3),k=new $o(288),x=new $o(32),C=0,E=0,O=(c=0,0),I=0,P=0;c<s;++c){var T=w(c),R=32767&c,A=v[T];if(m[R]=A,v[T]=R,I<=c){var M=s-c;if((C>7e3||O>24576)&&M>423){u=ys(e,l,0,S,k,x,E,O,P,c-P,u),O=C=E=0,P=c;for(var _=0;_<286;++_)k[_]=0;for(_=0;_<30;++_)x[_]=0}var N=2,L=0,D=f,U=R-A&32767;if(M>2&&T==w(c-U))for(var F=Math.min(p,M)-1,j=Math.min(32767,c),B=Math.min(258,M);U<=j&&--D&&R!=A;){if(e[c+N]==e[c+N-U]){for(var q=0;q<B&&e[c+q]==e[c+q-U];++q);if(q>N){if(N=q,L=U,q>F)break;var z=Math.min(U,q-2),V=0;for(_=0;_<z;++_){var W=c-U+_+32768&32767,$=W-m[W]+32768&32767;$>V&&(V=$,A=W)}}}U+=(R=A)-(A=m[R])+32768&32767}if(L){S[O++]=268435456|Zo[N]<<18|es[L];var K=31&Zo[N],H=31&es[L];E+=Ho[K]+Jo[H],++k[257+K],++x[H],I=c+N,++C}else S[O++]=e[c],++k[e[c]]}}u=ys(e,l,o,S,k,x,E,O,P,c-P,u)}return cs(a,0,n+us(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,!0)};function Ss(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=ws(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 ks=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}(Ss(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 cs(n,0,i)}(JSON.stringify(t))),!0)};var xs=function(){function e(e,t,r,n){var i,o=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=ks(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=F();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("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}(),Cs="Failed to store session replay events in IndexedDB",Es="1.30.10-feat-zoning-alpha.0",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(s=function(){var e=F();return(null==e?void 0:e.location)?e.location.href:""}(),a=Es,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(_o(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]}})})},e.prototype.handleReponse=function(e,t){switch((new Je).buildStatus(e)){case N.Success:this.handleSuccessResponse(t);break;case N.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 Is=(e,t)=>t.some(t=>e instanceof t);let Ps,Ts;const Rs=new WeakMap,As=new WeakMap,Ms=new WeakMap;let _s={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return Rs.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Us(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Ns(e){_s=e(_s)}function Ls(e){return(Ts||(Ts=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Fs(this),t),Us(this.request)}:function(...t){return Us(e.apply(Fs(this),t))}}function Ds(e){return"function"==typeof e?Ls(e):(e instanceof IDBTransaction&&function(e){if(Rs.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)});Rs.set(e,t)}(e),Is(e,Ps||(Ps=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,_s):e)}function Us(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(Us(e.result)),n()},o=()=>{r(e.error),n()};e.addEventListener("success",i),e.addEventListener("error",o)});return Ms.set(t,e),t}(e);if(As.has(e))return As.get(e);const t=Ds(e);return t!==e&&(As.set(e,t),Ms.set(t,e)),t}const Fs=e=>Ms.get(e);function js(e,t,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=Us(s);return n&&s.addEventListener("upgradeneeded",e=>{n(Us(s.result),e.oldVersion,e.newVersion,Us(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"],qs=["put","add","delete","clear"],zs=new Map;function Vs(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(zs.get(t))return zs.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,i=qs.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 zs.set(t,o),o}Ns(e=>({...e,get:(t,r,n)=>Vs(t,r)||e.get(t,r,n),has:(t,r)=>!!Vs(t,r)||e.has(t,r)}));const Ws=["continue","continuePrimaryKey","advance"],$s={},Ks=new WeakMap,Hs=new WeakMap,Js={get(e,t){if(!Ws.includes(t))return e[t];let r=$s[t];return r||(r=$s[t]=function(...e){Ks.set(this,Hs.get(this)[t](...e))}),r}};async function*Gs(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,Js);for(Hs.set(r,t),Ms.set(r,Fs(t));t;)yield r,t=await(Ks.get(r)||t.continue()),Ks.delete(r)}function Ys(e,t){return t===Symbol.asyncIterator&&Is(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Is(e,[IDBIndex,IDBObjectStore])}Ns(e=>({...e,get:(t,r,n)=>Ys(t,r)?Gs:e.get(t,r,n),has:(t,r)=>Ys(t,r)||e.has(t,r)}));var Xs,Qs=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"}(Xs||(Xs={}));var Zs,ea,ta,ra="sessionCurrentSequence",na="sequencesToSend",ia=function(){var e=F();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"),i=!1;n.onupgradeneeded=function(){1===n.result.version&&(i=!0)},n.onsuccess=function(){if(i){try{n.result.close()}catch(e){}try{e.indexedDB.deleteDatabase("keyval-store")}catch(e){}t()}else t(n.result)},n.onerror=function(e){var i;if("AbortError"===(null===(i=n.error)||void 0===i?void 0:i.name))return e.preventDefault(),void t();r(n.error)}}catch(e){r(e)}})},oa=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]}})})},sa=function(e){var t,r;return e.objectStoreNames.contains(ra)||(r=e.createObjectStore(ra,{keyPath:"sessionId"})),e.objectStoreNames.contains(na)||(t=e.createObjectStore(na,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},aa=function(e){return a(void 0,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return[4,js(e,1,{upgrade:sa})];case 1:return[2,t.sent()]}})})},la=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(Cs,": ").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(ra,e)];case 1:return(t=i.sent())?[4,this.db.put(na,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=i.sent(),[4,this.db.put(ra,{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(Cs,": ").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(ra,"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(Cs,": ").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(na,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(Cs,": ").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(na,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(Cs,": ").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,ia()];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!==Xs.SENT&&n.push(i.storeSendingEvents(e,u.events))}),[4,oa(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!==Xs.SENT&&s.push(a.storeSendingEvents(n,l[t].events))})}}),[4,oa(s)]):[3,2];case 1:l.sent(),l.label=2;case 2:return t(),[2]}})})}}),[4,o];case 3:return g.sent(),(s=F())&&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,aa(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(Cs,": ").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}(Qs),ua=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}(Qs),ca=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 ua({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,la.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&&Do().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}]}})})},ha=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 da(e,t){if(ta=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};Zs=o(o({},r),t),ea=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Zs.root,r);var n=pa(e,"all",function(){return pa(e,"two",function(){return pa(e,"one",function(){return pa(e,"none")})})});if(n){var i=xa(Ca(n,e));return i.length>0&&(n=i[0]),ga(n)}throw new Error("Selector was not found.")}function pa(e,t,r){for(var n=null,i=[],o=e,s=0,a=function(){var e,a,l=(new Date).getTime()-ta.getTime();if(void 0!==Zs.timeoutMs&&l>Zs.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var d=wa(function(e){var t=e.getAttribute("id");if(t&&Zs.idName(t))return{name:"#"+CSS.escape(t),penalty:0};return null}(o))||wa.apply(void 0,h([],c(function(e){var t=Array.from(e.attributes).filter(function(e){return Zs.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))||wa.apply(void 0,h([],c(function(e){var t=Array.from(e.classList).filter(Zs.className);return t.map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(o)),!1))||wa(function(e){var t=e.tagName.toLowerCase();if(Zs.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(ba).map(function(e){return ya(e,p)})));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(ba).map(function(e){return ya(e,p)})));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&ba(f)&&(d=[ya(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[ya(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>=Zs.seedMinLength&&(n=fa(i,r)))return"break";o=o.parentElement,s++};o;){if("break"===a())break}return n||(n=fa(i,r)),!n&&r?r():n}function fa(e,t){var r,n,i=xa(ka(e));if(i.length>Zs.threshold)return t?t():null;try{for(var o=u(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(va(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 ga(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 ma(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function va(e){var t=ga(e);switch(ea.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 ya(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function ba(e){return"html"!==e.name&&!e.name.startsWith("#")}function wa(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(Sa);return r.length>0?r:null}function Sa(e){return null!=e}function ka(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(ka(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 xa(e){return h([],c(e),!1).sort(function(e,t){return ma(e)-ma(t)})}function Ca(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>Zs.optimizedMinLength))return[3,5];n=1,s.label=1;case 1:return n<e.length-1?r.counter>Zs.maxNumberOfTries?[2]:(r.counter+=1,(i=h([],c(e),!1)).splice(n,1),o=ga(i),r.visited.has(o)?[2]:va(i)&&function(e,t){return ea.querySelector(ga(e))===t}(i,t)?[4,i]:[3,4]):[3,5];case 2:return s.sent(),r.visited.set(o,!0),[5,u(Ca(i,t,r))];case 3:s.sent(),s.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var Ea=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)}},Ia=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,a=e.performanceOptions;return function(e){if(e.type===qo.Click){var l=F();if(l){var u=l.location,c=l.innerHeight,h=l.innerWidth;if(u){var d=e.x,p=e.y;if(void 0!==d&&void 0!==p){var f,g=o.getNode(e.id);if(g)try{f=da(g,a)}catch(e){r.logger.debug("error resolving selector from finder")}var m=Lo(u.href,s),v={x:d+r.scrollWatcher.currentScrollX,y:p+r.scrollWatcher.currentScrollY,selector:f,viewportHeight:c,viewportWidth:h,pageUrl:m,timestamp:Date.now(),type:"click"},y=i();y&&t.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(v)},deviceId:y})}}}}}},this.logger=e,this.scrollWatcher=t};function Pa(){var e=F();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function Ta(){var e=F();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}var Ra=function(){function e(e,t){var r=F();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=_o(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=F();s&&o&&r.transport.send(o,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:Pa(),viewportWidth:Ta(),pageUrl:Lo(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=Ta(),this._maxScrollHeight=Pa(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new Ra(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=Ta();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=Pa();this._maxScrollY=e.y;var o=e.y+i;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),Ma=function(e){var t=e.sessionId,r=e.deviceId;this.deviceId=r,this.sessionId=t,t&&r&&(this.sessionReplayId=function(e,t){return"".concat(t,"/").concat(e)}(t,r))},_a=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,js(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]}})})}},Na=new _a,La=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,Na.clearStoreOfOldSessions({loggerProvider:n,apiKey:i,currentSessionId:t})];case 1:return l.sent(),[4,Na.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 Mh})];case 4:return[4,(0,l.sent().evaluateTargeting)(o(o({},s),{flag:r,sessionId:"string"==typeof t?parseInt(t,10):t,apiKey:i,loggerProvider:n}))];case 5:return(a=l.sent())&&a.sr_targeting_config&&(e="on"===a.sr_targeting_config.key),Na.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?Lo(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),k=r.history.replaceState.bind(r.history);return r.history.pushState[f]||(r.history.pushState=y(S),r.history.replaceState=y(k)),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 Ua,Fa,ja,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=F();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,La({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!==wo.METADATA?(e={config:Uo(i),version:Es},n?[4,Do()]:[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 To(new J)}return e.prototype.init=function(e,t){return V(this._init(e,t))},e.prototype._init=function(e,t){var r,n,i,o,s,u;return a(this,void 0,void 0,function(){var a,d,p,f,g,m,v,y,b,w,S,k,x,C,E,O,I;return l(this,function(l){switch(l.label){case 0:return this.loggerProvider=new To(t.loggerProvider||new J),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new Ma({sessionId:t.sessionId,deviceId:t.deviceId}),a=this,[4,Vo(e,t)];case 1:return a.joinedConfigGenerator=l.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:d=l.sent(),p=d.joinedConfig,f=d.localConfig,g=d.remoteConfig,this.config=p,this.setMetadata(t.sessionId,p,f,g,null===(r=t.version)||void 0===r?void 0:r.version,Es,null===(n=t.version)||void 0===n?void 0:n.type),t.sessionId&&(null===(i=this.config.interactionConfig)||void 0===i?void 0:i.enabled)&&(m=Aa.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[m.send(this.getDeviceId.bind(this)).bind(m)],this.scrollHook=m.hook.bind(m),this.clickHandler=new Ia(this.loggerProvider,m)),v=[],"idb"!==(y=this.config.storeType)||(null===(o=F())||void 0===o?void 0:o.indexedDB)||(y="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(y," for event storage.")),l.label=3;case 3:return l.trys.push([3,5,,6]),[4,ca({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:y})];case 4:return b=l.sent(),v.push({name:"replay",manager:b}),[3,6];case 5:return w=l.sent(),C=w,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(C.toString())),[3,6];case 6:if(!(null===(s=this.config.interactionConfig)||void 0===s?void 0:s.enabled))return[3,10];S=this.config.interactionConfig.batch?Oa:Ea,l.label=7;case 7:return l.trys.push([7,9,,10]),[4,ca({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!==(u=this.config.interactionConfig.trackEveryNms)&&void 0!==u?u:3e4,maxInterval:6e4,payloadBatcher:S,storeType:y})];case 8:return k=l.sent(),v.push({name:"interaction",manager:k}),[3,10];case 9:return x=l.sent(),C=x,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(C.toString())),[3,10];case 10:return this.eventsManager=new(ha.bind.apply(ha,h([void 0],c(v),!1))),this.eventCompressor&&this.eventCompressor.terminate(),E=void 0,O=F(),this.config.useWebWorker&&O&&O.Worker?[4,Promise.resolve().then(function(){return _h})]:[3,12];case 11:I=l.sent().compressionScript,E=I,l.label=12;case 12:return this.eventCompressor=new xs(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 V(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n;return a(this,void 0,void 0,function(){var i,o,s;return l(this,function(a){switch(a.label){case 0:return this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(i=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(i),o=t||this.getDeviceId(),this.identifiers=new Ma({sessionId:e,deviceId:o}),this.joinedConfigGenerator&&i?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2];case 1:s=a.sent().joinedConfig,this.config=s,a.label=2;case 2:return(null===(n=this.config)||void 0===n?void 0:n.targetingConfig)?[4,this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties},!1,!0)]:[3,4];case 3:return a.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:a.sent(),a.label=6;case 6:return[2]}})})},e.prototype.getSessionReplayProperties=function(){var e,t=this.config,r=this.identifiers;if(!t||!r)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var n=this.getShouldRecord(),i={};return n&&((e={})[Co]=r.sessionReplayId?r.sessionReplayId:null,i=e,t.debugMode&&(i[Io]=JSON.stringify({appHash:Ie(t.apiKey).toString()}))),this.addCustomRRWebEvent(wo.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=ye(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=Ie(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(wo.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 Jg})];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 WS})];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,u;return void 0===e&&(e=!0),a(this,void 0,void 0,function(){var a,c,h,d,p,f,g,m,v,y,b,w,S,k=this;return l(this,function(l){switch(l.label){case 0:return a=this.config,c=this.getShouldRecord(),h=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,c&&h&&a?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(d=l.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:l.sent(),null===(r=this.networkObservers)||void 0===r||r.start(function(e){k.addCustomRRWebEvent(wo.FETCH_REQUEST,e)}),p=a.privacyConfig,f=a.interactionConfig,g=a.loggingConfig,m=(null==f?void 0:f.enabled)?{mouseInteraction:this.eventsManager&&(null===(n=this.clickHandler)||void 0===n?void 0:n.createHook({eventsManager:this.eventsManager,sessionId:h,deviceIdFn:this.getDeviceId.bind(this),mirror:d.mirror,ugcFilterRules:null!==(i=f.ugcFilterRules)&&void 0!==i?i:[],performanceOptions:null===(o=a.performanceConfig)||void 0===o?void 0:o.interaction})),scroll:this.scrollHook}:{},v=(null==f?void 0:f.enabled)&&f.ugcFilterRules?f.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(h,".")),l.label=3;case 3:return l.trys.push([3,5,,6]),y=this,b=d,S={emit:function(e){if(k.shouldOptOut())return k.loggerProvider.log("Opting session ".concat(h," out of recording due to optOut config.")),k.stopRecordingEvents(),void k.sendEvents();e.type===Bo.Meta&&(e.data.href=Lo(e.data.href,v)),k.eventCompressor&&k.eventCompressor.enqueueEvent(e,h)},inlineStylesheet:a.shouldInlineStylesheet,hooks:m,maskAllInputs:!0,maskTextClass:Po,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:a.applyBackgroundColorToBlockedElements,maskInputFn:Mo("input",p),maskTextFn:Mo("text",p),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:null===(s=a.omitElementTags)||void 0===s?void 0:s.script,comment:null===(u=a.omitElementTags)||void 0===u?void 0:u.comment},errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return k.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(g)];case 4:return y.recordCancelCallback=b.apply(void 0,[(S.plugins=l.sent(),S)]),this.addCustomRRWebEvent(wo.DEBUG_INFO),e&&this.addCustomRRWebEvent(wo.METADATA,this.metadata),[3,6];case 5:return w=l.sent(),this.loggerProvider.warn("Failed to initialize session replay:",w),[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())?Ie(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 KS})];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}(),qa=function(e){return function(){var t=e.config||Fo();return{logger:t.loggerProvider,logLevel:t.logLevel}}},za=function(){var e=new Ba;return{init:oe(e.init.bind(e),"init",qa(e)),evaluateTargetingAndCapture:oe(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",qa(e)),setSessionId:oe(e.setSessionId.bind(e),"setSessionId",qa(e)),getSessionId:oe(e.getSessionId.bind(e),"getSessionId",qa(e)),getSessionReplayProperties:oe(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",qa(e)),flush:oe(e.flush.bind(e),"flush",qa(e)),shutdown:oe(e.shutdown.bind(e),"shutdown",qa(e))}}(),Va=za.init,Wa=za.setSessionId,$a=za.getSessionId,Ka=za.getSessionReplayProperties,Ha=za.flush,Ja=za.shutdown,Ga=za.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"}(Ua||(Ua={})),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"}(ja||(ja={}));var Ya=[Ua.SET,Ua.SET_ONCE,Ua.ADD,Ua.APPEND,Ua.PREPEND,Ua.POSTINSERT],Xa="1.25.11-feat-zoning-alpha.0",Qa="".concat("[Amplitude]"," Session Replay ID"),Za=function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:Ha,getSessionId:$a,getSessionReplayProperties:Ka,init:Va,setSessionId:Wa,shutdown:Ja,evaluateTargetingAndCapture:Ga},this.options=o({forceSessionTracking:!1},t),this.srInitOptions=this.options}return e.prototype.setup=function(e,t){var r,n,i,s,u,c,h,d;return a(this,void 0,void 0,function(){var t,a,p;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(Xa,".")),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=(f=this.config.instanceName,void 0===f&&(f="$default_instance"),ve.getInstance(f)).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:Xa},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:null!==(h=this.options.useWebWorker)&&void 0!==h?h:null===(d=this.options.experimental)||void 0===d?void 0:d.useWebWorker,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 p=l.sent(),null==e||e.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(p.message)),[3,3];case 3:return[2]}var f})})},e.prototype.onSessionIdChanged=function(e){var t;return a(this,void 0,void 0,function(){return l(this,function(r){switch(r.label){case 0:return null===(t=this.config)||void 0===t||t.loggerProvider.debug("Analytics session id is changed to ".concat(e,", SR session id is ").concat(String(this.sessionReplay.getSessionId()),".")),[4,this.sessionReplay.setSessionId(e).promise];case 1:return r.sent(),[2]}})})},e.prototype.onOptOutChanged=function(e){var t;return a(this,void 0,void 0,function(){return l(this,function(r){switch(r.label){case 0:return null===(t=this.config)||void 0===t||t.loggerProvider.debug("optOut is changed to ".concat(String(e),", calling ").concat(e?"sessionReplay.shutdown()":"sessionReplay.init()",".")),e?(this.sessionReplay.shutdown(),[3,4]):[3,1];case 1:return null!=this.config?[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise]:[3,3];case 2:r.sent(),r.label=3;case 3:r.label=4;case 4:return[2]}})})},e.prototype.execute=function(e){var t,r;return a(this,void 0,void 0,function(){var n,s,a,u;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,9,,10]),this.options.customSessionId?(n=this.options.customSessionId(e))?n===this.sessionReplay.getSessionId()?[3,2]:[4,this.sessionReplay.setSessionId(n).promise]:[3,3]:[3,4];case 1:l.sent(),l.label=2;case 2:a=this.sessionReplay.getSessionReplayProperties(),e.event_properties=o(o({},e.event_properties),a),l.label=3;case 3:return[3,8];case 4:return(n=null===(t=this.config)||void 0===t?void 0:t.sessionId)&&n!==this.sessionReplay.getSessionId()?[4,this.sessionReplay.setSessionId(n).promise]:[3,6];case 5:l.sent(),l.label=6;case 6:return n&&n===e.session_id?(s=void 0,e.event_type===i.IDENTIFY&&(s=function(e){if(e.user_properties){var t={};return Object.keys(e.user_properties).forEach(function(r){if(Ya.includes(r)){var n=e.user_properties&&e.user_properties[r];t=o(o({},t),n)}}),t}}(e)),[4,this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:s})]):[3,8];case 7:l.sent(),a=this.sessionReplay.getSessionReplayProperties(),e.event_properties=o(o({},e.event_properties),a),l.label=8;case 8:return e.event_type===i.IDENTIFY&&e.event_properties&&delete e.event_properties[Qa],[2,Promise.resolve(e)];case 9:return u=l.sent(),null===(r=this.config)||void 0===r||r.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(u.message)),[2,Promise.resolve(e)];case 10:return[2]}})})},e.prototype.teardown=function(){var e;return a(this,void 0,void 0,function(){return l(this,function(t){try{this.sessionReplay.shutdown(),this.config=null}catch(t){null===(e=this.config)||void 0===e||e.loggerProvider.error("Session Replay: teardown failed due to ".concat(t.message))}return[2]})})},e.prototype.getSessionReplayProperties=function(){return this.sessionReplay.getSessionReplayProperties()},e.pluginName="@amplitude/plugin-session-replay-browser",e}(),el=function(e,t){return el=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])},el(e,t)};function tl(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}el(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var rl=function(){return rl=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},rl.apply(this,arguments)};function nl(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 il(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 ol(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 sl(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 al(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 ll="is",ul="is not",cl="contains",hl="does not contain",dl="less",pl="less or equal",fl="greater",gl="greater or equal",ml="version less",vl="version less or equal",yl="version greater",bl="version greater or equal",wl="set is",Sl="set is not",kl="set contains",xl="set does not contain",Cl="set contains any",El="set does not contain any",Ol="regex match",Il="regex does not match",Pl=-862048943,Tl=461845907,Rl=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=Nl(r,s<<2);o=Al(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,Pl),u=_l(u,15),o^=u=Math.imul(u,Tl);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,Pl),u=_l(u,15),o^=u=Math.imul(u,Tl);break;case 1:u^=r[l],u=Math.imul(u,Pl),u=_l(u,15),o^=u=Math.imul(u,Tl)}return Ml(o^=n)>>>0},Al=function(e,t){var r=e,n=t;return r=Math.imul(r,Pl),r=_l(r,15),r=Math.imul(r,Tl),n=_l(n^=r,13),(n=Math.imul(n,5))+-430675100|0},Ml=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},_l=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},Nl=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 Ll(r)},Ll=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Dl=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=ol(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}},Ul="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),Fl=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(Ul).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}(),jl=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=ol(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=ol(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=rl(rl(rl({},t.metadata),a.metadata),i.metadata);i=rl(rl({},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=ol(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=!0;try{for(var c=(i=void 0,ol(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=Dl(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 Rl(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(Dl(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=ol(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,ol(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 ll:case cl:case dl:case pl:case fl:case gl:case ml:case vl:case yl:case bl:case wl:case kl:case Cl:return r;case ul:case hl:case xl:case El:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case wl:return this.setEquals(e,r);case Sl:return!this.setEquals(e,r);case kl:return this.matchesSetContainsAll(e,r);case xl:return!this.matchesSetContainsAll(e,r);case Cl: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 ll:return this.matchesIs(e,r);case ul:return!this.matchesIs(e,r);case cl:return this.matchesContains(e,r);case hl:return!this.matchesContains(e,r);case dl:case pl:case fl:case gl:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case ml:case vl:case yl:case bl:return this.matchesComparable(e,t,r,function(e){return Fl.parse(e)},this.versionComparator);case Ol:return this.matchesRegex(e,r);case Il: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=ol(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 dl:case ml:return e<r;case pl:case vl:return e<=r;case fl:case yl:return e>r;case gl:case bl:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case dl:case ml:return n<0;case pl:case vl:return n<=0;case fl:case yl:return n>0;case gl:case bl: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 wl:case Sl:case kl:case xl:case Cl: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&&al([],sl(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=ol(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=ol(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}(),Bl=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=Bl(e,t,r);n&&s.push.apply(s,al([],sl(n),!1))};try{for(var l=ol(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 ql="function"==typeof Buffer,zl=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),Vl=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Wl=(e=>{let t={};return e.forEach((e,r)=>t[e]=r),t})(Vl),$l=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Kl=String.fromCharCode.bind(String),Hl=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_")),Jl=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Gl=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+=Vl[t>>18&63]+Vl[t>>12&63]+Vl[t>>6&63]+Vl[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},Yl="function"==typeof btoa?e=>btoa(e):ql?e=>Buffer.from(e,"binary").toString("base64"):Gl,Xl=ql?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 Yl(t.join(""))},Ql=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)},Zl=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,eu=e=>e.replace(Zl,Ql),tu=ql?e=>Buffer.from(e,"utf8").toString("base64"):zl?e=>Xl(zl.encode(e)):e=>Yl(eu(e)),ru=(e,t=!1)=>t?Hl(tu(e)):tu(e),nu=e=>ru(e,!0),iu=e=>{if(e=e.replace(/\s+/g,""),!$l.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=Wl[e.charAt(o++)]<<18|Wl[e.charAt(o++)]<<12|(r=Wl[e.charAt(o++)])<<6|(n=Wl[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},ou=nu;var su=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return tl(t,e),t}(Error),au=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return tl(t,e),t}(Error),lu=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return nl(this,void 0,void 0,function(){var r,n,i,o;return il(this,function(s){switch(s.label){case 0:return r=ou(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"]=ou(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 su(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}})})},e}(),uu=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return nl(this,void 0,void 0,function(){var t,r;return il(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"]=ou(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}(),cu="undefined"!=typeof globalThis?globalThis:global||self,hu=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},du=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=cu.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(cu.clearInterval(this.poller),this.poller=void 0)},e}(),pu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},fu={},gu={get exports(){return fu},set exports(e){fu=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",k="ASUS",x="BlackBerry",C="Browser",E="Chrome",O="Firefox",I="Google",P="Huawei",T="LG",R="Microsoft",A="Motorola",M="Opera",_="Samsung",N="Sharp",L="Sony",D="Xiaomi",U="Zebra",F="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!==q(t).indexOf(q(e))},q=function(e){return e.toLowerCase()},z=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},V=function(e,t){for(var r,o,a,l,u,c,h=0;h<t.length&&!u;){var d=t[h],p=t[h+1];for(r=o=0;r<d.length&&!u;)if(u=d[r++].exec(e))for(a=0;a<p.length;a++)c=u[++o],typeof(l=p[a])===s&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):n:this[l[0]]=c?l[1].call(this,c,l[2]):n:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):n):this[l]=c||n;h+=2}},W=function(e,t){for(var r in t)if(typeof t[r]===s&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(B(t[r][i],e))return"?"===r?n:r}else if(B(t[r],e))return"?"===r?n:r;return e},$={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"},K={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"+C]],[/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 "+C],d],[/\bfocus\/([\w\.]+)/i],[d,[u,O+" 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 "+C]],[/fxios\/([-\w\.]+)/i],[d,[u,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+C]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+C],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,F],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,E+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,E+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[u,"Android "+C]],[/(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,O+" 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,q]],[/((?: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/,"",q]],[/(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,q]]],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,_],[c,m]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[h,_],[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,P],[c,m]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[h,P],[c,g]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[h,D],[c,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[h,D],[c,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[h,"OPPO"],[c,g]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[h,"Vivo"],[c,g]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[h,"Realme"],[c,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[h,A],[c,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[h,A],[c,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[h,T],[c,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[h,T],[c,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[h,"Lenovo"],[c,m]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[h,"Nokia"],[c,g]],[/(pixel c)\b/i],[l,[h,I],[c,m]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[h,I],[c,g]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[h,L],[c,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[h,L],[c,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[h,"OnePlus"],[c,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[h,w],[c,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[h,w],[c,g]],[/(playbook);[-\w\),; ]+(rim)/i],[l,h,[c,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[h,x],[c,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[h,k],[c,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[h,k],[c,g]],[/(nexus 9)/i],[l,[h,"HTC"],[c,m]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[l,/_/g," "],[c,g]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[h,"Acer"],[c,m]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[h,"Meizu"],[c,g]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[h,N],[c,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,l,[c,g]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,l,[c,m]],[/(surface duo)/i],[l,[h,R],[c,m]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[h,"Fairphone"],[c,g]],[/(u304aa)/i],[l,[h,"AT&T"],[c,g]],[/\bsie-(\w*)/i],[l,[h,"Siemens"],[c,g]],[/\b(rct\w+) b/i],[l,[h,"RCA"],[c,m]],[/\b(venue[\d ]{2,7}) b/i],[l,[h,"Dell"],[c,m]],[/\b(q(?:mv|ta)\w+) b/i],[l,[h,"Verizon"],[c,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[h,"Barnes & Noble"],[c,m]],[/\b(tm\d{3}\w+) b/i],[l,[h,"NuVision"],[c,m]],[/\b(k88) b/i],[l,[h,"ZTE"],[c,m]],[/\b(nx\d{3}j) b/i],[l,[h,"ZTE"],[c,g]],[/\b(gen\d{3}) b.+49h/i],[l,[h,"Swiss"],[c,g]],[/\b(zur\d{3}) b/i],[l,[h,"Swiss"],[c,m]],[/\b((zeki)?tb.*\b) b/i],[l,[h,"Zeki"],[c,m]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],l,[c,m]],[/\b(ns-?\w{0,9}) b/i],[l,[h,"Insignia"],[c,m]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[h,"NextBook"],[c,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],l,[c,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],l,[c,g]],[/\b(ph-1) /i],[l,[h,"Essential"],[c,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[h,"Envizen"],[c,m]],[/\b(trio[-\w\. ]+) b/i],[l,[h,"MachSpeed"],[c,m]],[/\btu_(1491) b/i],[l,[h,"Rotor"],[c,m]],[/(shield[\w ]+) b/i],[l,[h,"Nvidia"],[c,m]],[/(sprint) (\w+)/i],[h,l,[c,g]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[h,R],[c,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[h,U],[c,m]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[h,U],[c,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,l,[c,f]],[/droid.+; (shield) bui/i],[l,[h,"Nvidia"],[c,f]],[/(playstation [345portablevi]+)/i],[l,[h,L],[c,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[h,R],[c,f]],[/smart-tv.+(samsung)/i],[h,[c,v]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[h,_],[c,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,T],[c,v]],[/(apple) ?tv/i],[h,[l,S+" TV"],[c,v]],[/crkey/i],[[l,E+"cast"],[h,I],[c,v]],[/droid.+aft(\w)( bui|\))/i],[l,[h,w],[c,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[h,N],[c,v]],[/(bravia[\w ]+)( bui|\))/i],[l,[h,L],[c,v]],[/(mitv-\w{5}) bui/i],[l,[h,D],[c,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,z],[l,z],[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,I],[c,y]],[/droid.+; (wt63?0{2,3})\)/i],[l,[h,U],[c,y]],[/(quest( 2)?)/i],[l,[h,F],[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,$]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[d,W,$]],[/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,x]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[u,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[u,E+"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]]},H=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof H))return new H(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}(K,t):K;return this.getBrowser=function(){var e={};return e[u]=n,e[d]=n,V.call(e,i,f.browser),e.major=function(e){return typeof e===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n}(e.version),e},this.getCPU=function(){var e={};return e[p]=n,V.call(e,i,f.cpu),e},this.getDevice=function(){var e={};return e[h]=n,e[l]=n,e[c]=n,V.call(e,i,f.device),e},this.getEngine=function(){var e={};return e[u]=n,e[d]=n,V.call(e,i,f.engine),e},this.getOS=function(){var e={};return e[u]=n,e[d]=n,V.call(e,i,f.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===a&&e.length>350?z(e,350):e,this},this.setUA(i),this};H.VERSION="0.7.33",H.BROWSER=j([u,d,"major"]),H.CPU=j([p]),H.DEVICE=j([l,h,c,f,g,v,m,y,b]),H.ENGINE=H.OS=j([u,d]),e.exports&&(t=e.exports=H),t.UAParser=H;var J=typeof r!==o&&(r.jQuery||r.Zepto);if(J&&!J.ua){var G=new H;J.ua=G.getResult(),J.ua.get=function(){return G.getUA()},J.ua.set=function(e){G.setUA(e);var t=G.getResult();for(var r in t)J.ua[r]=t[r]}}}("object"==typeof window?window:pu)}(gu,fu);var mu=function(){return mu=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},mu.apply(this,arguments)};function vu(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 yu(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 bu(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 wu(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 Su(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 ku=function(e,t){var r,n;void 0===t&&(t=!1);var i=xu(e,t),o=void 0,s=cu.document.cookie.split("; ");try{for(var a=bu(s),l=a.next();!l.done;l=a.next()){var u=wu(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}},xu=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))},Cu=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 vu(this,void 0,void 0,function(){return yu(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=ku(this.apiKey,!0);return(e||(e=ku(this.apiKey,!1))||(e=function(e){var t=xu(e,!0);try{var r=cu.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=xu(e,!0);try{var r=cu.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 vu(this,void 0,void 0,function(){var t,r=this;return yu(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){cu.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])]})})},e}();var Eu,Ou,Iu,Pu=cu.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)})},Tu=function(){function e(e){this.client=e}return e.prototype.request=function(e){return vu(this,void 0,void 0,function(){return yu(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}(),Ru={request:function(e,t,r,n,i){return function(e,t){return null==t||t<=0?e:new Promise(function(r,n){cu.setTimeout(function(){n(new au("Request timeout after "+t+" milliseconds"))},t),e.then(r,n)})}(vu(void 0,void 0,void 0,function(){var i,o;return yu(this,function(s){switch(s.label){case 0:return[4,Pu(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"}(Eu||(Eu={})),function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(Ou||(Ou={})),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"}(Iu||(Iu={}));var Au=function(e){return!e||e===Iu.FallbackInline||e===Iu.FallbackConfig||e===Iu.SecondaryInitialVariants},Mu={debug:!1,logLevel:Eu.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:Ou.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:Ru},_u="1.20.0",Nu=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:Mu.instanceName;this.queue=new Du(i),this.cache=new Lu(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}(),Lu=function(){function e(e){this.isSessionStorageAvailable=Uu(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&cu.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=cu.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&cu.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),Du=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=function(){var e=hu();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=cu.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=bu(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&&(cu.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=cu.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)),cu.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),Uu=function(){var e=hu();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},Fu=function(){function e(e,t){void 0===t&&(t=Eu.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>=Eu.Error&&(t=this.logger).error.apply(t,Su([e],wu(r),!1))},e.prototype.warn=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=Eu.Warn&&(t=this.logger).warn.apply(t,Su([e],wu(r),!1))},e.prototype.info=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=Eu.Info&&(t=this.logger).info.apply(t,Su([e],wu(r),!1))},e.prototype.debug=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=Eu.Debug&&(t=this.logger).debug.apply(t,Su([e],wu(r),!1))},e.prototype.verbose=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.logLevel>=Eu.Verbose&&(t=this.logger).verbose.apply(t,Su([e],wu(r),!1))},e}(),ju=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,Su([e],wu(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,Su([e],wu(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,Su([e],wu(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,Su([e],wu(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,Su([e],wu(t),!1))},e}(),Bu=function(){function e(){this.globalScope=hu()}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}(),qu=function(){function e(e,t){this.namespace=e,this.storage=t}return e.prototype.get=function(){return this.value},e.prototype.put=function(e){this.value=e},e.prototype.load=function(){var e=this.storage.get(this.namespace);e&&(this.value=JSON.parse(e))},e.prototype.store=function(){void 0===this.value?this.storage.delete(this.namespace):this.storage.put(this.namespace,JSON.stringify(this.value))},e}(),zu=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 mu({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=bu(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=bu(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}(),Vu=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}},Wu=function(){function e(){this.globalScope=hu()}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}(),$u=function(e){return null==e},Ku=function(e){return!!$u(e)||e&&0===Object.keys(e).length},Hu=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},Ju=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 vu(this,void 0,void 0,function(){return yu(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 vu(this,void 0,void 0,function(){var n=this;return yu(this,function(i){return this.done||(this.timeoutHandle=cu.setTimeout(function(){return vu(n,void 0,void 0,function(){var n,i;return yu(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}(),Gu=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},Yu=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},Xu=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}(),Qu=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}(),Zu=function(){function e(t,r){var n,i,o,s,a=this;this.engine=new jl,this.isRunning=!1,this.apiKey=t,r=function(e){var t,r;if(!e||"object"!=typeof e)return{};var n={};try{for(var i=bu(Object.entries(e)),o=i.next();!o.done;o=i.next()){var s=wu(o.value,2),a=s[0],l=s[1];$u(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=mu(mu(mu({},Mu),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":Mu.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":Mu.flagsServerUrl),flagConfigPollingIntervalMillis:r.flagConfigPollingIntervalMillis<6e4?6e4:null!==(o=r.flagConfigPollingIntervalMillis)&&void 0!==o?o:Mu.flagConfigPollingIntervalMillis}),this.logger=new Fu(this.config.loggerProvider||new ju,e.getLogLevel(r));var l=null===(s=this.config)||void 0===s?void 0:s.internalInstanceNameSuffix;if(this.isWebExperiment="web"===l,this.poller=new du(function(){return a.doFlags()},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var u in this.config.initialVariants)this.config.initialVariants[u]=Vu(this.config.initialVariants[u]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new Xu(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new Qu(this.config.exposureTrackingProvider)),this.integrationManager=new Nu(this.config,this);var c,h=new Tu(this.config.httpClient||Ru);this.flagApi=new uu(this.apiKey,this.config.flagsServerUrl,h),this.evaluationApi=new lu(this.apiKey,this.config.serverUrl,h);var d=l?"".concat(this.config.instanceName,"-").concat(l):this.config.instanceName;c=this.isWebExperiment?new Wu:new Bu,this.variants=function(e,t,r){var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n);return new zu(i,r,Vu)}(this.apiKey,d,c),this.flags=function(e,t,r){void 0===r&&(r=new Bu);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-flags");return new zu(i,r)}(this.apiKey,d,c),this.fetchVariantsOptions=function(e,t,r){void 0===r&&(r=new Bu);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-variants-options");return new qu(i,r)}(this.apiKey,d,c);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return vu(this,void 0,void 0,function(){var t,r,n;return yu(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 vu(this,arguments,void 0,function(e,t){var r;return void 0===e&&(e=this.user),yu(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 au?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);Hu(r)||delete e[t]}return mu(mu(mu({},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=mu({},this.user.user_properties);return mu(mu({},this.user),{user_properties:t})}return mu({},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=mu({},e.user_properties);this.user=mu(mu({},e),{user_properties:r})}else this.user=mu({},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=rl({},e),o=[],s=t||Object.keys(i);try{for(var a=ol(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=Bl(u,i);c&&o.push.apply(o,al([],sl(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=hu();s&&(o.page={url:s.location.href});var a={};if(!e.groups)return o;try{for(var l=bu(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=bu(Object.keys(s)),u=l.next();!u.done;u=l.next()){var c=u.value;a[c]=Yu(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===Ou.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===Ou.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var n=this.flags.get(e);return(Hu(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=Iu.LocalEvaluation,a=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!$u(o)&&!a)return{variant:Gu(o),source:s,hasDefaultVariant:!1};if(a&&(i={variant:Gu(o),source:s,hasDefaultVariant:!0}),!$u(r))return{variant:Gu(r),source:Iu.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!$u(l))return{variant:Gu(l),source:Iu.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=Gu(this.config.fallbackVariant),c={variant:u,source:Iu.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return Ku(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(!$u(i)&&!o)return{variant:Gu(i),source:Iu.LocalStorage,hasDefaultVariant:!1};if(o&&(n={variant:Gu(i),source:Iu.LocalStorage,hasDefaultVariant:!0}),!$u(t))return{variant:Gu(t),source:Iu.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=this.config.initialVariants[e];if(!$u(s))return{variant:Gu(s),source:Iu.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var a=Gu(this.config.fallbackVariant),l={variant:a,source:Iu.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return Ku(a)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!$u(i))return{variant:Gu(i),source:Iu.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(!$u(o)&&!s)return{variant:Gu(o),source:Iu.LocalStorage,hasDefaultVariant:!1};if(s&&(n={variant:Gu(o),source:Iu.LocalStorage,hasDefaultVariant:!0}),!$u(t))return{variant:Gu(t),source:Iu.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var a=Gu(this.config.fallbackVariant),l={variant:a,source:Iu.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return Ku(a)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return vu(this,void 0,void 0,function(){var i,o,s;return yu(this,function(a){switch(a.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.logger.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.doFetch(e,t,mu({trackingOption:null===(s=this.fetchVariantsOptions.get())||void 0===s?void 0:s.trackingOption},n))];case 2:return i=a.sent(),[4,this.storeVariants(i,n)];case 3:return a.sent(),[2,i];case 4:throw o=a.sent(),r&&this.shouldRetryFetch(o)&&this.startRetries(e,n),o;case 5:return[2]}})})},e.prototype.setTracksAssignment=function(e){return vu(this,void 0,void 0,function(){return yu(this,function(t){return this.fetchVariantsOptions.put(mu(mu({},this.fetchVariantsOptions.get()||{}),{trackingOption:e?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]})})},e.prototype.cleanUserPropsForFetch=function(e){var t=mu({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return vu(this,void 0,void 0,function(){var n,i,o,s,a,l,u;return yu(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,mu({timeoutMillis:t},r))];case 2:n=c.sent(),i={};try{for(o=bu(Object.keys(n)),s=o.next();!s.done;s=o.next())a=s.value,i[a]=Yu(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 vu(this,void 0,void 0,function(){var e,t,r;return yu(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:_u,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 au))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 vu(this,void 0,void 0,function(){var r,n,i,o;return yu(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 vu(this,void 0,void 0,function(){var r=this;return yu(this,function(n){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new Ju(8,500,1e4,1.5),this.retriesBackoff.start(function(){return vu(r,void 0,void 0,function(){return yu(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=mu(mu(mu({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return mu(mu(mu(mu({library:"experiment-js-client/".concat(_u)},r),n),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return vu(this,void 0,void 0,function(){return yu(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==Ou.LocalStorage?this.variants.getAll():this.config.source==Ou.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==Ou.LocalStorage?this.config.initialVariants:this.config.source==Ou.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=Au(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=hu();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);Au(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?Eu.Debug:null!==(t=e.logLevel)&&void 0!==t?t:Eu.Error},e.prototype.shouldRetryFetch=function(e){return!(e instanceof su)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),ec=function(){function e(e,t){var r,n,i;this.globalScope=hu(),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 fu.UAParser(this.userAgent).getResult(),this.localStorage=new Bu,this.sessionStorage=new Wu,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 mu({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=bu(i.searchParams),s=o.next();!s.done;s=o.next()){var a=wu(s.value,2),l=a[0],u=a[1];n[l]=Su(Su([],wu(null!==(r=n[l])&&void 0!==r?r:[]),!1),wu(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=wu(t,2),n=r[0],i=r[1];return e[n]=1==i.length?i[0]:i,e},{})}},e}();cu.experimentInstances={};var tc=cu.experimentInstances,rc=function(e){return(null==e?void 0:e.instanceName)||Mu.instanceName},nc=function(e,t,r){var n=function(e,t){var r=rc(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)}(e,t),i=tc[n];return i||(i=function(e,t){return new Zu(e,mu(mu({},t),{userProvider:new ec(null==t?void 0:t.userProvider,e)}))}(e,t),r&&i.addPlugin(r()),tc[n]=i,i)},ic=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 nc(e,t,function(){return new Cu(e,ve.getInstance(rc(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}(),oc=function(e){return new ic(e)},sc=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:ac(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),ac=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},lc=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}(),uc=function(){return uc=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},uc.apply(this,arguments)};function cc(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 hc(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 dc=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=cc(["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(!dc(u,c))return!1;var h=!0;return Object.keys(e).forEach(function(r){dc(e[r],t[r])||(h=!1)}),h}for(var d=0;d<e.length;d++)if(!dc(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 pc=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=uc({},this.identity.userProperties),r=uc(uc({},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=cc(Object.entries(e)),c=u.next();!c.done;c=u.next()){var h=hc(c.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(i=void 0,cc(Object.entries(p))),g=f.next();!g.done;g=f.next()){var m=hc(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,cc(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 uc({},this.identity)},e.prototype.setIdentity=function(e){var t=uc({},this.identity);this.identity=uc({},e),dc(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}(),fc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:self,gc=function(){function e(){this.identityStore=new pc,this.eventBridge=new lc,this.applicationContextProvider=new sc}return e.getInstance=function(t){return fc.analyticsConnectorInstances||(fc.analyticsConnectorInstances={}),fc.analyticsConnectorInstances[t]||(fc.analyticsConnectorInstances[t]=new e),fc.analyticsConnectorInstances[t]},e}(),mc=["boot"];var vc=(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))(vc||{});var yc=((e=>{if(typeof window<"u"&&window.opener)for(let t of Object.values(vc))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(mc.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=gc.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)}}}):mc.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))),bc=e=>(typeof window<"u"&&!window.engagement&&(window.engagement=yc),yc.plugin(e)),wc=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(ic);return 0===e.length?void this.config.loggerProvider.debug("".concat(ic.pluginName," plugin is not found.")):1===e.length?e[0].experiment:void this.config.loggerProvider.debug("Multiple instances of ".concat(ic.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){return a(this,void 0,void 0,function(){var t;return l(this,function(r){return e.library="".concat("amplitude-ts-unified","/").concat("1.0.0-feat-zoning-alpha.0","-").concat(null!==(t=e.library)&&void 0!==t?t:""),[2,e]})})}}),[4,e.prototype.init.call(this,t,o(o({},null==r?void 0:r.analytics),n)).promise];case 1:return s.sent(),[4,e.prototype.add.call(this,(u=o(o({},null==r?void 0:r.sessionReplay),n),new Za(u))).promise];case 2:return s.sent(),[4,e.prototype.add.call(this,oc(o(o({},null==r?void 0:r.experiment),n))).promise];case 3:return s.sent(),void 0===(i=this.plugin(Za.pluginName))?this.config.loggerProvider.debug("".concat(Za.pluginName," plugin is not found.")):this._sessionReplay=i.sessionReplay,[4,e.prototype.add.call(this,bc(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}(So),Sc=function(){var e=new wc;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"]))}},kc=Sc(),xc=kc._setDiagnosticsSampleRate,Cc=kc.initAll,Ec=kc.experiment,Oc=kc.sessionReplay,Ic=kc.add,Pc=kc.extendSession,Tc=kc.flush,Rc=kc.getDeviceId,Ac=kc.getSessionId,Mc=kc.getUserId,_c=kc.groupIdentify,Nc=kc.identify,Lc=kc.logEvent,Dc=kc.remove,Uc=kc.reset,Fc=kc.revenue,jc=kc.setDeviceId,Bc=kc.setGroup,qc=kc.setOptOut,zc=kc.setSessionId,Vc=kc.setTransport,Wc=kc.setUserId,$c=kc.track,Kc=function(e,t){return Kc=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])},Kc(e,t)};var Hc=function(){return Hc=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},Hc.apply(this,arguments)};function Jc(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}"function"==typeof SuppressedError&&SuppressedError;var Gc="is",Yc="is not",Xc="contains",Qc="does not contain",Zc="less",eh="less or equal",th="greater",rh="greater or equal",nh="version less",ih="version less or equal",oh="version greater",sh="version greater or equal",ah="set is",lh="set is not",uh="set contains",ch="set does not contain",hh="set contains any",dh="set does not contain any",ph="regex match",fh="regex does not match",gh=-862048943,mh=461845907,vh=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=Sh(r,s<<2);o=yh(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,gh),u=wh(u,15),o^=u=Math.imul(u,mh);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,gh),u=wh(u,15),o^=u=Math.imul(u,mh);break;case 1:u^=r[l],u=Math.imul(u,gh),u=wh(u,15),o^=u=Math.imul(u,mh)}return bh(o^=n)>>>0},yh=function(e,t){var r=e,n=t;return r=Math.imul(r,gh),r=wh(r,15),r=Math.imul(r,mh),n=wh(n^=r,13),(n=Math.imul(n,5))+-430675100|0},bh=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},wh=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},Sh=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 kh(r)},kh=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},xh=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=Jc(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}},Ch="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),Eh=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(Ch).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}(),Oh=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var s=Jc(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=Jc(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=Hc(Hc(Hc({},t.metadata),a.metadata),i.metadata);i=Hc(Hc({},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=Jc(r.conditions),l=a.next();!l.done;l=a.next()){var u,c=l.value,h=!0;try{for(var d=(o=void 0,Jc(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=xh(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 vh(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var s=this.coerceString(xh(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=Jc(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,Jc(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 Gc:case Xc:case Zc:case eh:case th:case rh:case nh:case ih:case oh:case sh:case ah:case uh:case hh:return r;case Yc:case Qc:case ch:case dh:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case ah:return this.setEquals(e,r);case lh:return!this.setEquals(e,r);case uh:return this.matchesSetContainsAll(e,r);case ch:return!this.matchesSetContainsAll(e,r);case hh:return this.matchesSetContainsAny(e,r);case dh:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Gc:return this.matchesIs(e,r);case Yc:return!this.matchesIs(e,r);case Xc:return this.matchesContains(e,r);case Qc:return!this.matchesContains(e,r);case Zc:case eh:case th:case rh:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case nh:case ih:case oh:case sh:return this.matchesComparable(e,t,r,function(e){return Eh.parse(e)},this.versionComparator);case ph:return this.matchesRegex(e,r);case fh: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=Jc(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 Zc:case nh:return e<r;case eh:case ih:return e<=r;case th:case oh:return e>r;case rh:case sh:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Zc:case nh:return n<0;case eh:case ih:return n<=0;case th:case oh:return n>0;case rh:case sh: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 ah:case lh:case uh:case ch:case hh:case dh: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=Jc(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=Jc(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}Kc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var Ih,Ph=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,js(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]}})})}},Th=new Ph,Rh=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,Th.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 Oh},Ah=function(){var e=new Rh;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,Mh=Object.freeze({__proto__:null,evaluateTargeting:Ah}),_h=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,!0)};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'}),Nh=Object.defineProperty,Lh=(e,t,r)=>((e,t,r)=>t in e?Nh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Dh=Object.defineProperty,Uh=(e,t,r)=>((e,t,r)=>t in e?Dh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Fh=Object.defineProperty,jh=(e,t,r)=>((e,t,r)=>t in e?Fh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const Bh={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},qh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},zh={};function Vh(e){if(zh[e])return zh[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 Bh?Bh[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 qh?qh[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 zh[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?zh[e]=o:r}catch{return r}}const Wh={};function $h(e,t,r){var n;const i=`${e}.${String(r)}`;if(Wh[i])return Wh[i].call(t);const o=Vh(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Wh[i]=s,s.call(t)):t[r]}const Kh={};function Hh(e,t,r){const n=`${e}.${String(r)}`;if(Kh[n])return Kh[n].bind(t);const i=Vh(e)[r];return"function"!=typeof i?t[r]:(Kh[n]=i,i.bind(t))}const Jh={childNodes:function(e){return $h("Node",e,"childNodes")},parentNode:function(e){return $h("Node",e,"parentNode")},parentElement:function(e){return $h("Node",e,"parentElement")},textContent:function(e){return $h("Node",e,"textContent")},contains:function(e,t){return Hh("Node",e,"contains")(t)},getRootNode:function(e){return Hh("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?$h("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?$h("Element",e,"shadowRoot"):null},querySelector:function(e,t){return $h("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return $h("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Vh("MutationObserver").constructor}};class Gh{constructor(){jh(this,"idNodeMap",new Map),jh(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 Yh(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Yh(Jh.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Yh(Jh.parentNode(e),t,r)}function Xh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qh(e){if(Object.prototype.hasOwnProperty.call(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 Zh,ed={exports:{}};function td(){if(Zh)return ed.exports;Zh=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return ed.exports=t(),ed.exports.createColors=t,ed.exports}const rd=Qh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var nd,id;function od(){if(id)return nd;id=1;let e=td(),t=rd;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return nd=r,r.default=r,nd}var sd,ad,ld,ud,cd,hd,dd,pd,fd,gd,md,vd,yd,bd,wd,Sd,kd,xd,Cd,Ed,Od,Id,Pd,Td,Rd,Ad,Md,_d,Nd,Ld,Dd,Ud,Fd,jd,Bd,qd,zd,Vd,Wd,$d,Kd,Hd,Jd,Gd,Yd,Xd,Qd,Zd,ep,tp,rp,np,ip,op={};function sp(){return sd||(sd=1,op.isClean=Symbol("isClean"),op.my=Symbol("my")),op}function ap(){if(ld)return ad;ld=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}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)}}return ad=t,t.default=t,ad}function lp(){if(cd)return ud;cd=1;let e=ap();function t(t,r){new e(r).stringify(t)}return ud=t,t.default=t,ud}function up(){if(dd)return hd;dd=1;let{isClean:e,my:t}=sp(),r=od(),n=ap(),i=lp();function o(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],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=i){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}}return hd=s,s.default=s,hd}function cp(){if(fd)return pd;fd=1;let e=up();class t extends e{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]}}return pd=t,t.default=t,pd}function hp(){if(md)return gd;md=1;return gd={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}},gd}function dp(){if(yd)return vd;yd=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=rd,{existsSync:r,readFileSync:n}=rd,{dirname:i,join:o}=rd;class s{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=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return vd=s,s.default=s,vd}function pp(){if(wd)return bd;wd=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=rd,{fileURLToPath:r,pathToFileURL:n}=rd,{isAbsolute:i,resolve:o}=rd,{nanoid:s}=hp(),a=rd,l=od(),u=dp(),c=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&i);class p{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&&(!d||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new u(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,i={}){let o,s,a;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);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];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[c]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=u.sourceContentFor(c.source);return d&&(h.source=d),h}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}}return bd=p,p.default=p,a&&a.registerInput&&a.registerInput(p),bd}function fp(){if(kd)return Sd;kd=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=rd,{dirname:r,relative:n,resolve:i,sep:o}=rd,{pathToFileURL:s}=rd,a=pp(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return Sd=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 t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}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(),u&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.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?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}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 a(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(s){let t=s(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Sd}function gp(){if(Cd)return xd;Cd=1;let e=up();class t extends e{constructor(e){super(e),this.type="comment"}}return xd=t,t.default=t,xd}function mp(){if(Od)return Ed;Od=1;let e,t,r,n,{isClean:i,my:o}=sp(),s=cp(),a=gp(),l=up();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class h extends l{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(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},Ed=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},Ed}function vp(){if(Pd)return Id;Pd=1;let e,t,r=mp();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Id=n,n.default=n,Id}function yp(){if(Rd)return Td;Rd=1;let e={};return Td=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function bp(){if(Md)return Ad;Md=1;class e{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}}return Ad=e,e.default=e,Ad}function wp(){if(Nd)return _d;Nd=1;let e=bp();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return _d=t,t.default=t,_d}function Sp(){if(Fd)return Ud;Fd=1;let e=mp();class t extends e{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)}}return Ud=t,t.default=t,e.registerAtRule(t),Ud}function kp(){if(Bd)return jd;Bd=1;let e,t,r=mp();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},jd=n,n.default=n,r.registerRoot(n),jd}function xp(){if(zd)return qd;zd=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return qd=e,e.default=e,qd}function Cp(){if(Wd)return Vd;Wd=1;let e=mp(),t=xp();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return Vd=r,r.default=r,e.registerRule(r),Vd}function Ep(){if(Kd)return $d;Kd=1;let e=cp(),t=function(){if(Dd)return Ld;Dd=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),m="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,k=/[\da-f]/i;return Ld=function(x,C={}){let E,O,I,P,T,R,A,M,_,N,L=x.css.valueOf(),D=C.ignoreErrors,U=L.length,F=0,j=[],B=[];function q(e){throw x.error("Unclosed "+e,F)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&F>=U},nextToken:function(x){if(B.length)return B.pop();if(F>=U)return;let C=!!x&&x.ignoreUnclosed;switch(E=L.charCodeAt(F),E){case i:case o:case a:case l:case s:O=F;do{O+=1,E=L.charCodeAt(O)}while(E===o||E===i||E===a||E===l||E===s);N=["space",L.slice(F,O)],F=O-1;break;case u:case c:case p:case f:case v:case g:case d:{let e=String.fromCharCode(E);N=[e,e,F];break}case h:if(M=j.length?j.pop()[1]:"",_=L.charCodeAt(F+1),"url"===M&&_!==e&&_!==t&&_!==o&&_!==i&&_!==a&&_!==s&&_!==l){O=F;do{if(R=!1,O=L.indexOf(")",O+1),-1===O){if(D||C){O=F;break}q("bracket")}for(A=O;L.charCodeAt(A-1)===r;)A-=1,R=!R}while(R);N=["brackets",L.slice(F,O+1),F,O],F=O}else O=L.indexOf(")",F+1),P=L.slice(F,O+1),-1===O||S.test(P)?N=["(","(",F]:(N=["brackets",P,F,O],F=O);break;case e:case t:I=E===e?"'":'"',O=F;do{if(R=!1,O=L.indexOf(I,O+1),-1===O){if(D||C){O=F+1;break}q("string")}for(A=O;L.charCodeAt(A-1)===r;)A-=1,R=!R}while(R);N=["string",L.slice(F,O+1),F,O],F=O;break;case y:b.lastIndex=F+1,b.test(L),O=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(F,O+1),F,O],F=O;break;case r:for(O=F,T=!0;L.charCodeAt(O+1)===r;)O+=1,T=!T;if(E=L.charCodeAt(O+1),T&&E!==n&&E!==o&&E!==i&&E!==a&&E!==l&&E!==s&&(O+=1,k.test(L.charAt(O)))){for(;k.test(L.charAt(O+1));)O+=1;L.charCodeAt(O+1)===o&&(O+=1)}N=["word",L.slice(F,O+1),F,O],F=O;break;default:E===n&&L.charCodeAt(F+1)===m?(O=L.indexOf("*/",F+2)+1,0===O&&(D||C?O=L.length:q("comment")),N=["comment",L.slice(F,O+1),F,O],F=O):(w.lastIndex=F+1,w.test(L),O=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(F,O+1),F,O],j.push(N),F=O)}return F++,N},position:function(){return F}}}}(),r=gp(),n=Sp(),i=kp(),o=Cp();const s={empty:!0,space:!0};return $d=class{constructor(e){this.input=e,this.root=new i,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,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,u=r.length,c="",h=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?h=!1:c+=i[1]):c+=i[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;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})}},$d}function Op(){if(Jd)return Hd;Jd=1;let e=mp(),t=Ep(),r=pp();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return Hd=n,n.default=n,e.registerParse(n),Hd}function Ip(){if(Yd)return Gd;Yd=1;let{isClean:e,my:t}=sp(),r=fp(),n=lp(),i=mp(),o=vp(),s=yp(),a=wp(),l=Op(),u=kp();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[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 g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>m(e)),t}let v={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=m(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=m(r);this.result=new a(e,o,n),this.helpers={...v,postcss:v,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return y.registerPostcss=e=>{v=e},Gd=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),Gd}function Pp(){if(ep)return Zd;ep=1;let e=function(){if(Qd)return Xd;Qd=1;let e=fp(),t=lp(),r=yp(),n=Op();const i=wp();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.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||r("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=n;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"}}return Xd=o,o.default=o,Xd}(),t=Ip(),r=vp(),n=kp();class i{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Zd=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),Zd}const Tp=Xh(function(){if(ip)return np;ip=1;let e=od(),t=cp(),r=Ip(),n=mp(),i=Pp(),o=lp(),s=function(){if(rp)return tp;rp=1;let e=cp(),t=dp(),r=gp(),n=Sp(),i=pp(),o=kp(),s=Cp();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...h}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,u))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=u[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new s(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return tp=a,a.default=a,tp}(),a=vp(),l=bp(),u=gp(),c=Sp(),h=wp(),d=pp(),p=Op(),f=xp(),g=Cp(),m=kp(),v=up();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new m(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=h,y.Input=d,y.Rule=g,y.Root=m,y.Node=v,r.registerPostcss(y),np=y,y.default=y,np}());Tp.stringify,Tp.fromJSON,Tp.plugin,Tp.parse,Tp.list,Tp.document,Tp.comment,Tp.atRule,Tp.rule,Tp.decl,Tp.root,Tp.CssSyntaxError,Tp.Declaration,Tp.Container,Tp.Processor,Tp.Document,Tp.Comment,Tp.Warning,Tp.AtRule,Tp.Result,Tp.Input,Tp.Rule,Tp.Root,Tp.Node;var Rp=Object.defineProperty,Ap=(e,t,r)=>((e,t,r)=>t in e?Rp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Mp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _p(e){if(Object.prototype.hasOwnProperty.call(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 Np,Lp={exports:{}};function Dp(){if(Np)return Lp.exports;Np=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Lp.exports=t(),Lp.exports.createColors=t,Lp.exports}const Up=_p(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Fp,jp;function Bp(){if(jp)return Fp;jp=1;let e=Dp(),t=Up;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Fp=r,r.default=r,Fp}var qp,zp,Vp,Wp,$p,Kp,Hp,Jp,Gp,Yp,Xp,Qp,Zp,ef,tf,rf,nf,of,sf,af,lf,uf,cf,hf,df,pf,ff,gf,mf,vf,yf,bf,wf,Sf,kf,xf,Cf,Ef,Of,If,Pf,Tf,Rf,Af,Mf,_f,Nf,Lf,Df,Uf,Ff,jf,Bf,qf={};function zf(){return qp||(qp=1,qf.isClean=Symbol("isClean"),qf.my=Symbol("my")),qf}function Vf(){if(Vp)return zp;Vp=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}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)}}return zp=t,t.default=t,zp}function Wf(){if($p)return Wp;$p=1;let e=Vf();function t(t,r){new e(r).stringify(t)}return Wp=t,t.default=t,Wp}function $f(){if(Hp)return Kp;Hp=1;let{isClean:e,my:t}=zf(),r=Bp(),n=Vf(),i=Wf();function o(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],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=i){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}}return Kp=s,s.default=s,Kp}function Kf(){if(Gp)return Jp;Gp=1;let e=$f();class t extends e{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]}}return Jp=t,t.default=t,Jp}function Hf(){if(Xp)return Yp;Xp=1;return Yp={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}},Yp}function Jf(){if(Zp)return Qp;Zp=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Up,{existsSync:r,readFileSync:n}=Up,{dirname:i,join:o}=Up;class s{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=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Qp=s,s.default=s,Qp}function Gf(){if(tf)return ef;tf=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Up,{fileURLToPath:r,pathToFileURL:n}=Up,{isAbsolute:i,resolve:o}=Up,{nanoid:s}=Hf(),a=Up,l=Bp(),u=Jf(),c=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&i);class p{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&&(!d||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new u(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,i={}){let o,s,a;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);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];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[c]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=u.sourceContentFor(c.source);return d&&(h.source=d),h}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}}return ef=p,p.default=p,a&&a.registerInput&&a.registerInput(p),ef}function Yf(){if(nf)return rf;nf=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Up,{dirname:r,relative:n,resolve:i,sep:o}=Up,{pathToFileURL:s}=Up,a=Gf(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return rf=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 t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}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(),u&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.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?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}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 a(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(s){let t=s(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},rf}function Xf(){if(sf)return of;sf=1;let e=$f();class t extends e{constructor(e){super(e),this.type="comment"}}return of=t,t.default=t,of}function Qf(){if(lf)return af;lf=1;let e,t,r,n,{isClean:i,my:o}=zf(),s=Kf(),a=Xf(),l=$f();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class h extends l{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(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},af=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},af}function Zf(){if(cf)return uf;cf=1;let e,t,r=Qf();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},uf=n,n.default=n,uf}function eg(){if(df)return hf;df=1;let e={};return hf=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function tg(){if(ff)return pf;ff=1;class e{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}}return pf=e,e.default=e,pf}function rg(){if(mf)return gf;mf=1;let e=tg();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return gf=t,t.default=t,gf}function ng(){if(wf)return bf;wf=1;let e=Qf();class t extends e{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)}}return bf=t,t.default=t,e.registerAtRule(t),bf}function ig(){if(kf)return Sf;kf=1;let e,t,r=Qf();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Sf=n,n.default=n,r.registerRoot(n),Sf}function og(){if(Cf)return xf;Cf=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return xf=e,e.default=e,xf}function sg(){if(Of)return Ef;Of=1;let e=Qf(),t=og();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return Ef=r,r.default=r,e.registerRule(r),Ef}function ag(){if(Pf)return If;Pf=1;let e=Kf(),t=function(){if(yf)return vf;yf=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),m="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,k=/[\da-f]/i;return vf=function(x,C={}){let E,O,I,P,T,R,A,M,_,N,L=x.css.valueOf(),D=C.ignoreErrors,U=L.length,F=0,j=[],B=[];function q(e){throw x.error("Unclosed "+e,F)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&F>=U},nextToken:function(x){if(B.length)return B.pop();if(F>=U)return;let C=!!x&&x.ignoreUnclosed;switch(E=L.charCodeAt(F),E){case i:case o:case a:case l:case s:O=F;do{O+=1,E=L.charCodeAt(O)}while(E===o||E===i||E===a||E===l||E===s);N=["space",L.slice(F,O)],F=O-1;break;case u:case c:case p:case f:case v:case g:case d:{let e=String.fromCharCode(E);N=[e,e,F];break}case h:if(M=j.length?j.pop()[1]:"",_=L.charCodeAt(F+1),"url"===M&&_!==e&&_!==t&&_!==o&&_!==i&&_!==a&&_!==s&&_!==l){O=F;do{if(R=!1,O=L.indexOf(")",O+1),-1===O){if(D||C){O=F;break}q("bracket")}for(A=O;L.charCodeAt(A-1)===r;)A-=1,R=!R}while(R);N=["brackets",L.slice(F,O+1),F,O],F=O}else O=L.indexOf(")",F+1),P=L.slice(F,O+1),-1===O||S.test(P)?N=["(","(",F]:(N=["brackets",P,F,O],F=O);break;case e:case t:I=E===e?"'":'"',O=F;do{if(R=!1,O=L.indexOf(I,O+1),-1===O){if(D||C){O=F+1;break}q("string")}for(A=O;L.charCodeAt(A-1)===r;)A-=1,R=!R}while(R);N=["string",L.slice(F,O+1),F,O],F=O;break;case y:b.lastIndex=F+1,b.test(L),O=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(F,O+1),F,O],F=O;break;case r:for(O=F,T=!0;L.charCodeAt(O+1)===r;)O+=1,T=!T;if(E=L.charCodeAt(O+1),T&&E!==n&&E!==o&&E!==i&&E!==a&&E!==l&&E!==s&&(O+=1,k.test(L.charAt(O)))){for(;k.test(L.charAt(O+1));)O+=1;L.charCodeAt(O+1)===o&&(O+=1)}N=["word",L.slice(F,O+1),F,O],F=O;break;default:E===n&&L.charCodeAt(F+1)===m?(O=L.indexOf("*/",F+2)+1,0===O&&(D||C?O=L.length:q("comment")),N=["comment",L.slice(F,O+1),F,O],F=O):(w.lastIndex=F+1,w.test(L),O=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(F,O+1),F,O],j.push(N),F=O)}return F++,N},position:function(){return F}}}}(),r=Xf(),n=ng(),i=ig(),o=sg();const s={empty:!0,space:!0};return If=class{constructor(e){this.input=e,this.root=new i,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,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,u=r.length,c="",h=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?h=!1:c+=i[1]):c+=i[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;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})}},If}function lg(){if(Rf)return Tf;Rf=1;let e=Qf(),t=ag(),r=Gf();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return Tf=n,n.default=n,e.registerParse(n),Tf}function ug(){if(Mf)return Af;Mf=1;let{isClean:e,my:t}=zf(),r=Yf(),n=Wf(),i=Qf(),o=Zf(),s=eg(),a=rg(),l=lg(),u=ig();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[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 g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>m(e)),t}let v={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=m(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=m(r);this.result=new a(e,o,n),this.helpers={...v,postcss:v,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return y.registerPostcss=e=>{v=e},Af=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),Af}function cg(){if(Df)return Lf;Df=1;let e=function(){if(Nf)return _f;Nf=1;let e=Yf(),t=Wf(),r=eg(),n=lg();const i=rg();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.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||r("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=n;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"}}return _f=o,o.default=o,_f}(),t=ug(),r=Zf(),n=ig();class i{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Lf=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),Lf}const hg=Mp(function(){if(Bf)return jf;Bf=1;let e=Bp(),t=Kf(),r=ug(),n=Qf(),i=cg(),o=Wf(),s=function(){if(Ff)return Uf;Ff=1;let e=Kf(),t=Jf(),r=Xf(),n=ng(),i=Gf(),o=ig(),s=sg();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...h}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,u))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=u[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new s(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return Uf=a,a.default=a,Uf}(),a=Zf(),l=tg(),u=Xf(),c=ng(),h=rg(),d=Gf(),p=lg(),f=og(),g=sg(),m=ig(),v=$f();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new m(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=h,y.Input=d,y.Rule=g,y.Root=m,y.Node=v,r.registerPostcss(y),jf=y,y.default=y,jf}());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;class dg{constructor(...e){Ap(this,"parentElement",null),Ap(this,"parentNode",null),Ap(this,"ownerDocument"),Ap(this,"firstChild",null),Ap(this,"lastChild",null),Ap(this,"previousSibling",null),Ap(this,"nextSibling",null),Ap(this,"ELEMENT_NODE",1),Ap(this,"TEXT_NODE",3),Ap(this,"nodeType"),Ap(this,"nodeName"),Ap(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 dg))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 pg={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},fg={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},gg={};function mg(e){if(gg[e])return gg[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 pg?pg[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 fg?fg[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 gg[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?gg[e]=o:r}catch{return r}}const vg={};function yg(e,t,r){var n;const i=`${e}.${String(r)}`;if(vg[i])return vg[i].call(t);const o=mg(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(vg[i]=s,s.call(t)):t[r]}const bg={};function wg(e,t,r){const n=`${e}.${String(r)}`;if(bg[n])return bg[n].bind(t);const i=mg(e)[r];return"function"!=typeof i?t[r]:(bg[n]=i,i.bind(t))}const Sg={childNodes:function(e){return yg("Node",e,"childNodes")},parentNode:function(e){return yg("Node",e,"parentNode")},parentElement:function(e){return yg("Node",e,"parentElement")},textContent:function(e){return yg("Node",e,"textContent")},contains:function(e,t){return wg("Node",e,"contains")(t)},getRootNode:function(e){return wg("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?yg("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?yg("Element",e,"shadowRoot"):null},querySelector:function(e,t){return yg("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return yg("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return mg("MutationObserver").constructor}};const kg="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 xg={map:{},getId:()=>(console.error(kg),-1),getNode:()=>(console.error(kg),null),removeNodeFromMap(){console.error(kg)},has:()=>(console.error(kg),!1),reset(){console.error(kg)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(xg=new Proxy(xg,{get:(e,t,r)=>("map"===t&&console.error(kg),Reflect.get(e,t,r))}));let Cg=Date.now;function Eg(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Sg.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Cg=()=>(new Date).getTime());function Og(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Sg.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Sg.host(Sg.getRootNode(e))&&(r=Sg.host(Sg.getRootNode(e))),r}function Ig(e){let t,r=e;for(;t=Og(r);)r=t;return r}function Pg(e){const t=e.ownerDocument;if(!t)return!1;const r=Ig(e);return Sg.contains(t,r)}const Tg=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Uh(this,"id",1),Uh(this,"styleIDMap",new WeakMap),Uh(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 xg},closestElementOfNode:Eg,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:Ig,getShadowHost:Og,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=Sg.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=Sg.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 dg&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Sg.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&&(Sg.contains(t,e)||Pg(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&Jh.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Jh.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const i=Sg.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=Eg(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(Yh(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 Cg},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:Pg,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 Rg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ag="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Mg=0;Mg<64;Mg++)Ag[Rg.charCodeAt(Mg)]=Mg;"undefined"!=typeof self&&self.Blob&&new Blob(['(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n'],{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)}var _g,Ng;new Gh,(Ng=_g||(_g={}))[Ng.NotStarted=0]="NotStarted",Ng[Ng.Running=1]="Running",Ng[Ng.Stopped=2]="Stopped";class Lg{constructor(e){Lh(this,"fileName"),Lh(this,"functionName"),Lh(this,"lineNumber"),Lh(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 Dg=/(^|@)\S+:\d+/,Ug=/^\s*at .*(\S+:\d+|\(native\))/m,Fg=/^(eval@)?(\[native code])?$/,jg={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ug)?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(Ug)},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 Lg({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(Fg)},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 Lg({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Lg({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 Lg({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 Lg({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(Dg)&&!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 Lg({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Bg(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 qg(e){return"[object Object]"===Object.prototype.toString.call(e)}function zg(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(qg(e[n])&&zg(e[n],t-1))return!0;return!1}function Vg(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(qg(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(qg(e)&&zg(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]=Bg(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 Wg={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 $g(e,t,r){const n=r?Object.assign({},Wg,r):Wg,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=jg.parse(i).map(e=>e.toString()),s=[Vg(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=[Vg(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,i=[Vg("Uncaught (in promise)",n.stringifyOptions),Vg(t.reason,n.stringifyOptions)]);const o=jg.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]?Tg.patch(t,r,t=>(...i)=>{if(t.apply(this,i),!("assert"===r&&i[0]||a)){a=!0;try{const t=jg.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?i.slice(1):i).map(e=>Vg(e,n.stringifyOptions));s++,s<n.lengthThreshold?e({level:r,trace:t,payload:o}):s===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Vg("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...i)}finally{a=!1}}}):()=>{}}}const Kg="rrweb/console@1";var Hg,Jg=Object.freeze({__proto__:null,PLUGIN_NAME:Kg,getRecordConsolePlugin:e=>({name:Kg,observer:$g,options:e})}),Gg=Object.defineProperty,Yg=(e,t,r)=>((e,t,r)=>t in e?Gg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Xg=Object.defineProperty,Qg=(e,t,r)=>((e,t,r)=>t in e?Xg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Zg=(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))(Zg||{});const em={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},tm={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},rm={};function nm(e){if(rm[e])return rm[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 em?em[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 tm?tm[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 rm[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?rm[e]=o:r}catch{return r}}const im={};function om(e,t,r){var n;const i=`${e}.${String(r)}`;if(im[i])return im[i].call(t);const o=nm(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(im[i]=s,s.call(t)):t[r]}const sm={};function am(e,t,r){const n=`${e}.${String(r)}`;if(sm[n])return sm[n].bind(t);const i=nm(e)[r];return"function"!=typeof i?t[r]:(sm[n]=i,i.bind(t))}const lm={childNodes:function(e){return om("Node",e,"childNodes")},parentNode:function(e){return om("Node",e,"parentNode")},parentElement:function(e){return om("Node",e,"parentElement")},textContent:function(e){return om("Node",e,"textContent")},contains:function(e,t){return am("Node",e,"contains")(t)},getRootNode:function(e){return am("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?om("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?om("Element",e,"shadowRoot"):null},querySelector:function(e,t){return om("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return om("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return nm("MutationObserver").constructor}};function um(e){return e.nodeType===e.ELEMENT_NODE}function cm(e){const t=e&&"host"in e&&"mode"in e&&lm.host(e)||null;return Boolean(t&&"shadowRoot"in t&&lm.shadowRoot(t)===e)}function hm(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function dm(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=>pm(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 pm(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=dm(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?Cm(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?Cm(r,t):r}}class fm{constructor(){Qg(this,"idNodeMap",new Map),Qg(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 gm({element:e,maskInputOptions:t,tagName:r,type:n,value:i,maskInputFn:o}){let s=i||"";const a=n&&mm(n);return(t[r.toLowerCase()]||a&&t[a])&&(s=o?o(s,e):"*".repeat(s.length)),s}function mm(e){return e.toLowerCase()}const vm="__rrweb_original__";function ym(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?mm(t):null}function bm(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 wm=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Sm=/^(?:[a-z+]+:)?\/\//i,km=/^www\..*/i,xm=/^(data:)([^,]*),(.*)/i;function Cm(e,t){return(e||"").replace(wm,(e,r,n,i,o,s)=>{const a=n||o||s,l=r||i||"";if(!a)return e;if(Sm.test(a)||km.test(a))return`url(${l}${a}${l})`;if(xm.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 Em(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Om(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=Em(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=Em(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=Em(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=Em(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 Im="lightgrey";let Pm=1;const Tm=new RegExp("[^a-z0-9-_:]");function Rm(){return Pm++}let Am,Mm;const _m=/^[^ \t\n\r\u000c]+/,Nm=/^[, \t\n\r\u000c]+/;const Lm=new WeakMap;function Dm(e,t){return t&&""!==t.trim()?Fm(e,t):t}function Um(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Fm(e,t){let r=Lm.get(e);if(r||(r=e.createElement("a"),Lm.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function jm(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Dm(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(Nm),!(r>=t.length);){let o=n(_m);if(","===o.slice(-1))o=Dm(e,o.substring(0,o.length-1)),i.push(o);else{let n="";o=Dm(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?Cm(n,Fm(e)):"object"===t&&"data"===r?Dm(e,n):n:Dm(e,n):n}function Bm(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function qm(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&qm(lm.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&qm(lm.parentNode(e),t,r)}function zm(e,t,r,n){let i;if(um(e)){if(i=e,!lm.childNodes(i).length)return!1}else{if(null===lm.parentElement(e))return!1;i=lm.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(qm(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 Vm(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:Zg.Document,childNodes:[],compatMode:e.compatMode}:{type:Zg.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Zg.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=mm(e.tagName);return Tm.test(t)?"div":t}(e);let v={};const y=e.attributes.length;for(let t=0;t<y;t++){const n=e.attributes[t];Bm(m,n.name,n.value)||(v[n.name]=jm(r,m,mm(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=dm(t)),n&&(delete v.rel,delete v.href,v._cssText=n)}if("style"===m&&e.sheet){let t=dm(e.sheet);t&&(e.childNodes.length>1&&(t=Om(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=gm({element:e,type:ym(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=vm in i?i[vm]: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){Am||(Am=r.createElement("canvas"),Mm=Am.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",i=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{Am.width=t.naturalWidth,Am.height=t.naturalHeight,Mm.drawImage(t,0,0),v.rr_dataURL=Am.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:Im}:{}}}"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:Zg.Element,tagName:m,attributes:v,childNodes:[],isSVG:Um(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=lm.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=lm.textContent(e),u&&l&&(l=Cm(l,Fm(t.doc))));!u&&!c&&l&&r&&(l=n?n(l,lm.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Zg.Text,textContent:l||"",rootId:i}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:y,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:Zg.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:Zg.Comment,textContent:lm.textContent(e)||"",rootId:y};default:return!1}}function Wm(e){return null==e?"":e.toLowerCase()}function $m(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:k=()=>!1,newlyAddedElement:x=!1,cssCaptured:C=!1,applyBackgroundColorToBlockedElements:E=!1}=t;let{needsMask:O}=t,{preserveWhiteSpace:I=!0}=t;if(!O){O=zm(e,s,a,void 0===O)}const P=Vm(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:O,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:k,newlyAddedElement:x,cssCaptured:C,applyBackgroundColorToBlockedElements:E});if(!P)return console.warn(e,"not serialized"),null;let T;T=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===Zg.Comment)return!0;if(e.type===Zg.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"===bm(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Wm(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Wm(e.attributes.name)||"icon"===Wm(e.attributes.rel)||"apple-touch-icon"===Wm(e.attributes.rel)||"shortcut icon"===Wm(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Wm(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Wm(e.attributes.property).match(/^(og|twitter|fb):/)||Wm(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Wm(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Wm(e.attributes.name)||"googlebot"===Wm(e.attributes.name)||"bingbot"===Wm(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Wm(e.attributes.name)||"generator"===Wm(e.attributes.name)||"framework"===Wm(e.attributes.name)||"publisher"===Wm(e.attributes.name)||"progid"===Wm(e.attributes.name)||Wm(e.attributes.property).match(/^article:/)||Wm(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Wm(e.attributes.name)||"yandex-verification"===Wm(e.attributes.name)||"csrf-token"===Wm(e.attributes.name)||"p:domain_verify"===Wm(e.attributes.name)||"verify-v1"===Wm(e.attributes.name)||"verification"===Wm(e.attributes.name)||"shopify-checkout-api-token"===Wm(e.attributes.name)))return!0}}return!1}(P,p)||!I&&P.type===Zg.Text&&!P.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Rm();const R=Object.assign(P,{id:T});if(n.add(e,R),-2===T)return null;v&&v(e);let A=!l;if(R.type===Zg.Element){A=A&&!R.needBlock,delete R.needBlock;const t=lm.shadowRoot(e);t&&hm(t)&&(R.isShadowHost=!0)}if((R.type===Zg.Document||R.type===Zg.Element)&&A){p.headWhitespace&&R.type===Zg.Element&&"head"===R.tagName&&(I=!1);const t={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:O,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:k,cssCaptured:!1,applyBackgroundColorToBlockedElements:E};if(R.type===Zg.Element&&"textarea"===R.tagName&&void 0!==R.attributes.value);else{R.type===Zg.Element&&void 0!==R.attributes._cssText&&"string"==typeof R.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(lm.childNodes(e))){const e=$m(r,t);e&&R.childNodes.push(e)}}let x=null;if(um(e)&&(x=lm.shadowRoot(e)))for(const e of Array.from(lm.childNodes(x))){const r=$m(e,t);r&&(hm(x)&&(r.isShadow=!0),R.childNodes.push(r))}}const M=lm.parentNode(e);return M&&cm(M)&&hm(M)&&(R.isShadow=!0),R.type===Zg.Element&&"iframe"===R.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let i,o=!1;try{i=n.document.readyState}catch(e){return}if("complete"!==i){const n=setTimeout(()=>{o||(t(),o=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(n),o=!0,t()})}const s="about:blank";if(n.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&y){const r=$m(t,{doc:t,mirror:n,blockClass:i,blockSelector:o,needsMask:O,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:k});r&&y(e,r)}},b),R.type===Zg.Element&&"link"===R.tagName&&"string"==typeof R.attributes.rel&&("stylesheet"===R.attributes.rel||"preload"===R.attributes.rel&&"string"==typeof R.attributes.href&&"css"===bm(R.attributes.href))&&function(e,t,r){let n,i=!1;try{n=e.sheet}catch(e){return}if(n)return;const o=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),i=!0,t()})}(e,()=>{if(w){const t=$m(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:O,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:k});t&&w(e,t)}},S),R}function Km(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Hm(e){if(Object.prototype.hasOwnProperty.call(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 Jm,Gm={exports:{}};function Ym(){if(Jm)return Gm.exports;Jm=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Gm.exports=t(),Gm.exports.createColors=t,Gm.exports}const Xm=Hm(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Qm,Zm;function ev(){if(Zm)return Qm;Zm=1;let e=Ym(),t=Xm;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Qm=r,r.default=r,Qm}var tv,rv,nv,iv,ov,sv,av,lv,uv,cv,hv,dv,pv,fv,gv,mv,vv,yv,bv,wv,Sv,kv,xv,Cv,Ev,Ov,Iv,Pv,Tv,Rv,Av,Mv,_v,Nv,Lv,Dv,Uv,Fv,jv,Bv,qv,zv,Vv,Wv,$v,Kv,Hv,Jv,Gv,Yv,Xv,Qv,Zv,ey={};function ty(){return tv||(tv=1,ey.isClean=Symbol("isClean"),ey.my=Symbol("my")),ey}function ry(){if(nv)return rv;nv=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}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)}}return rv=t,t.default=t,rv}function ny(){if(ov)return iv;ov=1;let e=ry();function t(t,r){new e(r).stringify(t)}return iv=t,t.default=t,iv}function iy(){if(av)return sv;av=1;let{isClean:e,my:t}=ty(),r=ev(),n=ry(),i=ny();function o(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],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=i){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}}return sv=s,s.default=s,sv}function oy(){if(uv)return lv;uv=1;let e=iy();class t extends e{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]}}return lv=t,t.default=t,lv}function sy(){if(hv)return cv;hv=1;return cv={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}},cv}function ay(){if(pv)return dv;pv=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Xm,{existsSync:r,readFileSync:n}=Xm,{dirname:i,join:o}=Xm;class s{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=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return dv=s,s.default=s,dv}function ly(){if(gv)return fv;gv=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Xm,{fileURLToPath:r,pathToFileURL:n}=Xm,{isAbsolute:i,resolve:o}=Xm,{nanoid:s}=sy(),a=Xm,l=ev(),u=ay(),c=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&i);class p{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&&(!d||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new u(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,i={}){let o,s,a;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);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];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[c]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=u.sourceContentFor(c.source);return d&&(h.source=d),h}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}}return fv=p,p.default=p,a&&a.registerInput&&a.registerInput(p),fv}function uy(){if(vv)return mv;vv=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Xm,{dirname:r,relative:n,resolve:i,sep:o}=Xm,{pathToFileURL:s}=Xm,a=ly(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return mv=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 t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}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(),u&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.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?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}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 a(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(s){let t=s(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},mv}function cy(){if(bv)return yv;bv=1;let e=iy();class t extends e{constructor(e){super(e),this.type="comment"}}return yv=t,t.default=t,yv}function hy(){if(Sv)return wv;Sv=1;let e,t,r,n,{isClean:i,my:o}=ty(),s=oy(),a=cy(),l=iy();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class h extends l{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(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},wv=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},wv}function dy(){if(xv)return kv;xv=1;let e,t,r=hy();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},kv=n,n.default=n,kv}function py(){if(Ev)return Cv;Ev=1;let e={};return Cv=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function fy(){if(Iv)return Ov;Iv=1;class e{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}}return Ov=e,e.default=e,Ov}function gy(){if(Tv)return Pv;Tv=1;let e=fy();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return Pv=t,t.default=t,Pv}function my(){if(_v)return Mv;_v=1;let e=hy();class t extends e{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)}}return Mv=t,t.default=t,e.registerAtRule(t),Mv}function vy(){if(Lv)return Nv;Lv=1;let e,t,r=hy();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},Nv=n,n.default=n,r.registerRoot(n),Nv}function yy(){if(Uv)return Dv;Uv=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return Dv=e,e.default=e,Dv}function by(){if(jv)return Fv;jv=1;let e=hy(),t=yy();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return Fv=r,r.default=r,e.registerRule(r),Fv}function wy(){if(qv)return Bv;qv=1;let e=oy(),t=function(){if(Av)return Rv;Av=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),m="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,k=/[\da-f]/i;return Rv=function(x,C={}){let E,O,I,P,T,R,A,M,_,N,L=x.css.valueOf(),D=C.ignoreErrors,U=L.length,F=0,j=[],B=[];function q(e){throw x.error("Unclosed "+e,F)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&F>=U},nextToken:function(x){if(B.length)return B.pop();if(F>=U)return;let C=!!x&&x.ignoreUnclosed;switch(E=L.charCodeAt(F),E){case i:case o:case a:case l:case s:O=F;do{O+=1,E=L.charCodeAt(O)}while(E===o||E===i||E===a||E===l||E===s);N=["space",L.slice(F,O)],F=O-1;break;case u:case c:case p:case f:case v:case g:case d:{let e=String.fromCharCode(E);N=[e,e,F];break}case h:if(M=j.length?j.pop()[1]:"",_=L.charCodeAt(F+1),"url"===M&&_!==e&&_!==t&&_!==o&&_!==i&&_!==a&&_!==s&&_!==l){O=F;do{if(R=!1,O=L.indexOf(")",O+1),-1===O){if(D||C){O=F;break}q("bracket")}for(A=O;L.charCodeAt(A-1)===r;)A-=1,R=!R}while(R);N=["brackets",L.slice(F,O+1),F,O],F=O}else O=L.indexOf(")",F+1),P=L.slice(F,O+1),-1===O||S.test(P)?N=["(","(",F]:(N=["brackets",P,F,O],F=O);break;case e:case t:I=E===e?"'":'"',O=F;do{if(R=!1,O=L.indexOf(I,O+1),-1===O){if(D||C){O=F+1;break}q("string")}for(A=O;L.charCodeAt(A-1)===r;)A-=1,R=!R}while(R);N=["string",L.slice(F,O+1),F,O],F=O;break;case y:b.lastIndex=F+1,b.test(L),O=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(F,O+1),F,O],F=O;break;case r:for(O=F,T=!0;L.charCodeAt(O+1)===r;)O+=1,T=!T;if(E=L.charCodeAt(O+1),T&&E!==n&&E!==o&&E!==i&&E!==a&&E!==l&&E!==s&&(O+=1,k.test(L.charAt(O)))){for(;k.test(L.charAt(O+1));)O+=1;L.charCodeAt(O+1)===o&&(O+=1)}N=["word",L.slice(F,O+1),F,O],F=O;break;default:E===n&&L.charCodeAt(F+1)===m?(O=L.indexOf("*/",F+2)+1,0===O&&(D||C?O=L.length:q("comment")),N=["comment",L.slice(F,O+1),F,O],F=O):(w.lastIndex=F+1,w.test(L),O=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(F,O+1),F,O],j.push(N),F=O)}return F++,N},position:function(){return F}}}}(),r=cy(),n=my(),i=vy(),o=by();const s={empty:!0,space:!0};return Bv=class{constructor(e){this.input=e,this.root=new i,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,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,u=r.length,c="",h=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?h=!1:c+=i[1]):c+=i[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;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})}},Bv}function Sy(){if(Vv)return zv;Vv=1;let e=hy(),t=wy(),r=ly();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return zv=n,n.default=n,e.registerParse(n),zv}function ky(){if($v)return Wv;$v=1;let{isClean:e,my:t}=ty(),r=uy(),n=ny(),i=hy(),o=dy(),s=py(),a=gy(),l=Sy(),u=vy();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[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 g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>m(e)),t}let v={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=m(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=m(r);this.result=new a(e,o,n),this.helpers={...v,postcss:v,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return y.registerPostcss=e=>{v=e},Wv=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),Wv}function xy(){if(Gv)return Jv;Gv=1;let e=function(){if(Hv)return Kv;Hv=1;let e=uy(),t=ny(),r=py(),n=Sy();const i=gy();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.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||r("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=n;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"}}return Kv=o,o.default=o,Kv}(),t=ky(),r=dy(),n=vy();class i{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Jv=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),Jv}var Cy=function(){if(Zv)return Qv;Zv=1;let e=ev(),t=oy(),r=ky(),n=hy(),i=xy(),o=ny(),s=function(){if(Xv)return Yv;Xv=1;let e=oy(),t=ay(),r=cy(),n=my(),i=ly(),o=vy(),s=by();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...h}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,u))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=u[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new s(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return Yv=a,a.default=a,Yv}(),a=dy(),l=fy(),u=cy(),c=my(),h=gy(),d=ly(),p=Sy(),f=yy(),g=by(),m=vy(),v=iy();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new m(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=h,y.Input=d,y.Rule=g,y.Root=m,y.Node=v,r.registerPostcss(y),Qv=y,y.default=y,Qv}();const Ey=Km(Cy);Ey.stringify,Ey.fromJSON,Ey.plugin,Ey.parse,Ey.list,Ey.document,Ey.comment,Ey.atRule,Ey.rule,Ey.decl,Ey.root,Ey.CssSyntaxError,Ey.Declaration,Ey.Container,Ey.Processor,Ey.Document,Ey.Comment,Ey.Warning,Ey.AtRule,Ey.Result,Ey.Input,Ey.Rule,Ey.Root,Ey.Node;var Oy=Object.defineProperty,Iy=(e,t,r)=>((e,t,r)=>t in e?Oy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Py(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ty(e){if(Object.prototype.hasOwnProperty.call(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 Ry,Ay={exports:{}};function My(){if(Ry)return Ay.exports;Ry=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Ay.exports=t(),Ay.exports.createColors=t,Ay.exports}const _y=Ty(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ny,Ly;function Dy(){if(Ly)return Ny;Ly=1;let e=My(),t=_y;class r extends Error{constructor(e,t,n,i,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}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(r){if(!this.source)return"";let n=this.source;null==r&&(r=e.isColorSupported),t&&r&&(n=t(n));let i,o,s=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);i=e=>t(n(e)),o=e=>r(e)}else i=o=e=>e;return s.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){let t=o(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+o(n)+e+"\n "+t+i("^")}return" "+o(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Ny=r,r.default=r,Ny}var Uy,Fy,jy,By,qy,zy,Vy,Wy,$y,Ky,Hy,Jy,Gy,Yy,Xy,Qy,Zy,eb,tb,rb,nb,ib,ob,sb,ab,lb,ub,cb,hb,db,pb,fb,gb,mb,vb,yb,bb,wb,Sb,kb,xb,Cb,Eb,Ob,Ib,Pb,Tb,Rb,Ab,Mb,_b,Nb,Lb,Db={};function Ub(){return Uy||(Uy=1,Db.isClean=Symbol("isClean"),Db.my=Symbol("my")),Db}function Fb(){if(jy)return Fy;jy=1;const e={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class t{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(t,r,n){let i;if(n||(n=r),r&&(i=t.raws[r],void 0!==i))return i;let o=t.parent;if("before"===n){if(!o||"root"===o.type&&o.first===t)return"";if(o&&"document"===o.type)return""}if(!o)return e[n];let s=t.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?i=this[e](s,t):s.walk(e=>{if(i=e.raws[r],void 0!==i)return!1})}var a;return void 0===i&&(i=e[n]),s.rawCache[n]=i,i}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)}}return Fy=t,t.default=t,Fy}function jb(){if(qy)return By;qy=1;let e=Fb();function t(t,r){new e(r).stringify(t)}return By=t,t.default=t,By}function Bb(){if(Vy)return zy;Vy=1;let{isClean:e,my:t}=Ub(),r=Dy(),n=Fb(),i=jb();function o(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],s=typeof i;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=i:Array.isArray(i)?r[n]=i.map(e=>o(e,r)):("object"===s&&null!==i&&(i=o(i)),r[n]=i)}return r}class s{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}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=o(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 r(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[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!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 n).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=i){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}}return zy=s,s.default=s,zy}function qb(){if($y)return Wy;$y=1;let e=Bb();class t extends e{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]}}return Wy=t,t.default=t,Wy}function zb(){if(Hy)return Ky;Hy=1;return Ky={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}},Ky}function Vb(){if(Gy)return Jy;Gy=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=_y,{existsSync:r,readFileSync:n}=_y,{dirname:i,join:o}=_y;class s{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=i(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(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=i(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=o(i(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Jy=s,s.default=s,Jy}function Wb(){if(Xy)return Yy;Xy=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=_y,{fileURLToPath:r,pathToFileURL:n}=_y,{isAbsolute:i,resolve:o}=_y,{nanoid:s}=zb(),a=_y,l=Dy(),u=Vb(),c=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(o&&i);class p{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&&(!d||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=o(t.from)),d&&h){let e=new u(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,i={}){let o,s,a;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);s=e.line,a=e.col}else s=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let u=this.origin(t,r,s,a);return o=u?new l(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,i.plugin):new l(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:a,line:s},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:s,line:t,source:this.css},this.file&&(n&&(o.input.url=n(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[c])r=this[c];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[c]=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:o(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,o,s){if(!this.map)return!1;let a,l,u=this.map.consumer(),c=u.originalPositionFor({column:t,line:e});if(!c.source)return!1;"number"==typeof o&&(a=u.originalPositionFor({column:s,line:o})),l=i(c.source)?n(c.source):new URL(c.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let h={column:c.column,endColumn:a&&a.column,endLine:a&&a.line,line:c.line,url:l.toString()};if("file:"===l.protocol){if(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(l)}let d=u.sourceContentFor(c.source);return d&&(h.source=d),h}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}}return Yy=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Yy}function $b(){if(Zy)return Qy;Zy=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=_y,{dirname:r,relative:n,resolve:i,sep:o}=_y,{pathToFileURL:s}=_y,a=Wb(),l=Boolean(e&&t),u=Boolean(r&&i&&n&&o);return Qy=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 t of this.previous()){let n,i=this.toUrl(this.path(t.file)),o=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,i,this.toUrl(this.path(o)))}}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(),u&&l&&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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(s.generated.line=n,s.generated.column=i-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),i=t.length-r):i+=t.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?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=i-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=i-1,this.map.addMapping(s)))}})}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 o=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(o=r(i(o,this.mapOpts.annotation)));let s=n(o,e);return this.memoizedPaths.set(e,s),s}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 a(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(s){let t=s(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;"\\"===o&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Qy}function Kb(){if(tb)return eb;tb=1;let e=Bb();class t extends e{constructor(e){super(e),this.type="comment"}}return eb=t,t.default=t,eb}function Hb(){if(nb)return rb;nb=1;let e,t,r,n,{isClean:i,my:o}=Ub(),s=qb(),a=Kb(),l=Bb();function u(e){return e.map(e=>(e.nodes&&(e.nodes=u(e.nodes)),delete e.source,e))}function c(e){if(e[i]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)c(t)}class h extends l{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(n,l){if("string"==typeof n)n=u(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[o]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[i]&&c(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}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]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},rb=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,s.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[o]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},rb}function Jb(){if(ob)return ib;ob=1;let e,t,r=Hb();class n extends r{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},ib=n,n.default=n,ib}function Gb(){if(ab)return sb;ab=1;let e={};return sb=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Yb(){if(ub)return lb;ub=1;class e{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}}return lb=e,e.default=e,lb}function Xb(){if(hb)return cb;hb=1;let e=Yb();class t{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(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return cb=t,t.default=t,cb}function Qb(){if(gb)return fb;gb=1;let e=Hb();class t extends e{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)}}return fb=t,t.default=t,e.registerAtRule(t),fb}function Zb(){if(vb)return mb;vb=1;let e,t,r=Hb();class n extends r{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(r={}){return new e(new t,this,r).stringify()}}return n.registerLazyResult=t=>{e=t},n.registerProcessor=e=>{t=e},mb=n,n.default=n,r.registerRoot(n),mb}function ew(){if(bb)return yb;bb=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\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}};return yb=e,e.default=e,yb}function tw(){if(Sb)return wb;Sb=1;let e=Hb(),t=ew();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.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)}}return wb=r,r.default=r,e.registerRule(r),wb}function rw(){if(xb)return kb;xb=1;let e=qb(),t=function(){if(pb)return db;pb=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),i="\n".charCodeAt(0),o=" ".charCodeAt(0),s="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),u="[".charCodeAt(0),c="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),g=";".charCodeAt(0),m="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,k=/[\da-f]/i;return db=function(x,C={}){let E,O,I,P,T,R,A,M,_,N,L=x.css.valueOf(),D=C.ignoreErrors,U=L.length,F=0,j=[],B=[];function q(e){throw x.error("Unclosed "+e,F)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&F>=U},nextToken:function(x){if(B.length)return B.pop();if(F>=U)return;let C=!!x&&x.ignoreUnclosed;switch(E=L.charCodeAt(F),E){case i:case o:case a:case l:case s:O=F;do{O+=1,E=L.charCodeAt(O)}while(E===o||E===i||E===a||E===l||E===s);N=["space",L.slice(F,O)],F=O-1;break;case u:case c:case p:case f:case v:case g:case d:{let e=String.fromCharCode(E);N=[e,e,F];break}case h:if(M=j.length?j.pop()[1]:"",_=L.charCodeAt(F+1),"url"===M&&_!==e&&_!==t&&_!==o&&_!==i&&_!==a&&_!==s&&_!==l){O=F;do{if(R=!1,O=L.indexOf(")",O+1),-1===O){if(D||C){O=F;break}q("bracket")}for(A=O;L.charCodeAt(A-1)===r;)A-=1,R=!R}while(R);N=["brackets",L.slice(F,O+1),F,O],F=O}else O=L.indexOf(")",F+1),P=L.slice(F,O+1),-1===O||S.test(P)?N=["(","(",F]:(N=["brackets",P,F,O],F=O);break;case e:case t:I=E===e?"'":'"',O=F;do{if(R=!1,O=L.indexOf(I,O+1),-1===O){if(D||C){O=F+1;break}q("string")}for(A=O;L.charCodeAt(A-1)===r;)A-=1,R=!R}while(R);N=["string",L.slice(F,O+1),F,O],F=O;break;case y:b.lastIndex=F+1,b.test(L),O=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["at-word",L.slice(F,O+1),F,O],F=O;break;case r:for(O=F,T=!0;L.charCodeAt(O+1)===r;)O+=1,T=!T;if(E=L.charCodeAt(O+1),T&&E!==n&&E!==o&&E!==i&&E!==a&&E!==l&&E!==s&&(O+=1,k.test(L.charAt(O)))){for(;k.test(L.charAt(O+1));)O+=1;L.charCodeAt(O+1)===o&&(O+=1)}N=["word",L.slice(F,O+1),F,O],F=O;break;default:E===n&&L.charCodeAt(F+1)===m?(O=L.indexOf("*/",F+2)+1,0===O&&(D||C?O=L.length:q("comment")),N=["comment",L.slice(F,O+1),F,O],F=O):(w.lastIndex=F+1,w.test(L),O=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["word",L.slice(F,O+1),F,O],j.push(N),F=O)}return F++,N},position:function(){return F}}}}(),r=Kb(),n=Qb(),i=Zb(),o=tw();const s={empty:!0,space:!0};return kb=class{constructor(e){this.input=e,this.root=new i,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,i,o=new n;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?u.push("("===t?")":"]"):"{"===t&&u.length>0?u.push("}"):t===u[u.length-1]&&u.pop(),0===u.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(i=l.length-1,r=l[i];r&&"space"===r[0];)r=l[--i];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(o.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(o,"params",l),s&&(e=l[l.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}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 r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let i,o=t[t.length-1];for(";"===o[0]&&(this.semicolon=!0,t.pop()),n.source.end=this.getPosition(o[3]||o[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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(i=t.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;t.length&&(s=t[0][0],"space"===s||"comment"===s);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(i=t[e],"!important"===i[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===i[1].toLowerCase()){let r=t.slice(0),i="";for(let t=e;t>0;t--){let e=r[t][0];if(0===i.trim().indexOf("!")&&"space"!==e)break;i=r.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,t=r)}if("space"!==i[0]&&"comment"!==i[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new o;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,a,l,u=r.length,c="",h=!0;for(let e=0;e<u;e+=1)i=r[e],o=i[0],"space"!==o||e!==u-1||n?"comment"===o?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",s[l]||s[a]||","===c.slice(-1)?h=!1:c+=i[1]):c+=i[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new o;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})}},kb}function nw(){if(Eb)return Cb;Eb=1;let e=Hb(),t=rw(),r=Wb();function n(e,n){let i=new r(e,n),o=new t(i);try{o.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&n&&n.from&&(/\.scss$/i.test(n.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(n.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(n.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return o.root}return Cb=n,n.default=n,e.registerParse(n),Cb}function iw(){if(Ib)return Ob;Ib=1;let{isClean:e,my:t}=Ub(),r=$b(),n=jb(),i=Hb(),o=Jb(),s=Gb(),a=Xb(),l=nw(),u=Zb();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return"object"==typeof e&&"function"==typeof e.then}function f(e){let t=!1,r=c[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 g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>m(e)),t}let v={};class y{constructor(e,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)o=m(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=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[t]&&i.rebuild(o)}else o=m(r);this.result=new a(e,o,n),this.helpers={...v,postcss:v,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(!h[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[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(p(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,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 p(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=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new r(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||s("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(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:i}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(i.length>0&&r.visitorIndex<i.length){let[e,t]=i[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===i.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let i,o=r.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[e])return i[e]=!0,void t.push(g(i));r.iterator=0,delete n.indexes[o]}let o=r.events;for(;r.eventIndex<o.length;){let t=o[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.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"}}return y.registerPostcss=e=>{v=e},Ob=y,y.default=y,u.registerLazyResult(y),o.registerLazyResult(y),Ob}function ow(){if(Ab)return Rb;Ab=1;let e=function(){if(Tb)return Pb;Tb=1;let e=$b(),t=jb(),r=Gb(),n=nw();const i=Xb();class o{constructor(r,n,o){let s;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=o,this._map=void 0;let a=t;this.result=new i(this._processor,s,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let u=new e(a,s,this._opts,n);if(u.isMap()){let[e,t]=u.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else u.clearAnnotation(),this.result.css=u.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||r("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=n;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"}}return Pb=o,o.default=o,Pb}(),t=iw(),r=Jb(),n=Zb();class i{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(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Rb=i,i.default=i,n.registerProcessor(i),r.registerProcessor(i),Rb}var sw=function(){if(Lb)return Nb;Lb=1;let e=Dy(),t=qb(),r=iw(),n=Hb(),i=ow(),o=jb(),s=function(){if(_b)return Mb;_b=1;let e=qb(),t=Vb(),r=Kb(),n=Qb(),i=Wb(),o=Zb(),s=tw();function a(l,u){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:c,...h}=l;if(c){u=[];for(let e of c){let r={...e,__proto__:i.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),u.push(r)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,u))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=u[e])}if("root"===h.type)return new o(h);if("decl"===h.type)return new e(h);if("rule"===h.type)return new s(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return Mb=a,a.default=a,Mb}(),a=Jb(),l=Yb(),u=Kb(),c=Qb(),h=Xb(),d=Wb(),p=nw(),f=ew(),g=tw(),m=Zb(),v=Bb();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return y.plugin=function(e,t){let r,n=!1;function o(...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 o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return y([o(r)]).process(e,t)},o},y.stringify=o,y.parse=p,y.fromJSON=s,y.list=f,y.comment=e=>new u(e),y.atRule=e=>new c(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new m(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=i,y.Document=a,y.Comment=u,y.Warning=l,y.AtRule=c,y.Result=h,y.Input=d,y.Rule=g,y.Root=m,y.Node=v,r.registerPostcss(y),Nb=y,y.default=y,Nb}();const aw=Py(sw);aw.stringify,aw.fromJSON,aw.plugin,aw.parse,aw.list,aw.document,aw.comment,aw.atRule,aw.rule,aw.decl,aw.root,aw.CssSyntaxError,aw.Declaration,aw.Container,aw.Processor,aw.Document,aw.Comment,aw.Warning,aw.AtRule,aw.Result,aw.Input,aw.Rule,aw.Root,aw.Node;class lw{constructor(...e){Iy(this,"parentElement",null),Iy(this,"parentNode",null),Iy(this,"ownerDocument"),Iy(this,"firstChild",null),Iy(this,"lastChild",null),Iy(this,"previousSibling",null),Iy(this,"nextSibling",null),Iy(this,"ELEMENT_NODE",1),Iy(this,"TEXT_NODE",3),Iy(this,"nodeType"),Iy(this,"nodeName"),Iy(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 lw))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 uw={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},cw={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},hw={};function dw(e){if(hw[e])return hw[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 uw?uw[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 cw?cw[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 hw[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?hw[e]=o:r}catch{return r}}const pw={};function fw(e,t,r){var n;const i=`${e}.${String(r)}`;if(pw[i])return pw[i].call(t);const o=dw(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(pw[i]=s,s.call(t)):t[r]}const gw={};function mw(e,t,r){const n=`${e}.${String(r)}`;if(gw[n])return gw[n].bind(t);const i=dw(e)[r];return"function"!=typeof i?t[r]:(gw[n]=i,i.bind(t))}function vw(){return dw("MutationObserver").constructor}const yw={childNodes:function(e){return fw("Node",e,"childNodes")},parentNode:function(e){return fw("Node",e,"parentNode")},parentElement:function(e){return fw("Node",e,"parentElement")},textContent:function(e){return fw("Node",e,"textContent")},contains:function(e,t){return mw("Node",e,"contains")(t)},getRootNode:function(e){return mw("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?fw("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?fw("Element",e,"shadowRoot"):null},querySelector:function(e,t){return fw("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return fw("Element",e,"querySelectorAll")(t)},mutationObserver:vw};function bw(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const ww="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 Sw={map:{},getId:()=>(console.error(ww),-1),getNode:()=>(console.error(ww),null),removeNodeFromMap(){console.error(ww)},has:()=>(console.error(ww),!1),reset(){console.error(ww)}};function kw(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 xw(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)}}),()=>xw(e,t,o||{},!0)}function Cw(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&&(Sw=new Proxy(Sw,{get:(e,t,r)=>("map"===t&&console.error(ww),Reflect.get(e,t,r))}));let Ew=Date.now;function Ow(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=yw.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=yw.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Iw(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Pw(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Tw(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:yw.parentElement(e)}function Rw(e,t,r,n){if(!e)return!1;const i=Tw(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(qm(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 Aw(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function Mw(e,t){if(cm(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=yw.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Mw(n,t))}function _w(e){return Boolean(e.changedTouches)}function Nw(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Lw(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Dw(e){return!!e&&(e instanceof lw&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(yw.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ew=()=>(new Date).getTime());class Uw{constructor(){Yg(this,"id",1),Yg(this,"styleIDMap",new WeakMap),Yg(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 Fw(e){var t;let r=null;return"getRootNode"in e&&(null==(t=yw.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&yw.host(yw.getRootNode(e))&&(r=yw.host(yw.getRootNode(e))),r}function jw(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=Fw(r);)r=t;return r}(e);return yw.contains(t,r)}function Bw(e){const t=e.ownerDocument;return!!t&&(yw.contains(t,e)||jw(e))}var qw=(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))(qw||{}),zw=(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))(zw||{}),Vw=(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))(Vw||{}),Ww=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ww||{}),$w=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))($w||{}),Kw=(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))(Kw||{}),Hw=(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))(Hw||{});function Jw(e){return"__ln"in e}class Gw{constructor(){Yg(this,"length",0),Yg(this,"head",null),Yg(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&&Jw(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&&Jw(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 Yw=(e,t)=>`${e}@${t}`;class Xw{constructor(){Yg(this,"frozen",!1),Yg(this,"locked",!1),Yg(this,"texts",[]),Yg(this,"attributes",[]),Yg(this,"attributeMap",new WeakMap),Yg(this,"removes",[]),Yg(this,"mapRemoves",[]),Yg(this,"movedMap",{}),Yg(this,"addedSet",new Set),Yg(this,"movedSet",new Set),Yg(this,"droppedSet",new Set),Yg(this,"removesSubTreeCache",new Set),Yg(this,"mutationCb"),Yg(this,"blockClass"),Yg(this,"blockSelector"),Yg(this,"maskTextClass"),Yg(this,"maskTextSelector"),Yg(this,"inlineStylesheet"),Yg(this,"maskInputOptions"),Yg(this,"maskTextFn"),Yg(this,"maskInputFn"),Yg(this,"keepIframeSrcFn"),Yg(this,"recordCanvas"),Yg(this,"inlineImages"),Yg(this,"slimDOMOptions"),Yg(this,"dataURLOptions"),Yg(this,"doc"),Yg(this,"mirror"),Yg(this,"iframeManager"),Yg(this,"stylesheetManager"),Yg(this,"shadowDomManager"),Yg(this,"canvasManager"),Yg(this,"processedNodeManager"),Yg(this,"unattachedDoc"),Yg(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Yg(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Gw,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=yw.parentNode(i);if(!o||!Bw(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=cm(o)?this.mirror.getId(Fw(i)):this.mirror.getId(o),l=n(i);if(-1===a||-1===l)return r.addNode(i);const u=$m(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=>{Nw(e,this.mirror)&&this.iframeManager.addIframe(e),Lw(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Dw(i)&&this.shadowDomManager.addShadowRoot(yw.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)Zw(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(yw.parentNode(e))||i(e);for(const e of this.addedSet)eS(this.droppedSet,e)||Zw(this.removesSubTreeCache,e,this.mirror)?eS(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(yw.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(yw.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=yw.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=yw.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=yw.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))}),Yg(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(yw.childNodes(e),e=>yw.textContent(e)||"").join("");t.attributes.value=gm({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:ym(e),value:r,maskInputFn:this.maskInputFn})}),Yg(this,"processMutation",e=>{if(!Aw(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=yw.textContent(e.target);Rw(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:zm(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Tw(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=ym(t);n=gm({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(Rw(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"),!Bm(t.tagName,r))if(i.attributes[r]=jm(this.doc,mm(t.tagName),mm(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(Rw(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=cm(e.target)?this.mirror.getId(yw.host(e.target)):this.mirror.getId(e.target);Rw(e.target,this.blockClass,this.blockSelector,!1)||Aw(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Qw(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Mw(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Yw(r,n)]?Qw(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!cm(e.target)||!hm(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),yw.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Yg(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Aw(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[Yw(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Rw(e,this.blockClass,this.blockSelector,!1)||(yw.childNodes(e).forEach(e=>this.genAdds(e)),Dw(e)&&yw.childNodes(yw.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 Qw(e,t){e.delete(t),yw.childNodes(t).forEach(t=>Qw(e,t))}function Zw(e,t,r){return 0!==e.size&&function(e,t){const r=yw.parentNode(t);return!!r&&e.has(r)}(e,t)}function eS(e,t){return 0!==e.size&&tS(e,t)}function tS(e,t){const r=yw.parentNode(t);return!!r&&(!!e.has(r)||tS(e,r))}let rS;const nS=e=>{if(!rS)return e;return(...t)=>{try{return e(...t)}catch(e){if(rS&&!0===rS(e))return;throw e}}};function iS(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const oS=[];function sS(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 aS(e,t){const r=new Xw;oS.push(r),r.init(e);const n=new(vw())(nS(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function lS({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(Vw).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(o=>{let s=mm(o);const u=(t=>o=>{const s=sS(o);if(Rw(s,n,i,!0))return;let a=null,u=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Ww.Mouse;break;case"touch":a=Ww.Touch;break;case"pen":a=Ww.Pen}a===Ww.Touch?Vw[t]===Vw.MouseDown?u="TouchStart":Vw[t]===Vw.MouseUp&&(u="TouchEnd"):Ww.Pen}else _w(o)&&(a=Ww.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===Ww.Touch||u.startsWith("Mouse")&&a===Ww.Mouse)&&(a=null)):Vw[t]===Vw.Click&&(a=l,l=null);const c=_w(o)?o.changedTouches[0]:o;if(!c)return;const h=r.getId(s),{clientX:d,clientY:p}=c;nS(e)({type:Vw[u],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Vw[o]){case Vw.MouseDown:case Vw.MouseUp:s=s.replace("mouse","pointer");break;case Vw.TouchStart:case Vw.TouchEnd:return}a.push(bw(s,u,t))}),nS(()=>{a.forEach(e=>e())})}function uS({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){const s=nS(kw(nS(o=>{const s=sS(o);if(!s||Rw(s,n,i,!0))return;const a=r.getId(s);if(s===t&&t.defaultView){const r=Ow(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 bw("scroll",s,t)}const cS=["INPUT","TEXTAREA","SELECT"],hS=new WeakMap;function dS(e){return function(e,t){if(mS("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||mS("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||mS("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||mS("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 pS(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function fS({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(yw.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}}),nS(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function gS(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=aS(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=kw(nS(t=>{const r=Date.now()-s;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],s=null}),o),u=nS(kw(nS(e=>{const t=sS(e),{clientX:r,clientY:i}=_w(e)?e.changedTouches[0]:e;s||(s=Ew()),a.push({x:r,y:i,id:n.getId(t),timeOffset:Ew()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?zw.Drag:e instanceof MouseEvent?zw.MouseMove:zw.TouchMove)}),i,{trailing:!1})),c=[bw("mousemove",u,r),bw("touchmove",u,r),bw("drag",u,r)];return nS(()=>{c.forEach(e=>e())})}(e),o=lS(e),s=uS(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return bw("resize",nS(kw(nS(()=>{const t=Iw(),i=Pw();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=sS(e);const u=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=yw.parentElement(r)),!r||!h||cS.indexOf(h)<0||Rw(r,n,i,!0))return;if(r.classList.contains(o)||s&&r.matches(s))return;let p=r.value,f=!1;const g=ym(r)||"";"radio"===g||"checkbox"===g?f=r.checked:(a[h.toLowerCase()]||a[g])&&(p=gm({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=hS.get(t);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){hS.set(t,n);const i=r.getId(t);nS(e)({...n,id:i})}}const p=("last"===u.input?["change"]:["input","change"]).map(e=>bw(e,nS(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=>xw(e[0],e[1],{set(){nS(h)({target:this,isTrusted:!1})}},!1,f))),nS(()=>{p.forEach(e=>e())})}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:o}){const s=nS(o=>kw(nS(i=>{const s=sS(i);if(!s||Rw(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=[bw("play",s(Kw.Play),o),bw("pause",s(Kw.Pause),o),bw("seeked",s(Kw.Seeked),o),bw("volumechange",s(Kw.VolumeChange),o),bw("ratechange",s(Kw.RateChange),o)];return nS(()=>{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:nS((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=pS(i,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:a}]}),iS(()=>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:nS((n,i,o)=>{const[s]=o,{id:a,styleId:l}=pS(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:s}]}),iS(()=>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:nS((n,i,o)=>{const[s]=o,{id:a,styleId:l}=pS(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:nS((n,i,o)=>{const[s]=o,{id:a,styleId:l}=pS(i,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:s}),n.apply(i,o)})}));const l={};vS("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(vS("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),vS("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),vS("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:nS((n,i,o)=>{const[s,a]=o,{id:l,styleId:u}=pS(i.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,adds:[{rule:s,index:[...dS(i),a||0]}]}),n.apply(i,o)})}),i.prototype.deleteRule=new Proxy(u[n].deleteRule,{apply:nS((n,i,o)=>{const[s]=o,{id:a,styleId:l}=pS(i.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...dS(i),s]}]}),n.apply(i,o)})})}),nS(()=>{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=fS(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:nS((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}=pS(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:dS(s.parentRule)}),i.apply(s,a)})});const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:nS((i,o,a)=>{var l;const[u]=a;if(r.has(u))return s.apply(o,[u]);const{id:c,styleId:h}=pS(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:dS(o.parentRule)}),i.apply(o,a)})}),nS(()=>{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=Cw(t.fonts,"add",function(t){return function(r){return setTimeout(nS(()=>{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),nS(()=>{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=nS(()=>{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;Rw(s,n,i,!0)||Rw(u,n,i,!0)||a.push({start:r.getId(s),startOffset:l,end:r.getId(u),endOffset:c})}o({ranges:a})});return a(),bw("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?Cw(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 nS(()=>{oS.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 mS(e){return void 0!==window[e]}function vS(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class yS{constructor(e){Yg(this,"iframeIdToRemoteIdMap",new WeakMap),Yg(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 bS{constructor(e){Yg(this,"iframes",new WeakMap),Yg(this,"crossOriginIframeMap",new WeakMap),Yg(this,"crossOriginIframeMirror",new yS(Rm)),Yg(this,"crossOriginIframeStyleMirror"),Yg(this,"crossOriginIframeRootIdMap",new WeakMap),Yg(this,"mirror"),Yg(this,"mutationCb"),Yg(this,"wrappedEmit"),Yg(this,"loadListener"),Yg(this,"stylesheetManager"),Yg(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new yS(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 qw.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:qw.IncrementalSnapshot,data:{source:zw.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case qw.Meta:case qw.Load:case qw.DomContentLoaded:return!1;case qw.Plugin:return t;case qw.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case qw.IncrementalSnapshot:switch(t.data.source){case zw.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 zw.Drag:case zw.TouchMove:case zw.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case zw.ViewportResize:return!1;case zw.MediaInteraction:case zw.MouseInteraction:case zw.Scroll:case zw.CanvasMutation:case zw.Input:return this.replaceIds(t.data,e,["id"]),t;case zw.StyleSheetRule:case zw.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case zw.Font:return t;case zw.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case zw.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===Hw.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class wS{constructor(e){Yg(this,"shadowDoms",new WeakSet),Yg(this,"mutationCb"),Yg(this,"scrollCb"),Yg(this,"bypassOptions"),Yg(this,"mirror"),Yg(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(!hm(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=aS({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(uS({...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(yw.host(e))),this.restoreHandlers.push(fS({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(Cw(e.prototype,"attachShadow",function(e){return function(n){const i=e.call(this,n),o=yw.shadowRoot(this);return o&&Bw(this)&&r.addShadowRoot(o,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var SS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kS="undefined"==typeof Uint8Array?[]:new Uint8Array(256),xS=0;xS<64;xS++)kS[SS.charCodeAt(xS)]=xS;const CS=new Map;const ES=(e,t,r)=>{if(!e||!PS(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=CS.get(e);return r||(r=new Map,CS.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 OS(e,t,r){if(e instanceof Array)return e.map(e=>OS(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+=SS[r[t]>>2],i+=SS[(3&r[t])<<4|r[t+1]>>4],i+=SS[(15&r[t+1])<<2|r[t+2]>>6],i+=SS[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:[OS(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:[OS(e.data,t,r),e.width,e.height]}}if(PS(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:ES(e,t,r)}}return e}const IS=(e,t,r)=>e.map(e=>OS(e,t,r)),PS=(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 TS(e,t,r,n){const i=[];try{const o=Cw(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(i,...o){if(!Rw(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 RS(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=Cw(e,l,function(e){return function(...s){const a=e.apply(this,s);if(ES(a,o,this),"tagName"in this.canvas&&!Rw(this.canvas,n,i,!0)){const e=IS(s,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});s.push(a)}catch{const n=xw(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(n)}return s}const AS='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',MS="undefined"!=typeof self&&self.Blob&&new Blob([AS],{type:"text/javascript;charset=utf-8"});function _S(e){let t;try{if(t=MS&&(self.URL||self.webkitURL).createObjectURL(MS),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(AS),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class NS{constructor(e){Yg(this,"pendingCanvasMutations",new Map),Yg(this,"rafStamps",{latestId:0,invokeId:null}),Yg(this,"mirror"),Yg(this,"mutationCb"),Yg(this,"resetObservers"),Yg(this,"frozen",!1),Yg(this,"locked",!1),Yg(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=TS(t,r,n,!0),s=new Map,a=new _S;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:$w["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=>{Rw(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=TS(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=Cw(t.CanvasRenderingContext2D.prototype,s,function(i){return function(...o){return Rw(this.canvas,r,n,!0)||setTimeout(()=>{const r=IS(o,t,this);e(this.canvas,{type:$w["2D"],property:s,args:r})},0),i.apply(this,o)}});i.push(o)}catch{const r=xw(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:$w["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(...RS(t.WebGLRenderingContext.prototype,$w.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...RS(t.WebGL2RenderingContext.prototype,$w.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 LS{constructor(e){Yg(this,"trackedLinkElements",new WeakSet),Yg(this,"mutationCb"),Yg(this,"adoptedStyleSheetCb"),Yg(this,"styleMirror",new Uw),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:pm(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 DS{constructor(){Yg(this,"nodeMap",new WeakMap),Yg(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 US,FS,jS,BS=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Hg=e.contentWindow)?void 0:Hg.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const qS=new fm;function zS(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:k=!1,recordCrossOriginIframes:x=!1,recordAfter:C=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:O=!1,inlineImages:I=!1,plugins:P,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:R=new Set([]),errorHandler:A,applyBackgroundColorToBlockedElements:M=!1}=e;rS=A;const _=!x||window.parent===window;let N=!1;if(!_)try{window.parent.document&&(N=!1)}catch(e){N=!0}if(_&&!t)throw new Error("emit function is required");if(!_&&!N)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),qS.reset();const L=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==d?d:{password:!0},D=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let U;!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 F=0;const j=e=>{for(const t of P||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!N&&(e=v(e)),e};US=(e,i)=>{var o;const s=e;if(s.timestamp=Ew(),!(null==(o=oS[0])?void 0:o.isFrozen())||s.type===qw.FullSnapshot||s.type===qw.IncrementalSnapshot&&s.data.source===zw.Mutation||oS.forEach(e=>e.unfreeze()),_)null==t||t(j(s),i);else if(N){const e={type:"rrweb",event:j(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,"*")}if(s.type===qw.FullSnapshot)U=s,F=0;else if(s.type===qw.IncrementalSnapshot){if(s.data.source===zw.Mutation&&s.data.isAttachIframe)return;F++;const e=n&&F>=n,t=r&&s.timestamp-U.timestamp>r;(e||t)&&FS(!0)}};const B=e=>{US({type:qw.IncrementalSnapshot,data:{source:zw.Mutation,...e}})},q=e=>US({type:qw.IncrementalSnapshot,data:{source:zw.Scroll,...e}}),z=e=>US({type:qw.IncrementalSnapshot,data:{source:zw.CanvasMutation,...e}}),V=new LS({mutationCb:B,adoptedStyleSheetCb:e=>US({type:qw.IncrementalSnapshot,data:{source:zw.AdoptedStyleSheet,...e}})}),W=new bS({mirror:qS,mutationCb:B,stylesheetManager:V,recordCrossOriginIframes:x,wrappedEmit:US});for(const e of P||[])e.getMirror&&e.getMirror({nodeMirror:qS,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});const $=new DS;jS=new NS({recordCanvas:k,mutationCb:z,win:window,blockClass:i,blockSelector:o,mirror:qS,sampling:y.canvas,dataURLOptions:b});const K=new wS({mutationCb:B,scrollCb:q,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:L,dataURLOptions:b,maskTextFn:g,maskInputFn:f,recordCanvas:k,inlineImages:I,sampling:y,slimDOMOptions:D,iframeManager:W,stylesheetManager:V,canvasManager:jS,keepIframeSrcFn:T,processedNodeManager:$},mirror:qS});FS=(e=!1)=>{if(!S)return;US({type:qw.Meta,data:{href:window.location.href,width:Pw(),height:Iw()}},e),V.reset(),K.init(),oS.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new fm,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:k=!1}=t||{};return $m(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:k})}(document,{mirror:qS,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:L,maskTextFn:g,maskInputFn:f,slimDOM:D,dataURLOptions:b,recordCanvas:k,inlineImages:I,applyBackgroundColorToBlockedElements:M,onSerialize:e=>{Nw(e,qS)&&W.addIframe(e),Lw(e,qS)&&V.trackLinkElement(e),Dw(e)&&K.addShadowRoot(yw.shadowRoot(e),document)},onIframeLoad:(e,t)=>{W.attachIframe(e,t),K.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!t)return console.warn("Failed to snapshot the document");US({type:qw.FullSnapshot,data:{node:t,initialOffset:Ow(window)}},e),oS.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,qS.getId(document))};try{const e=[],t=e=>{var t;return nS(gS)({mutationCb:B,mousemoveCb:(e,t)=>US({type:qw.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>US({type:qw.IncrementalSnapshot,data:{source:zw.MouseInteraction,...e}}),scrollCb:q,viewportResizeCb:e=>US({type:qw.IncrementalSnapshot,data:{source:zw.ViewportResize,...e}}),inputCb:e=>US({type:qw.IncrementalSnapshot,data:{source:zw.Input,...e}}),mediaInteractionCb:e=>US({type:qw.IncrementalSnapshot,data:{source:zw.MediaInteraction,...e}}),styleSheetRuleCb:e=>US({type:qw.IncrementalSnapshot,data:{source:zw.StyleSheetRule,...e}}),styleDeclarationCb:e=>US({type:qw.IncrementalSnapshot,data:{source:zw.StyleDeclaration,...e}}),canvasMutationCb:z,fontCb:e=>US({type:qw.IncrementalSnapshot,data:{source:zw.Font,...e}}),selectionCb:e=>{US({type:qw.IncrementalSnapshot,data:{source:zw.Selection,...e}})},customElementCb:e=>{US({type:qw.IncrementalSnapshot,data:{source:zw.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:L,inlineStylesheet:c,sampling:y,recordDOM:S,recordCanvas:k,inlineImages:I,userTriggeredOnInput:E,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:T,blockSelector:o,slimDOMOptions:D,dataURLOptions:b,mirror:qS,iframeManager:W,stylesheetManager:V,shadowDomManager:K,processedNodeManager:$,canvasManager:jS,ignoreCSSAttributes:R,plugins:(null==(t=null==P?void 0:P.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>US({type:qw.Plugin,data:{plugin:e.name,payload:t}})})))||[]},m)};W.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{FS(),e.push(t(document)),BS=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(bw("DOMContentLoaded",()=>{US({type:qw.DomContentLoaded,data:{}}),"DOMContentLoaded"===C&&r()})),e.push(bw("load",()=>{US({type:qw.Load,data:{}}),"load"===C&&r()},window))),()=>{e.forEach(e=>e()),$.destroy(),BS=!1,rS=void 0}}catch(e){console.warn(e)}}var VS;zS.addCustomEvent=(e,t)=>{if(!BS)throw new Error("please add custom event after start recording");US({type:qw.Custom,data:{tag:e,payload:t}})},zS.freezePage=()=>{oS.forEach(e=>e.freeze())},zS.takeFullSnapshot=e=>{if(!BS)throw new Error("please take full snapshot after start recording");FS(e)},zS.mirror=qS,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(VS||(VS={}));var WS=Object.freeze({__proto__:null,record:zS}),$S=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=F();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}(),KS=Object.freeze({__proto__:null,NetworkObservers:$S});e.Identify=_,e.Revenue=$,e.Types=ko,e._setDiagnosticsSampleRate=xc,e.add=Ic,e.createInstance=Sc,e.experiment=Ec,e.extendSession=Pc,e.flush=Tc,e.getDeviceId=Rc,e.getSessionId=Ac,e.getUserId=Mc,e.groupIdentify=_c,e.identify=Nc,e.initAll=Cc,e.logEvent=Lc,e.remove=Dc,e.reset=Uc,e.revenue=Fc,e.sessionReplay=Oc,e.setDeviceId=jc,e.setGroup=Bc,e.setOptOut=qc,e.setSessionId=zc,e.setTransport=Vc,e.setUserId=Wc,e.track=$c,Object.defineProperty(e,"__esModule",{value:!0})});
|