@amplitude/session-replay-browser 1.52.0-codexsemantic-review-integration.0 → 1.52.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.
Files changed (111) hide show
  1. package/lib/cjs/config/joined-config.d.ts +1 -0
  2. package/lib/cjs/config/joined-config.d.ts.map +1 -1
  3. package/lib/cjs/config/joined-config.js +10 -1
  4. package/lib/cjs/config/joined-config.js.map +1 -1
  5. package/lib/cjs/config/local-config.d.ts +3 -3
  6. package/lib/cjs/config/local-config.d.ts.map +1 -1
  7. package/lib/cjs/config/local-config.js +5 -3
  8. package/lib/cjs/config/local-config.js.map +1 -1
  9. package/lib/cjs/config/types.d.ts +17 -9
  10. package/lib/cjs/config/types.d.ts.map +1 -1
  11. package/lib/cjs/config/types.js.map +1 -1
  12. package/lib/cjs/helpers.d.ts.map +1 -1
  13. package/lib/cjs/helpers.js +7 -4
  14. package/lib/cjs/helpers.js.map +1 -1
  15. package/lib/cjs/hooks/click.d.ts +2 -8
  16. package/lib/cjs/hooks/click.d.ts.map +1 -1
  17. package/lib/cjs/hooks/click.js +3 -42
  18. package/lib/cjs/hooks/click.js.map +1 -1
  19. package/lib/cjs/index.d.ts +1 -0
  20. package/lib/cjs/index.d.ts.map +1 -1
  21. package/lib/cjs/index.js.map +1 -1
  22. package/lib/cjs/plugins/url-tracking-plugin.d.ts +0 -3
  23. package/lib/cjs/plugins/url-tracking-plugin.d.ts.map +1 -1
  24. package/lib/cjs/plugins/url-tracking-plugin.js +9 -16
  25. package/lib/cjs/plugins/url-tracking-plugin.js.map +1 -1
  26. package/lib/cjs/semantic-identity.d.ts +1 -1
  27. package/lib/cjs/semantic-identity.d.ts.map +1 -1
  28. package/lib/cjs/semantic-identity.js +4 -3
  29. package/lib/cjs/semantic-identity.js.map +1 -1
  30. package/lib/cjs/semantic-types.d.ts +45 -0
  31. package/lib/cjs/semantic-types.d.ts.map +1 -0
  32. package/lib/cjs/semantic-types.js +3 -0
  33. package/lib/cjs/semantic-types.js.map +1 -0
  34. package/lib/cjs/semantic.d.ts +9 -12
  35. package/lib/cjs/semantic.d.ts.map +1 -1
  36. package/lib/cjs/semantic.js +17 -90
  37. package/lib/cjs/semantic.js.map +1 -1
  38. package/lib/cjs/session-replay.d.ts +39 -2
  39. package/lib/cjs/session-replay.d.ts.map +1 -1
  40. package/lib/cjs/session-replay.js +267 -132
  41. package/lib/cjs/session-replay.js.map +1 -1
  42. package/lib/cjs/utils/rrweb.d.ts +0 -3
  43. package/lib/cjs/utils/rrweb.d.ts.map +1 -1
  44. package/lib/cjs/utils/rrweb.js.map +1 -1
  45. package/lib/cjs/version.d.ts +1 -1
  46. package/lib/cjs/version.d.ts.map +1 -1
  47. package/lib/cjs/version.js +1 -1
  48. package/lib/cjs/version.js.map +1 -1
  49. package/lib/cjs/window-focus.d.ts +40 -0
  50. package/lib/cjs/window-focus.d.ts.map +1 -0
  51. package/lib/cjs/window-focus.js +182 -0
  52. package/lib/cjs/window-focus.js.map +1 -0
  53. package/lib/esm/config/joined-config.d.ts +1 -0
  54. package/lib/esm/config/joined-config.d.ts.map +1 -1
  55. package/lib/esm/config/joined-config.js +10 -1
  56. package/lib/esm/config/joined-config.js.map +1 -1
  57. package/lib/esm/config/local-config.d.ts +3 -3
  58. package/lib/esm/config/local-config.d.ts.map +1 -1
  59. package/lib/esm/config/local-config.js +5 -3
  60. package/lib/esm/config/local-config.js.map +1 -1
  61. package/lib/esm/config/types.d.ts +17 -9
  62. package/lib/esm/config/types.d.ts.map +1 -1
  63. package/lib/esm/config/types.js.map +1 -1
  64. package/lib/esm/helpers.d.ts.map +1 -1
  65. package/lib/esm/helpers.js +8 -5
  66. package/lib/esm/helpers.js.map +1 -1
  67. package/lib/esm/hooks/click.d.ts +2 -8
  68. package/lib/esm/hooks/click.d.ts.map +1 -1
  69. package/lib/esm/hooks/click.js +3 -42
  70. package/lib/esm/hooks/click.js.map +1 -1
  71. package/lib/esm/index.d.ts +1 -0
  72. package/lib/esm/index.d.ts.map +1 -1
  73. package/lib/esm/index.js.map +1 -1
  74. package/lib/esm/plugins/url-tracking-plugin.d.ts +0 -3
  75. package/lib/esm/plugins/url-tracking-plugin.d.ts.map +1 -1
  76. package/lib/esm/plugins/url-tracking-plugin.js +9 -16
  77. package/lib/esm/plugins/url-tracking-plugin.js.map +1 -1
  78. package/lib/esm/semantic-identity.d.ts +1 -1
  79. package/lib/esm/semantic-identity.d.ts.map +1 -1
  80. package/lib/esm/semantic-identity.js +4 -3
  81. package/lib/esm/semantic-identity.js.map +1 -1
  82. package/lib/esm/semantic-types.d.ts +45 -0
  83. package/lib/esm/semantic-types.d.ts.map +1 -0
  84. package/lib/esm/semantic-types.js +2 -0
  85. package/lib/esm/semantic-types.js.map +1 -0
  86. package/lib/esm/semantic.d.ts +9 -12
  87. package/lib/esm/semantic.d.ts.map +1 -1
  88. package/lib/esm/semantic.js +17 -90
  89. package/lib/esm/semantic.js.map +1 -1
  90. package/lib/esm/session-replay.d.ts +39 -2
  91. package/lib/esm/session-replay.d.ts.map +1 -1
  92. package/lib/esm/session-replay.js +267 -132
  93. package/lib/esm/session-replay.js.map +1 -1
  94. package/lib/esm/utils/rrweb.d.ts +0 -3
  95. package/lib/esm/utils/rrweb.d.ts.map +1 -1
  96. package/lib/esm/utils/rrweb.js.map +1 -1
  97. package/lib/esm/version.d.ts +1 -1
  98. package/lib/esm/version.d.ts.map +1 -1
  99. package/lib/esm/version.js +1 -1
  100. package/lib/esm/version.js.map +1 -1
  101. package/lib/esm/window-focus.d.ts +40 -0
  102. package/lib/esm/window-focus.d.ts.map +1 -0
  103. package/lib/esm/window-focus.js +179 -0
  104. package/lib/esm/window-focus.js.map +1 -0
  105. package/lib/scripts/index-min.js +1 -1
  106. package/lib/scripts/index-min.js.gz +0 -0
  107. package/lib/scripts/index-min.js.map +1 -1
  108. package/lib/scripts/session-replay-browser-min.js +1 -1
  109. package/lib/scripts/session-replay-browser-min.js.gz +0 -0
  110. package/lib/scripts/session-replay-browser-min.js.map +1 -1
  111. package/package.json +4 -4
@@ -1,2 +1,2 @@
1
- var sessionReplay=function(e){"use strict";function t(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(e)}var r=function(e,t){return r=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])},r(e,t)};var n,s,i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)};function o(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 s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r}function a(e,t,r,n){return new(r||(r=Promise))(function(s,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function l(e,t){var r,n,s,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(s=i.trys,(s=s.length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(6===a[0]&&i.label<s[1]){i.label=s[1],s=a;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(a);break}s[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function c(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 u(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function h(e,t,r){if(r||2===arguments.length)for(var n,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);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"}(s||(s={}));var d,p="$default_instance",f="https://api2.amplitude.com/2/httpapi";!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"}(d||(d={}));var m=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},g=h([],u(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),v=function(e){var t,r=m();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,v)}(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,h([],u(n.entries()),!1).map(function(e){var t=u(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(g[n]):g[n]}).join("")},y={},b={get exports(){return y},set exports(e){y=e}},w=Object.prototype.hasOwnProperty;function S(e){return"[Throws: "+(e?e.message:"?")+"]"}function C(e){var t=[];return function e(r){if(null===r||"object"!=typeof r)return r;if(-1!==t.indexOf(r))return"[Circular]";if(t.push(r),"function"==typeof r.toJSON)try{var n=e(r.toJSON());return t.pop(),n}catch(e){return S(e)}if(Array.isArray(r)){var s=r.map(e);return t.pop(),s}var i=Object.keys(r).reduce(function(t,n){return t[n]=e(function(e,t){if(w.call(e,t))try{return e[t]}catch(e){return S(e)}return e[t]}(r,n)),t},{});return t.pop(),i}(e)}b.exports=function(e,t,r){return JSON.stringify(C(e),t,r)};var k,x=y.ensureProperties=C,O=y||t({__proto__:null,ensureProperties:x,get default(){return y}},[y]),I=function(e){return{promise:e||Promise.resolve()}};!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 E="Amplitude Logger ",M=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(E,"[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(E,"[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(E,"[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(E,"[Debug]: ").concat(e.join(" ")))},e}(),R=function(e){return void 0===e||""===e?p:e},P=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:p,logLevel:k.Warn,loggerProvider:new M,offline:!1,optOut:!1,serverUrl:f,serverZone:"US",useBatch:!1}},A=function(){function e(e){var t,r,n,s;this._optOut=!1;var i=P();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:i.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||i.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||i.flushQueueSize,this.instanceName=R(e.instanceName),this.loggerProvider=e.loggerProvider||i.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:i.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:i.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:i.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||i.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(s=e.useBatch)&&void 0!==s?s:i.useBatch,this.loggerProvider.enable(this.logLevel);var o=N(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),T=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":f},N=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=P().serverZone),void 0===r&&(r=P().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:P().serverZone;return{serverZone:n,serverUrl:T(n,r)}};var L=function(e,t,r,n,s){return void 0===s&&(s=null),function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var a=r(),l=a.logger,c=a.logLevel;if(c&&c<k.Debug||!c||!l)return e.apply(s,i);var u,h={type:"invoke public method",name:t,args:i,stacktrace:(u=1,void 0===u&&(u=0),((new Error).stack||"").split("\n").slice(2+u).map(function(e){return e.trim()})),time:{start:(new Date).toISOString()},states:{}};n&&h.states&&(h.states.before=n());var d=e.apply(s,i);return d&&d.promise?d.promise.then(function(){n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))}):(n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))),d}};class _{getApplicationContext(){return{versionName:this.versionName,language:D(),platform:"Web",os:void 0,deviceModel:void 0}}}const D=()=>"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||"";class F{constructor(){this.queue=[]}logEvent(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)}setEventReceiver(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(t=>{e(t)}),this.queue=[])}}const B=(e,t)=>{const r=["string","number","boolean","undefined"],n=typeof e;if(n!==typeof t)return!1;for(const s of r)if(s===n)return e===t;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;const s=Array.isArray(e),i=Array.isArray(t);if(s!==i)return!1;if(!s||!i){const r=Object.keys(e).sort(),n=Object.keys(t).sort();if(!B(r,n))return!1;let s=!0;return Object.keys(e).forEach(r=>{B(e[r],t[r])||(s=!1)}),s}for(let r=0;r<e.length;r++)if(!B(e[r],t[r]))return!1;return!0};Object.entries||(Object.entries=function(e){const t=Object.keys(e);let r=t.length;const n=new Array(r);for(;r--;)n[r]=[t[r],e[t[r]]];return n});class j{constructor(){this.identity={userProperties:{}},this.listeners=new Set}editIdentity(){const e=this,t=Object.assign({},this.identity.userProperties),r=Object.assign(Object.assign({},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(e){return r.optOut=e,this},updateUserProperties:function(e){let t=r.userProperties||{};for(const[r,n]of Object.entries(e))switch(r){case"$set":for(const[e,r]of Object.entries(n))t[e]=r;break;case"$unset":for(const e of Object.keys(n))delete t[e];break;case"$clearAll":t={}}return r.userProperties=t,this},commit:function(){return e.setIdentity(r),this}}}getIdentity(){return Object.assign({},this.identity)}setIdentity(e){const t=Object.assign({},this.identity);this.identity=Object.assign({},e),B(t,this.identity)||this.listeners.forEach(t=>{t(e)})}addIdentityListener(e){this.listeners.add(e)}removeIdentityListener(e){this.listeners.delete(e)}}const U="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self;class ${constructor(){this.identityStore=new j,this.eventBridge=new F,this.applicationContextProvider=new _}static getInstance(e){return U.analyticsConnectorInstances||(U.analyticsConnectorInstances={}),U.analyticsConnectorInstances[e]||(U.analyticsConnectorInstances[e]=new $),U.analyticsConnectorInstances[e]}}var z=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},W=function(){function e(){}return e.prototype.send=function(e,t,r){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,i,o,a,l,c,u,h,p,f,m,g,v,y,b,w,S,C,k;if("object"!=typeof e)return null;var x=e.code||0,O=this.buildStatus(x);switch(O){case d.Success:return{status:O,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 d.Invalid:return{status:O,statusCode:x,body:{error:null!==(s=e.error)&&void 0!==s?s:"",missingField:null!==(i=e.missing_field)&&void 0!==i?i:"",eventsWithInvalidFields:null!==(o=e.events_with_invalid_fields)&&void 0!==o?o:{},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!==(c=e.eps_threshold)&&void 0!==c?c:0,exceededDailyQuotaDevices:null!==(u=e.exceeded_daily_quota_devices)&&void 0!==u?u:{},silencedDevices:null!==(h=e.silenced_devices)&&void 0!==h?h:[],silencedEvents:null!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(m=e.throttled_events)&&void 0!==m?m:[]}};case d.PayloadTooLarge:return{status:O,statusCode:x,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case d.RateLimit:return{status:O,statusCode:x,body:{error:null!==(v=e.error)&&void 0!==v?v:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(b=e.throttled_devices)&&void 0!==b?b:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(S=e.exceeded_daily_quota_devices)&&void 0!==S?S:{},exceededDailyQuotaUsers:null!==(C=e.exceeded_daily_quota_users)&&void 0!==C?C:{},throttledEvents:null!==(k=e.throttled_events)&&void 0!==k?k:[]}};case d.Timeout:default:return{status:O,statusCode:x}}},e.prototype.buildStatus=function(e){return function(e){return e>=200&&e<300}(e)?d.Success:429===e?d.RateLimit:413===e?d.PayloadTooLarge:408===e?d.Timeout:e>=400&&e<500?d.Invalid:e>=500?d.Failed:d.Unknown},e}(),q=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,function(){var r,n,s;return l(this,function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:i({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=o.sent()).text()];case 2:s=o.sent();try{return[2,this.buildResponse(JSON.parse(s))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}})})},t}(W),V=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t;try{this.isSupported="undefined"!=typeof localStorage}catch(e){this.logger.debug("Remote config localstorage failed to access: ",e),this.isSupported=!1}}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};if(!this.isSupported)return Promise.resolve(t);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(O(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){if(!this.isSupported)return Promise.resolve(!1);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}();var G,H=401,J=403,K=429,Y=function(){function e(t,r,n,s,i,o,a){void 0===n&&(n="US"),void 0===o&&(o=e.DEFAULT_CONFIG_GROUP),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=t,this.configGroup=o,this.serverUrl=s||("US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=r,this.storage=a||new V(t,r),this.customFetch=i}return e.prototype.subscribe=function(e,t,r){var n=v(),s={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(s),"all"===t?this.subscribeAll(s):this.subscribeWaitForRemote(s,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.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null}),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,s=this;return l(this,function(i){switch(i.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){s.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),s.sendCallback(e,t,"remote"),s.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=i.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 i.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return a(this,void 0,void 0,function(){var r,n;return l(this,function(s){switch(s.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),s.label=1;case 1:return s.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=s.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 s.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=s.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,s,i,o,a,c=this;return l(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},s=function(n){var s,o,a,u,h,d,p,f,m;return l(this,function(l){switch(l.label){case 0:s=!0,o=new AbortController,a=setTimeout(function(){return o.abort()},t),l.label=1;case 1:return l.trys.push([1,10,11,12]),u=i.getUrlParams(),h={Accept:"*/*"},i.customFetch?[4,(g=i.customFetch({url:u,method:"GET",headers:h,signal:o.signal}),v=o.signal,new Promise(function(e,t){var r=function(){var e=new Error("Remote config custom fetch aborted by timeout");e.name="AbortError",t(e)};v.addEventListener("abort",r,{once:!0}),g.then(function(t){v.removeEventListener("abort",r),e(t)},function(e){v.removeEventListener("abort",r),t(e)})}))]:[3,3];case 2:return p=l.sent(),[3,5];case 3:return[4,fetch(u,{method:"GET",headers:h,signal:o.signal})];case 4:p=l.sent(),l.label=5;case 5:return(d=p).ok||d.status>=200&&d.status<300?[3,7]:[4,d.text()];case 6:return f=l.sent(),i.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(d.status,": ").concat(f)),d.status===H||d.status===J?(i.logger.error("Remote config client fetch failed with ".concat(d.status,". Invalid API key; future fetches will be skipped.")),i.isLastFetchInvalidApiKey=!0,s=!1):d.status>=400&&d.status<500&&d.status!==K&&(s=!1),[3,9];case 7:return[4,d.json()];case 8:return[2,{value:{remoteConfig:l.sent(),lastFetch:new Date}}];case 9:return[3,12];case 10:return(m=l.sent())instanceof Error&&"AbortError"===m.name?i.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):i.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),m),[3,12];case 11:return clearTimeout(a),[7];case 12:return s?n<e-1?[4,new Promise(function(e){return setTimeout(e,c.getJitterDelay(r))})]:[3,14]:[2,"break"];case 13:l.sent(),l.label=14;case 14:return[2]}var g,v})},i=this,o=0,u.label=1;case 1:return o<e?[5,s(o)]:[3,4];case 2:if("object"==typeof(a=u.sent()))return[2,a.value];if("break"===a)return[3,4];u.label=3;case 3:return o++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var e=encodeURIComponent(this.apiKey),t=new URLSearchParams;return t.append("config_group",this.configGroup),"".concat(this.serverUrl,"/").concat(e,"?").concat(t.toString())},e.DEFAULT_CONFIG_GROUP="browser",e}();function X(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function Q(e,t,r){e&&Z({json:e,allowlist:t.map(ee),excludelist:r.map(ee),ancestors:[]})}function Z(e){var t,r,n=e.json,s=e.targetObject,i=e.allowlist,o=e.excludelist,a=e.ancestors,l=e.parentObject,d=e.targetKey;s||(s=n);var p=Object.keys(s);try{for(var f=c(p),m=f.next();!m.done;m=f.next()){var g=m.value,v=h(h([],u(a),!1),[g],!1);X(s[g])?re(v,i)&&!re(v,o)||delete s[g]:Z({json:n,targetObject:s[g],allowlist:i,excludelist:o,ancestors:v,parentObject:s,targetKey:g})}}catch(e){t={error:e}}finally{try{m&&!m.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}0===Object.keys(s).length&&l&&d&&delete l[d]}function ee(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function te(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 s=t[n];if("**"===s){if(n+1===t.length)return!0;for(var i=r;i<=e.length;i++)if(te(e,t,i,n+1))return!0;return!1}return("*"===s||s===e[r])&&te(e,t,r+1,n+1)}function re(e,t){return t.some(function(t){return te(e,t)})}!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(G||(G={}));var ne,se="https://app.amplitude.com",ie={US:se,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var oe="__AMPLITUDE_MESSENGER_INSTANCE__",ae="__AMPLITUDE_MESSENGER__",le=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?se:t;this[ne]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=r}return e.prototype.notify=function(e){var t,r,n,s;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===(s=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===s||s.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var s="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),i={id:s,action:e,args:t};return new Promise(function(t,o){n.requestCallbacks[s]={resolve:t,reject:o},n.notify(i),r.timeout>0&&setTimeout(function(){o(new Error("".concat(e," timed out (id: ").concat(s,")"))),delete n.requestCallbacks[s]},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.registerActionHandler=function(e,t){var r,n,s,i;this.actionHandlers.has(e)&&(null===(i=null===(s=this.logger)||void 0===s?void 0:s.warn)||void 0===i||i.call(s,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var o=this.pendingMessages.get(e);if(o){this.pendingMessages.delete(e);try{for(var a=c(o),l=a.next();!l.done;l=a.next()){t(l.value)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return a(this,void 0,void 0,function(){var t,r,n;return l(this,function(s){switch(s.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,r){var n;try{var s=document.createElement("script");s.type="text/javascript",s.async=!0,s.src=e,s.addEventListener("load",function(){t({status:!0})},{once:!0}),s.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),null===(n=document.head)||void 0===n||n.appendChild(s)}catch(e){r(e)}})}(e).then(function(){}),this.scriptLoadPromises.set(e,r),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,r];case 2:return s.sent(),[3,4];case 3:throw n=s.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}})})},e.prototype.setup=function(e){var t,r,n=this,s=void 0===e?{}:e,i=s.logger,o=s.endpoint;i&&(this.logger=i),o&&this.endpoint===se&&(this.endpoint=o),this.isSetup||(this.isSetup=!0,null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,r,s,i,o;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 a=e.data,l=null==a?void 0:a.action;if(l)if("id"in a&&a.id)null===(i=null===(s=n.logger)||void 0===s?void 0:s.debug)||void 0===i||i.call(s,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(a);else{if("ping"===l)return void n.notify({action:"pong"});var c=n.actionHandlers.get(l);if(c)c(a.data);else{var u=null!==(o=n.pendingMessages.get(l))&&void 0!==o?o:[];u.push(a.data),n.pendingMessages.set(l,u)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=m();(null==e?void 0:e[ae])===this&&delete e[ae]},e}();function ce(e){var t,r=m(),n=null==r?void 0:r[ae];if("object"==typeof(t=n)&&null!==t&&oe in t&&!0===t[oe])return n;var s=new le(e);return r&&(r[ae]=s),s}ne=oe;var ue=["desktop","tablet","mobile"],he="__AMPLITUDE_BACKGROUND_CAPTURE__";function de(e,t){var r,n=e;if(!0!==n[he]){n[he]=!0;var s=null!==(r=null==t?void 0:t.scriptUrl)&&void 0!==r?r:"https://cdn.amplitude.com/libs/background-capture-1.1.0.js.gz",o=null,a=function(t,r){var n,s;"background-capture-complete"===t&&(null===(s=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===s||s.call(n,"Background capture complete"),e.notify({action:"background-capture-complete",data:r}))};e.registerActionHandler("initialize-background-capture",function(t){var r,n;null===(n=null===(r=e.logger)||void 0===r?void 0:r.debug)||void 0===n||n.call(r,"Initializing background capture (external script)");var l=new URL(s,e.endpoint).toString(),c=t&&"object"==typeof t?function(e){if("string"==typeof e)return ue.includes(e)?e:void 0}(t.deviceMode):void 0;e.loadScriptOnce(l).then(function(){var t,r,n;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Background capture script loaded (external)"),o=null===(n=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===n?void 0:n.call(window,i({messenger:e,onBackgroundCapture:a},void 0!==c?{initialDeviceMode:c}:{})),e.notify({action:"background-capture-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var e;null===(e=null==o?void 0:o.close)||void 0===e||e.call(o),o=null})}}const pe="[Amplitude]",fe=`${pe} Session Replay ID`,me=G.US,ge={enabled:!0},ve=1e3,ye=`${pe} Session Replay Debug`,be="https://api-sr.amplitude.com/sessions/v2/track",we="https://api-sr.eu.amplitude.com/sessions/v2/track",Se="https://api-sr.stag2.amplitude.com/sessions/v2/track",Ce=9e6,ke=/payload.*exceed/i,xe=500,Oe=1e4,Ie=1024,Ee="X-Session-Replay-Event-Skipped",Me="amplitude-sr-iframe";var Re;!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",e.REPLAY_GATE_DECISION="replay-gate-decision"}(Re||(Re={}));class Pe{constructor(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}getSafeMethod(e){var t;if(!this.logger)return()=>{};const r=this.logger[e];if("function"==typeof r){return(null!==(t=r.__rrweb_original__)&&void 0!==t?t:r).bind(this.logger)}return()=>{}}enable(e){this.logger.enable(e)}disable(){this.logger.disable()}}var Ae="medium";function Te(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}var Ne=new Map,Le=function(e){var t=Ne.get(e);if(t)return t;var r="\0TRAIL\0",n="\0MID\0",s="\0DS\0",i="\0ST\0",o="\0QU\0",a=e;a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=a.replace(/\/\*\*$/,r)).replace(/\/\*\*\//g,n)).replace(/\*\*/g,s)).replace(/\*/g,i)).replace(/\?/g,o)).replace(/[.+^${}()|[\]\\]/g,"\\$&")).split(r).join("(/.*)?")).split(n).join("/(.*\\/)?")).split(s).join(".*")).split(i).join(".*")).split(o).join(".");var l=new RegExp("^".concat(a,"$"));return Ne.set(e,l),l},_e=function(e,t,r){var n;switch(t){case"light":if("input"!==e)return!1;var s=r?Te(r):"";return!!s&&(!!["password","hidden","email","tel"].includes(s)||!!(null===(n=r.autocomplete)||void 0===n?void 0:n.startsWith("cc-")));case"medium":return"input"===e;case"conservative":return!0;default:return _e(e,Ae,r)}},De=function(e,t){var r,n,s;if(e&&t.urlMaskLevels)try{for(var i=c(t.urlMaskLevels),o=i.next();!o.done;o=i.next()){var a=o.value;if(Le(a.match).test(e))return a.maskLevel}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return null!==(s=t.defaultMaskLevel)&&void 0!==s?s:Ae},Fe=function(e,t,r,n){var s,i;if(void 0===t&&(t={defaultMaskLevel:Ae}),r){if(r.closest(".amp-mask, [data-amp-mask]"))return!0;var o=(null!==(s=t.maskSelector)&&void 0!==s?s:[]).some(function(e){return r.closest(e)});if(o)return!0;if(r.closest(".amp-unmask, [data-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 _e(e,De(n,t),r)},Be=function(e,t,r){return function(n,s){return Fe(e,t,s,null==r?void 0:r())?n.replace(/[^\s]/g,"*"):n}},je=function(e,t){return function(r,n,s){var i;if("style"===r)return n;if(!(null!==(i=null==e?void 0:e.maskAttributes)&&void 0!==i?i:[]).includes(r))return n;var o=["INPUT","SELECT","TEXTAREA"].includes(s.tagName)?"input":"text";return Fe(o,e,s,null==t?void 0:t())?n.replace(/[^\s]/g,"*"):n}},Ue=function(e){var t=null==e?void 0:e.blockSelector;return h(h([],u("string"==typeof t?t?[t]:[]:null!=t?t:[]),!1),["[data-amp-block]"],!1).join(",")},$e=function(e,t){var r,n;return e&&("conservative"===De(t,e)||"conservative"===e.defaultMaskLevel||(null===(r=e.urlMaskLevels)||void 0===r?void 0:r.some(function(e){return"conservative"===e.maskLevel})))?"*":h(h([],u(null!==(n=null==e?void 0:e.maskSelector)&&void 0!==n?n:[]),!1),["[data-amp-mask]"],!1).join(",")};function ze(e,t){return t||("STAGING"===e?Se:"EU"===e?we:be)}const We=()=>{const e=m();return(null==e?void 0:e.location)?e.location.href:""},qe=(e,t)=>{for(const r of t){const t=Le(r.selector);if(t.test(e))return e.replace(t,r.replacement)}return e},Ve=()=>a(void 0,void 0,void 0,function*(){try{const e=m();if(e){const{usage:t,quota:r,usageDetails:n}=yield e.navigator.storage.estimate(),s=t?Math.round(t/Ie):0;return{totalStorageSize:s,percentOfQuota:t&&r?Math.round(1e3*(t/r+Number.EPSILON))/1e3:0,usageDetails:JSON.stringify(n)}}}catch(e){}return{totalStorageSize:0,percentOfQuota:0,usageDetails:""}}),Ge=e=>{const t=Object.assign({},e),{apiKey:r}=t;return t.apiKey=`****${r.substring(r.length-4)}`,t},He=()=>({flushMaxRetries:2,logLevel:k.Warn,loggerProvider:new M,transportProvider:new q});class Je extends A{constructor(e,t){var r,n,s,i,o,a,l,c,u,h,d,p,f,m;const g=He();super(Object.assign(Object.assign({transportProvider:g.transportProvider,loggerProvider:new Pe(t.loggerProvider||g.loggerProvider)},t),{apiKey:e})),this.flushMaxRetries=void 0!==t.flushMaxRetries&&t.flushMaxRetries<=g.flushMaxRetries?t.flushMaxRetries:g.flushMaxRetries,this.apiKey=e,this.sampleRate=t.sampleRate||0,this.semanticCapture=t.semanticCapture,this.semanticAnalyticsContext=t.semanticAnalyticsContext,this.serverZone=t.serverZone||me,this.configServerUrl=t.configServerUrl,this.trackServerUrl=t.trackServerUrl,this.shouldInlineStylesheet=t.shouldInlineStylesheet,this.inlineImages=t.inlineImages,this.version=t.version,this.performanceConfig=t.performanceConfig||ge,this.storeType=null!==(r=t.storeType)&&void 0!==r?r:"memory",this.applyBackgroundColorToBlockedElements=null!==(n=t.applyBackgroundColorToBlockedElements)&&void 0!==n&&n,this.enableUrlChangePolling=null!==(s=t.enableUrlChangePolling)&&void 0!==s&&s,this.urlChangePollingInterval=null!==(i=t.urlChangePollingInterval)&&void 0!==i?i:ve,this.captureDocumentTitle=null!==(o=t.captureDocumentTitle)&&void 0!==o&&o,void 0!==t.fullSnapshotIntervalMs&&(this.fullSnapshotIntervalMs=t.fullSnapshotIntervalMs),void 0!==t.eagerFullSnapshotSend&&(this.eagerFullSnapshotSend=t.eagerFullSnapshotSend),this.captureFullSnapshotOnFocus=null!==(a=t.captureFullSnapshotOnFocus)&&void 0!==a&&a,void 0!==t.maxPersistedEventsSizeBytes&&(this.maxPersistedEventsSizeBytes=Ze(t.maxPersistedEventsSizeBytes,Ye,Xe,"maxPersistedEventsSizeBytes",this.loggerProvider)),void 0!==t.maxSingleEventSizeBytes&&(this.maxSingleEventSizeBytes=Ze(t.maxSingleEventSizeBytes,Ye,Qe,"maxSingleEventSizeBytes",this.loggerProvider)),this.privacyConfig=Object.assign(Object.assign({},null!==(l=t.privacyConfig)&&void 0!==l?l:{}),{unmaskSelector:Array.from(new Set([".amp-unmask",...null!==(u=null===(c=t.privacyConfig)||void 0===c?void 0:c.unmaskSelector)&&void 0!==u?u:[]]))}),t.interactionConfig&&(this.interactionConfig=t.interactionConfig,this.interactionConfig.ugcFilterRules&&(e=>{if(!e.every(e=>"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(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")})(this.interactionConfig.ugcFilterRules)),t.debugMode&&(this.debugMode=t.debugMode);const v=t;this.useWebWorker=null===(p=null!==(h=t.useWebWorker)&&void 0!==h?h:null===(d=v.experimental)||void 0===d?void 0:d.useWebWorker)||void 0===p||p,this.enableTransportCompression=null===(f=t.enableTransportCompression)||void 0===f||f,this.sendTimeoutMs=t.sendTimeoutMs,this.captureAdoptedStyleSheets=null===(m=t.captureAdoptedStyleSheets)||void 0===m||m,t.crossOriginIframes&&(this.crossOriginIframes=t.crossOriginIframes),t.flushIntervalConfig?this.flushIntervalConfig=function(e,t){var r,n;const s={};void 0!==e.minIntervalMs&&(!Number.isFinite(e.minIntervalMs)||e.minIntervalMs<Ke?(t.warn(`flushIntervalConfig.minIntervalMs ${e.minIntervalMs} is below floor ${Ke}ms; clamping.`),s.minIntervalMs=Ke):s.minIntervalMs=e.minIntervalMs);void 0!==e.maxIntervalMs&&(Number.isNaN(e.maxIntervalMs)||e.maxIntervalMs<Ke?(t.warn(`flushIntervalConfig.maxIntervalMs ${e.maxIntervalMs} is below floor ${Ke}ms; clamping.`),s.maxIntervalMs=Ke):s.maxIntervalMs=e.maxIntervalMs);if(void 0!==s.minIntervalMs||void 0!==s.maxIntervalMs){const e=null!==(r=s.minIntervalMs)&&void 0!==r?r:xe,i=null!==(n=s.maxIntervalMs)&&void 0!==n?n:Oe;i<e&&(void 0===s.maxIntervalMs?(t.warn(`flushIntervalConfig.minIntervalMs (${e}) exceeds the default maxIntervalMs (10000); raising max to match min.`),s.maxIntervalMs=e):void 0===s.minIntervalMs?(t.warn(`flushIntervalConfig.maxIntervalMs (${i}) is below the default minIntervalMs (500); lowering min to match max.`),s.minIntervalMs=i):(t.warn(`flushIntervalConfig.maxIntervalMs (${s.maxIntervalMs}) is less than minIntervalMs (${s.minIntervalMs}); raising max to match min.`),s.maxIntervalMs=s.minIntervalMs))}return s}(t.flushIntervalConfig,this.loggerProvider):this.flushIntervalConfig={minIntervalMs:1e3,maxIntervalMs:1e4},this.handleSendEvents=t.handleSendEvents,this.handleFetchConfig=t.handleFetchConfig}}const Ke=100,Ye=1e3,Xe=8e6,Qe=1e7;function Ze(e,t,r,n,s){if(Number.isFinite(e))return e<t?(s.warn(`${n} ${e} is below floor ${t}; clamping.`),t):e>r?(s.warn(`${n} ${e} exceeds ceiling ${r}; clamping.`),r):e;s.warn(`${n} value is not a finite number (got ${String(e)}); ignoring.`)}var et=new Set(["button","checkbox","combobox","link","listbox","menuitem","menuitemcheckbox","menuitemradio","option","radio","searchbox","slider","spinbutton","switch","tab","textbox","treeitem","gridcell"]),tt=new Set(["banner","navigation","main","complementary","contentinfo","search","form","region","dialog","alertdialog","list","table","row","group"]),rt=new Set(["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","rowheader","switch","tab","tooltip","treeitem","alert","status","listitem"]),nt=new Set(["INPUT","SELECT","TEXTAREA"]),st=["type","name","href","target","aria-controls","aria-haspopup","data-testid"];function it(e,t){var r=e.replace(/\s+/g," ").trim();return r.length>t?r.slice(0,t-1)+"…":r}function ot(e,t){void 0===t&&(t="https://semantic.invalid/");try{var r=new URL(e,t);if("http:"!==r.protocol&&"https:"!==r.protocol)return"/";var n=/^#!?\//.test(r.hash)?"#"+r.hash.slice(1).split(/[?#]/)[0]:"",s=function(e){return e.split("/").map(function(e){var t;try{t=decodeURIComponent(e)}catch(e){return":id"}return/^\d+$/.test(t)||/^[\da-f]{8,}$/i.test(t)||/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/i.test(t)||t.length>=16&&/^[a-z\d]+$/i.test(t)&&/[a-z]/i.test(t)&&/\d/.test(t)?":id":e}).join("/")};return s(r.pathname)+s(n)}catch(e){return"/"}}function at(e){var t,r,n,s,i=null===(t=e.getAttribute("role"))||void 0===t?void 0:t.trim().split(/\s+/)[0].toLowerCase();if(i)return"none"===i||"presentation"===i?"generic":i;var o=e.tagName.toLowerCase();if("a"===o||"area"===o)return e.hasAttribute("href")?"link":"generic";if("input"===o){return null!==(n={button:"button",image:"button",reset:"button",submit:"button",file:"button",checkbox:"checkbox",radio:"radio",range:"slider",number:"spinbutton",search:"searchbox",hidden:"generic"}[(null!==(r=e.getAttribute("type"))&&void 0!==r?r:"text").toLowerCase()])&&void 0!==n?n:e.hasAttribute("list")?"combobox":"textbox"}if("select"===o)return e.multiple||e.size>1?"listbox":"combobox";return/^h[1-6]$/.test(o)?"heading":"section"===o?e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?"region":"generic":null!==(s={button:"button",summary:"button",textarea:"textbox",nav:"navigation",main:"main",form:"form",header:"banner",footer:"contentinfo",aside:"complementary",dialog:"dialog",ul:"list",ol:"list",menu:"list",li:"listitem",table:"table",tr:"row",td:"cell",th:"columnheader",img:"img",option:"option",progress:"progressbar",output:"status",fieldset:"group",details:"group",optgroup:"group"}[o])&&void 0!==s?s:"generic"}function lt(e){var t,r=null===(t=e.getAttribute("aria-invalid"))||void 0===t?void 0:t.trim().toLowerCase();return!!r&&"false"!==r}function ct(e){var t=function(t){try{var r=e.getPrivacy().blockSelector;return!!t.closest(h([".amp-block","[data-amp-block]"],u("string"==typeof r?[r]:null!=r?r:[]),!1).join(","))}catch(e){return!0}},r=function(r){try{return t(r)||Fe(nt.has(r.tagName)?"input":"text",e.getPrivacy(),r,e.getUrl())}catch(e){return!0}},n=function(e){return!!e.closest('[contenteditable]:not([contenteditable="false"])')},s=function(t,s,i){var o;if(void 0===i&&(i=80),r(t)||n(t)||void 0===s&&nt.has(t.tagName))return null;if(void 0!==s)return null===s?null:it(s,i);for(var a,l=e.document.createTreeWalker(t,5),c=0,u="";a=l.nextNode();){if(++c>256)return null;if(1===a.nodeType){var h=a;if(r(h)||n(h)||nt.has(h.tagName))return null}else u+=null!==(o=a.nodeValue)&&void 0!==o?o:"";if(u.length>2*i)break}return it(u,i)},i=function(i){var o,a,l,u,h,d=function(e,t){return{name:e||null,source:null===e?"masked":e?t:"unnamed"}};if(t(i))return d(null,"masked");var p=i.getAttribute("aria-labelledby");if(p){var f=p.trim().split(/\s+/).slice(0,20).map(function(t){return e.document.getElementById(t)}).filter(function(e){return!!e}).map(function(e){return s(e)});if(f.some(function(e){return null===e}))return d(null,"masked");var m=it(f.join(" "),80);if(m)return d(m,"aria-labelledby")}var g=i.getAttribute("aria-label");if(null==g?void 0:g.trim())return d(s(i,g),"aria-label");var v=i.labels;if(null==v?void 0:v.length){var y=v[0],b="";if(r(y))return d(null,"masked");for(var w=!1,S=e.document.createTreeWalker(y,5),C=void 0,k=0;C=S.nextNode();){if(++k>256){w=!0;break}if(1===C.nodeType&&C!==i&&(r(C)||n(C))){w=!0;break}3!==C.nodeType||(null===(l=C.parentElement)||void 0===l?void 0:l.closest('input, select, textarea, [contenteditable]:not([contenteditable="false"])'))||(b+=null!==(u=C.nodeValue)&&void 0!==u?u:"")}return d(w?null:s(y,b),y.htmlFor?"label-for":"label-wrap")}if("IMG"===i.tagName&&i.hasAttribute("alt"))return d(s(i,i.getAttribute("alt")),"alt");if("INPUT"===i.tagName&&/^(button|submit|reset)$/i.test(null!==(h=i.getAttribute("type"))&&void 0!==h?h:"")&&i.hasAttribute("value"))return d(s(i,i.getAttribute("value")),"value");if(rt.has(at(i))){var x=s(i);if(null===x||x)return d(x,"text")}try{for(var O=c(["title","placeholder"]),I=O.next();!I.done;I=O.next()){var E=I.value,M=i.getAttribute(E);if(M)return d(s(i,M),E)}}catch(e){o={error:e}}finally{try{I&&!I.done&&(a=O.return)&&a.call(O)}finally{if(o)throw o.error}}return d("","unnamed")},o=function(r){if(t(r))return null;var n=e.getNodeId(r);return n<0?null:n},a=function(e){var t=i(e);return{id:o(e),role:at(e),name:t.name,name_source:t.source}},l=function(t){var r=t;try{return r.checkVisibility?r.checkVisibility({opacityProperty:!0,visibilityProperty:!0}):t.getClientRects().length>0&&"hidden"!==e.window.getComputedStyle(t).visibility}catch(e){return!1}},d=null,p=0,f="";return{id:o,blocked:t,masked:r,text:s,name:i,describe:a,visible:l,role:at,url:function(t){return void 0===t&&(t=e.getUrl()),ot(t,e.getUrl())},actionable:function(e){for(var t=e,r=e,n=0;t&&n<12;n++,t=t.parentElement){var s=at(t);if(et.has(s))return t;r===e&&"generic"!==s&&(r=t)}return r},container:function(e){for(var t=e.parentElement,r=0;t&&r<20;r++,t=t.parentElement)if(tt.has(at(t))||t.hasAttribute("aria-label")){var n=a(t);return{id:n.id,role:n.role,name:n.name}}return null},states:function(e){var t,r,n=[],s=e,i="INPUT"===e.tagName&&"checkbox"===s.type&&s.indeterminate||"mixed"===e.getAttribute("aria-checked")||"mixed"===e.getAttribute("aria-pressed");try{for(var o=c(Object.entries({disabled:e.matches(":disabled")||"true"===e.getAttribute("aria-disabled"),required:s.required||"true"===e.getAttribute("aria-required"),invalid:lt(e)||s.willValidate&&!s.validity.valid,checked:!i&&(s.checked||"true"===e.getAttribute("aria-checked")),mixed:i,busy:"true"===e.getAttribute("aria-busy"),open:("DETAILS"===e.tagName||"DIALOG"===e.tagName)&&e.hasAttribute("open"),expanded:"true"===e.getAttribute("aria-expanded"),collapsed:"false"===e.getAttribute("aria-expanded"),selected:s.selected||"true"===e.getAttribute("aria-selected"),current:e.hasAttribute("aria-current")&&"false"!==e.getAttribute("aria-current"),pressed:"true"===e.getAttribute("aria-pressed"),readonly:s.readOnly||"true"===e.getAttribute("aria-readonly")})),a=o.next();!a.done;a=o.next()){var l=u(a.value,2),h=l[0];l[1]&&n.push(h)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},heading:function(){var t=e.window.performance.now(),r=e.getUrl();if(t<p&&r===f&&(!d||d.isConnected&&l(d)))return d?s(d):null;d=null,p=t+250,f=r;var n=e.document.body;if(!n)return null;for(var i=e.document.createTreeWalker(n,1),o=i.nextNode(),a=0;o&&a++<2e3&&e.window.performance.now()-t<2;){var c="H1"===o.tagName;if((c||o.matches('[role="heading"][aria-level="1"]'))&&l(o)){if(o.closest('main,[role="main"]')){d=o;break}c&&!d&&(d=o)}o=i.nextNode()}return d?s(d):null},invalidateHeading:function(){p=0,d=null},attributes:function(n){var s,i,o,a={};if(t(n))return a;try{for(var l=c(st),u=l.next();!u.done;u=l.next()){var h=u.value,d=n.getAttribute(h);null===d||(null===(o=e.getPrivacy().maskAttributes)||void 0===o?void 0:o.includes(h))&&r(n)||(a[h]=it("href"===h?ot(d,e.getUrl()):d,60))}}catch(e){s={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(s)throw s.error}}return a}}}var ut=new WeakMap;function ht(e){try{return e.crypto.randomUUID()}catch(e){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}function dt(e,t){var r=ut.get(e);return r||(r=Object.freeze({tab_id:ht(t),document_id:ht(t)}),ut.set(e,r)),r}var pt={click:2e3,keys:1e3,"resource-error":200,field:1e3,submit:300,notice:300,dialog:300,"amp-event":500,context:200,recording:200,navigation:200,visibility:200,lifecycle:200};function ft(e){return i(i({},e),{families:e.families?i({},e.families):void 0})}var mt=["valueMissing","typeMismatch","patternMismatch","tooShort","tooLong","rangeUnderflow","rangeOverflow","stepMismatch","badInput","customError"];function gt(e){var t,r=e.target;return 1===(null==r?void 0:r.nodeType)?r:null!==(t=null==r?void 0:r.parentElement)&&void 0!==t?t:null}function vt(e){return["INPUT","SELECT","TEXTAREA"].includes(e.tagName)}function yt(e){var t;return"INPUT"===e.tagName&&["password","hidden"].includes(null!==(t=Te(e))&&void 0!==t?t:"")}function bt(e){var t,r,n=[];if(vt(e))try{for(var s=c(mt),i=s.next();!i.done;i=s.next()){var o=i.value;e.validity[o]&&n.push(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return lt(e)&&n.push("ariaInvalid"),{valid:(!vt(e)||e.validity.valid)&&!n.includes("ariaInvalid"),validity:n}}function wt(e,t){var r=e.helpers.name(t),n=r.name,s=r.source;return{id:e.helpers.id(t),role:e.helpers.role(t),name:"text"===s||"value"===s?null:n,name_source:"text"===s||"value"===s?"masked":s}}function St(e,t,r){if(r)return null;if("SELECT"===t.tagName){var n=t.selectedOptions[0];return!n||e.helpers.blocked(n)?null:n.hasAttribute("label")?e.helpers.text(n,n.label):e.helpers.text(n)}return"INPUT"===t.tagName&&["radio","checkbox"].includes(t.type)&&t.checked?wt(e,t).name:null}var Ct={families:["click","field","submit"],setup:function(e){var t,r,n=e.host,s=e.helpers,o=[],a=new Set,l=!0,d=new WeakMap,p=new Map,f=function(e){var t=n.window.setTimeout(function(){a.delete(t),l&&e()},0);return a.add(t),t},m=function(e,t){n.document.addEventListener(e,t,!0),o.push(function(){return n.document.removeEventListener(e,t,!0)})},g=function(t){var r=e.now();if(l&&e.enabled("click")&&("auxclick"!==t.type||1===t.button)){var o=gt(t);if(o&&!s.blocked(o)){var a=s.actionable(o);if(!s.blocked(a)&&e.canEmit("click")){var u=function(e,t){var r,n,s,i=null!==(s=e.host.getPrivacy().maskAttributes)&&void 0!==s?s:[];try{for(var o=c(["data-amp-key","data-testid","data-test","data-cy","id"]),a=o.next();!a.done;a=o.next()){var l=a.value,u=t.getAttribute(l);if(!(!u||i.includes(l)&&e.helpers.masked(t)||"id"===l&&(/^\d+$/.test(u)||/[a-f\d]{8,}/i.test(u)||/:r/.test(u)||/\d{3,}/.test(u))))return u.length>80?"".concat(u.slice(0,79),"…"):u}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return null}(e,a),h=null;if(!u&&n.getSelector)try{h=n.getSelector(a)}catch(e){}e.emit("click",i(i(i(i({},s.describe(a)),{container:s.container(a),states:s.states(a),visible:s.visible(a),key:u}),u?{}:{selector:h}),{attrs:s.attributes(a),url:s.url(),heading:s.heading(),keyboard:0===t.detail,modifiers:[t.altKey?"alt":"",t.ctrlKey?"ctrl":"",t.metaKey?"meta":"",t.shiftKey?"shift":""].filter(Boolean),trusted:t.isTrusted}),r)}}}},v=function(t){var r,o;if(e.enabled("field")){var a=gt(t),l=null==a?void 0:a.closest('input, select, textarea, [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]');if(l&&("change"!==t.type||vt(l))&&!yt(l)&&!s.blocked(l)&&e.canEmit("field")){var c=Fe("input",n.getPrivacy(),l,n.getUrl()),u=i(i(i(i(i(i({},wt(e,l)),{states:s.states(l),kind:"INPUT"===l.tagName?l.type:vt(l)?l.tagName.toLowerCase():"contenteditable",value_state:(vt(l)?l.value.length>0:(null!==(o=null===(r=l.textContent)||void 0===r?void 0:r.length)&&void 0!==o?o:0)>0)?"filled":"empty"}),"INPUT"===l.tagName&&["checkbox","radio"].includes(l.type)?{checked:l.checked}:{}),function(e,t){if(t)return{};if("TEXTAREA"===e.tagName)return{value:e.value};if("INPUT"!==e.tagName)return{};var r=e;return["checkbox","radio","file","button","submit","reset","image"].includes(r.type)?{}:{value:r.value}}(l,c)),bt(l)),{masked:c,option_label:St(e,l,c)}),h=JSON.stringify(u),p=d.get(l),f=e.now();(null==p?void 0:p.payload)===h&&("focusout"===t.type||f-p.timestamp<500)||e.emit("field",u)&&d.set(l,{payload:h,timestamp:f})}}},y=function(e,t){var r=s.describe(e);if(null===r.name&&"masked"!==r.name_source){var n=null!=t?t:e.querySelector('button:not([type]), button[type="submit"], input[type="submit"], input[type="image"]');n&&!s.blocked(n)&&(r.name=s.name(n).name)}return{id:r.id,role:r.role,name:r.name}};return e.enabled("click")&&(n.externalClicks?o.push(e.on("click",g)):m("click",function(e){return g(e)}),(null!==(t=n.externalAuxClicks)&&void 0!==t?t:n.externalClicks)||m("auxclick",function(e){return g(e)})),e.enabled("field")&&(m("change",v),m("focusout",v)),e.enabled("submit")&&(m("submit",function(t){if(e.enabled("submit")){var r=gt(t);if("FORM"===(null==r?void 0:r.tagName)&&!s.blocked(r)){var n=t.submitter,i=n&&!s.blocked(n)?n:null;f(function(){e.enabled("submit")&&!s.blocked(r)&&e.canEmit("submit")&&e.emit("submit",{form:y(r,i&&!s.blocked(i)?i:null),submitter:i&&!s.blocked(i)?{id:s.id(i),role:s.role(i),name:s.name(i).name}:null,valid:!0,invalid_fields:[],prevented:t.defaultPrevented})})}}}),m("invalid",function(t){if(e.enabled("submit")){var n=gt(t);if(n&&vt(n)){var i=n.form;if(i&&!s.blocked(i)){var o=p.get(i);o||(o=new Set,p.set(i,o)),!yt(n)&&!s.blocked(n)&&o.size<10&&o.add(n),void 0===r&&(r=f(function(){var t,n;r=void 0;var i=h([],u(p),!1);if(p.clear(),e.enabled("submit"))try{for(var o=c(i),a=o.next();!a.done;a=o.next()){var l=u(a.value,2),d=l[0],f=l[1];s.blocked(d)||e.canEmit("submit")&&e.emit("submit",{form:y(d,null),submitter:null,valid:!1,prevented:!0,invalid_fields:h([],u(f),!1).filter(function(e){return!s.blocked(e)&&!yt(e)}).map(function(t){var r=wt(e,t);return{id:r.id,name:r.name,validity:bt(t).validity}})})}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}))}}}})),function(){l=!1,o.forEach(function(e){return e()}),a.forEach(function(e){return n.window.clearTimeout(e)}),a.clear(),p.clear()}}},kt='dialog,[role="dialog"],[role="alertdialog"],[aria-modal="true"]';function xt(e,t){var r,n,s,i,o,a;return l(this,function(l){switch(l.label){case 0:r=[{children:[e],index:0,hidden:!1}],l.label=1;case 1:return r.length?(n=r[r.length-1]).index===n.children.length?(r.pop(),[3,1]):(s=n.children[n.index++],i=s.attributes,o=n.hidden||void 0!==(null==i?void 0:i.hidden)||"true"===(null==i?void 0:i["aria-hidden"]),[4,{node:s,baseline:t,hidden:o}]):[3,3];case 2:return l.sent(),(null===(a=s.childNodes)||void 0===a?void 0:a.length)&&r.push({children:s.childNodes,index:0,hidden:o}),[3,1];case 3:return[2]}})}function Ot(e){var t,r,n,s,i,o,a,u,h,d,p,f,m,g,v,y,b,w,S,C,k,x,O,I,E,M;return l(this,function(R){switch(R.label){case 0:return"snapshot"!==e.type?[3,2]:[5,c(xt(e.node,!0))];case 1:return R.sent(),[3,33];case 2:R.trys.push([2,7,8,9]),t=c(e.texts),r=t.next(),R.label=3;case 3:return r.done?[3,6]:[4,{id:r.value.id,text:!0}];case 4:R.sent(),R.label=5;case 5:return r=t.next(),[3,3];case 6:return[3,9];case 7:return n=R.sent(),S={error:n},[3,9];case 8:try{r&&!r.done&&(C=t.return)&&C.call(t)}finally{if(S)throw S.error}return[7];case 9:s=function(e){return l(this,function(t){switch(t.label){case 0:return[4,{id:e.id,dialogs:["open","hidden","aria-hidden","role","aria-modal"].some(function(t){return t in e.attributes})}];case 1:return t.sent(),[2]}})},R.label=10;case 10:R.trys.push([10,15,16,17]),i=c(e.attributes),o=i.next(),R.label=11;case 11:return o.done?[3,14]:(a=o.value,[5,s(a)]);case 12:R.sent(),R.label=13;case 13:return o=i.next(),[3,11];case 14:return[3,17];case 15:return u=R.sent(),k={error:u},[3,17];case 16:try{o&&!o.done&&(x=i.return)&&x.call(i)}finally{if(k)throw k.error}return[7];case 17:h=new Set,d=function(e){var t=!h.has(e);return h.size<1e3&&h.add(e),{id:e,text:t}},R.label=18;case 18:R.trys.push([18,23,24,25]),p=c(e.removes),f=p.next(),R.label=19;case 19:return f.done?[3,22]:(m=f.value,[4,d(m.parentId)]);case 20:R.sent(),R.label=21;case 21:return f=p.next(),[3,19];case 22:return[3,25];case 23:return g=R.sent(),O={error:g},[3,25];case 24:try{f&&!f.done&&(I=p.return)&&I.call(p)}finally{if(O)throw O.error}return[7];case 25:R.trys.push([25,31,32,33]),v=c(e.adds),y=v.next(),R.label=26;case 26:return y.done?[3,30]:(b=y.value,[4,d(b.parentId)]);case 27:return R.sent(),[5,c(xt(b.node,!1))];case 28:R.sent(),R.label=29;case 29:return y=v.next(),[3,26];case 30:return[3,33];case 31:return w=R.sent(),E={error:w},[3,33];case 32:try{y&&!y.done&&(M=v.return)&&M.call(v)}finally{if(E)throw E.error}return[7];case 33:return[2]}})}var It={families:["notice","dialog"],setup:function(e){var t=e.hasCapacity("notice"),r=e.hasCapacity("dialog"),n=e.host,s=e.helpers,i=n.window;if(!t&&!r||!n.getNode)return function(){};var o,a=!0,l=null,h=!1,d=0,p=[],f=new Set,m=new Set,g=new Set,v=new WeakMap,y=new WeakMap,b=new Map,w=new WeakMap,S=new Set,C=new Set,k=!1,x=!1,O=function(e){var t;if(!C.has(e)){C.add(e);try{null===(t=n.onError)||void 0===t||t.call(n,new Error("Semantic feedback ".concat(e," limit reached; some changes may be omitted.")))}catch(e){}}},I=function(e,r){var n;if(t&&e.isConnected&&!(void 0!==r&&(null!==(n=y.get(e))&&void 0!==n?n:-1)>=r)){if(!m.has(e)&&!b.has(e)){if(m.size+b.size>=256)return void O("notice queue");m.add(e)}void 0!==r&&y.set(e,r)}},E=function(e){r&&!g.has(e)&&g.add(e)},M=e.subscribe(function(e){"click"===e.name&&(l=e.timestamp)}),R=function(){return null!==l&&e.now()-l>=0&&e.now()-l<=3e3?l:null},P=function(){m.clear(),b.forEach(function(e){return i.clearTimeout(e)}),b.clear()},A=function(){a=!1,j(),M(),void 0!==o&&(h?i.clearTimeout(o):i.cancelAnimationFrame(o),o=void 0),P(),p.length=0,f.clear(),g.clear(),S.clear()},T=function(){return t&&!e.hasCapacity("notice")&&(t=!1,P()),r&&!e.hasCapacity("dialog")&&(r=!1,g.clear(),S.clear(),f.clear()),t||r||A(),a},N=function(r){if(m.delete(r),r.isConnected&&!b.has(r)){var n=v.get(r),o=void 0===n?0:500-(e.now()-n);o<=0?function(t){if(a&&t.isConnected&&!s.blocked(t)&&e.canEmit("notice")){var r=s.text(t,void 0,200);if(null===r||r.trim()){var n=t.getAttribute("role"),i=s.container(t);e.emit("notice",{id:s.id(t),role:"alert"===n||"status"===n||"log"===n?n:"live",text:r,visible:s.visible(t),region:i?{role:i.role,name:i.name}:null,cause_click_ts:R()}),v.set(t,e.now())}}}(r):b.set(r,i.setTimeout(function(){b.delete(r),a&&t&&(I(r),m.size&&D())},o))}},L=function(t){if(g.delete(t),s.blocked(t))return S.delete(t),void f.delete(t);var r=w.get(t),n=function(e){return e.isConnected&&e.matches(kt)&&!e.closest('[hidden],[aria-hidden="true"]')&&("DIALOG"!==e.tagName||e.hasAttribute("open"))}(t);if((null==r?void 0:r.open)!==n&&(r||n)){var i=function(e){var t=w.get(e),r=e.isConnected&&e.matches(kt)&&!e.closest('[hidden],[aria-hidden="true"]')&&("DIALOG"!==e.tagName||e.hasAttribute("open")),n="true"===e.getAttribute("aria-modal");try{n=n||e.matches(":modal")}catch(e){}var i=!e.isConnected&&t?t.payload:s.describe(e);return{open:r,payload:{id:i.id,role:"alertdialog"===e.getAttribute("role")?"alertdialog":"dialog",name:e.isConnected?i.name:null,name_source:e.isConnected?i.name_source:"masked",state:r?"open":"closed",modal:!e.isConnected&&t?t.payload.modal:n,visible:r&&s.visible(e),cause_click_ts:R()}}}(t);w.set(t,i),n?S.add(t):S.delete(t),e.emit("dialog",i.payload),t.isConnected||f.delete(t)}},_=function(){var e,t,r,n,s,l,h,d;if(o=void 0,a&&T()){var v=i.performance.now();if(k){k=!1;try{for(var y=c(f),w=y.next();!w.done;w=y.next()){var C=w.value;E(C)}}catch(t){e={error:t}}finally{try{w&&!w.done&&(t=y.return)&&t.call(y)}finally{if(e)throw e.error}}try{for(var O=c(m),I=O.next();!I.done;I=O.next()){(C=I.value).isConnected||m.delete(C)}}catch(e){r={error:e}}finally{try{I&&!I.done&&(n=O.return)&&n.call(O)}finally{if(r)throw r.error}}try{for(var M=c(b),R=M.next();!R.done;R=M.next()){var P=u(R.value,2),A=(C=P[0],P[1]);C.isConnected||(i.clearTimeout(A),b.delete(C))}}catch(e){s={error:e}}finally{try{R&&!R.done&&(l=M.return)&&l.call(M)}finally{if(s)throw s.error}}try{for(var _=c(f),F=_.next();!F.done;F=_.next()){(C=F.value).isConnected||S.has(C)||(f.delete(C),g.delete(C))}}catch(e){h={error:e}}finally{try{F&&!F.done&&(d=_.return)&&d.call(_)}finally{if(h)throw h.error}}}var j=0,U=function(e){for(;a&&(m.size||g.size)&&j<50&&i.performance.now()<e;){var t=g.size>0&&(x||!m.size);x=!t,j++,t?L(g.values().next().value):N(m.values().next().value),T()}};U(v+2);for(var $=0;a&&p.length&&$++<1e3&&i.performance.now()-v<4;){var z=p[0],W=z.work.next();W.done?p.shift():B(W.value,z.generation)}U(v+4),a&&(k||p.length||m.size||g.size)&&D()}},D=function(){a&&void 0===o&&(h="function"!=typeof i.requestAnimationFrame,o=h?i.setTimeout(_,16):i.requestAnimationFrame(_))},F=function(e){return!!f.has(e)||(f.size>=256?(O("dialog tracking"),!1):(f.add(e),!0))},B=function(e,i){var o,a,l;if("node"in e){var u=e.node,h=e.baseline,d=e.hidden;if(2!==u.type)return;var p=null!==(l=u.attributes)&&void 0!==l?l:{},m="dialog"===u.tagName||"dialog"===p.role||"alertdialog"===p.role||"true"===p["aria-modal"],g=["alert","status","log"].includes(p.role)||["polite","assertive"].includes(p["aria-live"]);if((!r||!m)&&(!t||!g||h))return;var v=n.getNode(u.id);if(!v||1!==v.nodeType||s.blocked(v))return;var y=v;if(r&&m&&F(y))if(h&&!w.has(y)){var b=!d&&("dialog"!==u.tagName||void 0!==p.open);w.set(y,{open:b,payload:{id:u.id,role:"alertdialog"===p.role?"alertdialog":"dialog",name:null,name_source:"unnamed",state:b?"open":"closed",modal:"true"===p["aria-modal"]||"modal"===p.rr_open_mode,visible:!1,cause_click_ts:null}}),b&&S.add(y)}else{var C=w.get(y);C&&h&&(C.payload.id=u.id),E(y)}t&&g&&!h&&I(y,i)}else if(t&&e.text||r&&e.dialogs){var k=n.getNode(e.id),x=1===(null==k?void 0:k.nodeType)?k:null==k?void 0:k.parentElement;if(x&&x.isConnected&&!s.blocked(x)){if(t&&e.text){var O=x.closest('[role="alert"],[role="status"],[role="log"],[aria-live="polite"],[aria-live="assertive"]');O&&I(O,i)}if(r&&e.dialogs){x.matches(kt)&&F(x)&&E(x);try{for(var M=c(f),R=M.next();!R.done;R=M.next()){m=R.value;x.contains(m)&&E(m)}}catch(e){o={error:e}}finally{try{R&&!R.done&&(a=M.return)&&a.call(M)}finally{if(o)throw o.error}}}}}},j=e.on("dom",function(e){a&&T()&&(d++,("snapshot"===e.type||e.removes.length)&&(k=!0),p.length>=128?O("replay batch queue"):p.push({work:Ot(e),generation:d}),D())});return A}};var Et={families:["context","recording","visibility","lifecycle"],setup:function(e){var t=[],r=e.host,n=r.document,s=r.window;if(e.enabled("context")&&t.push(e.on("snapshot",function(){return function(e){var t,r,n,s,o;if(e.canEmit("context")){var a=e.host,l=a.document,u=a.window,h={total:0,inlined:0,unreadable:0};try{for(var d=c(Array.from(l.styleSheets)),p=d.next();!p.done;p=d.next()){var f=p.value;h.total++;try{f.cssRules,!1!==a.inlineStylesheet&&h.inlined++}catch(e){h.unreadable++}}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}var m="function"==typeof u.matchMedia&&u.matchMedia("(pointer:coarse)").matches,g=m&&u.innerWidth<768?"mobile":m&&u.innerWidth<1024?"tablet":"desktop",v=e.dropped();e.emit("context",i({sdk:a.sdk,mask:null!==(n=a.getPrivacy().defaultMaskLevel)&&void 0!==n?n:"medium",css:h,viewport:{w:u.innerWidth,h:u.innerHeight},device:g,language:u.navigator.language,visibility_state:"hidden"===l.visibilityState?"hidden":"visible",focused:l.hasFocus(),user_agent:u.navigator.userAgent,analytics_sdk:null!==(o=null===(s=a.getAnalyticsContext)||void 0===s?void 0:s.call(a))&&void 0!==o?o:{present:!1,autocapture:[]}},Object.keys(v).length?{caps_hit:v}:{}))}}(e)})),e.enabled("recording")&&t.push(e.on("recording",function(t){return e.emit("recording",t)})),e.enabled("visibility")){var o=function(){return"hidden"===n.visibilityState?"hidden":"visible"},a=o(),l=function(){var t=o();t!==a&&(a=t,e.emit("visibility",{state:t}))};n.addEventListener("visibilitychange",l,!0),t.push(function(){return n.removeEventListener("visibilitychange",l,!0)})}if(e.enabled("lifecycle")){var u=function(r,n,s){var i=function(t){e.emit("lifecycle",{type:"pageshow"===n&&t.persisted?"pageshow_bfcache":s})};r.addEventListener(n,i,!0),t.push(function(){return r.removeEventListener(n,i,!0)})};u(s,"pagehide","pagehide"),u(s,"pageshow","pageshow"),u(n,"freeze","freeze"),u(n,"resume","resume")}return function(){return t.forEach(function(e){return e()})}}},Mt=/^(Escape|Enter|Tab|ArrowUp|ArrowDown|ArrowLeft|ArrowRight|Home|End|PageUp|PageDown|F[1-9]|F1[0-2])$/,Rt=/^[kpf]$/i,Pt={families:["keys"],setup:function(e){var t=e.host.document,r=e.helpers,n=function(t){if(e.enabled("keys")&&!t.repeat&&!t.isComposing&&229!==t.keyCode&&!t.getModifierState("AltGraph")){var n=t.key;if(!Mt.test(n)){if(t.altKey||t.ctrlKey===t.metaKey||!Rt.test(n))return;n=n.toUpperCase()}var s=t.composedPath().filter(function(e){return 1===e.nodeType}),i=s[0];if(i&&!s.some(function(e){return r.blocked(e)})&&!i.matches('input[type="password"], input[type="hidden"]')&&e.canEmit("keys")){var o=r.name(i),a="value"===o.source||"text"===o.source&&!!i.closest("input,textarea,select,[contenteditable]");e.emit("keys",{key:[t.ctrlKey?"Ctrl":"",t.metaKey?"Meta":"",t.altKey?"Alt":"",t.shiftKey?"Shift":"",n].filter(Boolean).join("+"),target:{id:r.id(i),role:r.role(i),name:a?null:o.name,name_source:a?"masked":o.source,states:r.states(i)}})}}},s=function(){return t.removeEventListener("keydown",n,!0)};return e.onCleanup(s),t.addEventListener("keydown",n,!0),s}},At=65535,Tt={families:["resource-error"],setup:function(e){var t,r=e.host,n=r.document,s=r.window,o=e.helpers,a=!0,l=[],u=0,h=n.fonts,d=function(){void 0!==t&&s.clearTimeout(t),t=void 0},p=function(){var t,r,n,s;d();var h=l,p=u;if(l=[],u=0,a&&e.enabled("resource-error")){var f=new Map;try{for(var m=c(h),g=m.next();!g.done;g=m.next()){var v=g.value;if(v.element.isConnected&&!o.blocked(v.element)){var y=o.container(v.element),b=i(i({rt:v.rt,count:v.count},v.path?{path:v.path}:{}),y?{container:y}:{}),w=JSON.stringify([b.rt,b.path,b.container]),S=f.get(w);S?S.count=Math.min(At,S.count+b.count):f.set(w,b)}}}catch(e){t={error:e}}finally{try{g&&!g.done&&(r=m.return)&&r.call(m)}finally{if(t)throw t.error}}p&&e.emit("resource-error",{rt:"font",count:p});try{for(var C=c(f.values()),k=C.next();!k.done;k=C.next()){b=k.value;e.emit("resource-error",b)}}catch(e){n={error:e}}finally{try{k&&!k.done&&(s=C.return)&&s.call(C)}finally{if(n)throw n.error}}}},f=function(){"hidden"===n.visibilityState?p():void 0===t&&(t=s.setTimeout(p,500))},m=function(t){if(a&&e.enabled("resource-error")){var r=t.target;if(r&&1===r.nodeType&&!o.blocked(r)){var s,i;if("IMG"===r.tagName)s="img",i=r.currentSrc||r.getAttribute("src")||"";else if("SCRIPT"===r.tagName&&r.hasAttribute("src"))s="script",i=r.getAttribute("src")||"";else{if("LINK"!==r.tagName||!r.relList.contains("stylesheet"))return;s="css",i=r.getAttribute("href")||""}var c=function(e){if(e)try{var t=new URL(e,n.baseURI);if("http:"!==t.protocol&&"https:"!==t.protocol)return;var r=o.url(t.origin+t.pathname);return r.length<=200?r:void 0}catch(e){return}}(i),u=l.find(function(e){return e.element===r&&e.rt===s&&e.path===c});u?u.count=Math.min(At,u.count+1):(l.length>=100&&p(),l.push({element:r,rt:s,path:c,count:1})),f()}}},g=function(t){if(a&&e.enabled("resource-error")){var r=t.fontfaces;(null==r?void 0:r.length)&&(u=Math.min(At,u+r.length),f())}},v=function(){"hidden"===n.visibilityState&&p()},y=function(){a=!1,d(),l=[],u=0,n.removeEventListener("error",m,!0),n.removeEventListener("visibilitychange",v,!0),s.removeEventListener("pagehide",p,!0),null==h||h.removeEventListener("loadingerror",g)};return e.onCleanup(y),n.addEventListener("error",m,!0),n.addEventListener("visibilitychange",v,!0),s.addEventListener("pagehide",p,!0),null==h||h.addEventListener("loadingerror",g),y}},Nt=new Set(["[Amplitude] Dead Click","[Amplitude] Rage Click","[Amplitude] Error Click","[Amplitude] Thrashed Cursor"]),Lt=["[Amplitude] Clicks","[Amplitude] Begin Time","[Amplitude] End Time"],_t="[Amplitude] Element Text",Dt="[Amplitude] Element Tag",Ft="[Amplitude] Page Path",Bt={families:["amp-event"],setup:function(e){if(!e.enabled("amp-event"))return function(){};var t,r=e.subscribe(function(e){"click"===e.name&&(t={timestamp:e.timestamp,id:e.payload.id,name:e.payload.name})}),n=e.on("analytics",function(r){var n,s;if(e.enabled("amp-event")&&Nt.has(r.eventType)){var i=e.helpers,o=r.element;if((!o||!i.blocked(o))&&e.canEmit("amp-event")){var a=r.properties,l={},u=null,h=a[_t];if("string"==typeof h){if(o){var d=i.text(o),p=i.text(o,h);null!==d&&d===p&&(u=p)}l[_t]=u}var f=a[Dt];o?l[Dt]=o.tagName.toLowerCase():"string"==typeof f&&/^[a-z][a-z0-9-]{0,59}$/i.test(f)&&(l[Dt]=f.toLowerCase());try{for(var m=c(Lt),g=m.next();!g.done;g=m.next()){var v=g.value,y=a[v];"number"==typeof y&&Number.isFinite(y)&&(l[v]=y)}}catch(e){n={error:e}}finally{try{g&&!g.done&&(s=m.return)&&s.call(m)}finally{if(n)throw n.error}}var b=a[Ft];"string"==typeof b&&(l[Ft]=i.url(b));var w=t?e.now()-t.timestamp:1/0,S=null!==u&&t&&w>=0&&w<=3e3&&t.name===u?t.id:null;e.emit("amp-event",{event_type:r.eventType,insert_id:"string"==typeof r.insertId?r.insertId:null,id:S,props:l})}}});return function(){n(),r(),t=void 0}}},jt=[Ct,It,Et,{families:["navigation"],setup:function(e){return e.on("url",function(t){var r=t.url,n=t.timestamp;r.trim()&&e.canEmit("navigation")&&e.emit("navigation",{url:e.helpers.url(r)},n)})}},Bt,Pt,Tt];function Ut(e,t,r){return void 0===r&&(r=jt),function(e,t,r){var n,s,o=ft(e),a=!1,l=!1,u=!1,h=[],d={},p={},f=new Map,m=new Set,g=null!==(n=t.now)&&void 0!==n?n:Date.now,v=function(e){var r;try{null===(r=t.onError)||void 0===r||r.call(t,e)}catch(e){}},y=function(e){try{e()}catch(e){v(e)}},b=function(e){var t;return a&&!1!==(null===(t=o.families)||void 0===t?void 0:t[e])},w=function(e){var t;return b(e)&&(null!==(t=d[e])&&void 0!==t?t:0)<pt[e]},S=function(e){var t;return!(!b(e)||!w(e)&&(p[e]=(null!==(t=p[e])&&void 0!==t?t:0)+1,1))},C={host:t,helpers:ct(t),now:g,enabled:b,canEmit:S,hasCapacity:w,dropped:function(){return i({},p)},hasSnapshot:function(){return u},emit:function(e,r,n){var s,o,a;if(void 0===n&&(n=g()),!S(e))return!1;try{a=null===(s=t.getIdentity)||void 0===s?void 0:s.call(t)}catch(e){v(e)}null!=a||(a=dt(t.document,t.window));var l={name:e,payload:i(i({},r),{v:1,tab_id:a.tab_id,document_id:a.document_id}),timestamp:n};d[e]=(null!==(o=d[e])&&void 0!==o?o:0)+1;try{t.emit(l)}catch(e){return v(e),!1}return"context"===e&&(p={}),m.forEach(function(e){return y(function(){return e(l)})}),!0},on:function(e,t){var r=f.get(e);r||(r=new Set,f.set(e,r));var n=function(e){return y(function(){return t(e)})};r.add(n);var s=r;return function(){s.delete(n)}},subscribe:function(e){return m.add(e),function(){m.delete(e)}}},k=function(){a=!1;var e=h;h=[],e.reverse().forEach(function(e){return y(e)}),f.clear(),m.clear()},x=function(){var e,n,u,d;if(!a&&l&&o.enabled){var p=null!==(u=o.sampleRate)&&void 0!==u?u:1;if(!(!Number.isFinite(p)||p<=0||p>1||(void 0===s&&(s=(null!==(d=t.random)&&void 0!==d?d:Math.random)()),s>=p))){a=!0;var f=function(e){if(e.families.some(b)){var t=[],r=i(i({},C),{onCleanup:function(e){t.push(e)},on:function(e,r){var n=C.on(e,r);return t.push(n),n},subscribe:function(e){var r=C.subscribe(e);return t.push(r),r}}),n=function(){t.splice(0).reverse().forEach(function(e){return y(e)})};try{t.push(e.setup(r)),h.push(n)}catch(e){n(),v(e)}}};try{for(var m=c(r),g=m.next();!g.done;g=m.next())f(g.value)}catch(t){e={error:t}}finally{try{g&&!g.done&&(n=m.return)&&n.call(m)}finally{if(e)throw e.error}}}}};return{isActive:function(){return a},start:function(){l=!0,x()},stop:function(){l=!1,u=!1,k()},updateConfig:function(e){k(),o=ft(e),x()},resetSession:function(){k(),s=void 0,u=!1,d={},p={},x()},notify:function(e,t){var r,n,s;"snapshot"===e&&(u=!0),"snapshot"!==e&&"navigation"!==e&&"url"!==e||null===(n=(r=C.helpers).invalidateHeading)||void 0===n||n.call(r),a&&(null===(s=f.get(e))||void 0===s||s.forEach(function(e){return e(t)}))}}}(e,t,r)}var $t=(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))($t||{}),zt=(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))(zt||{}),Wt=(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))(Wt||{});class qt{constructor(e){this.ready=!1,this.firstSnapshot=!1,this.pendingSnapshots=0,this.pendingEvents=[],this.startSignal={state:"start",reason:"init"},this.resumeReason="focus",this.config={enabled:!1},this.capture=Ut(this.config,e)}prepare(e,t){const r=this.sessionId!==t,n=void 0===this.sessionId;this.config=e,this.capture.updateConfig(e),r&&this.capture.resetSession(),this.startSignal={state:r?"start":"resume",reason:n?"init":r?"new_session":this.resumeReason},this.sessionId=t,this.ready=!1,this.firstSnapshot=!1,this.pendingSnapshots=0,this.pendingEvents=[]}recordingReady(){if(!this.config.enabled||this.ready)return;this.ready=!0,this.capture.start();const e=this.pendingEvents;this.pendingEvents=[];for(const t of e)this.event(t);const t=this.pendingSnapshots;this.pendingSnapshots=0;for(let e=0;e<t;e++)this.snapshot()}event(e){if(!this.config.enabled)return;const t=e.type===$t.FullSnapshot,r=e.type===$t.IncrementalSnapshot&&e.data.source===zt.Mutation,n=e.type===$t.Plugin&&"amplitude/url-tracking@1"===e.data.plugin?e.data.payload:void 0,s=n&&"object"==typeof n&&"url-change-event"===n.type&&"string"==typeof n.href?n.href:void 0;(t||r||void 0!==s)&&(this.ready?this.capture.isActive()&&(void 0!==s?this.capture.notify("url",{url:s,timestamp:e.timestamp}):e.type===$t.FullSnapshot?(this.capture.notify("dom",{type:"snapshot",node:e.data.node}),this.snapshot()):e.type===$t.IncrementalSnapshot&&e.data.source===zt.Mutation&&this.capture.notify("dom",Object.assign(Object.assign({},e.data),{type:"mutation"}))):this.pendingEvents.length<128&&this.pendingEvents.push(e))}click(e){this.ready&&this.capture.notify("click",e)}snapshot(){this.config.enabled&&(this.ready?(this.firstSnapshot||(this.firstSnapshot=!0,this.capture.notify("recording",this.startSignal)),this.capture.notify("snapshot",void 0)):this.pendingSnapshots++)}stop(e="targeting",t="stop"){const r=this.ready&&this.firstSnapshot;this.ready=!1,this.firstSnapshot=!1,r&&(this.resumeReason=e,this.capture.notify("recording",{state:t,reason:e})),this.capture.stop(),this.pendingEvents=[],this.ready=!1,this.pendingSnapshots=0}}const Vt="AMP_semantic_tab_v1",Gt=new WeakMap,Ht=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;let Jt,Kt,Yt;function Xt(e,t){if(Yt=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";const r={root:document.body,idName:e=>!0,className:e=>!0,tagName:e=>!0,attr:(e,t)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};Jt=Object.assign(Object.assign({},r),t),Kt=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Jt.root,r);let n=Qt(e,"all",()=>Qt(e,"two",()=>Qt(e,"one",()=>Qt(e,"none"))));if(n){const t=fr(mr(n,e));return t.length>0&&(n=t[0]),er(n)}throw new Error("Selector was not found.")}function Qt(e,t,r){let n=null,s=[],i=e,o=0;for(;i;){const e=(new Date).getTime()-Yt.getTime();if(void 0!==Jt.timeoutMs&&e>Jt.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${e}ms`);let a=hr(nr(i))||hr(...sr(i))||hr(...ir(i))||hr(or(i))||[ar()];const l=lr(i);if("all"==t)l&&(a=a.concat(a.filter(ur).map(e=>cr(e,l))));else if("two"==t)a=a.slice(0,1),l&&(a=a.concat(a.filter(ur).map(e=>cr(e,l))));else if("one"==t){const[e]=a=a.slice(0,1);l&&ur(e)&&(a=[cr(e,l)])}else"none"==t&&(a=[ar()],l&&(a=[cr(a[0],l)]));for(let e of a)e.level=o;if(s.push(a),s.length>=Jt.seedMinLength&&(n=Zt(s,r),n))break;i=i.parentElement,o++}return n||(n=Zt(s,r)),!n&&r?r():n}function Zt(e,t){const r=fr(pr(e));if(r.length>Jt.threshold)return t?t():null;for(let e of r)if(rr(e))return e;return null}function er(e){let t=e[0],r=t.name;for(let n=1;n<e.length;n++){const s=e[n].level||0;r=t.level===s-1?`${e[n].name} > ${r}`:`${e[n].name} ${r}`,t=e[n]}return r}function tr(e){return e.map(e=>e.penalty).reduce((e,t)=>e+t,0)}function rr(e){const t=er(e);switch(Kt.querySelectorAll(t).length){case 0:throw new Error(`Can't select any node with this selector: ${t}`);case 1:return!0;default:return!1}}function nr(e){const t=e.getAttribute("id");return t&&Jt.idName(t)?{name:"#"+CSS.escape(t),penalty:0}:null}function sr(e){const t=Array.from(e.attributes).filter(e=>Jt.attr(e.name,e.value));return t.map(e=>({name:`[${CSS.escape(e.name)}="${CSS.escape(e.value)}"]`,penalty:.5}))}function ir(e){return Array.from(e.classList).filter(Jt.className).map(e=>({name:"."+CSS.escape(e),penalty:1}))}function or(e){const t=e.tagName.toLowerCase();return Jt.tagName(t)?{name:t,penalty:2}:null}function ar(){return{name:"*",penalty:3}}function lr(e){const t=e.parentNode;if(!t)return null;let r=t.firstChild;if(!r)return null;let n=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&n++,r!==e);)r=r.nextSibling;return n}function cr(e,t){return{name:e.name+`:nth-child(${t})`,penalty:e.penalty+1}}function ur(e){return"html"!==e.name&&!e.name.startsWith("#")}function hr(...e){const t=e.filter(dr);return t.length>0?t:null}function dr(e){return null!=e}function*pr(e,t=[]){if(e.length>0)for(let r of e[0])yield*pr(e.slice(1,e.length),t.concat(r));else yield t}function fr(e){return[...e].sort((e,t)=>tr(e)-tr(t))}function*mr(e,t,r={counter:0,visited:new Map}){if(e.length>2&&e.length>Jt.optimizedMinLength)for(let n=1;n<e.length-1;n++){if(r.counter>Jt.maxNumberOfTries)return;r.counter+=1;const s=[...e];s.splice(n,1);const i=er(s);if(r.visited.has(i))return;rr(s)&&gr(s,t)&&(yield s,r.visited.set(i,!0),yield*mr(s,t,r))}}function gr(e,t){return Kt.querySelector(er(e))===t}const vr=(e,t)=>{const r=document.createDocumentFragment();return function(e,t,r){var n,s,o=i({},e);try{for(var a=c(["blockSelector","maskSelector","unmaskSelector"]),l=a.next();!l.done;l=a.next()){var u=l.value,h=e[u],d=("string"==typeof h?[h]:null!=h?h:[]).filter(function(e){try{return t(e),!0}catch(t){if(!r)throw new Error("Invalid privacy selector: ".concat(e));return r(e),!1}});o[u]=d.length?d:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}return o}(e,e=>{r.querySelector(e)},e=>{t.warn(`[session-replay-browser] omitting selector "${e}" because it is invalid`)})};class yr{constructor(e,t){this.localConfig=t,this.remoteConfigClient=e}generateJoinedConfig(){var e,t,r,n,s,i,o,l;return a(this,void 0,void 0,function*(){const a=Object.assign({},this.localConfig);let c;a.optOut=this.localConfig.optOut,a.captureEnabled=!0;try{yield new Promise((e,t)=>{this.remoteConfigClient.subscribe("configs.sessionReplay",{timeout:1500},(r,n)=>{var s;if(this.localConfig.loggerProvider.debug(`Session Replay remote configuration received from ${n}:`,JSON.stringify(r,null,2)),!r)return void t(new Error("No remote config received"));const i=r,o=i.sr_sampling_config,l=i.sr_privacy_config,u=i.sr_targeting_config,h=i.sr_semantic_config,d=null===(s=a.interactionConfig)||void 0===s?void 0:s.ugcFilterRules;a.interactionConfig=i.sr_interaction_config,a.interactionConfig&&d&&(a.interactionConfig.ugcFilterRules=d),a.loggingConfig=i.sr_logging_config,(o||l||u||h)&&(c={},h&&(c.sr_semantic_config=h),o&&(c.sr_sampling_config=o),l&&(c.sr_privacy_config=l),u&&(c.sr_targeting_config=u)),e()})})}catch(e){return this.localConfig.loggerProvider.error("Failed to generate joined config: ",e),a.captureEnabled=!1,{localConfig:this.localConfig,joinedConfig:a,remoteConfig:void 0}}if(!c)return{localConfig:this.localConfig,joinedConfig:a,remoteConfig:c};const{sr_sampling_config:u,sr_privacy_config:h,sr_targeting_config:d,sr_semantic_config:p}=c;if(p&&(a.semanticCapture=Object.assign(Object.assign(Object.assign({enabled:!1},a.semanticCapture),p),{families:Object.assign(Object.assign({},null===(e=a.semanticCapture)||void 0===e?void 0:e.families),p.families)})),u&&Object.keys(u).length>0?(Object.prototype.hasOwnProperty.call(u,"capture_enabled")?a.captureEnabled=u.capture_enabled:a.captureEnabled=!1,Object.prototype.hasOwnProperty.call(u,"sample_rate")&&(a.sampleRate=u.sample_rate),Object.prototype.hasOwnProperty.call(u,"min_session_duration_ms")&&(a.minSessionDurationMs=this.sanitizeMinSessionDurationMs(u.min_session_duration_ms))):(a.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),h){const e=null!==(t=a.privacyConfig)&&void 0!==t?t:{},c={defaultMaskLevel:null!==(n=null!==(r=h.defaultMaskLevel)&&void 0!==r?r:e.defaultMaskLevel)&&void 0!==n?n:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[],maskAttributes:[...new Set([...null!==(s=e.maskAttributes)&&void 0!==s?s:[],...null!==(i=h.maskAttributes)&&void 0!==i?i:[]])],urlMaskLevels:[...null!==(o=h.urlMaskLevels)&&void 0!==o?o:[],...null!==(l=e.urlMaskLevels)&&void 0!==l?l:[]]},u=e=>{var t,r,n;const s={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);for(const r of null!==(t=e.blockSelector)&&void 0!==t?t:[])s[r]="block";for(const t of null!==(r=e.maskSelector)&&void 0!==r?r:[])s[t]="mask";for(const t of null!==(n=e.unmaskSelector)&&void 0!==n?n:[])s[t]="unmask";return s},d=Object.assign(Object.assign({},u(e)),u(h));for(const[e,t]of Object.entries(d))"mask"===t?c.maskSelector.push(e):"block"===t?c.blockSelector.push(e):"unmask"===t&&c.unmaskSelector.push(e);a.privacyConfig=vr(c,this.localConfig.loggerProvider)}return d&&Object.keys(d).length>0&&(a.targetingConfig=d),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:Ge(a)},null,2)),{localConfig:this.localConfig,joinedConfig:a,remoteConfig:c}})}sanitizeMinSessionDurationMs(e){if("number"==typeof e&&Number.isFinite(e)){if(!(e<0))return e>br?(this.localConfig.loggerProvider.warn(`min_session_duration_ms remote value ${e} exceeds ${br}ms ceiling; clamping.`),br):e;this.localConfig.loggerProvider.warn(`min_session_duration_ms remote value is negative (${e}); ignoring.`)}else this.localConfig.loggerProvider.warn(`min_session_duration_ms remote value is not a finite number (got ${String(e)}); ignoring.`)}}const br=6e4;function wr(e){const t=e.length;let r=0;for(;r<t&&!(e.charCodeAt(r)>127);r++);if(r===t)return t;let n=r;for(;r<t;r++){const s=e.charCodeAt(r);if(s<=127)n++;else if(s<=2047)n+=2;else if(s>=55296&&s<=56319){const s=r+1<t?e.charCodeAt(r+1):NaN;s>=56320&&s<=57343?(n+=4,r++):n+=3}else n+=3}return n}function Sr(e){let t=0;for(let r=0;r<e.length;r++)t+=wr(e[r]);return t}function Cr(e,t){if(3*e.length<=t)return;const r=wr(e);return r>t?r:void 0}function kr(e){if(e.type!==$t.IncrementalSnapshot)return!1;const t=e.data;return t.source===zt.Mutation&&!t.isAttachIframe}function xr(e){const t={};for(const r of e)for(const e of Object.keys(r))t[e]=r[e];return t}function Or(e){const t=new Map;if(e.forEach((e,r)=>{if(e.attributes&&"style"in e.attributes){const n=t.get(e.id);n?n.push(r):t.set(e.id,[r])}}),0===t.size)return e;const r=t=>e[t].attributes.style,n=new Set,s=new Map;for(const e of t.values()){if(1===e.length)continue;let t=-1;e.forEach((e,n)=>{var s;("object"!=typeof(s=r(e))||null===s)&&(t=n)});const i=[];if(e.forEach((e,r)=>{r!==t&&(n.add(e),r>t&&i.push(e))}),i.length>0){const e=i[i.length-1],t=xr(i.map(e=>r(e)));n.delete(e),s.set(e,t)}}if(0===n.size&&0===s.size)return e;const i=[];return e.forEach((e,t)=>{const r=s.get(t);if(void 0!==r)return void i.push(Object.assign(Object.assign({},e),{attributes:Object.assign(Object.assign({},e.attributes),{style:r})}));if(!n.has(t))return void i.push(e);const o=Object.assign({},e.attributes);delete o.style,Object.keys(o).length>0&&i.push(Object.assign(Object.assign({},e),{attributes:o}))}),i}function Ir(e){const t=e[0],r=new Map,n=new Map,s=new Map,i=new Map,o=new Map;e.forEach((e,t)=>{const a=e.data;for(const e of a.adds)r.has(e.node.id)||r.set(e.node.id,t),n.set(e.node.id,t),o.set(e.node.id,e.parentId);for(const e of a.removes)s.has(e.id)||s.set(e.id,t),i.set(e.id,t)});const a=new Set,l=new Set;for(const[e,t]of r){const r=s.get(e);if(void 0===r)continue;n.get(e)>=i.get(e)||(t<r?a.add(e):r<t&&l.add(e))}const c=new Set;if(a.size>0||l.size>0){let e=!0;for(;e;){e=!1;for(const[t,n]of o)if(!a.has(t)&&!l.has(t)&&!c.has(t)&&(a.has(n)||l.has(n)||c.has(n))){const n=s.get(t),i=r.get(t);void 0!==n&&void 0!==i&&n<i?l.add(t):void 0!==n&&void 0!==i&&n===i?c.add(t):a.add(t),e=!0}}}const u=a.size>0||l.size>0||c.size>0,h=[];e.forEach((e,t)=>{for(const n of e.data.removes)a.has(n.id)||l.has(n.id)&&t>=r.get(n.id)||c.has(n.id)&&(a.has(n.parentId)||l.has(n.parentId)||c.has(n.parentId))||h.push(n)});const d=e.flatMap(e=>e.data.adds),p=e.flatMap(e=>e.data.texts),f=e.flatMap(e=>e.data.attributes),m=u?f.filter(e=>!a.has(e.id)&&!l.has(e.id)&&!c.has(e.id)):f,g={source:zt.Mutation,removes:h,adds:u?d.filter(e=>!a.has(e.node.id)&&!l.has(e.node.id)&&!c.has(e.node.id)):d,texts:u?p.filter(e=>!a.has(e.id)&&!l.has(e.id)&&!c.has(e.id)):p,attributes:Or(m)};return Object.assign(Object.assign({},t),{data:g})}function Er(e){if(e.length<=1)return e;const t=[];let r=0;for(;r<e.length;){if(!kr(e[r])){t.push(e[r]),r++;continue}let n=r+1;for(;n<e.length&&kr(e[n]);)n++;t.push(n>r+1?Ir(e.slice(r,n)):e[r]),r=n}return t}class Mr{constructor(e,t,r,n,s){var i;this.taskQueue=[],this.pendingQueue=[],this.isProcessing=!1,this.compressEvent=e=>{const{type:t,timestamp:r,delay:n,data:s}=e;return null!=n?JSON.stringify({type:t,timestamp:r,delay:n,data:s}):JSON.stringify({type:t,timestamp:r,data:s})},this.addCompressedEventToManager=(e,t)=>{var r;const n=Cr(e,null!==(r=this.config.maxSingleEventSizeBytes)&&void 0!==r?r:Ce);void 0===n?this.eventsManager&&this.deviceId&&this.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:this.deviceId}):this.config.loggerProvider.warn(`Session replay event dropped: serialized size ${Math.round(n/1024)} KB exceeds maximum allowed event size. If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support.`)},this.addCompressedEvent=(e,t)=>{if(this.worker)try{this.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?this.worker.postMessage(JSON.stringify({event:e,sessionId:t})):this.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{const r=this.compressEvent(e);this.addCompressedEventToManager(r,t)}},this.flushQueue=()=>{for(this.pendingQueue.length>0&&this.taskQueue.push(...this.mergeMutationTasks(this.pendingQueue.splice(0)));this.taskQueue.length>0;){const e=this.taskQueue.shift();if(e){const{event:t,sessionId:r}=e,n=this.compressEvent(t);this.addCompressedEventToManager(n,r)}}this.isProcessing=!1},this.terminate=()=>{var e;null===(e=this.worker)||void 0===e||e.terminate()};const o=m();if(this.canUseIdleCallback=o&&"requestIdleCallback"in o,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(i=t.performanceConfig)||void 0===i?void 0:i.timeout)||2e3,this.onFullSnapshotProcessed=s,n){t.loggerProvider.log("Enabling web worker for compression");try{const e=new Blob([n],{type:"application/javascript"}),r=URL.createObjectURL(e),s=new Worker(r);s.onerror=e=>{e.preventDefault(),t.loggerProvider.error(`Worker failed, falling back to non-worker compression: ${e.message} (${e.filename}:${e.lineno})`),s.terminate(),this.worker=void 0},s.onmessage=e=>{const{compressedEvent:t,sessionId:r}=e.data;this.addCompressedEventToManager(t,r)},this.worker=s}catch(e){t.loggerProvider.error("Failed to create worker, falling back to non-worker compression:",e)}}}scheduleIdleProcessing(){this.isProcessing||(this.isProcessing=!0,requestIdleCallback(e=>{this.processQueue(e)},{timeout:this.timeout}))}enqueueEvent(e,t){var r,n;if(e.type===$t.FullSnapshot){if(this.config.loggerProvider.debug("Processing full snapshot immediately."),this.taskQueue.length>0||this.pendingQueue.length>0){const e=[...this.taskQueue.splice(0),...this.mergeMutationTasks(this.pendingQueue.splice(0))];for(const t of e){const e=this.compressEvent(t.event);this.addCompressedEventToManager(e,t.sessionId)}this.isProcessing=!1}const n=this.compressEvent(e);return this.addCompressedEventToManager(n,t),void(null===(r=this.onFullSnapshotProcessed)||void 0===r||r.call(this))}this.canUseIdleCallback&&(null===(n=this.config.performanceConfig)||void 0===n?void 0:n.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.pendingQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))}processQueue(e){for(this.pendingQueue.length>0&&this.taskQueue.push(...this.mergeMutationTasks(this.pendingQueue.splice(0)));this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){const e=this.taskQueue.shift();if(e){const{event:t,sessionId:r}=e;this.addCompressedEvent(t,r)}}this.taskQueue.length>0||this.pendingQueue.length>0?requestIdleCallback(e=>{this.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1}mergeMutationTasks(e){var t;if(!1===(null===(t=this.config.performanceConfig)||void 0===t?void 0:t.mergeMutations))return e;if(e.length<=1)return e;const r=[];let n=0;for(;n<e.length;){const t=e[n].sessionId;let s=n+1;for(;s<e.length&&e[s].sessionId===t;)s++;const i=Er(e.slice(n,s).map(e=>e.event));for(const e of i)r.push({event:e,sessionId:t});n=s}return r}}const Rr="Session replay event batch rejected due to exceeded retry count",Pr="Failed to store session replay events in IndexedDB",Ar="Session replay event batch dropped: server signalled capture disabled or session out of valid range for this session",Tr="1.52.0-codexsemantic-review-integration.0";class Nr{constructor({trackServerUrl:e,loggerProvider:t,payloadBatcher:r,workerScript:n,enableTransportCompression:s,sendTimeoutMs:i,handleSendEvents:o}){if(this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.sendIdCounter=0,this.pendingWorkerRequests=new Map,this.timedOutWorkerRequests=new Map,this.flushPauseUntilMs=0,this.mergeOnNextFlush=!1,this.coalesceNextFlush=!1,this.mergeLogFiredThisPause=!1,this.killedSessions=new Set,this.loggerProvider=t,this.payloadBatcher=r||(e=>e),this.trackServerUrl=e,this.enableTransportCompression=null==s||s,this.sendTimeoutMs=null!=i?i:1e4,this.handleSendEvents=o,n)try{const e=new Blob([n],{type:"application/javascript"}),r=URL.createObjectURL(e),s=new Worker(r);s.onerror=e=>{e.preventDefault(),t.error(`Track destination worker failed, falling back to main-thread sending: ${e.message} (${e.filename}:${e.lineno})`),s.terminate(),this.worker=void 0;for(const[,r]of this.pendingWorkerRequests)r.timeout&&clearTimeout(r.timeout),t.warn(`Session replay event send failed due to worker crash: ${e.message}`),r.resolve();this.pendingWorkerRequests.clear(),this.timedOutWorkerRequests.clear()},s.onmessage=e=>{const r=e.data;if("log"===r.type)t.log(r.message);else if("warn"===r.type)t.warn(r.message);else if("payload_too_large"===r.type){const e=this.pendingWorkerRequests.get(r.id);if(e)e.timeout&&clearTimeout(e.timeout),this.handlePayloadTooLargeResponse(e.context,r.isWaf),e.resolve(),this.pendingWorkerRequests.delete(r.id);else{const e=this.timedOutWorkerRequests.get(r.id);e&&(this.timedOutWorkerRequests.delete(r.id),this.handlePayloadTooLargeResponse(e,r.isWaf))}}else if("complete"===r.type){const e=this.pendingWorkerRequests.get(r.id);if(e)e.timeout&&clearTimeout(e.timeout),void 0!==r.skipCode&&this.applyServerDirective(e.context.sessionId,r.skipCode),this.completeRequest({context:e.context}),e.resolve(),this.pendingWorkerRequests.delete(r.id);else{const e=this.timedOutWorkerRequests.get(r.id);e&&(this.timedOutWorkerRequests.delete(r.id),void 0!==r.skipCode&&this.applyServerDirective(e.sessionId,r.skipCode),this.completeRequest({context:e}))}}else"fetch-request"===r.type&&this.handleDelegatedFetch(s,r).catch(e=>{t.warn("Failed to handle delegated session replay fetch:",e)})},this.worker=s}catch(e){t.error("Failed to create track destination worker, falling back to main-thread sending:",e)}}sendEventsList(e){this.addToQueue(Object.assign(Object.assign({},e),{attempts:0,timeout:0}))}markCoalesceNextFlush(){this.coalesceNextFlush=!0,this.schedule(0)}sendBeacon({events:e,sessionId:t,deviceId:r,apiKey:n,serverZone:s}){var i,o;const a=e=>wr(e);let l=e,c=JSON.stringify({version:2,events:l});if(a(c)>65536){let t=0,r=l.length;for(;t<r;){const e=Math.floor((t+r+1)/2);a(JSON.stringify({version:2,events:l.slice(0,e)}))<=65536?t=e:r=e-1}l=l.slice(0,t),c=JSON.stringify({version:2,events:l}),this.loggerProvider.warn(`sendBeacon payload exceeded 64 KB limit, trimmed from ${e.length} to ${l.length} events`)}if(0===l.length)return;if(this.handleSendEvents){const e=new URLSearchParams({device_id:r,session_id:String(t),type:"replay"}),i=`${ze(s,this.trackServerUrl)}?${e.toString()}`,o={"Content-Type":"application/json",Accept:"*/*",Authorization:`Bearer ${n}`};this.loggerProvider.debug(`Routing session replay exit batch (${l.length} events) through custom transport for session id ${t}.`);try{this.handleSendEvents({url:i,method:"POST",headers:o,body:c,keepalive:!0}).catch(e=>{this.loggerProvider.warn("Custom transport failed to send session replay exit batch:",e)})}catch(e){this.loggerProvider.warn("Custom transport threw while sending session replay exit batch:",e)}return}const u=new URLSearchParams({device_id:r,session_id:String(t),type:"replay",api_key:n}),h=`${ze(s,this.trackServerUrl)}?${u.toString()}`,d=m();try{const e=new Blob([c],{type:"application/json"});!1===(null===(o=null===(i=null==d?void 0:d.navigator)||void 0===i?void 0:i.sendBeacon)||void 0===o?void 0:o.call(i,h,e))&&this.loggerProvider.warn("sendBeacon failed to queue session replay payload")}catch(e){}}addToQueue(...e){e.filter(e=>this.killedSessions.has(e.sessionId)?(this.completeRequest({context:e,err:Ar}),!1):e.attempts<(e.flushMaxRetries||0)?(e.attempts+=1,!0):(this.completeRequest({context:e,err:Rr}),!1)).forEach(e=>{this.queue=this.queue.concat(e),this.schedule(0)})}schedule(e){if(this.scheduled)return;const t=this.flushPauseUntilMs-Date.now(),r=t>e?t:e;t>0&&(this.mergeOnNextFlush=!0),this.scheduled=setTimeout(()=>{this.flush(!0).then(()=>{this.queue.length>0&&this.schedule(e)})},r)}flush(e=!1){return a(this,void 0,void 0,function*(){let t=this.queue;this.queue=[],this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),this.mergeOnNextFlush?(this.mergeOnNextFlush=!1,this.coalesceNextFlush=!1,t=this.mergeQueueAfterThrottle(t)):this.coalesceNextFlush&&(this.coalesceNextFlush=!1,t=this.mergeDrainBacklog(t));for(const r of t)yield this.send(r,e)})}mergeQueueAfterThrottle(e){const t=this.coalesceByIdentity(e);return t.length<e.length&&!this.mergeLogFiredThisPause&&(this.mergeLogFiredThisPause=!0,this.loggerProvider.log(`Session replay throttle pause ended; merged ${e.length} queued batches into ${t.length} request(s)`)),t}mergeDrainBacklog(e){const t=this.coalesceByIdentity(e);return t.length<e.length&&this.loggerProvider.log(`Session replay coalesced ${e.length} persisted page-load backlog batches into ${t.length} request(s)`),t}coalesceByIdentity(e){var t,r,n,s,i,o,l;if(e.length<=1)return e;const c=new Map;for(const a of e){const e=[a.sessionId,null!==(t=a.deviceId)&&void 0!==t?t:"",null!==(r=a.apiKey)&&void 0!==r?r:"",a.type,null!==(n=a.serverZone)&&void 0!==n?n:"",a.sampleRate,null!==(i=null===(s=a.version)||void 0===s?void 0:s.type)&&void 0!==i?i:"",null!==(l=null===(o=a.version)||void 0===o?void 0:o.version)&&void 0!==l?l:""].join("|"),u=c.get(e);u?u.push(a):c.set(e,[a])}const u=[];for(const e of c.values()){if(1===e.length){u.push(e[0]);continue}let t=null,r=0;const n=()=>{t&&u.push(t),t=null,r=0};for(const s of e){const e=Sr(s.events);if(null===t){t=Object.assign(Object.assign({},s),{events:[...s.events],attempts:0}),r=e;continue}if(r+e>4e6){n(),t=Object.assign(Object.assign({},s),{events:[...s.events],attempts:0}),r=e;continue}const i=t.onComplete,o=s.onComplete;t.events=t.events.concat(s.events),r+=e,t.onComplete=()=>a(this,void 0,void 0,function*(){yield Promise.allSettled([i(),o()])})}n()}return u}send(e,t=!0){return a(this,void 0,void 0,function*(){if(this.killedSessions.has(e.sessionId))return this.completeRequest({context:e,err:Ar});const r=e.apiKey;if(!r)return this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"});const n=e.deviceId;if(!n)return this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"});const s=this.payloadBatcher({version:1,events:e.events});if(0===s.events.length)return void this.completeRequest({context:e});const{worker:i}=this;return i?this.sendViaWorker(i,e,s,t):this.sendOnMainThread(r,n,e,s,t)})}sendViaWorker(e,t,r,n){return a(this,void 0,void 0,function*(){const s=""+ ++this.sendIdCounter;return new Promise(i=>{var o;const a=this.sendTimeoutMs>0?setTimeout(()=>{const e=this.pendingWorkerRequests.get(s);e&&(this.pendingWorkerRequests.delete(s),this.rememberTimedOutRequest(s,e.context),this.loggerProvider.warn(`Session replay worker send timed out after ${this.sendTimeoutMs}ms; leaving events for retry`),e.resolve())},this.sendTimeoutMs):void 0;this.pendingWorkerRequests.set(s,{context:t,resolve:i,timeout:a}),e.postMessage({type:"send",id:s,payload:r,useRetry:n,useCustomTransport:!!this.handleSendEvents,context:{apiKey:t.apiKey,deviceId:t.deviceId,sessionId:t.sessionId,events:t.events,eventType:t.type,flushMaxRetries:null!==(o=t.flushMaxRetries)&&void 0!==o?o:0,sampleRate:t.sampleRate,serverZone:t.serverZone,trackServerUrl:this.trackServerUrl,version:t.version,currentUrl:We(),sdkVersion:Tr,enableTransportCompression:this.enableTransportCompression,sendTimeoutMs:this.sendTimeoutMs}})})})}rememberTimedOutRequest(e,t){if(this.timedOutWorkerRequests.set(e,t),this.timedOutWorkerRequests.size>256)for(const e of this.timedOutWorkerRequests.keys()){this.timedOutWorkerRequests.delete(e);break}}handleDelegatedFetch(e,t){var r,n,s;return a(this,void 0,void 0,function*(){const{requestId:i,url:o,method:a,headers:l,body:c,keepalive:u}=t;try{let t;this.handleSendEvents?t=yield this.handleSendEvents({url:o,method:a,headers:l,body:c,keepalive:u}):(this.loggerProvider.warn("Delegated session replay fetch received without a custom transport configured; falling back to built-in fetch."),t=yield fetch(o,{method:a,headers:l,body:c,keepalive:u}));const h=t.status;let d=null,p="";if(h>=200&&h<300&&(d=null!==(s=null===(n=null===(r=t.headers)||void 0===r?void 0:r.get)||void 0===n?void 0:n.call(r,Ee))&&void 0!==s?s:null),413===h)try{p=yield t.text()}catch(e){}this.loggerProvider.debug(`Delegated session replay fetch (request ${i}) returned status ${h}.`),e.postMessage({type:"fetch-response",requestId:i,status:h,skipHeader:d,body:p})}catch(t){this.loggerProvider.debug(`Delegated session replay fetch (request ${i}) failed:`,t),e.postMessage({type:"fetch-response",requestId:i,status:0,skipHeader:null,body:String(t),error:!0})}})}sendOnMainThread(e,t,r,n,s){var i,o,l,c,u,h,d;return a(this,void 0,void 0,function*(){const p=We(),f=Tr,g=r.sampleRate,v=new URLSearchParams({device_id:t,session_id:`${r.sessionId}`,type:`${r.type}`}),y=`${null!==(o=null===(i=r.version)||void 0===i?void 0:i.type)&&void 0!==o?o:"standalone"}/${null!==(c=null===(l=r.version)||void 0===l?void 0:l.version)&&void 0!==c?c:f}`;try{const t=JSON.stringify(n),i=m(),o=this.enableTransportCompression&&i&&"CompressionStream"in i?yield function(e,t){return a(this,void 0,void 0,function*(){try{const r=new(0,t.CompressionStream)("gzip"),n=r.writable.getWriter(),s=r.readable.getReader(),i=[],o=(()=>a(this,void 0,void 0,function*(){for(;;){const{done:e,value:t}=yield s.read();if(e)break;i.push(t)}}))();yield n.write((new TextEncoder).encode(e)),yield n.close(),yield o;const l=i.reduce((e,t)=>e+t.length,0),c=new Uint8Array(l);let u=0;for(const e of i)c.set(e,u),u+=e.length;return c}catch(e){return null}})}(t,i):null,l=o?o.byteLength:wr(t),c=new AbortController,S=Object.assign({"Content-Type":"application/json",Accept:"*/*",Authorization:`Bearer ${e}`,"X-Client-Version":f,"X-Client-Library":y,"X-Client-Url":p.substring(0,1e3),"X-Client-Sample-Rate":`${g}`,"X-Sampling-Hash-Alg":"xxhash32"},o?{"Content-Encoding":"gzip"}:{}),C=null!=o?o:t,k=l<=65536,x={headers:S,body:C,method:"POST",keepalive:k,signal:c.signal},O=`${ze(r.serverZone,this.trackServerUrl)}?${v.toString()}`;if(0===n.events.length)return void this.completeRequest({context:r});const I=this.sendTimeoutMs>0?setTimeout(()=>{c.abort()},this.sendTimeoutMs):void 0;let E;try{E=this.handleSendEvents?yield(b=this.handleSendEvents({url:O,method:"POST",headers:S,body:C,keepalive:k}),w=c.signal,new Promise((e,t)=>{const r=()=>{const e=new Error("Custom session replay transport aborted by send timeout");e.name="AbortError",t(e)};w.addEventListener("abort",r,{once:!0}),b.then(t=>{w.removeEventListener("abort",r),e(t)},e=>{w.removeEventListener("abort",r),t(e)})})):yield fetch(O,x)}finally{I&&clearTimeout(I)}if(null===E)return void this.completeRequest({context:r,err:"Unexpected error occurred"});if(E.status>=200&&E.status<300){const e=null!==(d=null===(h=null===(u=E.headers)||void 0===u?void 0:u.get)||void 0===h?void 0:h.call(u,Ee))&&void 0!==d?d:null;this.applyServerDirective(r.sessionId,e)}if(s){let e="";if(413===E.status)try{e=yield E.text()}catch(e){}yield this.handleReponse(E.status,r,e)}else{let e="";try{e=JSON.stringify(E.body,null,2)}catch(e){}this.completeRequest({context:r,success:`${E.status}: ${e}`})}}catch(e){!!e&&"object"==typeof e&&"AbortError"===e.name&&s?yield this.handleOtherResponse(r):this.completeRequest({context:r,err:e})}var b,w})}handleReponse(e,t,r=""){return a(this,void 0,void 0,function*(){switch((new W).buildStatus(e)){case d.Success:this.handleSuccessResponse(t);break;case d.Failed:case d.Timeout:case d.RateLimit:yield this.handleOtherResponse(t);break;case d.PayloadTooLarge:this.handlePayloadTooLargeResponse(t,ke.test(r));break;default:if(499===e){yield this.handleOtherResponse(t);break}this.completeRequest({context:t,err:"Network error occurred, event batch rejected"})}})}handlePayloadTooLargeResponse(e,t){const r=t?"WAF (compressed payload too large)":"server (event too large)",n=Math.round(e.events.reduce((e,t)=>e+t.length,0)/Ie);if(!t)return void this.completeRequest({context:e,err:`Session replay event batch dropped: ${r} rejected payload (${e.events.length} events, ${n} KB) — not retrying non-WAF 413`});if(1===e.events.length)return void this.completeRequest({context:e,err:`Session replay event dropped: single event (${n} KB, 1 event) rejected by ${r} — cannot split further`});this.loggerProvider.warn(`Session replay event batch rejected by ${r} (${e.events.length} events, ${n} KB total) — splitting and retrying`),e.onComplete();const s=()=>Promise.resolve(),i=Math.floor(e.events.length/2);this.sendEventsList(Object.assign(Object.assign({},e),{events:e.events.slice(0,i),onComplete:s})),this.sendEventsList(Object.assign(Object.assign({},e),{events:e.events.slice(i),onComplete:s}))}handleSuccessResponse(e){const t=Math.round(Sr(e.events)/Ie);this.completeRequest({context:e,success:`Session replay event batch tracked successfully for session id ${e.sessionId}, size of events: ${t} KB`})}handleOtherResponse(e){return a(this,void 0,void 0,function*(){const t=Math.random()*e.attempts*this.retryTimeout;e.attempts++,e.attempts>(e.flushMaxRetries||0)?this.completeRequest({context:e,err:Rr}):(yield new Promise(e=>setTimeout(e,t)),yield this.send(e,!0))})}completeRequest({context:e,err:t,success:r}){e.onComplete(),t?this.loggerProvider.warn(t):r&&this.loggerProvider.log(r)}applyServerDirective(e,t){if(null===t)return this.flushPauseUntilMs=0,void(this.mergeLogFiredThisPause=!1);if("429"===t){const e=this.flushPauseUntilMs>Date.now();return this.flushPauseUntilMs=Date.now()+6e4,void(e||this.loggerProvider.log("Session replay throttled by server; pausing flush schedule for 60s"))}"4005"!==t&&"4004"!==t||this.killSession(e,t)}killSession(e,t){if(this.killedSessions.has(e))return;if(this.killedSessions.add(e),this.killedSessions.size>256)for(const e of this.killedSessions){this.killedSessions.delete(e);break}this.loggerProvider.log(`Session replay capture stopped for session ${e} by server directive ${t}; remaining events will be dropped`);const r=[];for(const t of this.queue)t.sessionId===e?this.completeRequest({context:t,err:Ar}):r.push(t);this.queue=r}}const Lr=(e,t)=>t.some(t=>e instanceof t);let _r,Dr;const Fr=new WeakMap,Br=new WeakMap,jr=new WeakMap;let Ur={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return Fr.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return qr(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function $r(e){Ur=e(Ur)}function zr(e){return(Dr||(Dr=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Vr(this),t),qr(this.request)}:function(...t){return qr(e.apply(Vr(this),t))}}function Wr(e){return"function"==typeof e?zr(e):(e instanceof IDBTransaction&&function(e){if(Fr.has(e))return;const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",i),e.removeEventListener("abort",i)},s=()=>{t(),n()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",s),e.addEventListener("error",i),e.addEventListener("abort",i)});Fr.set(e,t)}(e),Lr(e,_r||(_r=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Ur):e)}function qr(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{t(qr(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",i)});return jr.set(t,e),t}(e);if(Br.has(e))return Br.get(e);const t=Wr(e);return t!==e&&(Br.set(e,t),jr.set(t,e)),t}const Vr=e=>jr.get(e);function Gr(e,t,{blocked:r,upgrade:n,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=qr(o);return n&&o.addEventListener("upgradeneeded",e=>{n(qr(o.result),e.oldVersion,e.newVersion,qr(o.transaction),e)}),r&&o.addEventListener("blocked",e=>r(e.oldVersion,e.newVersion,e)),a.then(e=>{i&&e.addEventListener("close",()=>i()),s&&e.addEventListener("versionchange",e=>s(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}const Hr=["get","getKey","getAll","getAllKeys","count"],Jr=["put","add","delete","clear"],Kr=new Map;function Yr(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Kr.get(t))return Kr.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=Jr.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!Hr.includes(r))return;const i=async function(e,...t){const i=this.transaction(e,s?"readwrite":"readonly");let o=i.store;return n&&(o=o.index(t.shift())),(await Promise.all([o[r](...t),s&&i.done]))[0]};return Kr.set(t,i),i}$r(e=>({...e,get:(t,r,n)=>Yr(t,r)||e.get(t,r,n),has:(t,r)=>!!Yr(t,r)||e.has(t,r)}));const Xr=["continue","continuePrimaryKey","advance"],Qr={},Zr=new WeakMap,en=new WeakMap,tn={get(e,t){if(!Xr.includes(t))return e[t];let r=Qr[t];return r||(r=Qr[t]=function(...e){Zr.set(this,en.get(this)[t](...e))}),r}};async function*rn(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,tn);for(en.set(r,t),jr.set(r,Vr(t));t;)yield r,t=await(Zr.get(r)||t.continue()),Zr.delete(r)}function nn(e,t){return t===Symbol.asyncIterator&&Lr(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Lr(e,[IDBIndex,IDBObjectStore])}$r(e=>({...e,get:(t,r,n)=>nn(t,r)?rn:e.get(t,r,n),has:(t,r)=>nn(t,r)||e.has(t,r)}));class sn{get timeAtLastSplit(){return this._timeAtLastSplit}constructor(e){var t,r,n;this.minInterval=xe,this.maxInterval=Oe,this.maxPersistedEventsSize=6e6,this._timeAtLastSplit=Date.now(),this.eventsContentBytes=new WeakMap,this.sequenceContentBytes=new Map,this.shouldSplitEventsList=(e,t)=>{const r=this.getEventsArraySize(e),n=this.maxPersistedEventsSize-r;let s=t.length>=n;return!s&&3*t.length>=n&&(s=wr(t)>=n),!!s||!!(Date.now()-this.timeAtLastSplit>this.interval&&e.length)&&(this.interval=Math.min(this.maxInterval,this.interval+this.minInterval),this._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,this.interval=this.minInterval}isPrefixOf(e,t){return!(t.length<e.length)&&(0===e.length||t[e.length-1]===e.tail)}measureContentBytes(e,t){if(e&&e.length===t.length&&this.isPrefixOf(e,t))return e;let r=0,n=0;e&&this.isPrefixOf(e,t)&&(r=e.contentBytes,n=e.length);for(let e=n;e<t.length;e++)r+=wr(t[e]);return{length:t.length,contentBytes:r,tail:t.length>0?t[t.length-1]:void 0}}getEventsContentBytes(e){const t=this.measureContentBytes(this.eventsContentBytes.get(e),e);return this.eventsContentBytes.set(e,t),t.contentBytes}getEventsArraySize(e){return this.getEventsContentBytes(e)+(2+Math.max(0,e.length-1)+2*e.length)}recallSequenceContentBytes(e,t){const r=this.sequenceContentBytes.get(e);r&&r.length===t.length&&this.isPrefixOf(r,t)&&this.eventsContentBytes.set(t,r)}rememberSequenceContentBytes(e,t){const r=this.measureContentBytes(this.sequenceContentBytes.get(e),t);this.sequenceContentBytes.set(e,r),this.eventsContentBytes.set(t,r)}forgetSequenceContentBytes(e){this.sequenceContentBytes.delete(e)}}const on=(e,t,r)=>{var n;"object"==typeof(n=r)&&null!==n&&"AbortError"===n.name?e.debug(t):e.warn(t)};const an="sessionCurrentSequence",ln="sequencesToSend",cn=5e3;function un(e,t,r){const n=setTimeout(r,t);return e.then(()=>clearTimeout(n),()=>clearTimeout(n)),()=>clearTimeout(n)}const hn=e=>{let t,r;return e.objectStoreNames.contains(an)||(r=e.createObjectStore(an,{keyPath:"sessionId"})),e.objectStoreNames.contains(ln)||(t=e.createObjectStore(ln,{keyPath:"sequenceId",autoIncrement:!0}),t.createIndex("sessionId","sessionId")),{sequencesStore:t,currentSequenceStore:r}},dn=e=>a(void 0,void 0,void 0,function*(){return yield function(e,t,r="IDB operation timed out"){return new Promise((n,s)=>{const i=setTimeout(()=>s(new Error(`${r} after ${t}ms`)),t);e.then(e=>{clearTimeout(i),n(e)},e=>{clearTimeout(i),s(e)})})}(Gr(e,1,{upgrade:hn}),2e3,"IDB openDB timed out")});class pn extends sn{maybeLogEmptyFiltered(e){this.emptyFilteredCount++%100==0&&this.loggerProvider.debug(`Filtered empty session replay sequence at ${e} (idb store)`)}constructor(e){var t;super(e),this.consecutiveFailures=0,this.hasTriggeredFallback=!1,this.emptyFilteredCount=0,this.getSequencesToSend=()=>a(this,void 0,void 0,function*(){let e=!1,t=!1;try{const r=[],n=this.db.transaction("sequencesToSend","readwrite");n.done.catch(r=>{e||t||(on(this.loggerProvider,`${Pr}: ${r}`,r),this.recordFailure())});const s=un(n.done,cn,()=>{e||t||(t=!0,on(this.loggerProvider,`${Pr}: transaction timed out`),this.recordFailure())});let i=yield n.store.openCursor();for(;i;){const{sessionId:e,events:t}=i.value;0===t.length?(this.maybeLogEmptyFiltered("getSequencesToSend"),yield i.delete()):r.push({events:t,sequenceId:i.key,sessionId:e}),i=yield i.continue()}return this.recordSuccess(),s(),r}catch(r){t||(e=!0,on(this.loggerProvider,`${Pr}: ${r}`,r),this.recordFailure())}}),this.storeCurrentSequence=e=>a(this,void 0,void 0,function*(){let t=!1,r=!1;try{const n=this.db.transaction([an,ln],"readwrite");n.done.catch(e=>{t||r||(on(this.loggerProvider,`${Pr}: ${e}`,e),this.recordFailure())});const s=un(n.done,cn,()=>{t||r||(r=!0,on(this.loggerProvider,`${Pr}: transaction timed out`),this.recordFailure())}),i=yield n.objectStore(an).get(e);if(!i||i.tabId&&i.tabId!==this.tabId)return void s();if(0===i.events.length)return this.maybeLogEmptyFiltered("storeCurrentSequence"),void s();const a=yield n.objectStore(ln).put({sessionId:e,events:i.events,tabId:this.tabId});yield n.objectStore(an).put({sessionId:e,events:[],tabId:this.tabId}),this.rememberSequenceContentBytes(e,[]),this.recordSuccess(),s();const{tabId:l}=i,c=o(i,["tabId"]);return Object.assign(Object.assign({},c),{sessionId:e,sequenceId:a})}catch(n){this.forgetSequenceContentBytes(e),r||(t=!0,on(this.loggerProvider,`${Pr}: ${n}`,n),this.recordFailure())}}),this.addEventToCurrentSequence=(e,t)=>a(this,void 0,void 0,function*(){let r=!1,n=!1;try{const s=this.db.transaction([an,ln],"readwrite");s.done.catch(e=>{r||n||(on(this.loggerProvider,`${Pr}: ${e}`,e),this.recordFailure())});const i=un(s.done,cn,()=>{r||n||(n=!0,on(this.loggerProvider,`${Pr}: transaction timed out`),this.recordFailure())}),o=yield s.objectStore(an).get(e);if((null==o?void 0:o.tabId)&&o.tabId!==this.tabId){o.events.length>0&&(yield s.objectStore(ln).put({sessionId:e,events:o.events,tabId:o.tabId}));const r=[t];return yield s.objectStore(an).put({sessionId:e,events:r,tabId:this.tabId}),this.rememberSequenceContentBytes(e,r),this.recordSuccess(),void i()}const a=o;if(!a){const r=[t];return yield s.objectStore(an).put({sessionId:e,events:r,tabId:this.tabId}),this.rememberSequenceContentBytes(e,r),this.recordSuccess(),void i()}if(this.recallSequenceContentBytes(e,a.events),!this.shouldSplitEventsList(a.events,t)){const r=a.events.concat(t);return yield s.objectStore(an).put({sessionId:e,events:r,tabId:this.tabId}),this.rememberSequenceContentBytes(e,r),this.recordSuccess(),void i()}const l=a.events;if(0===l.length){this.maybeLogEmptyFiltered("addEventToCurrentSequence");const r=[t];return yield s.objectStore(an).put({sessionId:e,events:r,tabId:this.tabId}),this.rememberSequenceContentBytes(e,r),this.recordSuccess(),void i()}const c=[t];yield s.objectStore(an).put({sessionId:e,events:c,tabId:this.tabId}),this.rememberSequenceContentBytes(e,c);const u=yield s.objectStore(ln).put({sessionId:e,events:l,tabId:this.tabId});return this.recordSuccess(),i(),{events:l,sessionId:e,sequenceId:u}}catch(t){this.forgetSequenceContentBytes(e),n||(r=!0,on(this.loggerProvider,`${Pr}: ${t}`,t),this.recordFailure())}}),this.storeSendingEvents=(e,t)=>a(this,void 0,void 0,function*(){try{const r=yield this.db.put(ln,{sessionId:e,events:t,tabId:this.tabId});return this.recordSuccess(),r}catch(e){on(this.loggerProvider,`${Pr}: ${e}`,e),this.recordFailure()}}),this.cleanUpSessionEventsStore=(e,t)=>a(this,void 0,void 0,function*(){if(t)try{yield this.db.delete(ln,t),this.recordSuccess()}catch(e){on(this.loggerProvider,`${Pr}: ${e}`,e),this.recordFailure()}}),this.db=e.db,this.tabId=e.tabId,this.onPersistentFailure=e.onPersistentFailure,this.consecutiveFailureThreshold=null!==(t=e.consecutiveFailureThreshold)&&void 0!==t?t:1}recordFailure(){var e;this.consecutiveFailures++,!this.hasTriggeredFallback&&this.consecutiveFailures>=this.consecutiveFailureThreshold&&(this.hasTriggeredFallback=!0,null===(e=this.onPersistentFailure)||void 0===e||e.call(this))}recordSuccess(){this.consecutiveFailures=0}static new(e,t){var r;return a(this,void 0,void 0,function*(){try{const n="replay"===e?"":`_${e}`,s=`${t.apiKey.substring(0,10)}_amp_session_replay_events${n}`,i=yield dn(s),o=null!==(r=t.tabId)&&void 0!==r?r:function(){try{return crypto.randomUUID()}catch(e){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}();return new pn(Object.assign(Object.assign({},t),{db:i,tabId:o}))}catch(e){on(t.loggerProvider,`${Pr}: ${e}`,e)}})}getCurrentSequenceEvents(e){return a(this,void 0,void 0,function*(){if(e){const t=yield this.db.get("sessionCurrentSequence",e);if(!t)return;if(t.tabId&&t.tabId!==this.tabId)return;return[o(t,["tabId"])]}const t=[];for(const e of yield this.db.getAll("sessionCurrentSequence")){if(e.tabId&&e.tabId!==this.tabId)continue;const r=o(e,["tabId"]);t.push(r)}return t})}}class fn extends sn{constructor(){super(...arguments),this.finalizedSequences={},this.sequences={},this.sequenceId=0,this.emptyFilteredCount=0}resetCurrentSequence(e){this.sequences[e]=[]}addSequence(e){const t=this.sequenceId++,r=[...this.sequences[e]];return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}}maybeLogEmptyFiltered(e){this.emptyFilteredCount++%100==0&&this.loggerProvider.debug(`Filtered empty session replay sequence at ${e} (in-memory store)`)}getSequencesToSend(){return a(this,void 0,void 0,function*(){const e=[];for(const[t,{sessionId:r,events:n}]of Object.entries(this.finalizedSequences))0!==n.length?e.push({sequenceId:Number(t),sessionId:r,events:n}):(this.maybeLogEmptyFiltered("getSequencesToSend"),delete this.finalizedSequences[Number(t)]);return e})}storeCurrentSequence(e){return a(this,void 0,void 0,function*(){const t=this.sequences[e];if(t){if(0!==t.length)return this.addSequence(e);this.maybeLogEmptyFiltered("storeCurrentSequence")}})}addEventToCurrentSequence(e,t){return a(this,void 0,void 0,function*(){let r;return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(0===this.sequences[e].length?this.maybeLogEmptyFiltered("addEventToCurrentSequence"):r=this.addSequence(e)),this.sequences[e].push(t),r})}storeSendingEvents(e,t){return a(this,void 0,void 0,function*(){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},this.sequenceId++})}cleanUpSessionEventsStore(e,t){return a(this,void 0,void 0,function*(){void 0!==t&&delete this.finalizedSequences[t]})}}const mn=({config:e,minInterval:t,maxInterval:r,maxPersistedEventsSize:n,type:s,payloadBatcher:i,storeType:o,trackDestinationWorkerScript:l,shouldSend:c})=>a(void 0,void 0,void 0,function*(){var u;const h=null!==(u=e.maxSingleEventSizeBytes)&&void 0!==u?u:Ce,d=new Nr(Object.assign(Object.assign({},e),{loggerProvider:e.loggerProvider,payloadBatcher:i,workerScript:l})),p=()=>new fn({loggerProvider:e.loggerProvider,maxInterval:r,minInterval:t,maxPersistedEventsSize:n});let f,m,g=!1;m="idb"===o?yield a(void 0,void 0,void 0,function*(){const i=yield pn.new(s,{loggerProvider:e.loggerProvider,minInterval:t,maxInterval:r,maxPersistedEventsSize:n,apiKey:e.apiKey,onPersistentFailure:()=>{a(void 0,void 0,void 0,function*(){if(!g)return;g=!1,e.loggerProvider.warn("IDB store is experiencing repeated failures; falling back to in-memory event store.");const t=f?yield m.getSequencesToSend():void 0;if(m=p(),t&&f){const e=f;t.forEach(t=>{w({sequenceId:t.sequenceId,events:t.events,sessionId:t.sessionId,deviceId:e})})}})}});return i?(g=!0,i):(e.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),p())}):p();const v=[];let y=0;const b=e=>{if(e<=y)return;const t=Math.min(e-y,v.length);t>0&&(v.splice(0,t),y=e)},w=({events:t,sessionId:r,deviceId:n,sequenceId:i})=>{let o=t;const l=[];for(let e=0;e<t.length;e++){const r=Cr(t[e],h);void 0!==r?(0===l.length&&(o=t.slice(0,e)),l.push(r)):o!==t&&o.push(t[e])}l.length>0&&e.loggerProvider.warn(`Dropping ${l.length} oversized event(s) from session replay sequence before send. Sizes: ${l.map(e=>`${Math.round(e/1024)} KB`).join(", ")}. If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support.`),0!==o.length?(e.debugMode&&Ve().then(({totalStorageSize:t,percentOfQuota:r,usageDetails:n})=>{e.loggerProvider.debug(`Total storage size: ${t} KB, percentage of quota: ${r}%, usage details: ${n}`)}).catch(()=>{}),d.sendEventsList({events:o,sessionId:r,flushMaxRetries:e.flushMaxRetries,apiKey:e.apiKey,deviceId:n,sampleRate:e.sampleRate,serverZone:e.serverZone,version:e.version,type:s,onComplete:()=>a(void 0,void 0,void 0,function*(){yield m.cleanUpSessionEventsStore(r,i)})})):m.cleanUpSessionEventsStore(r,i).catch(t=>{e.loggerProvider.warn("Failed to clean up session replay events store:",t)})};return{sendCurrentSequenceEvents:({sessionId:t,deviceId:r})=>{if(f=r,c&&!c())return;const n=y+v.length;m.storeCurrentSequence(t).then(e=>{e&&(b(n),w({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:r}))}).catch(t=>{e.loggerProvider.warn("Failed to get current sequence of session replay events for session:",t)})},addEvent:({event:t,sessionId:r,deviceId:n})=>{f=n;const s=!c||c(),i=y+v.length;v.push(t.data),m.addEventToCurrentSequence(r,t.data).then(t=>{if(t){if(!s)return m.cleanUpSessionEventsStore(t.sessionId,t.sequenceId).catch(t=>{e.loggerProvider.warn("Failed to clean up dropped session replay sequence:",t)}),void b(i);b(i),w({sequenceId:t.sequenceId,events:t.events,sessionId:t.sessionId,deviceId:n})}}).catch(t=>{e.loggerProvider.warn("Failed to add event to session replay capture:",t)})},sendStoredEvents:({deviceId:t})=>a(void 0,void 0,void 0,function*(){f=t;const r=yield m.getSequencesToSend();(null==r?void 0:r.length)&&(e.loggerProvider.log(`Draining ${r.length} stored sequence(s) from previous session.`),r.length>1&&d.markCoalesceNextFlush(),r.forEach(e=>{w({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}))}),flush:function(e=!1){return a(this,void 0,void 0,function*(){return d.flush(e)})},getBeaconEvents:()=>[...v],dropPendingBeaconEvents:()=>{b(y+v.length)},trackDestination:d}});class gn{constructor(...e){const t=new Map;e.forEach(e=>{t.set(e.name,e.manager)}),this.managers=t}sendStoredEvents(e){return a(this,void 0,void 0,function*(){const t=[];this.managers.forEach(r=>{t.push(r.sendStoredEvents(e))}),yield Promise.all(t)})}addEvent({sessionId:e,event:t,deviceId:r}){var n;null===(n=this.managers.get(t.type))||void 0===n||n.addEvent({sessionId:e,event:t,deviceId:r})}sendCurrentSequenceEvents({sessionId:e,deviceId:t}){this.managers.forEach(r=>{r.sendCurrentSequenceEvents({sessionId:e,deviceId:t})})}flush(e){return a(this,void 0,void 0,function*(){const t=[];this.managers.forEach(r=>{t.push(r.flush(e))}),yield Promise.all(t)})}}const vn=({version:e,events:t})=>{const r=[];return t.forEach(e=>{const t=JSON.parse(e);t.count=1,"click"===t.type&&r.push(t)}),{version:e,events:r}},yn=({version:e,events:t})=>{const r=[];t.forEach(e=>{const t=JSON.parse(e);"click"===t.type&&r.push(t)});const n=r.reduce((e,t)=>{const{x:r,y:n,selector:s,timestamp:i}=t,o=i-i%36e5,a=`${r}:${n}:${null!=s?s:""}:${o}`;return e[a]?e[a].count+=1:e[a]=Object.assign(Object.assign({},t),{timestamp:o,count:1}),e},{});return{version:e,events:Object.values(n)}};class bn{constructor(e,t){this.createHook=({eventsManager:e,sessionId:t,deviceIdFn:r,mirror:n,ugcFilterRules:s,performanceOptions:i})=>o=>{var a,l,c,u,h;if(o.type!==Wt.Click)return;const d=m();if(!d)return;const{location:p,innerHeight:f,innerWidth:g}=d;if(!p)return;const{x:v,y:y}=o;if(void 0===v||void 0===y)return;const b=n.getNode(o.id);let w;if(b)try{w=null!==(a=this.getSelector(b,i))&&void 0!==a?a:void 0}catch(e){this.logger.debug("error resolving selector from finder")}const S=qe(p.href,s),C={x:v+(null!==(c=null===(l=this.scrollWatcher)||void 0===l?void 0:l.currentScrollX)&&void 0!==c?c:0),y:y+(null!==(h=null===(u=this.scrollWatcher)||void 0===u?void 0:u.currentScrollY)&&void 0!==h?h:0),selector:w,viewportHeight:f,viewportWidth:g,pageUrl:S,timestamp:Date.now(),type:"click"},k=r();k&&e.addEvent({sessionId:t,event:{type:"interaction",data:JSON.stringify(C)},deviceId:k})},this.logger=e,this.scrollWatcher=t}getSelector(e,t){var r,n,s;if(null===(r=this.clickSelectors)||void 0===r?void 0:r.has(e))return null!==(n=this.clickSelectors.get(e))&&void 0!==n?n:null;const i=Xt(e,t);return null===(s=this.clickSelectors)||void 0===s||s.set(e,i),i}createSharedHook(e,t){return(r,n)=>{if(r.type!==Wt.Click)return;const s=this.clickSelectors;this.clickSelectors=new Map;try{try{null==e||e(r)}catch(e){this.logger.debug("Heatmap click hook failed",e)}if("click"===(null==n?void 0:n.type))try{null==t||t(n)}catch(e){this.logger.debug("Semantic click hook failed",e)}}finally{this.clickSelectors=s}}}}function wn(){const e=m();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function Sn(){const e=m();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}class Cn{constructor(e,t){const r=m();r&&r.navigator&&"function"==typeof r.navigator.sendBeacon?this.sendBeacon=(e,t)=>{try{if(r.navigator.sendBeacon(e,JSON.stringify(t)))return!0}catch(e){}return!1}:this.sendBeacon=()=>!1,this.sendXhr=(e,t)=>{const r=new XMLHttpRequest;return r.open("POST",e,!0),r.setRequestHeader("Accept","*/*"),r.send(JSON.stringify(t)),!0},this.basePageUrl=ze(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e,this.handleSendEvents=t.handleSendEvents,this.loggerProvider=t.loggerProvider}send(e,t){var r;const{sessionId:n,type:s}=this.context;if(this.handleSendEvents){const i=new URLSearchParams({device_id:e,session_id:String(n),type:String(s)}),o=`${this.basePageUrl}?${i.toString()}`,a={"Content-Type":"application/json",Accept:"*/*",Authorization:`Bearer ${this.apiKey}`};try{this.handleSendEvents({url:o,method:"POST",headers:a,body:JSON.stringify(t),keepalive:!0}).catch(e=>{var t;null===(t=this.loggerProvider)||void 0===t||t.warn("Custom transport failed to send session replay interaction beacon:",e)})}catch(e){null===(r=this.loggerProvider)||void 0===r||r.warn("Custom transport threw while sending session replay interaction beacon:",e)}return}const i=new URLSearchParams({device_id:e,session_id:String(n),type:String(s),api_key:this.apiKey}),o=`${this.basePageUrl}?${i.toString()}`;this.sendBeacon(o,t)||this.sendXhr(o,t)}}class kn{static default(e,t){return new kn(new Cn(e,t),t)}constructor(e,t){this.timestamp=Date.now(),this.hook=e=>{this.update(e)},this.send=e=>t=>{var r,n,s,i;const o=e(),a=m();if(a&&o){const e=null!==(r=a.scrollX)&&void 0!==r?r:0,t=null!==(n=a.scrollY)&&void 0!==n?n:0;(e>0||t>0)&&this.update({id:1,x:e,y:t}),this.transport.send(o,{version:1,events:[{maxScrollX:this._maxScrollX,maxScrollY:this._maxScrollY,maxScrollWidth:this._maxScrollWidth,maxScrollHeight:this._maxScrollHeight,viewportHeight:wn(),viewportWidth:Sn(),pageUrl:qe(a.location.href,null!==(i=null===(s=this.config.interactionConfig)||void 0===s?void 0:s.ugcFilterRules)&&void 0!==i?i:[]),timestamp:this.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=Sn(),this._maxScrollHeight=wn(),this.config=t,this.transport=e}get maxScrollX(){return this._maxScrollX}get maxScrollY(){return this._maxScrollY}get maxScrollWidth(){return this._maxScrollWidth}get maxScrollHeight(){return this._maxScrollHeight}get currentScrollX(){return this._currentScrollX}get currentScrollY(){return this._currentScrollY}update(e){const t=Date.now();if(this._currentScrollX=e.x,this._currentScrollY=e.y,e.x>this._maxScrollX){const r=Sn();this._maxScrollX=e.x;const n=e.x+r;n>this._maxScrollWidth&&(this._maxScrollWidth=n),this.timestamp=t}if(e.y>this._maxScrollY){const r=wn();this._maxScrollY=e.y;const n=e.y+r;n>this._maxScrollHeight&&(this._maxScrollHeight=n),this.timestamp=t}}}class xn{constructor({sessionId:e,deviceId:t}){this.deviceId=t,this.sessionId=e,e&&t&&(this.sessionReplayId=((e,t)=>`${t}/${e}`)(e,t))}}const On=864e5,In=e=>`AMP_SR_START_${e.substring(0,10)}_`,En=(e,t)=>`${In(e)}${t}`,Mn=()=>{try{const e=m();return null==e?void 0:e.localStorage}catch(e){return}};const Rn=new class{constructor(){this.dbs={},this.createStore=e=>a(this,void 0,void 0,function*(){return yield Gr(e,1,{upgrade:e=>{e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})}),this.openOrCreateDB=e=>a(this,void 0,void 0,function*(){if(this.dbs&&this.dbs[e])return this.dbs[e];const t=`${e.substring(0,10)}_amp_session_replay_targeting`,r=yield this.createStore(t);return this.dbs[e]=r,r}),this.getTargetingMatchForSession=({loggerProvider:e,apiKey:t,sessionId:r})=>a(this,void 0,void 0,function*(){try{const e=yield this.openOrCreateDB(t),n=String(r),s=yield e.get("sessionTargetingMatch",n);return null==s?void 0:s.targetingMatch}catch(t){on(e,`Failed to get targeting match for session id ${r}: ${t}`,t)}}),this.storeTargetingMatchForSession=({loggerProvider:e,apiKey:t,sessionId:r,targetingMatch:n})=>a(this,void 0,void 0,function*(){try{const e=yield this.openOrCreateDB(t),s=String(r);return yield e.put("sessionTargetingMatch",{targetingMatch:n,sessionId:s,lastUpdated:Date.now()})}catch(t){on(e,`Failed to store targeting match for session id ${r}: ${t}`,t)}}),this.clearStoreOfOldSessions=({loggerProvider:e,apiKey:t,currentSessionId:r})=>a(this,void 0,void 0,function*(){try{const e=yield this.openOrCreateDB(t),n=String(r),s=e.transaction("sessionTargetingMatch","readwrite"),i=yield s.store.getAll();for(let e=0;e<i.length;e++){const t=i[e],r=Date.now()-t.lastUpdated;t.sessionId!==n&&r>1728e5&&(yield s.store.delete(t.sessionId))}yield s.done}catch(t){on(e,`Failed to clear old targeting matches for sessions: ${t}`,t)}})}},Pn=2654435761,An=2246822519,Tn=3266489917,Nn=374761393;function Ln(e,t){return(e<<t|e>>>32-t)>>>0}function _n(e,t){return e=Ln(e=e+Math.imul(t,An)>>>0,13),e=Math.imul(e,Pn)>>>0}function Dn(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Fn(e,t=0){const r=function(e){const t=[];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>=55296&&n<=56319&&r+1<e.length){const t=e.charCodeAt(r+1);t>=56320&&t<=57343&&(n=t-56320+(n-55296<<10)+65536,r++)}n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<65536?t.push(224|n>>12,128|n>>6&63,128|63&n):t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n)}return new Uint8Array(t)}(e),n=r.length;let s,i=0;if(n>=16){let e=t+Pn+An>>>0,o=t+An>>>0,a=t>>>0,l=t-Pn>>>0;for(;i<=n-16;)e=_n(e,Dn(r,i)),i+=4,o=_n(o,Dn(r,i)),i+=4,a=_n(a,Dn(r,i)),i+=4,l=_n(l,Dn(r,i)),i+=4;s=Ln(e,1)+Ln(o,7)+Ln(a,12)+Ln(l,18)>>>0}else s=t+Nn>>>0;for(s=s+n>>>0;i<=n-4;)s=s+Math.imul(Dn(r,i),Tn)>>>0,s=Math.imul(Ln(s,17),668265263)>>>0,i+=4;for(;i<n;)s=s+Math.imul(r[i],Nn)>>>0,s=Math.imul(Ln(s,11),Pn)>>>0,i++;return s^=s>>>15,s=Math.imul(s,An)>>>0,s^=s>>>13,s=Math.imul(s,Tn)>>>0,s^=s>>>16,s>>>0}const Bn="__amplitude_url_tracking_patched__",jn=new WeakMap;function Un(e,t,r={}){if(!(null==e?void 0:e.location))return()=>{};const{enablePolling:n=!1,pollingInterval:s=ve}=r;if(n){const n=()=>{var t;return null!==(t=e.location.href)&&void 0!==t?t:""};let i=n();const o=e.setInterval(()=>{var e;const s=n();s!==i&&(i=s,t(s),null===(e=r.onNavigation)||void 0===e||e.call(r,"replace"))},s);return()=>{null!=o&&e.clearInterval(o)}}let i=jn.get(e);if(!i){let t;const r=new Set,n=()=>{var t;return null!==(t=e.location.href)&&void 0!==t?t:""},s=e=>{const s=n();void 0!==t&&s===t||(t=s,r.forEach(t=>t(s,e)))},o=(e,t)=>{const r=function(...r){const n=e.apply(this,r);return s(t),n};return r[Bn]=!0,r},a=e.history;if(null==a?void 0:a.pushState){const e=Reflect.get(a,"pushState");e[Bn]||(a.pushState=o(e,"push"))}if(null==a?void 0:a.replaceState){const e=Reflect.get(a,"replaceState");e[Bn]||(a.replaceState=o(e,"replace"))}i={callbacks:r,notify:s,onPopStateOrHashChange:e=>s("hashchange"===(null==e?void 0:e.type)?"hash":"pop"),listenersAttached:!1},jn.set(e,i)}const o=i;o.listenersAttached||(e.addEventListener("popstate",o.onPopStateOrHashChange),e.addEventListener("hashchange",o.onPopStateOrHashChange),o.listenersAttached=!0);const a=(e,n)=>{var s;t(e),null===(s=r.onNavigation)||void 0===s||s.call(r,n)};return o.callbacks.add(a),()=>{o.callbacks.delete(a),0===o.callbacks.size&&o.listenersAttached&&(e.removeEventListener("popstate",o.onPopStateOrHashChange),e.removeEventListener("hashchange",o.onPopStateOrHashChange),o.listenersAttached=!1)}}function $n(e={}){return{name:"amplitude/url-tracking@1",observer(t,r,n){var s,i,o;const a=Object.assign(Object.assign({},e),n),l=a.ugcFilterRules||[],c=null!==(s=a.enablePolling)&&void 0!==s&&s,u=null!==(i=a.pollingInterval)&&void 0!==i?i:ve,h=null!==(o=a.captureDocumentTitle)&&void 0!==o&&o;if(!r)return()=>{};let d;const p=()=>r.location&&r.location.href||"",f=()=>{const e=p();if(void 0===d||e!==d){d=e;const n=(()=>{const{innerHeight:e,innerWidth:t,document:n}=r,s=p();let i="";return h&&(i=(null==n?void 0:n.title)||""),{href:l.length>0?qe(s,l):s,title:i,viewportHeight:e,viewportWidth:t,type:"url-change-event"}})();t(n)}},m=Un(r,()=>f(),c?{enablePolling:!0,pollingInterval:u}:{});return f(),()=>m()},options:e}}class zn{constructor(){this.pendingLoadListeners=new Map}start(){var e;null===(e=this.mutationObserver)||void 0===e||e.disconnect();m()&&(this.sendToAllIframes({type:Me,action:"start"}),this.mutationObserver=new MutationObserver(e=>{for(const t of e){for(const e of Array.from(t.addedNodes))e instanceof HTMLIFrameElement?this.sendToIframeAfterLoad(e):e instanceof Element&&e.querySelectorAll("iframe").forEach(e=>{this.sendToIframeAfterLoad(e)});for(const e of Array.from(t.removedNodes))if(e instanceof HTMLIFrameElement){const t=this.pendingLoadListeners.get(e);t&&(e.removeEventListener("load",t),this.pendingLoadListeners.delete(e))}}}),this.mutationObserver.observe(document.documentElement,{childList:!0,subtree:!0}))}stop(){var e;null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=void 0,this.pendingLoadListeners.forEach((e,t)=>{t.removeEventListener("load",e)}),this.pendingLoadListeners.clear(),this.sendToAllIframes({type:Me,action:"stop"})}sendToIframeAfterLoad(e){const t=()=>{this.pendingLoadListeners.delete(e),this.sendToIframe(e,{type:Me,action:"start"})};this.pendingLoadListeners.set(e,t),e.addEventListener("load",t,{once:!0})}sendToAllIframes(e){document.querySelectorAll("iframe").forEach(t=>this.sendToIframe(t,e))}sendToIframe(e,t){var r;try{null===(r=e.contentWindow)||void 0===r||r.postMessage(t,"*")}catch(e){}}}class Wn{constructor(){this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,this.recordFunction=null,this.recordEventsInFlight=!1,this.recordingEnabled=!0,this.recordingGeneration=0,this.startChildRecordingOnSetup=!1,this.pendingEmitEvents=[],this.currentPageUrl="",this.recordEventsPendingShouldLogMetadata=null,this.urlChangeCleanup=null,this.crossOriginIframeCoordinator=null,this.crossOriginParentSignalCleanup=null,this.latestUrlChangeTargetingEvaluationId=0,this.teardownEventListeners=e=>{const t=m();t&&(t.removeEventListener("blur",this.blurListener),t.removeEventListener("focus",this.focusListener),!e&&t.addEventListener("blur",this.blurListener),!e&&t.addEventListener("focus",this.focusListener),t.self&&"onpagehide"in t.self?(t.removeEventListener("pagehide",this.pageLeaveListener),!e&&t.addEventListener("pagehide",this.pageLeaveListener)):(t.removeEventListener("beforeunload",this.pageLeaveListener),!e&&t.addEventListener("beforeunload",this.pageLeaveListener)))},this.blurListener=()=>{this.sendEvents()},this.focusListener=()=>{var e;if(this.recordingEnabled)if(this.recordCancelCallback&&this.recordFunction){if(!1===(null===(e=this.config)||void 0===e?void 0:e.captureFullSnapshotOnFocus))return;try{this.recordFunction.takeFullSnapshot(!0)}catch(e){this.loggerProvider.warn("Failed to take full snapshot on focus:",e)}}else this.recordEventsInFlight||this.recordEvents(!1)},this.pageLeaveListener=e=>{var t;null===(t=this.eventCompressor)||void 0===t||t.flushQueue(),this.sendEvents(),this.pageLeaveFns.forEach(t=>{t(e)})},this.evaluateTargetingAndCapture=(e,t=!1,r=!1,n=!1)=>a(this,void 0,void 0,function*(){var i,o,l,c,u,h;if(!this.identifiers||!this.identifiers.sessionId||!this.config)return void(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."));if(!this.config.targetingConfig){if(!t)return void this.loggerProvider.log("No targeting config set, skipping initialization/recording for event.");this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.")}this.lastTargetingParams=e;const d=this.config.targetingConfig;if(d&&!this.sessionTargetingMatch){const t=n?this.latestUrlChangeTargetingEvaluationId:void 0;let r=e.event;r&&Object.values(s).includes(r.event_type)&&(r=void 0);const p=null!==(u=null!==(o=null===(i=e.page)||void 0===i?void 0:i.url)&&void 0!==o?o:null===(c=null===(l=m())||void 0===l?void 0:l.location)||void 0===c?void 0:c.href)&&void 0!==u?u:"",f=null!==(h=e.page)&&void 0!==h?h:""!==p?{url:p}:void 0,g=yield(({sessionId:e,targetingConfig:t,loggerProvider:r,apiKey:n,targetingParams:s,urlChange:i=!1})=>a(void 0,void 0,void 0,function*(){if(yield Rn.clearStoreOfOldSessions({loggerProvider:r,apiKey:n,currentSessionId:e}),!0===(yield Rn.getTargetingMatchForSession({loggerProvider:r,apiKey:n,sessionId:e}))&&!i)return!0;let o=!0;try{const{evaluateTargeting:i}=yield Promise.resolve().then(function(){return Us}),a=Object.assign(Object.assign({},s),{flag:t,sessionId:"string"==typeof e?parseInt(e,10):e,apiKey:n,loggerProvider:r}),l=yield i(a);l&&l.sr_targeting_config&&(o="on"===l.sr_targeting_config.key),Rn.storeTargetingMatchForSession({loggerProvider:r,apiKey:n,sessionId:e,targetingMatch:o})}catch(e){const t=e;r.warn(t.message)}return o}))({sessionId:this.identifiers.sessionId,targetingConfig:d,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:e.userProperties,event:r,page:f},urlChange:n});if(n&&void 0!==t&&t!==this.latestUrlChangeTargetingEvaluationId)return void this.loggerProvider.debug(`Ignoring stale URL-change targeting result #${t}; latest is #${this.latestUrlChangeTargetingEvaluationId}.`);this.sessionTargetingMatch=this.sessionTargetingMatch||g,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:r,targetingParams:e},null,2))}t?this.initialize(!0):!r&&this.recordCancelCallback||(this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),yield this.recordEvents())}),this.addCustomRRWebEvent=(e,t={},r=!0)=>a(this,void 0,void 0,function*(){try{let n;const s=this.config;if(s&&e!==Re.METADATA&&(n={config:Ge(s),version:Tr},r)){const e=yield Ve();n=Object.assign(Object.assign({},e),n)}this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(e,Object.assign(Object.assign({},t),n)):this.loggerProvider.debug(`Not able to add custom replay capture event ${e} due to no ongoing recording.`)}catch(e){this.loggerProvider.debug("Error while adding custom replay capture event: ",e)}}),this.stopRecordingEvents=(e="targeting",t="stop")=>{var r,n,s,i;try{null===(r=this.semanticAdapter)||void 0===r||r.stop(e,t),this.loggerProvider.log("Session Replay capture stopping."),this.recordCancelCallback&&this.recordCancelCallback(),this.recordCancelCallback=null,null===(n=this.networkObservers)||void 0===n||n.stop(),null===(s=this.crossOriginIframeCoordinator)||void 0===s||s.stop(),this.crossOriginIframeCoordinator=null,null===(i=this.crossOriginParentSignalCleanup)||void 0===i||i.call(this),this.crossOriginParentSignalCleanup=null}catch(e){const t=e;this.loggerProvider.warn(`Error occurred while stopping replay capture: ${t.toString()}`)}},this.loggerProvider=new Pe(new M)}init(e,t){return I(this._init(e,t))}setupUrlChangeListener(){var e,t;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this);const r=m();if(!(null==r?void 0:r.location))return;const n=!!(null===(t=this.config)||void 0===t?void 0:t.targetingConfig),s=Un(r,e=>{if(this.currentPageUrl=e,n){const t=++this.latestUrlChangeTargetingEvaluationId;this.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:e}},!1,!1,!0),this.loggerProvider.debug(`Queued URL-change targeting re-evaluation #${t} for ${e}.`)}});this.urlChangeCleanup=()=>{s(),this.urlChangeCleanup=null}}isBelowMinSessionDuration(){var e;const t=null===(e=this.config)||void 0===e?void 0:e.minSessionDurationMs;return void 0!==t&&void 0!==this.sessionStartTime&&Date.now()-this.sessionStartTime<t}getCurrentPageForTargeting(){var e,t;const r=null===(t=null===(e=m())||void 0===e?void 0:e.location)||void 0===t?void 0:t.href;return null!=r?{url:r}:void 0}_init(e,t){var r,n,s,i,o,l,c,u,h,d,p,f,g,v,y;return a(this,void 0,void 0,function*(){null===(r=this.urlChangeCleanup)||void 0===r||r.call(this),null===(n=this.semanticAdapter)||void 0===n||n.stop("customer_stop"),this.semanticAdapter=void 0,this.recordingEnabled=!0,this.startChildRecordingOnSetup=!1,this.loggerProvider=new Pe(t.loggerProvider||new M),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.currentPageUrl=We(),this.identifiers=new xn({sessionId:t.sessionId,deviceId:t.deviceId});const b=Date.now();((e,t,r)=>{const n=Mn();if(!n)return;const s=In(e);try{const e=[];for(let r=0;r<n.length;r++){const i=n.key(r);if(!i||!i.startsWith(s))continue;const o=n.getItem(i);if(null===o)continue;const a=Number(o);(!Number.isFinite(a)||a<=0||t-a>=On)&&e.push(i)}for(const t of e)n.removeItem(t)}catch(e){null==r||r.debug(`Failed to prune stale replay start times: ${String(e)}`)}})(e,b,this.loggerProvider),this.sessionStartTime=void 0!==t.sessionId&&null!==(s=((e,t,r,n)=>{const s=Mn();if(!s)return;const i=En(e,t);try{const e=s.getItem(i);if(null!==e){const t=Number(e);if(Number.isFinite(t)&&t>0&&t<=r&&r-t<On)return t}return s.setItem(i,String(r)),r}catch(e){return void(null==n||n.debug(`Failed to read/write replay start time from storage: ${String(e)}`))}})(e,t.sessionId,b,this.loggerProvider))&&void 0!==s?s:b,this.joinedConfigGenerator=yield((e,t)=>a(void 0,void 0,void 0,function*(){const r=new Je(e,t),n=new Y(e,r.loggerProvider,r.serverZone,t.configServerUrl,t.handleFetchConfig);return new yr(n,r)}))(e,t);const{joinedConfig:w,localConfig:S,remoteConfig:C}=yield this.joinedConfigGenerator.generateJoinedConfig();if(this.config=w,this.setMetadata(t.sessionId,w,S,C,null===(i=t.version)||void 0===i?void 0:i.version,Tr,null===(o=t.version)||void 0===o?void 0:o.type),this.pageLeaveFns=[],t.sessionId&&(null===(l=this.config.interactionConfig)||void 0===l?void 0:l.enabled)){const e=kn.default({sessionId:t.sessionId,type:"interaction"},this.config);this.pageLeaveFns=[e.send(this.getDeviceId.bind(this)).bind(e)],this.scrollHook=e.hook.bind(e),this.clickHandler=new bn(this.loggerProvider,e)}const k=[];let x,O,{storeType:I}=this.config;"idb"!==I||(null===(c=m())||void 0===c?void 0:c.indexedDB)||(I="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log(`Using ${I} for event storage.`);const E=m();if(this.config.useWebWorker&&E&&E.Worker){const{compressionScript:e,trackDestinationScript:t}=yield Promise.resolve().then(function(){return zs});x=e,O=t}let R;try{R=yield mn({config:this.config,type:"replay",minInterval:null===(u=this.config.flushIntervalConfig)||void 0===u?void 0:u.minIntervalMs,maxInterval:null===(h=this.config.flushIntervalConfig)||void 0===h?void 0:h.maxIntervalMs,maxPersistedEventsSize:this.config.maxPersistedEventsSizeBytes,storeType:I,trackDestinationWorkerScript:O,shouldSend:()=>!this.isBelowMinSessionDuration()}),this.rrwebEventManager=R,k.push({name:"replay",manager:R})}catch(e){const t=e;this.loggerProvider.warn(`Error occurred while creating replay events manager: ${t.toString()}`)}if(null===(d=this.config.interactionConfig)||void 0===d?void 0:d.enabled){const e=this.config.interactionConfig.batch?yn:vn;try{const t=yield mn({config:this.config,type:"interaction",minInterval:null!==(p=this.config.interactionConfig.trackEveryNms)&&void 0!==p?p:3e4,maxInterval:6e4,maxPersistedEventsSize:this.config.maxPersistedEventsSizeBytes,payloadBatcher:e,storeType:I,trackDestinationWorkerScript:O});k.push({name:"interaction",manager:t})}catch(e){const t=e;this.loggerProvider.warn(`Error occurred while creating interaction events manager: ${t.toString()}`)}}this.eventsManager=new gn(...k),this.eventCompressor&&this.eventCompressor.terminate();const P=!0===this.config.eagerFullSnapshotSend?()=>this.sendEvents():void 0;if(this.eventCompressor=new Mr(this.eventsManager,this.config,this.getDeviceId(),x,P),this.pendingEmitEvents.length>0){const e=this.pendingEmitEvents.splice(0);for(const{event:t,sessionId:r}of e)this.eventCompressor.enqueueEvent(t,r)}if(this.pageLeaveFns=[...this.pageLeaveFns,()=>{var e;if(!this.config||!(null===(e=this.identifiers)||void 0===e?void 0:e.sessionId)||!R)return;const t=R.getBeaconEvents();if(!t.length)return;const r=this.getDeviceId();r&&(this.isBelowMinSessionDuration()||R.trackDestination.sendBeacon({events:t,sessionId:this.identifiers.sessionId,deviceId:r,apiKey:this.config.apiKey,serverZone:this.config.serverZone}))}],yield this.initializeNetworkObservers(),null===(f=m())||void 0===f?void 0:f.opener){const e=ce();de(e),e.setup(Object.assign({logger:this.loggerProvider},this.config.serverZone&&{endpoint:ie[this.config.serverZone]}))}this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),yield this.evaluateTargetingAndCapture({userProperties:t.userProperties,page:this.getCurrentPageForTargeting()},!0);(this.config.targetingConfig||(null!==(y=null===(v=null===(g=this.config.privacyConfig)||void 0===g?void 0:g.urlMaskLevels)||void 0===v?void 0:v.length)&&void 0!==y?y:0)>0)&&this.setupUrlChangeListener()})}setSessionId(e,t){return I(this.asyncSetSessionId(e,t))}asyncSetSessionId(e,t,r){var n,s,i,o,l,c;return a(this,void 0,void 0,function*(){const a=null===(n=this.identifiers)||void 0===n?void 0:n.sessionId,u=this.getDeviceId();if(!(void 0===a||a!==e||void 0!==t&&t!==u||void 0!==(null==r?void 0:r.userProperties)&&0!==Object.keys(r.userProperties).length))return;this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,a&&this.sendEvents(a);const h=a!==e;h&&(null===(i=null===(s=this.config)||void 0===s?void 0:s.semanticCapture)||void 0===i?void 0:i.enabled)&&this.semanticAdapter&&this.stopRecordingEvents("new_session"),h&&(null===(o=this.rrwebEventManager)||void 0===o||o.dropPendingBeaconEvents());const d=t||this.getDeviceId();if(this.identifiers=new xn({sessionId:e,deviceId:d}),h&&(this.sessionStartTime=Date.now(),this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,(null===(l=this.config)||void 0===l?void 0:l.apiKey)&&(((e,t,r,n)=>{const s=Mn();if(s)try{s.setItem(En(e,t),String(r))}catch(e){null==n||n.debug(`Failed to write replay start time to storage: ${String(e)}`)}})(this.config.apiKey,e,this.sessionStartTime,this.loggerProvider),void 0!==a&&((e,t,r)=>{const n=Mn();if(n)try{n.removeItem(En(e,t))}catch(e){null==r||r.debug(`Failed to remove replay start time from storage: ${String(e)}`)}})(this.config.apiKey,a,this.loggerProvider))),this.joinedConfigGenerator&&a){const{joinedConfig:e}=yield this.joinedConfigGenerator.generateJoinedConfig();this.config=e}(null===(c=this.config)||void 0===c?void 0:c.targetingConfig)?yield this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties,page:this.getCurrentPageForTargeting()},!1,!0):yield this.recordEvents()})}getSessionReplayProperties(){const e=this.config,t=this.identifiers;if(!e||!t)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};const r=this.getShouldRecord();let n={};return r&&(n={[fe]:t.sessionReplayId?t.sessionReplayId:null},e.debugMode&&(n[ye]=JSON.stringify({appHash:z(e.apiKey).toString()}))),this.addCustomRRWebEvent(Re.GET_SR_PROPS,{shouldRecord:r,eventProperties:n},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,n}sendEvents(e){var t,r;const n=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),s=this.getDeviceId();if(this.eventsManager&&n&&s){if(this.isBelowMinSessionDuration()){const e=this.sessionStartTime,t=this.config.minSessionDurationMs;return this.loggerProvider.log(`Session ${n} not sent: duration ${Date.now()-e}ms is below minimum ${t}ms.`),void this.suppressedSendCount++}if(!this.hasEmittedGateDecision&&void 0!==(null===(r=this.config)||void 0===r?void 0:r.minSessionDurationMs)&&this.recordCancelCallback&&this.recordFunction){this.hasEmittedGateDecision=!0;const e=void 0!==this.sessionStartTime?Date.now()-this.sessionStartTime:void 0;this.addCustomRRWebEvent(Re.REPLAY_GATE_DECISION,{sessionId:n,suppressedSendCount:this.suppressedSendCount,elapsedMs:e,minSessionDurationMs:this.config.minSessionDurationMs},!1)}this.eventsManager.sendCurrentSequenceEvents({sessionId:n,deviceId:s})}}initialize(e=!1){var t;return a(this,void 0,void 0,function*(){if(!(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId))return this.loggerProvider.log("Session is not being recorded due to lack of session id."),Promise.resolve();const r=this.getDeviceId();return r?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:r}),this.recordEvents()):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),Promise.resolve())})}shouldOptOut(){var e,t;let r;if(null===(e=this.config)||void 0===e?void 0:e.instanceName){r=(n=this.config.instanceName,$.getInstance(R(n))).identityStore.getIdentity().optOut}var n;return void 0!==r?r:null===(t=this.config)||void 0===t?void 0:t.optOut}getShouldRecord(){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.recordingEnabled)return this.loggerProvider.log(`Session ${this.identifiers.sessionId} not being captured because recording was stopped.`),!1;if(!this.config.captureEnabled)return this.loggerProvider.log(`Session ${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 ${this.identifiers.sessionId} out of recording due to optOut config.`),!1;let e=!1,t="",r=!1;if(this.config.targetingConfig)this.sessionTargetingMatch?(t=`Capturing replays for session ${this.identifiers.sessionId} due to matching targeting conditions.`,this.loggerProvider.log(t),e=!0,r=!0):(t=`Not capturing replays for session ${this.identifiers.sessionId} due to not matching targeting conditions.`,this.loggerProvider.log(t),e=!1,r=!1);else{(n=this.identifiers.sessionId,s=this.config.sampleRate,Fn(n.toString())%1e6/1e6<s)?(e=!0,r=!0):(t=`Opting session ${this.identifiers.sessionId} out of recording due to sample rate.`,this.loggerProvider.log(t),e=!1,r=!1)}var n,s;return this.lastShouldRecordDecision!==e&&this.config.targetingConfig&&(this.addCustomRRWebEvent(Re.TARGETING_DECISION,{message:t,sessionId:this.identifiers.sessionId,matched:r,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=e),e}getBlockSelectors(){var e;return Ue(null===(e=this.config)||void 0===e?void 0:e.privacyConfig)}getMaskTextSelectors(){var e;return $e(null===(e=this.config)||void 0===e?void 0:e.privacyConfig,this.currentPageUrl)}getRecordingPlugins(e){var t,r,n,s,i,o;return a(this,void 0,void 0,function*(){const a=[];try{const e=$n({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===(s=this.config)||void 0===s?void 0:s.urlChangePollingInterval,captureDocumentTitle:null===(i=this.config)||void 0===i?void 0:i.captureDocumentTitle});a.push(e)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(null===(o=null==e?void 0:e.console)||void 0===o?void 0:o.enabled)try{const{getRecordConsolePlugin:t}=yield Promise.resolve().then(function(){return nc});a.push(t({level:e.console.levels}))}catch(e){this.loggerProvider.warn("Failed to load console plugin:",e)}return a.length>0?a:void 0})}getRecordFunction(){return a(this,void 0,void 0,function*(){if(this.recordFunction)return this.recordFunction;try{const{record:e}=yield Promise.resolve().then(function(){return tm});return this.recordFunction=e,e}catch(e){return this.loggerProvider.warn("Failed to load rrweb-record module:",e),null}})}recordEvents(e=!0){return a(this,void 0,void 0,function*(){if(this.recordEventsInFlight)this.recordEventsPendingShouldLogMetadata=e;else{this.recordEventsInFlight=!0;try{for(yield this._recordEvents(e);null!==this.recordEventsPendingShouldLogMetadata;){const e=this.recordEventsPendingShouldLogMetadata;this.recordEventsPendingShouldLogMetadata=null,yield this._recordEvents(e)}}finally{this.recordEventsInFlight=!1,this.recordEventsPendingShouldLogMetadata=null}}})}shouldAbandonRecordStart(e){return!this.recordingEnabled||e!==this.recordingGeneration}_recordEvents(e=!0){var t,r,n,s,i,o,l,c,u,h,d,p,f;return a(this,void 0,void 0,function*(){const a=this.config,g=this.getShouldRecord(),v=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId;if(!g||!v||!a)return void((null===(r=null==a?void 0:a.semanticCapture)||void 0===r?void 0:r.enabled)&&this.semanticAdapter&&this.recordCancelCallback&&this.stopRecordingEvents(this.shouldOptOut()?"opt_out":a.targetingConfig?"targeting":"sampled_out"));this.stopRecordingEvents("focus","pause");const y=this.recordingGeneration,b=yield this.getRecordFunction();if(!b||this.shouldAbandonRecordStart(y))return;if(yield this.initializeNetworkObservers(),this.shouldAbandonRecordStart(y))return;const w=null===(n=a.loggingConfig)||void 0===n?void 0:n.network,S=ze(a.serverZone,a.trackServerUrl),C=[be,we,Se,S];null===(s=this.networkObservers)||void 0===s||s.start(e=>{C.some(t=>e.url.startsWith(t))||this.addCustomRRWebEvent(Re.FETCH_REQUEST,e)},w);const{interactionConfig:k,loggingConfig:x}=a,O=(null==k?void 0:k.enabled)&&this.eventsManager?null===(i=this.clickHandler)||void 0===i?void 0:i.createHook({eventsManager:this.eventsManager,sessionId:v,deviceIdFn:this.getDeviceId.bind(this),mirror:b.mirror,ugcFilterRules:null!==(o=k.ugcFilterRules)&&void 0!==o?o:[],performanceOptions:null===(l=a.performanceConfig)||void 0===l?void 0:l.interaction}):void 0;let I=O;if((null===(c=a.semanticCapture)||void 0===c?void 0:c.enabled)&&b.supportsNativeMouseInteraction){I=(null!==(u=this.clickHandler)&&void 0!==u?u:this.clickHandler=new bn(this.loggerProvider)).createSharedHook(O,e=>{var t;return null===(t=this.semanticAdapter)||void 0===t?void 0:t.click(e)})}const E=Object.assign(Object.assign({},I?{mouseInteraction:I}:{}),(null==k?void 0:k.enabled)?{scroll:this.scrollHook}:{}),M=(null==k?void 0:k.enabled)&&k.ugcFilterRules?k.ugcFilterRules:[];this.loggerProvider.log(`Session Replay capture beginning for ${v}.`);try{const t=!!(null===(h=a.crossOriginIframes)||void 0===h?void 0:h.enabled),r=!1!==(null===(d=a.crossOriginIframes)||void 0===d?void 0:d.coordinateChildren),n=t&&function(){try{const e=m();return!!e&&e.parent!==e}catch(e){return!0}}();if(n&&r)return this.crossOriginParentSignalCleanup=function(e){const t=m();if(!t)return()=>{};const r=t.parent;function n(t){if(t.source!==r)return;const n=t.data;(null==n?void 0:n.type)===Me&&("start"===n.action?e.onStart():"stop"===n.action&&e.onStop())}return t.addEventListener("message",n),()=>t.removeEventListener("message",n)}({onStart:()=>{this.recordingEnabled&&this._recordEventsInChildMode(b,v,a,E)},onStop:()=>{try{this.recordCancelCallback&&this.recordCancelCallback(),this.recordCancelCallback=null}catch(e){const t=e;this.loggerProvider.warn(`Error occurred while stopping child iframe replay capture: ${t.toString()}`)}}}),void(this.startChildRecordingOnSetup&&(this.startChildRecordingOnSetup=!1,this._recordEventsInChildMode(b,v,a,E)));this.startChildRecordingOnSetup=!1;const s=yield this.getRecordingPlugins(x);if(this.shouldAbandonRecordStart(y))return;this.prepareSemanticCapture(a,v),this.recordCancelCallback=b(Object.assign(Object.assign({},this.buildRRWebRecordOptions(a,E,e=>{var t,r,n,s;const i=(null===(r=null===(t=this.config)||void 0===t?void 0:t.semanticCapture)||void 0===r?void 0:r.enabled)&&this.semanticAdapter&&e.type===$t.Custom&&"amp-semantic/recording"===e.data.tag&&"stop"===(null===(n=e.data.payload)||void 0===n?void 0:n.state);if((this.shouldOptOut()||!this.recordingEnabled)&&!i)return this.loggerProvider.log(this.shouldOptOut()?`Opting session ${v} out of recording due to optOut config.`:`Session Replay capture stopping for ${v}.`),this.stopRecordingEvents(this.shouldOptOut()?"opt_out":"customer_stop"),void this.sendEvents();e.type===$t.Meta&&(e.data.href=qe(e.data.href,M)),this.eventCompressor?this.eventCompressor.enqueueEvent(e,v):this.pendingEmitEvents.push({event:e,sessionId:v}),null===(s=this.semanticAdapter)||void 0===s||s.event(e)},"Error while capturing replay: ")),{plugins:s,recordCrossOriginIframes:t})),this.recordCancelCallback&&(null===(p=this.semanticAdapter)||void 0===p||p.recordingReady()),t&&!n&&r&&(this.crossOriginIframeCoordinator||(this.crossOriginIframeCoordinator=new zn),this.crossOriginIframeCoordinator.start()),this.addCustomRRWebEvent(Re.DEBUG_INFO),e&&this.addCustomRRWebEvent(Re.METADATA,this.metadata)}catch(e){null===(f=this.semanticAdapter)||void 0===f||f.stop("error"),this.loggerProvider.warn("Failed to initialize session replay:",e)}})}prepareSemanticCapture(e,t){var r,n,s,i;const o=m();if(null==o?void 0:o.document){if(!(null===(r=e.semanticCapture)||void 0===r?void 0:r.enabled))return null===(n=this.semanticAdapter)||void 0===n||n.stop("targeting"),void(null===(s=this.semanticAdapter)||void 0===s||s.prepare({enabled:!1},t));this.semanticAdapter||(this.semanticAdapter=new qt({document:o.document,window:o,sdk:`@amplitude/session-replay-browser@${Tr}`,externalClicks:!0===(null===(i=this.recordFunction)||void 0===i?void 0:i.supportsNativeMouseInteraction),externalAuxClicks:!1,getNodeId:e=>{var t,r,n,s;return null!==(s=null===(n=null===(t=this.recordFunction)||void 0===t?void 0:(r=t.mirror).getId)||void 0===n?void 0:n.call(r,e))&&void 0!==s?s:-1},getNode:e=>{var t,r;return null!==(r=null===(t=this.recordFunction)||void 0===t?void 0:t.mirror.getNode(e))&&void 0!==r?r:null},getPrivacy:()=>{var e,t;return null!==(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)&&void 0!==t?t:{}},getUrl:()=>o.location.href,getIdentity:()=>function(e){const t=e.document,r=Gt.get(t);if(r)return r;let n=dt(t,e);if(e.top===e)try{const t=e.sessionStorage,r=()=>{var e;try{const r=JSON.parse(null!==(e=t.getItem(Vt))&&void 0!==e?e:"null");if(r&&Ht.test(r.tab_id)&&(null===r.owner||"string"==typeof r.owner))return r}catch(e){}},s=r();null===(null==s?void 0:s.owner)&&(n=Object.freeze(Object.assign(Object.assign({},n),{tab_id:s.tab_id})));const i=e=>{try{t.setItem(Vt,JSON.stringify({tab_id:n.tab_id,owner:e}))}catch(e){}};t.setItem(Vt,JSON.stringify({tab_id:n.tab_id,owner:n.document_id})),e.addEventListener("pagehide",()=>{var e;(null===(e=r())||void 0===e?void 0:e.owner)===n.document_id&&i(null)}),e.addEventListener("pageshow",e=>{e.persisted&&i(n.document_id)})}catch(r){n=dt(t,e)}return Gt.set(t,n),n}(o),getAnalyticsContext:()=>{var e,t;return null!==(t=null===(e=this.config)||void 0===e?void 0:e.semanticAnalyticsContext)&&void 0!==t?t:{present:!1,autocapture:[]}},inlineStylesheet:e.shouldInlineStylesheet,getSelector:e=>{var t,r;try{const n=Object.assign(Object.assign({},null===(r=null===(t=this.config)||void 0===t?void 0:t.performanceConfig)||void 0===r?void 0:r.interaction),{timeoutMs:1});return this.clickHandler?this.clickHandler.getSelector(e,n):Xt(e,n)}catch(e){return null}},emit:e=>{this.recordCancelCallback&&this.recordFunction&&this.recordFunction.addCustomEvent(`amp-semantic/${e.name}`,e.payload)},onError:e=>this.loggerProvider.debug("Semantic capture error:",e)})),this.semanticAdapter.prepare(e.semanticCapture,t)}}buildRRWebRecordOptions(e,t,r,n){const{privacyConfig:s}=e;return Object.assign(Object.assign(Object.assign(Object.assign({emit:r,inlineStylesheet:e.shouldInlineStylesheet,inlineImages:e.inlineImages,hooks:t},function(e,t){return void 0===t&&(t=function(){return""}),{maskAllInputs:!0,maskTextClass:"amp-mask",blockClass:"amp-block",blockSelector:Ue(e),maskTextSelector:$e(e,t()),maskInputFn:Be("input",e,t),maskTextFn:Be("text",e,t),maskAttributeFn:je(e,t)}}(s,()=>this.currentPageUrl)),{applyBackgroundColorToBlockedElements:e.applyBackgroundColorToBlockedElements}),void 0!==e.fullSnapshotIntervalMs&&{checkoutEveryNms:e.fullSnapshotIntervalMs}),{recordCanvas:!1,captureAdoptedStyleSheets:e.captureAdoptedStyleSheets,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0},errorHandler:e=>{const t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return this.loggerProvider.warn(n,t.toString()),!0}})}_recordEventsInChildMode(e,t,r,n){try{this.recordCancelCallback&&this.recordCancelCallback(),this.recordCancelCallback=null,this.recordCancelCallback=e(Object.assign(Object.assign({},this.buildRRWebRecordOptions(r,n,()=>{},"Error while capturing replay (child iframe): ")),{recordCrossOriginIframes:!0})),this.loggerProvider.log(`Session Replay child iframe capture beginning for session ${t}.`)}catch(e){this.loggerProvider.warn("Failed to initialize session replay in child iframe mode:",e)}}getDeviceId(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.deviceId}getSessionId(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.sessionId}start(){return I(this._start())}_start(){return a(this,void 0,void 0,function*(){this.recordingEnabled=!0,this.startChildRecordingOnSetup=!0,yield this.recordEvents()})}stop(){this.recordingEnabled=!1,this.startChildRecordingOnSetup=!1,this.recordingGeneration++,this.stopRecordingEvents("customer_stop"),this.sendEvents()}flush(e=!1){var t;return a(this,void 0,void 0,function*(){return null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)})}shutdown(){var e,t;this.recordingEnabled=!1,this.startChildRecordingOnSetup=!1,this.recordingGeneration++,null===(e=this.urlChangeCleanup)||void 0===e||e.call(this),null===(t=this.crossOriginParentSignalCleanup)||void 0===t||t.call(this),this.crossOriginParentSignalCleanup=null,this.teardownEventListeners(!0),this.stopRecordingEvents(this.semanticAdapter&&this.shouldOptOut()?"opt_out":"customer_stop"),this.sendEvents()}mapSDKType(e){return"plugin"===e?"@amplitude/plugin-session-replay-browser":"segment"===e?"@amplitude/segment-session-replay-plugin":null}setMetadata(e,t,r,n,s,i,o){const a=(null==e?void 0:e.toString())?z(e.toString()):void 0;this.metadata={joinedConfig:t,localConfig:r,remoteConfig:n,sessionId:e,hashValue:a,sampleRate:t.sampleRate,replaySDKType:this.mapSDKType(o),replaySDKVersion:s,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:i}}initializeNetworkObservers(){var e,t,r;return a(this,void 0,void 0,function*(){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)try{const{NetworkObservers:e}=yield Promise.resolve().then(function(){return om});this.networkObservers=new e}catch(e){this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",e)}})}}const qn=e=>()=>{const{config:t}=e,{loggerProvider:r,logLevel:n}=t||He();return{logger:r,logLevel:n}};var Vn=(()=>{const e=new Wn;return{init:L(e.init.bind(e),"init",qn(e)),evaluateTargetingAndCapture:L(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",qn(e)),setSessionId:L(e.setSessionId.bind(e),"setSessionId",qn(e)),getSessionId:L(e.getSessionId.bind(e),"getSessionId",qn(e)),getSessionReplayProperties:L(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",qn(e)),flush:L(e.flush.bind(e),"flush",qn(e)),start:L(e.start.bind(e),"start",qn(e)),stop:L(e.stop.bind(e),"stop",qn(e)),shutdown:L(e.shutdown.bind(e),"shutdown",qn(e))}})();const{init:Gn,setSessionId:Hn,getSessionId:Jn,getSessionReplayProperties:Kn,flush:Yn,start:Xn,stop:Qn,shutdown:Zn,evaluateTargetingAndCapture:es}=Vn;var ts=function(e,t){return ts=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])},ts(e,t)};var rs=function(){return rs=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},rs.apply(this,arguments)};function ns(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 ss="is",is="is not",os="contains",as="does not contain",ls="less",cs="less or equal",us="greater",hs="greater or equal",ds="version less",ps="version less or equal",fs="version greater",ms="version greater or equal",gs="set is",vs="set is not",ys="set contains",bs="set does not contain",ws="set contains any",Ss="set does not contain any",Cs="regex match",ks="regex does not match",xs=-862048943,Os=461845907,Is=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 s=e.charCodeAt(n);s<128?t[r++]=s:s<2048?(t[r++]=s>>6|192,t[r++]=63&s|128):55296==(64512&s)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++n)),t[r++]=s>>18|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128,t[r++]=63&s|128):(t[r++]=s>>12|224,t[r++]=s>>6&63|128,t[r++]=63&s|128)}return Uint8Array.from(t)}(e),n=r.length,s=n>>2,i=t,o=0;o<s;o++){var a=Ps(r,o<<2);i=Es(a,i)}var l=s<<2,c=0;switch(n-l){case 3:c^=r[l+2]<<16,c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,xs),c=Rs(c,15),i^=c=Math.imul(c,Os);break;case 2:c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,xs),c=Rs(c,15),i^=c=Math.imul(c,Os);break;case 1:c^=r[l],c=Math.imul(c,xs),c=Rs(c,15),i^=c=Math.imul(c,Os)}return Ms(i^=n)>>>0},Es=function(e,t){var r=e,n=t;return r=Math.imul(r,xs),r=Rs(r,15),r=Math.imul(r,Os),n=Rs(n^=r,13),(n=Math.imul(n,5))+-430675100|0},Ms=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},Rs=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},Ps=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 As(r)},As=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Ts=function(e,t){var r,n;if(t&&0!==t.length){try{for(var s=ns(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(!o||!e||"object"!=typeof e)return;e=e[o]}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e||void 0}},Ns="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),Ls=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(Ns).exec(t);if(r){var n=Number(r[1]),s=Number(r[2]);if(!isNaN(n)&&!isNaN(s))return new e(n,s,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}(),_s=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,s={},i={context:e,result:s};try{for(var o=ns(t),a=o.next();!a.done;a=o.next()){var l=a.value,c=this.evaluateFlag(i,l);c&&(s[l.key]=c)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},e.prototype.evaluateFlag=function(e,t){var r,n,s;try{for(var i=ns(t.segments),o=i.next();!o.done;o=i.next()){var a=o.value;if(s=this.evaluateSegment(e,t,a)){var l=rs(rs(rs({},t.metadata),a.metadata),s.metadata);s=rs(rs({},s),{metadata:l});break}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s},e.prototype.evaluateSegment=function(e,t,r){var n,s,i,o;if(!r.conditions)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0;try{for(var a=ns(r.conditions),l=a.next();!l.done;l=a.next()){var c,u=l.value,h=!0;try{for(var d=(i=void 0,ns(u)),p=d.next();!p.done;p=d.next()){var f=p.value;if(!(h=this.matchCondition(e,f)))break}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}if(h)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}},e.prototype.matchCondition=function(e,t){var r=Ts(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 s=this.coerceString(r);return void 0!==s&&this.matchString(s,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return Is(e)},e.prototype.bucket=function(e,t){var r,n,s,i;if(!t.bucket)return t.variant;var o=this.coerceString(Ts(e,t.bucket.selector));if(!o||0===o.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(o),l=this.getHash(a),c=l%100,u=Math.floor(l/100);try{for(var h=ns(t.bucket.allocations),d=h.next();!d.done;d=h.next()){var p=d.value,f=p.range[0],m=p.range[1];if(c>=f&&c<m)try{for(var g=(s=void 0,ns(p.distributions)),v=g.next();!v.done;v=g.next()){var y=v.value,b=y.range[0],w=y.range[1];if(u>=b&&u<w)return y.variant}}catch(e){s={error:e}}finally{try{v&&!v.done&&(i=g.return)&&i.call(g)}finally{if(s)throw s.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 ss:case os:case ls:case cs:case us:case hs:case ds:case ps:case fs:case ms:case gs:case ys:case ws:return r;case is:case as:case bs:case Ss:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case gs:return this.setEquals(e,r);case vs:return!this.setEquals(e,r);case ys:return this.matchesSetContainsAll(e,r);case bs:return!this.matchesSetContainsAll(e,r);case ws:return this.matchesSetContainsAny(e,r);case Ss:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case ss:return this.matchesIs(e,r);case is:return!this.matchesIs(e,r);case os:return this.matchesContains(e,r);case as:return!this.matchesContains(e,r);case ls:case cs:case us:case hs:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case ds:case ps:case fs:case ms:return this.matchesComparable(e,t,r,function(e){return Ls.parse(e)},this.versionComparator);case Cs:return this.matchesRegex(e,r);case ks: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 s=ns(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(e.toLowerCase().includes(o.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,s){var i=this,o=n(e),a=r.map(function(e){return n(e)}).filter(function(e){return void 0!==e});return void 0===o||0===a.length?r.some(function(r){return i.comparator(e,t,r)}):a.some(function(e){return s(o,t,e)})},e.prototype.comparator=function(e,t,r){switch(t){case ls:case ds:return e<r;case cs:case ps:return e<=r;case us:case fs:return e>r;case hs:case ms:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case ls:case ds:return n<0;case cs:case ps:return n<=0;case us:case fs:return n>0;case hs:case ms: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 gs:case vs:case ys:case bs:case ws:case Ss: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,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);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,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}(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 s=ns(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(!this.matchesIs(o,e))return!1}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var s=ns(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(this.matchesIs(o,e))return!0}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}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 s=e.call(this,n)||this;return s.statusCode=r,Object.setPrototypeOf(s,t.prototype),s}(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}ts(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var Ds=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,Gr(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,s=t.eventTime,o=t.loggerProvider,c=t.tx;return a(e,void 0,void 0,function(){var e,t,a,u,h,d,p,f,m;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=String(r),[4,c.store.get(e)];case 1:return t=l.sent(),a=t?t.eventTypes:{},u=a[n]||{},h=i(i({},a),((f={})[n]=i(i({},u),((m={})[s]={event_type:n},m)),f)),d={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,c.store.put(d)];case 2:return l.sent(),[2,h];case 3:return p=l.sent(),o.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,s=t.tx;return a(e,void 0,void 0,function(){var e,t,i,o,a,c;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),e=String(r),[4,s.store.getAll()];case 1:t=l.sent(),i=0,l.label=2;case 2:return i<t.length?(o=t[i],a=Date.now()-o.lastUpdated,o.sessionId!==e&&a>1728e5?[4,s.store.delete(o.sessionId)]:[3,4]):[3,5];case 3:l.sent(),l.label=4;case 4:return i++,[3,2];case 5:return[3,7];case 6:return c=l.sent(),n.warn("Failed to clear old session event types for targeting: ".concat(c)),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,s=t.eventType,i=t.eventTime,o=t.apiKey;return a(e,void 0,void 0,function(){var e,t,a,c;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,5,,6]),[4,this.openOrCreateDB(o)];case 1:return e=l.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:s,eventTime:i})]:[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 c=l.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(c)),[3,6];case 6:return[2,void 0]}})})}},Fs=new Ds,Bs=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,s=t.event,o=t.sessionId,c=t.userProperties,u=t.deviceId,h=t.page,d=t.flag;return a(e,void 0,void 0,function(){var e,t,a,p;return l(this,function(l){switch(l.label){case 0:return s&&s.time?[4,Fs.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:o,eventType:s.event_type,eventTime:s.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)),p={session_id:o,event:s,event_types:a&&Array.from(a),user:i(i({},c),{device_id:u,user_properties:c}),page:h},[2,this.evaluationEngine.evaluate(p,[d])]}})})},this.evaluationEngine=new _s},js=function(){var e=new Bs;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,Us=Object.freeze({__proto__:null,evaluateTargeting:js});var $s,zs=Object.freeze({__proto__:null,compressionScript:'var WebWorker=function(e){"use strict";onmessage=function(e){var s="string"==typeof e.data?JSON.parse(e.data):e.data,t=s.event,a=s.sessionId,n=t.type,r=t.timestamp,i=t.delay,o=t.data,d=null!=i?JSON.stringify({type:n,timestamp:r,delay:i,data:o}):JSON.stringify({type:n,timestamp:r,data:o});postMessage({compressedEvent:d,sessionId:a})};var s=onmessage;return e.compressionOnMessage=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n',trackDestinationScript:'var WebWorker=function(e){"use strict";var t,r=function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},r.apply(this,arguments)};function n(e,t,r,n){return new(r||(r=Promise))(function(s,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function i(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,i)}u((n=n.apply(e,t||[])).next())})}function s(e,t){var r,n,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=i(0),a.throw=i(1),a.return=i(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(o=0)),o;)try{if(r=1,n&&(s=2&i[0]?n.return:i[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,i[1])).done)return s;switch(n=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:case 1:s=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){o.label=i[1];break}if(6===i[0]&&o.label<s[1]){o.label=s[1],s=i;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(i);break}s[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{r=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}"function"==typeof SuppressedError&&SuppressedError,function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(t||(t={})),t.US;var o,a=/payload.*exceed/i,i="X-Session-Replay-Event-Skipped";!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",e.REPLAY_GATE_DECISION="replay-gate-decision"}(o||(o={}));var u="Network error occurred, event batch rejected";function c(e,t){return n(this,void 0,void 0,function(){var r,o,a,i,u,c,l,d,p,f,v,h,y,b,g=this;return s(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),r=t.CompressionStream,o=new r("gzip"),a=o.writable.getWriter(),i=o.readable.getReader(),u=[],c=n(g,void 0,void 0,function(){var e,t,r;return s(this,function(n){switch(n.label){case 0:return[4,i.read()];case 1:if(e=n.sent(),t=e.done,r=e.value,t)return[3,3];u.push(r),n.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,a.write((new TextEncoder).encode(e))];case 1:return m.sent(),[4,a.close()];case 2:return m.sent(),[4,c];case 3:m.sent(),l=u.reduce(function(e,t){return e+t.length},0),d=new Uint8Array(l),p=0;try{for(f=function(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.")}(u),v=f.next();!v.done;v=f.next())h=v.value,d.set(h,p),p+=h.length}catch(e){y={error:e}}finally{try{v&&!v.done&&(b=f.return)&&b.call(f)}finally{if(y)throw y.error}}return[2,d];case 4:return m.sent(),[2,null];case 5:return[2]}})})}function l(e){for(var t=e.length,r=0;r<t&&!(e.charCodeAt(r)>127);r++);if(r===t)return t;for(var n=r;r<t;r++){var s=e.charCodeAt(r);if(s<=127)n++;else if(s<=2047)n+=2;else if(s>=55296&&s<=56319){var o=r+1<t?e.charCodeAt(r+1):NaN;o>=56320&&o<=57343?(n+=4,r++):n+=3}else n+=3}return n}var d=0,p=new Map,f=function(e,t){return fetch(e,t)},v=function(e,t){var r="".concat(++d);return new Promise(function(n,s){var o=t.signal,a=function(){p.delete(r);var e=new Error("Delegated session replay fetch aborted by send timeout");e.name="AbortError",s(e)};o.addEventListener("abort",a,{once:!0}),p.set(r,function(e){o.removeEventListener("abort",a),e.error?s(new Error(e.body)):n({status:e.status,headers:{get:function(t){return t===i?e.skipHeader:null}},text:function(){return Promise.resolve(e.body)}})}),postMessage({type:"fetch-request",requestId:r,url:e,method:"POST",headers:t.headers,body:t.body,keepalive:t.keepalive})})};function h(e,t,o){var d,p,f,v,h,y,b,g;return n(this,void 0,void 0,function(){var n,m,w,S,T,E,k,R,C,x,A,I,M,O,U;return s(this,function(s){switch(s.label){case 0:n=null!==(d=t.sendTimeoutMs)&&void 0!==d?d:1e4,s.label=1;case 1:return s.trys.push([1,14,,15]),!1!==t.enableTransportCompression&&"CompressionStream"in self?[4,c(e,self)]:[3,3];case 2:return w=s.sent(),[3,4];case 3:w=null,s.label=4;case 4:m=w,S="".concat(null!==(f=null===(p=t.version)||void 0===p?void 0:p.type)&&void 0!==f?f:"standalone","/").concat(null!==(h=null===(v=t.version)||void 0===v?void 0:v.version)&&void 0!==h?h:t.sdkVersion),T=new URLSearchParams({device_id:t.deviceId,session_id:"".concat(t.sessionId),type:t.eventType}),E="".concat((P=t.serverZone,_=t.trackServerUrl,_||("STAGING"===P?"https://api-sr.stag2.amplitude.com/sessions/v2/track":"EU"===P?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")),"?").concat(T.toString()),k=r({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(t.apiKey),"X-Client-Version":t.sdkVersion,"X-Client-Library":S,"X-Client-Url":t.currentUrl.substring(0,1e3),"X-Client-Sample-Rate":"".concat(t.sampleRate),"X-Sampling-Hash-Alg":"xxhash32"},m?{"Content-Encoding":"gzip"}:{}),R=m?m.byteLength:l(e),C=new AbortController,x=n>0?setTimeout(function(){C.abort()},n):void 0,A=void 0,s.label=5;case 5:return s.trys.push([5,,7,8]),[4,o(E,{method:"POST",headers:k,body:null!=m?m:e,keepalive:R<=65536,signal:C.signal})];case 6:return A=s.sent(),[3,8];case 7:return x&&clearTimeout(x),[7];case 8:if(null===A)return[2,{shouldRetry:!1,success:!1,message:"Unexpected error occurred"}];if(A.status>=200&&A.status<300)return I=Math.round(function(e){for(var t=0,r=0;r<e.length;r++)t+=l(e[r]);return t}(t.events)/1024),M=null!==(g=null===(b=null===(y=A.headers)||void 0===y?void 0:y.get)||void 0===b?void 0:b.call(y,i))&&void 0!==g?g:null,[2,{shouldRetry:!1,success:!0,message:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(I," KB"),skipCode:M}];if(413!==A.status)return[3,13];O="",s.label=9;case 9:return s.trys.push([9,11,,12]),[4,A.text()];case 10:return O=s.sent(),[3,12];case 11:return s.sent(),[3,12];case 12:return[2,{shouldRetry:!1,success:!1,message:u,payloadTooLarge:!0,isWaf:a.test(O)}];case 13:return A.status>=500||408===A.status||429===A.status||499===A.status?[2,{shouldRetry:!0,success:!1,message:"HTTP ".concat(A.status)}]:[2,{shouldRetry:!1,success:!1,message:u}];case 14:return(U=s.sent())&&"object"==typeof U&&"AbortError"===U.name?[2,{shouldRetry:!0,success:!1,message:"Session replay worker request timed out after ".concat(n,"ms")}]:[2,{shouldRetry:!1,success:!1,message:String(U)}];case 15:return[2]}var P,_})})}function y(e,t,r,o,a){var i;return n(this,void 0,void 0,function(){var n,u,c;return s(this,function(s){switch(s.label){case 0:n=1,s.label=1;case 1:return[4,h(t,r,a)];case 2:return(u=s.sent()).success?(postMessage({type:"log",id:e,message:u.message}),postMessage({type:"complete",id:e,skipCode:null!==(i=u.skipCode)&&void 0!==i?i:null}),[2]):u.payloadTooLarge&&o?(postMessage({type:"payload_too_large",id:e,isWaf:!0===u.isWaf}),[2]):o&&u.shouldRetry&&n<r.flushMaxRetries?[4,new Promise(function(e){return setTimeout(e,Math.random()*n*1e3)})]:[3,4];case 3:return s.sent(),n++,[3,5];case 4:return c=n>=r.flushMaxRetries?"Session replay event batch rejected due to exceeded retry count":u.message,postMessage({type:"warn",id:e,message:c}),postMessage({type:"complete",id:e}),[2];case 5:return[3,1];case 6:return[2]}})})}onmessage=function(e){return n(void 0,void 0,void 0,function(){var t,r,n,o,a,i,u,c;return s(this,function(s){switch(s.label){case 0:return"fetch-response"===(t=e.data).type?((r=p.get(t.requestId))&&(p.delete(t.requestId),r(t)),[2]):"send"!==t.type?[3,2]:(n=t.id,o=t.payload,a=t.context,i=t.useRetry,u=t.useCustomTransport,c=JSON.stringify(o),[4,y(n,c,a,i,u?v:f)]);case 1:s.sent(),s.label=2;case 2:return[2]}})})};var b=onmessage;return e.trackDestinationOnMessage=b,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n'}),Ws=Object.defineProperty,qs=(e,t,r)=>((e,t,r)=>t in e?Ws(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Vs=Object.defineProperty,Gs=(e,t,r)=>((e,t,r)=>t in e?Vs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Hs=Object.defineProperty,Js=(e,t,r)=>((e,t,r)=>t in e?Hs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const Ks={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ys={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Xs={};function Qs(e){if(Xs[e])return Xs[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 Ks?Ks[e]:void 0,s=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]"))})),i=e in Ys?Ys[e]:void 0,o=Boolean(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&o)return Xs[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const i=s[e].prototype;return document.body.removeChild(n),i?Xs[e]=i:r}catch{return r}}const Zs={};function ei(e,t,r){var n;const s=`${e}.${String(r)}`;if(Zs[s])return Zs[s].call(t);const i=Qs(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(Zs[s]=o,o.call(t)):t[r]}const ti={};function ri(e,t,r){const n=`${e}.${String(r)}`;if(ti[n])return ti[n].bind(t);const s=Qs(e)[r];return"function"!=typeof s?t[r]:(ti[n]=s,s.bind(t))}const ni={childNodes:function(e){return ei("Node",e,"childNodes")},parentNode:function(e){return ei("Node",e,"parentNode")},parentElement:function(e){return ei("Node",e,"parentElement")},textContent:function(e){return ei("Node",e,"textContent")},contains:function(e,t){return ri("Node",e,"contains")(t)},getRootNode:function(e){return ri("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ei("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ei("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ei("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ei("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Qs("MutationObserver").constructor}};class si{constructor(){Js(this,"idNodeMap",new Map),Js(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 ii(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ii(ni.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&ii(ni.parentNode(e),t,r)}function oi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ai(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 li,ci={exports:{}};function ui(){if(li)return ci.exports;li=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return ci.exports=t(),ci.exports.createColors=t,ci.exports}const hi=ai(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var di,pi,fi,mi,gi,vi;function yi(){if(pi)return di;pi=1;let e=ui(),t=hi;class r extends Error{constructor(e,t,n,s,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),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);let s=e=>e,i=e=>e,o=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);i=e=>r(a(e)),s=e=>n(e),t&&(o=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+s(n)+o(l)+"\n "+c+i("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(n)+o(e)+"\n "+t+i("^")}return" "+s(n)+o(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return di=r,r.default=r,di}function bi(){if(mi)return fi;mi=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let i=t.parent;if("before"===n){if(!i||"root"===i.type&&i.first===t)return"";if(i&&"document"===i.type)return""}if(!i)return e[n];let o=t.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](o,t):o.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),o.rawCache[n]=s,s}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 fi=t,t.default=t,fi}function wi(){if(vi)return gi;vi=1;let e=bi();function t(t,r){new e(r).stringify(t)}return gi=t,t.default=t,gi}var Si,Ci,ki,xi,Oi,Ii,Ei,Mi,Ri,Pi,Ai,Ti,Ni,Li,_i,Di,Fi,Bi,ji,Ui,$i,zi,Wi,qi,Vi,Gi,Hi,Ji,Ki,Yi,Xi,Qi,Zi,eo,to,ro,no,so,io,oo,ao,lo,co,uo,ho,po,fo,mo,go,vo={};function yo(){return Si||(Si=1,vo.isClean=Symbol("isClean"),vo.my=Symbol("my")),vo}function bo(){if(ki)return Ci;ki=1;let e=yi(),t=bi(),r=wi(),{isClean:n,my:s}=yo();function i(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 s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>i(e,r)):("object"===o&&null!==s&&(s=i(s)),r[n]=s)}return r}function o(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let i=0;i<e.length;i++){if(n===t.line&&r===t.column){s=i;break}"\n"===e[i]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=i(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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(o(r,this.source.start),o(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=o(n,this.source.start),i=s+e;for(let e=s;e<i;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:o(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:o(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(o(t,this.source.start),o(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:o(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:o(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,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=r){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)}}return Ci=a,a.default=a,Ci}function wo(){if(Oi)return xi;Oi=1;let e=bo();class t extends e{constructor(e){super(e),this.type="comment"}}return xi=t,t.default=t,xi}function So(){if(Ei)return Ii;Ei=1;let e=bo();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return Ii=t,t.default=t,Ii}function Co(){if(Ri)return Mi;Ri=1;let e,t,r,n,s=wo(),i=So(),o=bo(),{isClean:a,my:l}=yo();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends o{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(r,o){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new i(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&o&&void 0!==o.raws.before&&(e.raws.before=o.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},Mi=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,i.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},Mi}function ko(){if(Ai)return Pi;Ai=1;let e=Co();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 Pi=t,t.default=t,e.registerAtRule(t),Pi}function xo(){if(Ni)return Ti;Ni=1;let e,t,r=Co();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},Ti=n,n.default=n,Ti}function Oo(){if(_i)return Li;_i=1;return Li={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},Li}function Io(){if(Fi)return Di;Fi=1;let{existsSync:e,readFileSync:t}=hi,{dirname:r,join:n}=hi,{SourceMapConsumer:s,SourceMapGenerator:i}=hi;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Di=o,o.default=o,Di}function Eo(){if(ji)return Bi;ji=1;let{nanoid:e}=Oo(),{isAbsolute:t,resolve:r}=hi,{SourceMapConsumer:n,SourceMapGenerator:s}=hi,{fileURLToPath:i,pathToFileURL:o}=hi,a=yi(),l=Io(),c=hi,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);i=e.line,s=e.col}else i=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,i,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:s,line:i},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:i,endOffset:l,line:t,offset:c,source:this.css},this.file&&(o&&(u.input.url=o(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?o(u.source):new URL(u.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!i)throw new Error("file: protocol is not available in this PostCSS build");h.file=i(l)}let d=c.sourceContentFor(u.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}}return Bi=f,f.default=f,c&&c.registerInput&&c.registerInput(f),Bi}function Mo(){if($i)return Ui;$i=1;let e,t,r=Co();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},Ui=n,n.default=n,r.registerRoot(n),Ui}function Ro(){if(Wi)return zi;Wi=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return zi=e,e.default=e,zi}function Po(){if(Vi)return qi;Vi=1;let e=Co(),t=Ro();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return qi=r,r.default=r,e.registerRule(r),qi}function Ao(){if(Ki)return Ji;Ki=1;let{dirname:e,relative:t,resolve:r,sep:n}=hi,{SourceMapConsumer:s,SourceMapGenerator:i}=hi,{pathToFileURL:o}=hi,a=Eo(),l=Boolean(s&&i),c=Boolean(e&&r&&t&&n);return Ji=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 r,n=this.toUrl(this.path(t.file)),i=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=i.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new i({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 i({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),t=i.match(/\n/g),t?(r+=t.length,e=i.lastIndexOf("\n"),n=i.length-e):n+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let i=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=e(r(i,this.mapOpts.annotation)));let o=t(i,n);return this.memoizedPaths.set(n,o),o}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(o){let t=o(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function To(){if(Zi)return Qi;Zi=1;let e=ko(),t=wo(),r=So(),n=Mo(),s=Po(),i=function(){if(Xi)return Yi;Xi=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),i=" ".charCodeAt(0),o="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Yi=function(k,x={}){let O,I,E,M,R,P,A,T,N,L,_=k.css.valueOf(),D=x.ignoreErrors,F=_.length,B=0,j=[],U=[];function $(e){throw k.error("Unclosed "+e,B)}return{back:function(e){U.push(e)},endOfFile:function(){return 0===U.length&&B>=F},nextToken:function(k){if(U.length)return U.pop();if(B>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=_.charCodeAt(B),O){case s:case i:case a:case l:case o:M=B;do{M+=1,O=_.charCodeAt(M)}while(O===i||O===s||O===a||O===l||O===o);P=["space",_.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case v:case m:case d:{let e=String.fromCharCode(O);P=[e,e,B];break}case h:if(L=j.length?j.pop()[1]:"",N=_.charCodeAt(B+1),"url"===L&&N!==e&&N!==t&&N!==i&&N!==s&&N!==a&&N!==o&&N!==l){M=B;do{if(A=!1,M=_.indexOf(")",M+1),-1===M){if(D||x){M=B;break}$("bracket")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",_.slice(B,M+1),B,M],B=M}else M=_.indexOf(")",B+1),I=_.slice(B,M+1),-1===M||S.test(I)?P=["(","(",B]:(P=["brackets",I,B,M],B=M);break;case e:case t:R=O===e?"'":'"',M=B;do{if(A=!1,M=_.indexOf(R,M+1),-1===M){if(D||x){M=B+1;break}$("string")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",_.slice(B,M+1),B,M],B=M;break;case y:b.lastIndex=B+1,b.test(_),M=0===b.lastIndex?_.length-1:b.lastIndex-2,P=["at-word",_.slice(B,M+1),B,M],B=M;break;case r:for(M=B,E=!0;_.charCodeAt(M+1)===r;)M+=1,E=!E;if(O=_.charCodeAt(M+1),E&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(M+=1,C.test(_.charAt(M)))){for(;C.test(_.charAt(M+1));)M+=1;_.charCodeAt(M+1)===i&&(M+=1)}P=["word",_.slice(B,M+1),B,M],B=M;break;default:O===n&&_.charCodeAt(B+1)===g?(M=_.indexOf("*/",B+2)+1,0===M&&(D||x?M=_.length:$("comment")),P=["comment",_.slice(B,M+1),B,M],B=M):(w.lastIndex=B+1,w.test(_),M=0===w.lastIndex?_.length-1:w.lastIndex-2,P=["word",_.slice(B,M+1),B,M],j.push(P),B=M)}return B++,P},position:function(){return B}}}}();const o={empty:!0,space:!0};return Qi=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,i=new e;i.name=t[1].slice(1),""===i.name&&this.unnamedAtrule(i,t),this.init(i,t[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){i.source.end=this.getPosition(t[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(t=l[l.length-1],i.source.end=this.getPosition(t[3]||t[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(r=o,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,a=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}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 s,i,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],i=s[0],"space"!==i||e!==c-1||n?"comment"===i?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",o[l]||o[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},Qi}function No(){if(to)return eo;to=1;let e=Co(),t=Eo(),r=To();function n(e,n){let s=new t(e,n),i=new r(s);try{i.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 i.root}return eo=n,n.default=n,e.registerParse(n),eo}function Lo(){if(no)return ro;no=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 ro=e,e.default=e,ro}function _o(){if(io)return so;io=1;let e=Lo();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return so=t,t.default=t,so}function Do(){if(ao)return oo;ao=1;let e={};return oo=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Fo(){if(co)return lo;co=1;let e=Co(),t=xo(),r=Ao(),n=No(),s=_o(),i=Mo(),o=wi(),{isClean:a,my:l}=yo(),c=Do();const u={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=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let v={};class y{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"}constructor(t,r,i){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 s)o=g(r.root),r.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{let t=n;i.syntax&&(t=i.syntax.parse),i.parser&&(t=i.parser),t.parse&&(t=t.parse);try{o=t(r,i)}catch(e){this.processed=!0,this.error=e}o&&!o[l]&&e.rebuild(o)}else o=g(r);this.result=new s(t,o,i),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,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return 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=o;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return y.registerPostcss=e=>{v=e},lo=y,y.default=y,i.registerLazyResult(y),t.registerLazyResult(y),lo}function Bo(){if(fo)return po;fo=1;let e=xo(),t=Fo(),r=function(){if(ho)return uo;ho=1;let e=Ao(),t=No();const r=_o();let n=wi(),s=Do();class i{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,r=t;try{e=r(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"}constructor(t,s,i){let o;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=i,this._map=void 0;let a=n;this.result=new r(this._processor,o,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return uo=i,i.default=i,uo}(),n=Mo();class s{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return po=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),po}const jo=oi(function(){if(go)return mo;go=1;let e=ko(),t=wo(),r=Co(),n=yi(),s=So(),i=xo(),o=function(){if(Hi)return Gi;Hi=1;let e=ko(),t=wo(),r=So(),n=Eo(),s=Io(),i=Mo(),o=Po();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new i(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return Gi=a,a.default=a,Gi}(),a=Eo(),l=Fo(),c=Ro(),u=bo(),h=No(),d=Bo(),p=_o(),f=Mo(),m=Po(),g=wi(),v=Lo();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return y.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return y([s(r)]).process(e,t)},s},y.stringify=g,y.parse=h,y.fromJSON=o,y.list=c,y.comment=e=>new t(e),y.atRule=t=>new e(t),y.decl=e=>new s(e),y.rule=e=>new m(e),y.root=e=>new f(e),y.document=e=>new i(e),y.CssSyntaxError=n,y.Declaration=s,y.Container=r,y.Processor=d,y.Document=i,y.Comment=t,y.Warning=v,y.AtRule=e,y.Result=p,y.Input=a,y.Rule=m,y.Root=f,y.Node=u,l.registerPostcss(y),mo=y,y.default=y,mo}());jo.stringify,jo.fromJSON,jo.plugin,jo.parse,jo.list,jo.document,jo.comment,jo.atRule,jo.rule,jo.decl,jo.root,jo.CssSyntaxError,jo.Declaration,jo.Container,jo.Processor,jo.Document,jo.Comment,jo.Warning,jo.AtRule,jo.Result,jo.Input,jo.Rule,jo.Root,jo.Node;var Uo=Object.defineProperty,$o=(e,t,r)=>((e,t,r)=>t in e?Uo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function zo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Wo(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 qo,Vo={exports:{}};function Go(){if(qo)return Vo.exports;qo=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return Vo.exports=t(),Vo.exports.createColors=t,Vo.exports}const Ho=Wo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Jo,Ko,Yo,Xo,Qo,Zo;function ea(){if(Ko)return Jo;Ko=1;let e=Go(),t=Ho;class r extends Error{constructor(e,t,n,s,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),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);let s=e=>e,i=e=>e,o=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);i=e=>r(a(e)),s=e=>n(e),t&&(o=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+s(n)+o(l)+"\n "+c+i("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(n)+o(e)+"\n "+t+i("^")}return" "+s(n)+o(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Jo=r,r.default=r,Jo}function ta(){if(Xo)return Yo;Xo=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let i=t.parent;if("before"===n){if(!i||"root"===i.type&&i.first===t)return"";if(i&&"document"===i.type)return""}if(!i)return e[n];let o=t.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](o,t):o.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),o.rawCache[n]=s,s}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 Yo=t,t.default=t,Yo}function ra(){if(Zo)return Qo;Zo=1;let e=ta();function t(t,r){new e(r).stringify(t)}return Qo=t,t.default=t,Qo}var na,sa,ia,oa,aa,la,ca,ua,ha,da,pa,fa,ma,ga,va,ya,ba,wa,Sa,Ca,ka,xa,Oa,Ia,Ea,Ma,Ra,Pa,Aa,Ta,Na,La,_a,Da,Fa,Ba,ja,Ua,$a,za,Wa,qa,Va,Ga,Ha,Ja,Ka,Ya,Xa,Qa={};function Za(){return na||(na=1,Qa.isClean=Symbol("isClean"),Qa.my=Symbol("my")),Qa}function el(){if(ia)return sa;ia=1;let e=ea(),t=ta(),r=ra(),{isClean:n,my:s}=Za();function i(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 s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>i(e,r)):("object"===o&&null!==s&&(s=i(s)),r[n]=s)}return r}function o(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let i=0;i<e.length;i++){if(n===t.line&&r===t.column){s=i;break}"\n"===e[i]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=i(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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(o(r,this.source.start),o(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=o(n,this.source.start),i=s+e;for(let e=s;e<i;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:o(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:o(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(o(t,this.source.start),o(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:o(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:o(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,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=r){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)}}return sa=a,a.default=a,sa}function tl(){if(aa)return oa;aa=1;let e=el();class t extends e{constructor(e){super(e),this.type="comment"}}return oa=t,t.default=t,oa}function rl(){if(ca)return la;ca=1;let e=el();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return la=t,t.default=t,la}function nl(){if(ha)return ua;ha=1;let e,t,r,n,s=tl(),i=rl(),o=el(),{isClean:a,my:l}=Za();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends o{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(r,o){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new i(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&o&&void 0!==o.raws.before&&(e.raws.before=o.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},ua=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,i.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},ua}function sl(){if(pa)return da;pa=1;let e=nl();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 da=t,t.default=t,e.registerAtRule(t),da}function il(){if(ma)return fa;ma=1;let e,t,r=nl();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},fa=n,n.default=n,fa}function ol(){if(va)return ga;va=1;return ga={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},ga}function al(){if(ba)return ya;ba=1;let{existsSync:e,readFileSync:t}=Ho,{dirname:r,join:n}=Ho,{SourceMapConsumer:s,SourceMapGenerator:i}=Ho;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return ya=o,o.default=o,ya}function ll(){if(Sa)return wa;Sa=1;let{nanoid:e}=ol(),{isAbsolute:t,resolve:r}=Ho,{SourceMapConsumer:n,SourceMapGenerator:s}=Ho,{fileURLToPath:i,pathToFileURL:o}=Ho,a=ea(),l=al(),c=Ho,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);i=e.line,s=e.col}else i=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,i,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:s,line:i},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:i,endOffset:l,line:t,offset:c,source:this.css},this.file&&(o&&(u.input.url=o(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?o(u.source):new URL(u.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!i)throw new Error("file: protocol is not available in this PostCSS build");h.file=i(l)}let d=c.sourceContentFor(u.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}}return wa=f,f.default=f,c&&c.registerInput&&c.registerInput(f),wa}function cl(){if(ka)return Ca;ka=1;let e,t,r=nl();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},Ca=n,n.default=n,r.registerRoot(n),Ca}function ul(){if(Oa)return xa;Oa=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return xa=e,e.default=e,xa}function hl(){if(Ea)return Ia;Ea=1;let e=nl(),t=ul();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return Ia=r,r.default=r,e.registerRule(r),Ia}function dl(){if(Aa)return Pa;Aa=1;let{dirname:e,relative:t,resolve:r,sep:n}=Ho,{SourceMapConsumer:s,SourceMapGenerator:i}=Ho,{pathToFileURL:o}=Ho,a=ll(),l=Boolean(s&&i),c=Boolean(e&&r&&t&&n);return Pa=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 r,n=this.toUrl(this.path(t.file)),i=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=i.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new i({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 i({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),t=i.match(/\n/g),t?(r+=t.length,e=i.lastIndexOf("\n"),n=i.length-e):n+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let i=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=e(r(i,this.mapOpts.annotation)));let o=t(i,n);return this.memoizedPaths.set(n,o),o}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(o){let t=o(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function pl(){if(_a)return La;_a=1;let e=sl(),t=tl(),r=rl(),n=cl(),s=hl(),i=function(){if(Na)return Ta;Na=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),i=" ".charCodeAt(0),o="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Ta=function(k,x={}){let O,I,E,M,R,P,A,T,N,L,_=k.css.valueOf(),D=x.ignoreErrors,F=_.length,B=0,j=[],U=[];function $(e){throw k.error("Unclosed "+e,B)}return{back:function(e){U.push(e)},endOfFile:function(){return 0===U.length&&B>=F},nextToken:function(k){if(U.length)return U.pop();if(B>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=_.charCodeAt(B),O){case s:case i:case a:case l:case o:M=B;do{M+=1,O=_.charCodeAt(M)}while(O===i||O===s||O===a||O===l||O===o);P=["space",_.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case v:case m:case d:{let e=String.fromCharCode(O);P=[e,e,B];break}case h:if(L=j.length?j.pop()[1]:"",N=_.charCodeAt(B+1),"url"===L&&N!==e&&N!==t&&N!==i&&N!==s&&N!==a&&N!==o&&N!==l){M=B;do{if(A=!1,M=_.indexOf(")",M+1),-1===M){if(D||x){M=B;break}$("bracket")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",_.slice(B,M+1),B,M],B=M}else M=_.indexOf(")",B+1),I=_.slice(B,M+1),-1===M||S.test(I)?P=["(","(",B]:(P=["brackets",I,B,M],B=M);break;case e:case t:R=O===e?"'":'"',M=B;do{if(A=!1,M=_.indexOf(R,M+1),-1===M){if(D||x){M=B+1;break}$("string")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",_.slice(B,M+1),B,M],B=M;break;case y:b.lastIndex=B+1,b.test(_),M=0===b.lastIndex?_.length-1:b.lastIndex-2,P=["at-word",_.slice(B,M+1),B,M],B=M;break;case r:for(M=B,E=!0;_.charCodeAt(M+1)===r;)M+=1,E=!E;if(O=_.charCodeAt(M+1),E&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(M+=1,C.test(_.charAt(M)))){for(;C.test(_.charAt(M+1));)M+=1;_.charCodeAt(M+1)===i&&(M+=1)}P=["word",_.slice(B,M+1),B,M],B=M;break;default:O===n&&_.charCodeAt(B+1)===g?(M=_.indexOf("*/",B+2)+1,0===M&&(D||x?M=_.length:$("comment")),P=["comment",_.slice(B,M+1),B,M],B=M):(w.lastIndex=B+1,w.test(_),M=0===w.lastIndex?_.length-1:w.lastIndex-2,P=["word",_.slice(B,M+1),B,M],j.push(P),B=M)}return B++,P},position:function(){return B}}}}();const o={empty:!0,space:!0};return La=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,i=new e;i.name=t[1].slice(1),""===i.name&&this.unnamedAtrule(i,t),this.init(i,t[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){i.source.end=this.getPosition(t[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(t=l[l.length-1],i.source.end=this.getPosition(t[3]||t[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(r=o,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,a=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}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 s,i,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],i=s[0],"space"!==i||e!==c-1||n?"comment"===i?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",o[l]||o[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},La}function fl(){if(Fa)return Da;Fa=1;let e=nl(),t=ll(),r=pl();function n(e,n){let s=new t(e,n),i=new r(s);try{i.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 i.root}return Da=n,n.default=n,e.registerParse(n),Da}function ml(){if(ja)return Ba;ja=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 Ba=e,e.default=e,Ba}function gl(){if($a)return Ua;$a=1;let e=ml();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return Ua=t,t.default=t,Ua}function vl(){if(Wa)return za;Wa=1;let e={};return za=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function yl(){if(Va)return qa;Va=1;let e=nl(),t=il(),r=dl(),n=fl(),s=gl(),i=cl(),o=ra(),{isClean:a,my:l}=Za(),c=vl();const u={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=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let v={};class y{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"}constructor(t,r,i){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 s)o=g(r.root),r.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{let t=n;i.syntax&&(t=i.syntax.parse),i.parser&&(t=i.parser),t.parse&&(t=t.parse);try{o=t(r,i)}catch(e){this.processed=!0,this.error=e}o&&!o[l]&&e.rebuild(o)}else o=g(r);this.result=new s(t,o,i),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,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return 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=o;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return y.registerPostcss=e=>{v=e},qa=y,y.default=y,i.registerLazyResult(y),t.registerLazyResult(y),qa}function bl(){if(Ka)return Ja;Ka=1;let e=il(),t=yl(),r=function(){if(Ha)return Ga;Ha=1;let e=dl(),t=fl();const r=gl();let n=ra(),s=vl();class i{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,r=t;try{e=r(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"}constructor(t,s,i){let o;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=i,this._map=void 0;let a=n;this.result=new r(this._processor,o,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return Ga=i,i.default=i,Ga}(),n=cl();class s{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Ja=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),Ja}const wl=zo(function(){if(Xa)return Ya;Xa=1;let e=sl(),t=tl(),r=nl(),n=ea(),s=rl(),i=il(),o=function(){if(Ra)return Ma;Ra=1;let e=sl(),t=tl(),r=rl(),n=ll(),s=al(),i=cl(),o=hl();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new i(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return Ma=a,a.default=a,Ma}(),a=ll(),l=yl(),c=ul(),u=el(),h=fl(),d=bl(),p=gl(),f=cl(),m=hl(),g=ra(),v=ml();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return y.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return y([s(r)]).process(e,t)},s},y.stringify=g,y.parse=h,y.fromJSON=o,y.list=c,y.comment=e=>new t(e),y.atRule=t=>new e(t),y.decl=e=>new s(e),y.rule=e=>new m(e),y.root=e=>new f(e),y.document=e=>new i(e),y.CssSyntaxError=n,y.Declaration=s,y.Container=r,y.Processor=d,y.Document=i,y.Comment=t,y.Warning=v,y.AtRule=e,y.Result=p,y.Input=a,y.Rule=m,y.Root=f,y.Node=u,l.registerPostcss(y),Ya=y,y.default=y,Ya}());wl.stringify,wl.fromJSON,wl.plugin,wl.parse,wl.list,wl.document,wl.comment,wl.atRule,wl.rule,wl.decl,wl.root,wl.CssSyntaxError,wl.Declaration,wl.Container,wl.Processor,wl.Document,wl.Comment,wl.Warning,wl.AtRule,wl.Result,wl.Input,wl.Rule,wl.Root,wl.Node;class Sl{constructor(...e){$o(this,"parentElement",null),$o(this,"parentNode",null),$o(this,"ownerDocument"),$o(this,"firstChild",null),$o(this,"lastChild",null),$o(this,"previousSibling",null),$o(this,"nextSibling",null),$o(this,"ELEMENT_NODE",1),$o(this,"TEXT_NODE",3),$o(this,"nodeType"),$o(this,"nodeName"),$o(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 Sl))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 Cl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},kl={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},xl={};function Ol(e){if(xl[e])return xl[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 Cl?Cl[e]:void 0,s=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]"))})),i=e in kl?kl[e]:void 0,o=Boolean(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&o)return xl[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const i=s[e].prototype;return document.body.removeChild(n),i?xl[e]=i:r}catch{return r}}const Il={};function El(e,t,r){var n;const s=`${e}.${String(r)}`;if(Il[s])return Il[s].call(t);const i=Ol(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(Il[s]=o,o.call(t)):t[r]}const Ml={};function Rl(e,t,r){const n=`${e}.${String(r)}`;if(Ml[n])return Ml[n].bind(t);const s=Ol(e)[r];return"function"!=typeof s?t[r]:(Ml[n]=s,s.bind(t))}const Pl={childNodes:function(e){return El("Node",e,"childNodes")},parentNode:function(e){return El("Node",e,"parentNode")},parentElement:function(e){return El("Node",e,"parentElement")},textContent:function(e){return El("Node",e,"textContent")},contains:function(e,t){return Rl("Node",e,"contains")(t)},getRootNode:function(e){return Rl("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?El("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?El("Element",e,"shadowRoot"):null},querySelector:function(e,t){return El("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return El("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ol("MutationObserver").constructor}};const Al="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 Tl={map:{},getId:()=>(console.error(Al),-1),getNode:()=>(console.error(Al),null),removeNodeFromMap(){console.error(Al)},has:()=>(console.error(Al),!1),reset(){console.error(Al)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Tl=new Proxy(Tl,{get:(e,t,r)=>("map"===t&&console.error(Al),Reflect.get(e,t,r))}));let Nl=Date.now;function Ll(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Pl.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Nl=()=>(new Date).getTime());function _l(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Pl.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Pl.host(Pl.getRootNode(e))&&(r=Pl.host(Pl.getRootNode(e))),r}function Dl(e){let t,r=e;for(;t=_l(r);)r=t;return r}function Fl(e){const t=e.ownerDocument;if(!t)return!1;const r=Dl(e);return Pl.contains(t,r)}const Bl=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Gs(this,"id",1),Gs(this,"styleIDMap",new WeakMap),Gs(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 Tl},closestElementOfNode:Ll,getBaseDimension:function e(t,r){var n,s;const i=null==(s=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:s.frameElement;if(!i||i===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),a=e(i,r),l=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.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:Dl,getShadowHost:_l,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,s;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=Pl.parentElement(i.body))?void 0:t.scrollLeft)||(null==(r=null==i?void 0:i.body)?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(n=Pl.parentElement(i.body))?void 0:n.scrollTop)||(null==(s=null==i?void 0:i.body)?void 0:s.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof Sl&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Pl.shadowRoot(e)))},hookSetter:function e(t,r,n,s,i=window){const o=i.Object.getOwnPropertyDescriptor(t,r);return i.Object.defineProperty(t,r,s?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>e(t,r,o||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(Pl.contains(t,e)||Fl(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&ni.host(e)||null;return Boolean(t&&"shadowRoot"in t&&ni.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=Pl.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))},isBlocked:function(e,t,r,n){if(!e)return!1;const s=Ll(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t))return!0;if(n&&null!==s.closest("."+t))return!0}else if(ii(s,t,n))return!0}catch(e){}if(r){if(s.matches(r))return!0;if(n&&null!==s.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 Nl},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],s=r(n);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{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 s of e){const{nextId:e,parentId:i}=s;if(e&&e in t){const i=t[e];if(i.parent){const e=i.parent.children.indexOf(i);i.parent.children.splice(e,0,r(s,i.parent))}else{const e=n.indexOf(i);n.splice(e,0,r(s,null))}continue}if(i in t){const e=t[i];e.children.push(r(s,e));continue}n.push(r(s,null))}return n},shadowHostInDom:Fl,throttle:function(e,t,r={}){let n=null,s=0;return function(...i){const o=Date.now();s||!1!==r.leading||(s=o);const a=t-(o-s),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),s=o,e.apply(l,i)):n||!1===r.trailing||(n=setTimeout(()=>{s=!1===r.leading?0:Date.now(),n=null,e.apply(l,i)},a))}},uniqueTextMutations:function(e){const t=new Set,r=[];for(let n=e.length;n--;){const s=e[n];t.has(s.id)||(r.push(s),t.add(s.id))}return r}},Symbol.toStringTag,{value:"Module"}));for(var jl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ul="undefined"==typeof Uint8Array?[]:new Uint8Array(256),$l=0;$l<64;$l++)Ul[jl.charCodeAt($l)]=$l;"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==($s=e.contentWindow)?void 0:$s.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var zl,Wl;new si,(Wl=zl||(zl={}))[Wl.NotStarted=0]="NotStarted",Wl[Wl.Running=1]="Running",Wl[Wl.Stopped=2]="Stopped";class ql{constructor(e){qs(this,"fileName"),qs(this,"functionName"),qs(this,"lineNumber"),qs(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 Vl=/(^|@)\S+:\d+/,Gl=/^\s*at .*(\S+:\d+|\(native\))/m,Hl=/^(eval@)?(\[native code])?$/,Jl={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Gl)?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(Gl)},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),s=this.extractLocation(r?r[1]:n.pop()),i=n.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0];return new ql({functionName:i,fileName:o,lineNumber:s[1],columnNumber:s[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(Hl)},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 ql({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new ql({functionName:n,fileName:s[0],lineNumber:s[1],columnNumber:s[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,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new ql({fileName:s[2],lineNumber:parseFloat(s[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,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new ql({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Vl)&&!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 ql({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Kl(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,s=[];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&&s.push(t)}s.length>1&&(r+=`:eq(${s.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function Yl(e){return"[object Object]"===Object.prototype.toString.call(e)}function Xl(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Yl(e[n])&&Xl(e[n],t-1))return!0;return!1}function Ql(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],s=[];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?s.splice(r,1/0,e):s.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+s.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(Yl(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Yl(e)&&Xl(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]=Kl(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 Zl={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 ec(e,t,r){const n=r?Object.assign({},Zl,r):Zl,s=n.logger;if(!s)return()=>{};let i;i="string"==typeof s?t[s]:s;let o=0,a=!1;const l=[];if(n.level.includes("error")){const r=t=>{const r=t.message,s=t.error,i=Jl.parse(s).map(e=>e.toString()),o=[Ql(r,n.stringifyOptions)];e({level:"error",trace:i,payload:o})};t.addEventListener("error",r),l.push(()=>{t.removeEventListener("error",r)});const s=t=>{let r,s;t.reason instanceof Error?(r=t.reason,s=[Ql(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[Ql("Uncaught (in promise)",n.stringifyOptions),Ql(t.reason,n.stringifyOptions)]);const i=Jl.parse(r).map(e=>e.toString());e({level:"error",trace:i,payload:s})};t.addEventListener("unhandledrejection",s),l.push(()=>{t.removeEventListener("unhandledrejection",s)})}for(const e of n.level)l.push(c(i,e));return()=>{l.forEach(e=>e())};function c(t,r){return t[r]?Bl.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=Jl.parse(new Error).map(e=>e.toString()).splice(1),i=("assert"===r?s.slice(1):s).map(e=>Ql(e,n.stringifyOptions));o++,o<n.lengthThreshold?e({level:r,trace:t,payload:i}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Ql("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}const tc="rrweb/console@1";var rc,nc=Object.freeze({__proto__:null,PLUGIN_NAME:tc,getRecordConsolePlugin:e=>({name:tc,observer:ec,options:e})}),sc=Object.defineProperty,ic=(e,t,r)=>((e,t,r)=>t in e?sc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),oc=Object.defineProperty,ac=(e,t,r)=>((e,t,r)=>t in e?oc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),lc=(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))(lc||{});const cc={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},uc={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},hc={};function dc(e){if(hc[e])return hc[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 cc?cc[e]:void 0,s=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]"))})),i=e in uc?uc[e]:void 0,o=Boolean(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&o)return hc[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const i=s[e].prototype;return document.body.removeChild(n),i?hc[e]=i:r}catch{return r}}const pc={};function fc(e,t,r){var n;const s=`${e}.${String(r)}`;if(pc[s])return pc[s].call(t);const i=dc(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(pc[s]=o,o.call(t)):t[r]}const mc={};function gc(e,t,r){const n=`${e}.${String(r)}`;if(mc[n])return mc[n].bind(t);const s=dc(e)[r];return"function"!=typeof s?t[r]:(mc[n]=s,s.bind(t))}const vc={childNodes:function(e){return fc("Node",e,"childNodes")},parentNode:function(e){return fc("Node",e,"parentNode")},parentElement:function(e){return fc("Node",e,"parentElement")},textContent:function(e){return fc("Node",e,"textContent")},contains:function(e,t){return gc("Node",e,"contains")(t)},getRootNode:function(e){return gc("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?fc("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?fc("Element",e,"shadowRoot"):null},querySelector:function(e,t){return fc("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return fc("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return dc("MutationObserver").constructor}};function yc(e){return e.nodeType===e.ELEMENT_NODE}function bc(e){const t=e&&"host"in e&&"mode"in e&&vc.host(e)||null;return Boolean(t&&"shadowRoot"in t&&vc.shadowRoot(t)===e)}function wc(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Sc(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 s=Array.from(r,e=>Cc(e,n)).join("");return(t=s).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 Cc(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Sc(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?Nc(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?Nc(r,t):r}}class kc{constructor(){ac(this,"idNodeMap",new Map),ac(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 xc({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:i}){let o=s||"";const a=n&&Oc(n);return(t[r.toLowerCase()]||a&&t[a])&&(o=i?i(o,e):"*".repeat(o.length)),o}function Oc(e){return e.toLowerCase()}const Ic="__rrweb_original__";function Ec(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Oc(t):null}function Mc(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 Rc=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Pc=/^(?:[a-z+]+:)?\/\//i,Ac=/^www\..*/i,Tc=/^(data:)([^,]*),(.*)/i;function Nc(e,t){return(e||"").replace(Rc,(e,r,n,s,i,o)=>{const a=n||i||o,l=r||s||"";if(!a)return e;if(Pc.test(a)||Ac.test(a))return`url(${l}${a}${l})`;if(Tc.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 c=t.split("/"),u=a.split("/");c.pop();for(const e of u)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`})}function Lc(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function _c(e,t){return function(e,t,r=!1){const n=Array.from(t.childNodes),s=[];let i=0;if(n.length>1&&e&&"string"==typeof e){let t=Lc(e,r);const o=t.length/e.length;for(let a=1;a<n.length;a++)if(n[a].textContent&&"string"==typeof n[a].textContent){const l=Lc(n[a].textContent,r),c=100;let u=3;for(;u<l.length&&(l[u].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,u),1));u++);for(;u<l.length;u++){let h=l.substring(0,u),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 s.push(e),s;u=c+1}else u===l.length-1&&(p=t.indexOf(h));if(d.length>=2&&u>c){const e=n[a-1].textContent;if(e&&"string"==typeof e){const r=Lc(e).length;p=t.indexOf(h,r)}-1===p&&(p=d[0].length)}if(-1!==p){let a=Math.floor(p/o);for(;a>0&&a<e.length;){if(i+=1,i>50*n.length)return s.push(e),s;const l=Lc(e.substring(0,a),r);if(l.length===p){s.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)/o)):a-=Math.max(1,Math.floor((l.length-p)*o))}break}}}}return s.push(e),s}(e,t).join("/* rr_split */")}const Dc="lightgrey";let Fc=1;const Bc=new RegExp("[^a-z0-9-_:]");function jc(){return Fc++}let Uc,$c;const zc=/^[^ \t\n\r\u000c]+/,Wc=/^[, \t\n\r\u000c]+/;const qc=new WeakMap;function Vc(e,t){return t&&""!==t.trim()?Hc(e,t):t}function Gc(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Hc(e,t){let r=qc.get(e);if(r||(r=e.createElement("a"),qc.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Jc(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Vc(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 s=e.exec(t.substring(r));return s?(n=s[0],r+=n.length,n):""}const s=[];for(;n(Wc),!(r>=t.length);){let i=n(zc);if(","===i.slice(-1))i=Vc(e,i.substring(0,i.length-1)),s.push(i);else{let n="";i=Vc(e,i);let o=!1;for(;;){const e=t.charAt(r);if(""===e){s.push((i+n).trim());break}if(o)")"===e&&(o=!1);else{if(","===e){r+=1,s.push((i+n).trim());break}"("===e&&(o=!0)}n+=e,r+=1}}}return s.join(", ")}(e,n):"style"===r?Nc(n,Hc(e)):"object"===t&&"data"===r?Vc(e,n):n:Vc(e,n):n}function Kc(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Yc(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Yc(vc.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Yc(vc.parentNode(e),t,r)}function Xc(e,t,r,n){let s;if(yc(e)){if(s=e,!vc.childNodes(s).length)return!1}else{if(null===vc.parentElement(e))return!1;s=vc.parentElement(e)}try{if("string"==typeof t){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(Yc(s,t,n))return!0;if(r)if(n){if(s.closest(r))return!0}else if(s.matches(r))return!0}catch(e){}return!1}function Qc(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,maskAttributeFn:h,dataURLOptions:d={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:g=!1,cssCaptured:v=!1,applyBackgroundColorToBlockedElements:y=!1}=t,b=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:lc.Document,childNodes:[],compatMode:e.compatMode}:{type:lc.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:lc.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:i,maskInputOptions:o={},maskInputFn:a,maskAttributeFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:h,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:f,applyBackgroundColorToBlockedElements:m=!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,s),v=function(e){if(e instanceof HTMLFormElement)return"form";const t=Oc(e.tagName);return Bc.test(t)?"div":t}(e);let y={};const b=e.attributes.length;for(let t=0;t<b;t++){const n=e.attributes[t];if(!Kc(v,n.name,n.value)){const t=Jc(r,v,Oc(n.name),n.value);if(l&&null!==t){const r=l(n.name,t,e);null!==r&&(y[n.name]=r)}else y[n.name]=t}}if("link"===v&&i){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=Sc(t)),n&&(delete y.rel,delete y.href,y._cssText=n)}if("style"===v&&e.sheet){let t=Sc(e.sheet);t&&(e.childNodes.length>1&&(t=_c(t,e)),y._cssText=t)}if("input"===v||"textarea"===v||"select"===v){const t=e.value,r=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=xc({element:e,type:Ec(e),tagName:v,value:t,maskInputOptions:o,maskInputFn:a}):r&&(y.checked=r)}"option"===v&&(e.selected&&!o.select?y.selected=!0:delete y.selected);"dialog"===v&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===v&&h)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 s=t.getImageData,i=Ic in s?s[Ic]:s;if(new Uint32Array(i.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)||(y.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(c.type,c.quality)&&(y.rr_dataURL=t)}if("img"===v&&u){Uc||(Uc=r.createElement("canvas"),$c=Uc.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{Uc.width=t.naturalWidth,Uc.height=t.naturalHeight,$c.drawImage(t,0,0),y.rr_dataURL=Uc.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i));console.warn(`Cannot inline img src=${n}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(s?y.crossOrigin=s:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if("audio"===v||"video"===v){const t=y;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}p||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(g){const{width:t,height:r}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${r}px`,...m?{rr_background_color:Dc}:{}}}"iframe"!==v||d(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(v)&&(w=!0)}catch(e){}return{type:lc.Element,tagName:v,attributes:y,childNodes:[],isSVG:Gc(e)||void 0,needBlock:g,rootId:f,isCustom:w}}(e,{doc:r,blockClass:s,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,maskAttributeFn:h,dataURLOptions:d,inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:g,rootId:b,applyBackgroundColorToBlockedElements:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:i}=t,o=vc.parentNode(e),a=o&&o.tagName;let l="";const c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;u?l="SCRIPT_PLACEHOLDER":i||(l=vc.textContent(e),c&&l&&(l=Nc(l,Hc(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,vc.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:lc.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:c,rootId:b,cssCaptured:v});case e.CDATA_SECTION_NODE:return{type:lc.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:lc.Comment,textContent:vc.textContent(e)||"",rootId:b};default:return!1}}function Zc(e){return null==e?"":e.toLowerCase()}function eu(e,t,r){return Array.from(e).map(e=>{const n=t(e);let s=[];if(!r.has(n)){r.add(n);try{s=Array.from(e.cssRules,(t,r)=>({rule:Cc(t,e.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}return{styleId:n,rules:s}})}function tu(e,t){var r,n;const{doc:s,mirror:i,blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:c,skipChild:u=!1,inlineStylesheet:h=!0,maskInputOptions:d={},maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:v={},inlineImages:y=!1,recordCanvas:b=!1,onSerialize:w,onAdoptedStyleSheet:S,onIframeLoad:C,iframeLoadTimeout:k=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:O=5e3,keepIframeSrcFn:I=()=>!1,newlyAddedElement:E=!1,cssCaptured:M=!1,applyBackgroundColorToBlockedElements:R=!1}=t,P=t._emittedStyleIds??new Set;let{needsMask:A}=t,{preserveWhiteSpace:T=!0}=t;if(!A){A=Xc(e,l,c,void 0===A)}const N=Qc(e,{doc:s,mirror:i,blockClass:o,blockSelector:a,needsMask:A,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,dataURLOptions:v,inlineImages:y,recordCanvas:b,keepIframeSrcFn:I,newlyAddedElement:E,cssCaptured:M,applyBackgroundColorToBlockedElements:R});if(!N)return console.warn(e,"not serialized"),null;let L;L=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===lc.Comment)return!0;if(e.type===lc.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"===Mc(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Zc(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Zc(e.attributes.name)||"icon"===Zc(e.attributes.rel)||"apple-touch-icon"===Zc(e.attributes.rel)||"shortcut icon"===Zc(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Zc(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Zc(e.attributes.property).match(/^(og|twitter|fb):/)||Zc(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Zc(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Zc(e.attributes.name)||"googlebot"===Zc(e.attributes.name)||"bingbot"===Zc(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Zc(e.attributes.name)||"generator"===Zc(e.attributes.name)||"framework"===Zc(e.attributes.name)||"publisher"===Zc(e.attributes.name)||"progid"===Zc(e.attributes.name)||Zc(e.attributes.property).match(/^article:/)||Zc(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Zc(e.attributes.name)||"yandex-verification"===Zc(e.attributes.name)||"csrf-token"===Zc(e.attributes.name)||"p:domain_verify"===Zc(e.attributes.name)||"verify-v1"===Zc(e.attributes.name)||"verification"===Zc(e.attributes.name)||"shopify-checkout-api-token"===Zc(e.attributes.name)))return!0}}return!1}(N,g)||!T&&N.type===lc.Text&&!N.textContent.replace(/^\s+|\s+$/gm,"").length?-2:jc();const _=Object.assign(N,{id:L});if(i.add(e,_),-2===L)return null;w&&w(e);let D=!u;if(_.type===lc.Element){D=D&&!_.needBlock,delete _.needBlock;const t=vc.shadowRoot(e);t&&wc(t)&&(_.isShadowHost=!0,S&&(null==(r=t.adoptedStyleSheets)?void 0:r.length)&&(_.adoptedStyleSheets=eu(t.adoptedStyleSheets,S,P)))}if(_.type===lc.Document&&S){const t=e;(null==(n=t.adoptedStyleSheets)?void 0:n.length)&&(_.adoptedStyleSheets=eu(t.adoptedStyleSheets,S,P))}if((_.type===lc.Document||_.type===lc.Element)&&D){g.headWhitespace&&_.type===lc.Element&&"head"===_.tagName&&(T=!1);const t={doc:s,mirror:i,blockClass:o,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:u,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:v,inlineImages:y,recordCanvas:b,preserveWhiteSpace:T,onSerialize:w,onAdoptedStyleSheet:S,_emittedStyleIds:P,onIframeLoad:C,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:I,cssCaptured:!1,applyBackgroundColorToBlockedElements:R};if(_.type===lc.Element&&"textarea"===_.tagName&&void 0!==_.attributes.value);else{_.type===lc.Element&&void 0!==_.attributes._cssText&&"string"==typeof _.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(vc.childNodes(e))){const e=tu(r,t);e&&_.childNodes.push(e)}}let r=null;if(yc(e)&&(r=vc.shadowRoot(e)))for(const e of Array.from(vc.childNodes(r))){const n=tu(e,t);n&&(wc(r)&&(n.isShadow=!0),_.childNodes.push(n))}}const F=vc.parentNode(e);return F&&bc(F)&&wc(F)&&(_.isShadow=!0),_.type===lc.Element&&"iframe"===_.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let s,i=!1;try{s=n.document.readyState}catch(e){return}if("complete"!==s){const n=setTimeout(()=>{i||(t(),i=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(n),i=!0,t()})}const o="about:blank";if(n.location.href!==o||e.src===o||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&C){const r=tu(t,{doc:t,mirror:i,blockClass:o,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:v,inlineImages:y,recordCanvas:b,preserveWhiteSpace:T,onSerialize:w,onAdoptedStyleSheet:S,_emittedStyleIds:P,onIframeLoad:C,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:I});r&&C(e,r)}},k),_.type===lc.Element&&"link"===_.tagName&&"string"==typeof _.attributes.rel&&("stylesheet"===_.attributes.rel||"preload"===_.attributes.rel&&"string"==typeof _.attributes.href&&"css"===Mc(_.attributes.href))&&function(e,t,r){let n,s=!1;try{n=e.sheet}catch(e){return}if(n)return;const i=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),s=!0,t()})}(e,()=>{if(x){const t=tu(e,{doc:s,mirror:i,blockClass:o,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:v,inlineImages:y,recordCanvas:b,preserveWhiteSpace:T,onSerialize:w,onIframeLoad:C,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:I});t&&x(e,t)}},O),_}function ru(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function nu(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 su,iu={exports:{}};function ou(){if(su)return iu.exports;su=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return iu.exports=t(),iu.exports.createColors=t,iu.exports}const au=nu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var lu,cu,uu,hu,du,pu;function fu(){if(cu)return lu;cu=1;let e=ou(),t=au;class r extends Error{constructor(e,t,n,s,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),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);let s=e=>e,i=e=>e,o=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);i=e=>r(a(e)),s=e=>n(e),t&&(o=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+s(n)+o(l)+"\n "+c+i("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(n)+o(e)+"\n "+t+i("^")}return" "+s(n)+o(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return lu=r,r.default=r,lu}function mu(){if(hu)return uu;hu=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let i=t.parent;if("before"===n){if(!i||"root"===i.type&&i.first===t)return"";if(i&&"document"===i.type)return""}if(!i)return e[n];let o=t.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](o,t):o.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),o.rawCache[n]=s,s}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 uu=t,t.default=t,uu}function gu(){if(pu)return du;pu=1;let e=mu();function t(t,r){new e(r).stringify(t)}return du=t,t.default=t,du}var vu,yu,bu,wu,Su,Cu,ku,xu,Ou,Iu,Eu,Mu,Ru,Pu,Au,Tu,Nu,Lu,_u,Du,Fu,Bu,ju,Uu,$u,zu,Wu,qu,Vu,Gu,Hu,Ju,Ku,Yu,Xu,Qu,Zu,eh,th,rh,nh,sh,ih,oh,ah,lh,ch,uh,hh,dh={};function ph(){return vu||(vu=1,dh.isClean=Symbol("isClean"),dh.my=Symbol("my")),dh}function fh(){if(bu)return yu;bu=1;let e=fu(),t=mu(),r=gu(),{isClean:n,my:s}=ph();function i(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 s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>i(e,r)):("object"===o&&null!==s&&(s=i(s)),r[n]=s)}return r}function o(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let i=0;i<e.length;i++){if(n===t.line&&r===t.column){s=i;break}"\n"===e[i]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=i(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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(o(r,this.source.start),o(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=o(n,this.source.start),i=s+e;for(let e=s;e<i;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:o(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:o(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(o(t,this.source.start),o(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:o(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:o(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,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=r){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)}}return yu=a,a.default=a,yu}function mh(){if(Su)return wu;Su=1;let e=fh();class t extends e{constructor(e){super(e),this.type="comment"}}return wu=t,t.default=t,wu}function gh(){if(ku)return Cu;ku=1;let e=fh();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return Cu=t,t.default=t,Cu}function vh(){if(Ou)return xu;Ou=1;let e,t,r,n,s=mh(),i=gh(),o=fh(),{isClean:a,my:l}=ph();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends o{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(r,o){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new i(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&o&&void 0!==o.raws.before&&(e.raws.before=o.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},xu=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,i.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},xu}function yh(){if(Eu)return Iu;Eu=1;let e=vh();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 Iu=t,t.default=t,e.registerAtRule(t),Iu}function bh(){if(Ru)return Mu;Ru=1;let e,t,r=vh();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},Mu=n,n.default=n,Mu}function wh(){if(Au)return Pu;Au=1;return Pu={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},Pu}function Sh(){if(Nu)return Tu;Nu=1;let{existsSync:e,readFileSync:t}=au,{dirname:r,join:n}=au,{SourceMapConsumer:s,SourceMapGenerator:i}=au;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Tu=o,o.default=o,Tu}function Ch(){if(_u)return Lu;_u=1;let{nanoid:e}=wh(),{isAbsolute:t,resolve:r}=au,{SourceMapConsumer:n,SourceMapGenerator:s}=au,{fileURLToPath:i,pathToFileURL:o}=au,a=fu(),l=Sh(),c=au,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);i=e.line,s=e.col}else i=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,i,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:s,line:i},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:i,endOffset:l,line:t,offset:c,source:this.css},this.file&&(o&&(u.input.url=o(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?o(u.source):new URL(u.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!i)throw new Error("file: protocol is not available in this PostCSS build");h.file=i(l)}let d=c.sourceContentFor(u.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}}return Lu=f,f.default=f,c&&c.registerInput&&c.registerInput(f),Lu}function kh(){if(Fu)return Du;Fu=1;let e,t,r=vh();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},Du=n,n.default=n,r.registerRoot(n),Du}function xh(){if(ju)return Bu;ju=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return Bu=e,e.default=e,Bu}function Oh(){if($u)return Uu;$u=1;let e=vh(),t=xh();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return Uu=r,r.default=r,e.registerRule(r),Uu}function Ih(){if(Vu)return qu;Vu=1;let{dirname:e,relative:t,resolve:r,sep:n}=au,{SourceMapConsumer:s,SourceMapGenerator:i}=au,{pathToFileURL:o}=au,a=Ch(),l=Boolean(s&&i),c=Boolean(e&&r&&t&&n);return qu=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 r,n=this.toUrl(this.path(t.file)),i=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=i.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new i({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 i({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),t=i.match(/\n/g),t?(r+=t.length,e=i.lastIndexOf("\n"),n=i.length-e):n+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let i=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=e(r(i,this.mapOpts.annotation)));let o=t(i,n);return this.memoizedPaths.set(n,o),o}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(o){let t=o(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},qu}function Eh(){if(Ku)return Ju;Ku=1;let e=yh(),t=mh(),r=gh(),n=kh(),s=Oh(),i=function(){if(Hu)return Gu;Hu=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),i=" ".charCodeAt(0),o="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Gu=function(k,x={}){let O,I,E,M,R,P,A,T,N,L,_=k.css.valueOf(),D=x.ignoreErrors,F=_.length,B=0,j=[],U=[];function $(e){throw k.error("Unclosed "+e,B)}return{back:function(e){U.push(e)},endOfFile:function(){return 0===U.length&&B>=F},nextToken:function(k){if(U.length)return U.pop();if(B>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=_.charCodeAt(B),O){case s:case i:case a:case l:case o:M=B;do{M+=1,O=_.charCodeAt(M)}while(O===i||O===s||O===a||O===l||O===o);P=["space",_.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case v:case m:case d:{let e=String.fromCharCode(O);P=[e,e,B];break}case h:if(L=j.length?j.pop()[1]:"",N=_.charCodeAt(B+1),"url"===L&&N!==e&&N!==t&&N!==i&&N!==s&&N!==a&&N!==o&&N!==l){M=B;do{if(A=!1,M=_.indexOf(")",M+1),-1===M){if(D||x){M=B;break}$("bracket")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",_.slice(B,M+1),B,M],B=M}else M=_.indexOf(")",B+1),I=_.slice(B,M+1),-1===M||S.test(I)?P=["(","(",B]:(P=["brackets",I,B,M],B=M);break;case e:case t:R=O===e?"'":'"',M=B;do{if(A=!1,M=_.indexOf(R,M+1),-1===M){if(D||x){M=B+1;break}$("string")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",_.slice(B,M+1),B,M],B=M;break;case y:b.lastIndex=B+1,b.test(_),M=0===b.lastIndex?_.length-1:b.lastIndex-2,P=["at-word",_.slice(B,M+1),B,M],B=M;break;case r:for(M=B,E=!0;_.charCodeAt(M+1)===r;)M+=1,E=!E;if(O=_.charCodeAt(M+1),E&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(M+=1,C.test(_.charAt(M)))){for(;C.test(_.charAt(M+1));)M+=1;_.charCodeAt(M+1)===i&&(M+=1)}P=["word",_.slice(B,M+1),B,M],B=M;break;default:O===n&&_.charCodeAt(B+1)===g?(M=_.indexOf("*/",B+2)+1,0===M&&(D||x?M=_.length:$("comment")),P=["comment",_.slice(B,M+1),B,M],B=M):(w.lastIndex=B+1,w.test(_),M=0===w.lastIndex?_.length-1:w.lastIndex-2,P=["word",_.slice(B,M+1),B,M],j.push(P),B=M)}return B++,P},position:function(){return B}}}}();const o={empty:!0,space:!0};return Ju=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,i=new e;i.name=t[1].slice(1),""===i.name&&this.unnamedAtrule(i,t),this.init(i,t[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){i.source.end=this.getPosition(t[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(t=l[l.length-1],i.source.end=this.getPosition(t[3]||t[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(r=o,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,a=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}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 s,i,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],i=s[0],"space"!==i||e!==c-1||n?"comment"===i?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",o[l]||o[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},Ju}function Mh(){if(Xu)return Yu;Xu=1;let e=vh(),t=Ch(),r=Eh();function n(e,n){let s=new t(e,n),i=new r(s);try{i.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 i.root}return Yu=n,n.default=n,e.registerParse(n),Yu}function Rh(){if(Zu)return Qu;Zu=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 Qu=e,e.default=e,Qu}function Ph(){if(th)return eh;th=1;let e=Rh();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return eh=t,t.default=t,eh}function Ah(){if(nh)return rh;nh=1;let e={};return rh=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Th(){if(ih)return sh;ih=1;let e=vh(),t=bh(),r=Ih(),n=Mh(),s=Ph(),i=kh(),o=gu(),{isClean:a,my:l}=ph(),c=Ah();const u={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=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let v={};class y{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"}constructor(t,r,i){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 s)o=g(r.root),r.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{let t=n;i.syntax&&(t=i.syntax.parse),i.parser&&(t=i.parser),t.parse&&(t=t.parse);try{o=t(r,i)}catch(e){this.processed=!0,this.error=e}o&&!o[l]&&e.rebuild(o)}else o=g(r);this.result=new s(t,o,i),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,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return 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=o;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return y.registerPostcss=e=>{v=e},sh=y,y.default=y,i.registerLazyResult(y),t.registerLazyResult(y),sh}function Nh(){if(ch)return lh;ch=1;let e=bh(),t=Th(),r=function(){if(ah)return oh;ah=1;let e=Ih(),t=Mh();const r=Ph();let n=gu(),s=Ah();class i{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,r=t;try{e=r(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"}constructor(t,s,i){let o;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=i,this._map=void 0;let a=n;this.result=new r(this._processor,o,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return oh=i,i.default=i,oh}(),n=kh();class s{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return lh=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),lh}var Lh=function(){if(hh)return uh;hh=1;let e=yh(),t=mh(),r=vh(),n=fu(),s=gh(),i=bh(),o=function(){if(Wu)return zu;Wu=1;let e=yh(),t=mh(),r=gh(),n=Ch(),s=Sh(),i=kh(),o=Oh();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new i(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return zu=a,a.default=a,zu}(),a=Ch(),l=Th(),c=xh(),u=fh(),h=Mh(),d=Nh(),p=Ph(),f=kh(),m=Oh(),g=gu(),v=Rh();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return y.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return y([s(r)]).process(e,t)},s},y.stringify=g,y.parse=h,y.fromJSON=o,y.list=c,y.comment=e=>new t(e),y.atRule=t=>new e(t),y.decl=e=>new s(e),y.rule=e=>new m(e),y.root=e=>new f(e),y.document=e=>new i(e),y.CssSyntaxError=n,y.Declaration=s,y.Container=r,y.Processor=d,y.Document=i,y.Comment=t,y.Warning=v,y.AtRule=e,y.Result=p,y.Input=a,y.Rule=m,y.Root=f,y.Node=u,l.registerPostcss(y),uh=y,y.default=y,uh}();const _h=ru(Lh);_h.stringify,_h.fromJSON,_h.plugin,_h.parse,_h.list,_h.document,_h.comment,_h.atRule,_h.rule,_h.decl,_h.root,_h.CssSyntaxError,_h.Declaration,_h.Container,_h.Processor,_h.Document,_h.Comment,_h.Warning,_h.AtRule,_h.Result,_h.Input,_h.Rule,_h.Root,_h.Node;var Dh=Object.defineProperty,Fh=(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);function Bh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jh(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 Uh,$h={exports:{}};function zh(){if(Uh)return $h.exports;Uh=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return $h.exports=t(),$h.exports.createColors=t,$h.exports}const Wh=jh(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var qh,Vh,Gh,Hh,Jh,Kh;function Yh(){if(Vh)return qh;Vh=1;let e=zh(),t=Wh;class r extends Error{constructor(e,t,n,s,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),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);let s=e=>e,i=e=>e,o=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);i=e=>r(a(e)),s=e=>n(e),t&&(o=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+s(n)+o(l)+"\n "+c+i("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(n)+o(e)+"\n "+t+i("^")}return" "+s(n)+o(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return qh=r,r.default=r,qh}function Xh(){if(Hh)return Gh;Hh=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let i=t.parent;if("before"===n){if(!i||"root"===i.type&&i.first===t)return"";if(i&&"document"===i.type)return""}if(!i)return e[n];let o=t.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](o,t):o.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),o.rawCache[n]=s,s}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 Gh=t,t.default=t,Gh}function Qh(){if(Kh)return Jh;Kh=1;let e=Xh();function t(t,r){new e(r).stringify(t)}return Jh=t,t.default=t,Jh}var Zh,ed,td,rd,nd,sd,id,od,ad,ld,cd,ud,hd,dd,pd,fd,md,gd,vd,yd,bd,wd,Sd,Cd,kd,xd,Od,Id,Ed,Md,Rd,Pd,Ad,Td,Nd,Ld,_d,Dd,Fd,Bd,jd,Ud,$d,zd,Wd,qd,Vd,Gd,Hd,Jd={};function Kd(){return Zh||(Zh=1,Jd.isClean=Symbol("isClean"),Jd.my=Symbol("my")),Jd}function Yd(){if(td)return ed;td=1;let e=Yh(),t=Xh(),r=Qh(),{isClean:n,my:s}=Kd();function i(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 s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>i(e,r)):("object"===o&&null!==s&&(s=i(s)),r[n]=s)}return r}function o(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let i=0;i<e.length;i++){if(n===t.line&&r===t.column){s=i;break}"\n"===e[i]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=i(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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(o(r,this.source.start),o(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=o(n,this.source.start),i=s+e;for(let e=s;e<i;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:o(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:o(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(o(t,this.source.start),o(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:o(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:o(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,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=r){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)}}return ed=a,a.default=a,ed}function Xd(){if(nd)return rd;nd=1;let e=Yd();class t extends e{constructor(e){super(e),this.type="comment"}}return rd=t,t.default=t,rd}function Qd(){if(id)return sd;id=1;let e=Yd();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return sd=t,t.default=t,sd}function Zd(){if(ad)return od;ad=1;let e,t,r,n,s=Xd(),i=Qd(),o=Yd(),{isClean:a,my:l}=Kd();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends o{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(r,o){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new i(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&o&&void 0!==o.raws.before&&(e.raws.before=o.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},od=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,i.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},od}function ep(){if(cd)return ld;cd=1;let e=Zd();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 ld=t,t.default=t,e.registerAtRule(t),ld}function tp(){if(hd)return ud;hd=1;let e,t,r=Zd();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},ud=n,n.default=n,ud}function rp(){if(pd)return dd;pd=1;return dd={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},dd}function np(){if(md)return fd;md=1;let{existsSync:e,readFileSync:t}=Wh,{dirname:r,join:n}=Wh,{SourceMapConsumer:s,SourceMapGenerator:i}=Wh;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return fd=o,o.default=o,fd}function sp(){if(vd)return gd;vd=1;let{nanoid:e}=rp(),{isAbsolute:t,resolve:r}=Wh,{SourceMapConsumer:n,SourceMapGenerator:s}=Wh,{fileURLToPath:i,pathToFileURL:o}=Wh,a=Yh(),l=np(),c=Wh,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);i=e.line,s=e.col}else i=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,i,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:s,line:i},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:i,endOffset:l,line:t,offset:c,source:this.css},this.file&&(o&&(u.input.url=o(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?o(u.source):new URL(u.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!i)throw new Error("file: protocol is not available in this PostCSS build");h.file=i(l)}let d=c.sourceContentFor(u.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}}return gd=f,f.default=f,c&&c.registerInput&&c.registerInput(f),gd}function ip(){if(bd)return yd;bd=1;let e,t,r=Zd();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},yd=n,n.default=n,r.registerRoot(n),yd}function op(){if(Sd)return wd;Sd=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return wd=e,e.default=e,wd}function ap(){if(kd)return Cd;kd=1;let e=Zd(),t=op();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return Cd=r,r.default=r,e.registerRule(r),Cd}function lp(){if(Ed)return Id;Ed=1;let{dirname:e,relative:t,resolve:r,sep:n}=Wh,{SourceMapConsumer:s,SourceMapGenerator:i}=Wh,{pathToFileURL:o}=Wh,a=sp(),l=Boolean(s&&i),c=Boolean(e&&r&&t&&n);return Id=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 r,n=this.toUrl(this.path(t.file)),i=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=i.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new i({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 i({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),t=i.match(/\n/g),t?(r+=t.length,e=i.lastIndexOf("\n"),n=i.length-e):n+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let i=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=e(r(i,this.mapOpts.annotation)));let o=t(i,n);return this.memoizedPaths.set(n,o),o}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(o){let t=o(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Id}function cp(){if(Ad)return Pd;Ad=1;let e=ep(),t=Xd(),r=Qd(),n=ip(),s=ap(),i=function(){if(Rd)return Md;Rd=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),i=" ".charCodeAt(0),o="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),b=/[\t\n\f\r "#'()/;[\\\]{}]/g,w=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Md=function(k,x={}){let O,I,E,M,R,P,A,T,N,L,_=k.css.valueOf(),D=x.ignoreErrors,F=_.length,B=0,j=[],U=[];function $(e){throw k.error("Unclosed "+e,B)}return{back:function(e){U.push(e)},endOfFile:function(){return 0===U.length&&B>=F},nextToken:function(k){if(U.length)return U.pop();if(B>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=_.charCodeAt(B),O){case s:case i:case a:case l:case o:M=B;do{M+=1,O=_.charCodeAt(M)}while(O===i||O===s||O===a||O===l||O===o);P=["space",_.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case v:case m:case d:{let e=String.fromCharCode(O);P=[e,e,B];break}case h:if(L=j.length?j.pop()[1]:"",N=_.charCodeAt(B+1),"url"===L&&N!==e&&N!==t&&N!==i&&N!==s&&N!==a&&N!==o&&N!==l){M=B;do{if(A=!1,M=_.indexOf(")",M+1),-1===M){if(D||x){M=B;break}$("bracket")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",_.slice(B,M+1),B,M],B=M}else M=_.indexOf(")",B+1),I=_.slice(B,M+1),-1===M||S.test(I)?P=["(","(",B]:(P=["brackets",I,B,M],B=M);break;case e:case t:R=O===e?"'":'"',M=B;do{if(A=!1,M=_.indexOf(R,M+1),-1===M){if(D||x){M=B+1;break}$("string")}for(T=M;_.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",_.slice(B,M+1),B,M],B=M;break;case y:b.lastIndex=B+1,b.test(_),M=0===b.lastIndex?_.length-1:b.lastIndex-2,P=["at-word",_.slice(B,M+1),B,M],B=M;break;case r:for(M=B,E=!0;_.charCodeAt(M+1)===r;)M+=1,E=!E;if(O=_.charCodeAt(M+1),E&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(M+=1,C.test(_.charAt(M)))){for(;C.test(_.charAt(M+1));)M+=1;_.charCodeAt(M+1)===i&&(M+=1)}P=["word",_.slice(B,M+1),B,M],B=M;break;default:O===n&&_.charCodeAt(B+1)===g?(M=_.indexOf("*/",B+2)+1,0===M&&(D||x?M=_.length:$("comment")),P=["comment",_.slice(B,M+1),B,M],B=M):(w.lastIndex=B+1,w.test(_),M=0===w.lastIndex?_.length-1:w.lastIndex-2,P=["word",_.slice(B,M+1),B,M],j.push(P),B=M)}return B++,P},position:function(){return B}}}}();const o={empty:!0,space:!0};return Pd=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,i=new e;i.name=t[1].slice(1),""===i.name&&this.unnamedAtrule(i,t),this.init(i,t[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){i.source.end=this.getPosition(t[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(t=l[l.length-1],i.source.end=this.getPosition(t[3]||t[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(r=o,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,a=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}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 s,i,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],i=s[0],"space"!==i||e!==c-1||n?"comment"===i?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",o[l]||o[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},Pd}function up(){if(Nd)return Td;Nd=1;let e=Zd(),t=sp(),r=cp();function n(e,n){let s=new t(e,n),i=new r(s);try{i.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 i.root}return Td=n,n.default=n,e.registerParse(n),Td}function hp(){if(_d)return Ld;_d=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 Ld=e,e.default=e,Ld}function dp(){if(Fd)return Dd;Fd=1;let e=hp();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return Dd=t,t.default=t,Dd}function pp(){if(jd)return Bd;jd=1;let e={};return Bd=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function fp(){if($d)return Ud;$d=1;let e=Zd(),t=tp(),r=lp(),n=up(),s=dp(),i=ip(),o=Qh(),{isClean:a,my:l}=Kd(),c=pp();const u={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=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let v={};class y{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"}constructor(t,r,i){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 s)o=g(r.root),r.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{let t=n;i.syntax&&(t=i.syntax.parse),i.parser&&(t=i.parser),t.parse&&(t=t.parse);try{o=t(r,i)}catch(e){this.processed=!0,this.error=e}o&&!o[l]&&e.rebuild(o)}else o=g(r);this.result=new s(t,o,i),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,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return 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=o;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return y.registerPostcss=e=>{v=e},Ud=y,y.default=y,i.registerLazyResult(y),t.registerLazyResult(y),Ud}function mp(){if(Vd)return qd;Vd=1;let e=tp(),t=fp(),r=function(){if(Wd)return zd;Wd=1;let e=lp(),t=up();const r=dp();let n=Qh(),s=pp();class i{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,r=t;try{e=r(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"}constructor(t,s,i){let o;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=i,this._map=void 0;let a=n;this.result=new r(this._processor,o,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return zd=i,i.default=i,zd}(),n=ip();class s{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return qd=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),qd}var gp=function(){if(Hd)return Gd;Hd=1;let e=ep(),t=Xd(),r=Zd(),n=Yh(),s=Qd(),i=tp(),o=function(){if(Od)return xd;Od=1;let e=ep(),t=Xd(),r=Qd(),n=sp(),s=np(),i=ip(),o=ap();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new i(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return xd=a,a.default=a,xd}(),a=sp(),l=fp(),c=op(),u=Yd(),h=up(),d=mp(),p=dp(),f=ip(),m=ap(),g=Qh(),v=hp();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return y.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return y([s(r)]).process(e,t)},s},y.stringify=g,y.parse=h,y.fromJSON=o,y.list=c,y.comment=e=>new t(e),y.atRule=t=>new e(t),y.decl=e=>new s(e),y.rule=e=>new m(e),y.root=e=>new f(e),y.document=e=>new i(e),y.CssSyntaxError=n,y.Declaration=s,y.Container=r,y.Processor=d,y.Document=i,y.Comment=t,y.Warning=v,y.AtRule=e,y.Result=p,y.Input=a,y.Rule=m,y.Root=f,y.Node=u,l.registerPostcss(y),Gd=y,y.default=y,Gd}();const vp=Bh(gp);vp.stringify,vp.fromJSON,vp.plugin,vp.parse,vp.list,vp.document,vp.comment,vp.atRule,vp.rule,vp.decl,vp.root,vp.CssSyntaxError,vp.Declaration,vp.Container,vp.Processor,vp.Document,vp.Comment,vp.Warning,vp.AtRule,vp.Result,vp.Input,vp.Rule,vp.Root,vp.Node;class yp{constructor(...e){Fh(this,"parentElement",null),Fh(this,"parentNode",null),Fh(this,"ownerDocument"),Fh(this,"firstChild",null),Fh(this,"lastChild",null),Fh(this,"previousSibling",null),Fh(this,"nextSibling",null),Fh(this,"ELEMENT_NODE",1),Fh(this,"TEXT_NODE",3),Fh(this,"nodeType"),Fh(this,"nodeName"),Fh(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 yp))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 bp={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},wp={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Sp={};function Cp(e){if(Sp[e])return Sp[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 bp?bp[e]:void 0,s=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]"))})),i=e in wp?wp[e]:void 0,o=Boolean(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&o)return Sp[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const i=s[e].prototype;return document.body.removeChild(n),i?Sp[e]=i:r}catch{return r}}const kp={};function xp(e,t,r){var n;const s=`${e}.${String(r)}`;if(kp[s])return kp[s].call(t);const i=Cp(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(kp[s]=o,o.call(t)):t[r]}const Op={};function Ip(e,t,r){const n=`${e}.${String(r)}`;if(Op[n])return Op[n].bind(t);const s=Cp(e)[r];return"function"!=typeof s?t[r]:(Op[n]=s,s.bind(t))}function Ep(){return Cp("MutationObserver").constructor}const Mp={childNodes:function(e){return xp("Node",e,"childNodes")},parentNode:function(e){return xp("Node",e,"parentNode")},parentElement:function(e){return xp("Node",e,"parentElement")},textContent:function(e){return xp("Node",e,"textContent")},contains:function(e,t){return Ip("Node",e,"contains")(t)},getRootNode:function(e){return Ip("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?xp("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?xp("Element",e,"shadowRoot"):null},querySelector:function(e,t){return xp("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return xp("Element",e,"querySelectorAll")(t)},mutationObserver:Ep};function Rp(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Pp="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 Ap={map:{},getId:()=>(console.error(Pp),-1),getNode:()=>(console.error(Pp),null),removeNodeFromMap(){console.error(Pp)},has:()=>(console.error(Pp),!1),reset(){console.error(Pp)}};function Tp(e,t,r={}){let n=null,s=0;return function(...i){const o=Date.now();s||!1!==r.leading||(s=o);const a=t-(o-s),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),s=o,e.apply(l,i)):n||!1===r.trailing||(n=setTimeout(()=>{s=!1===r.leading?0:Date.now(),n=null,e.apply(l,i)},a))}}function Np(e,t,r,n,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>Np(e,t,i||{},!0)}function Lp(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],s=r(n);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ap=new Proxy(Ap,{get:(e,t,r)=>("map"===t&&console.error(Pp),Reflect.get(e,t,r))}));let _p=Date.now;function Dp(e){var t,r,n,s;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=Mp.parentElement(i.body))?void 0:t.scrollLeft)||(null==(r=null==i?void 0:i.body)?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(n=Mp.parentElement(i.body))?void 0:n.scrollTop)||(null==(s=null==i?void 0:i.body)?void 0:s.scrollTop)||0}}function Fp(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Bp(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function jp(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Mp.parentElement(e)}function Up(e,t,r,n){if(!e)return!1;const s=jp(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t))return!0;if(n&&null!==s.closest("."+t))return!0}else if(Yc(s,t,n))return!0}catch(e){}if(r){if(s.matches(r))return!0;if(n&&null!==s.closest(r))return!0}return!1}function $p(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function zp(e,t){if(bc(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Mp.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||zp(n,t))}function Wp(e){return Boolean(e.changedTouches)}function qp(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Vp(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Gp(e){return!!e&&(e instanceof yp&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Mp.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(_p=()=>(new Date).getTime());class Hp{constructor(){ic(this,"id",1),ic(this,"styleIDMap",new WeakMap),ic(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 Jp(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Mp.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Mp.host(Mp.getRootNode(e))&&(r=Mp.host(Mp.getRootNode(e))),r}function Kp(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=Jp(r);)r=t;return r}(e);return Mp.contains(t,r)}function Yp(e){const t=e.ownerDocument;return!!t&&(Mp.contains(t,e)||Kp(e))}var Xp=(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))(Xp||{}),Qp=(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))(Qp||{}),Zp=(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))(Zp||{}),ef=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ef||{}),tf=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(tf||{}),rf=(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))(rf||{}),nf=(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))(nf||{});function sf(e){return"__ln"in e}class of{constructor(){ic(this,"length",0),ic(this,"head",null),ic(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&&sf(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&&sf(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 af=(e,t)=>`${e}@${t}`;class lf{constructor(){ic(this,"frozen",!1),ic(this,"locked",!1),ic(this,"texts",[]),ic(this,"attributes",[]),ic(this,"attributeMap",new WeakMap),ic(this,"removes",[]),ic(this,"mapRemoves",[]),ic(this,"movedMap",{}),ic(this,"addedSet",new Set),ic(this,"movedSet",new Set),ic(this,"droppedSet",new Set),ic(this,"removesSubTreeCache",new Set),ic(this,"mutationCb"),ic(this,"blockClass"),ic(this,"blockSelector"),ic(this,"maskTextClass"),ic(this,"maskTextSelector"),ic(this,"inlineStylesheet"),ic(this,"maskInputOptions"),ic(this,"maskTextFn"),ic(this,"maskInputFn"),ic(this,"maskAttributeFn"),ic(this,"keepIframeSrcFn"),ic(this,"recordCanvas"),ic(this,"inlineImages"),ic(this,"slimDOMOptions"),ic(this,"dataURLOptions"),ic(this,"doc"),ic(this,"mirror"),ic(this,"iframeManager"),ic(this,"stylesheetManager"),ic(this,"shadowDomManager"),ic(this,"canvasManager"),ic(this,"processedNodeManager"),ic(this,"captureAdoptedStyleSheets"),ic(this,"unattachedDoc"),ic(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),ic(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new of,n=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},s=s=>{const i=Mp.parentNode(s);if(!i||!Yp(s))return;let o=!1;if(s.nodeType===Node.TEXT_NODE){const e=i.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(i)&&(o=!0)}const a=bc(i)?this.mirror.getId(Jp(s)):this.mirror.getId(i),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=tu(s,{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=>{qp(e,this.mirror)&&this.iframeManager.addIframe(e),Vp(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Gp(s)&&this.shadowDomManager.addShadowRoot(Mp.shadowRoot(s),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},onAdoptedStyleSheet:this.captureAdoptedStyleSheets?e=>this.stylesheetManager.styleMirror.add(e):void 0,_emittedStyleIds:this.captureAdoptedStyleSheets?this.stylesheetManager.getInlinedAdoptedStyleSheetRuleIds():void 0,cssCaptured:o});c&&(e.push({parentId:a,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)uf(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Mp.parentNode(e))||s(e);for(const e of this.addedSet)hf(this.droppedSet,e)||uf(this.removesSubTreeCache,e,this.mirror)?hf(this.movedSet,e)?s(e):this.droppedSet.add(e):s(e);let i=null;for(;r.length;){let e=null;if(i){const t=this.mirror.getId(Mp.parentNode(i.value)),r=n(i.value);-1!==t&&-1!==r&&(e=i)}if(!e){let t=r.tail;for(;t;){const r=t;if(t=t.previous,r){const t=this.mirror.getId(Mp.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Mp.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Mp.host(n);if(-1!==this.mirror.getId(t)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}i=e.previous,r.removeNode(e.value),s(e.value)}const o={texts:this.texts.map(e=>{const t=e.node,r=Mp.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};(o.texts.length||o.attributes.length||o.removes.length||o.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(o))}),ic(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(Mp.childNodes(e),e=>Mp.textContent(e)||"").join("");t.attributes.value=xc({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Ec(e),value:r,maskInputFn:this.maskInputFn})}),ic(this,"processMutation",e=>{if(!$p(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Mp.textContent(e.target);Up(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Xc(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,jp(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=Ec(t);n=xc({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(Up(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let s=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;r="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!Kc(t.tagName,r)){if(s.attributes[r]=Jc(this.doc,Oc(t.tagName),Oc(r),n),this.maskAttributeFn&&"string"==typeof s.attributes[r]){const e=this.maskAttributeFn(r,s.attributes[r],t);null!==e?s.attributes[r]=e:delete s.attributes[r]}if("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),i=t.style.getPropertyPriority(e);n!==r.style.getPropertyValue(e)||i!==r.style.getPropertyPriority(e)?s.styleDiff[e]=""===i?n:[n,i]:s._unchangedStyles[e]=[n,i]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(s.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal")}break}case"childList":if(Up(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=bc(e.target)?this.mirror.getId(Mp.host(e.target)):this.mirror.getId(e.target);Up(e.target,this.blockClass,this.blockSelector,!1)||$p(t,this.mirror,this.slimDOMOptions)||(!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(cf(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||zp(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[af(r,n)]?cf(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!bc(e.target)||!wc(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Mp.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache)))),this.mapRemoves.push(t))})}}),ic(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if($p(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[af(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Up(e,this.blockClass,this.blockSelector,!1)||(Mp.childNodes(e).forEach(e=>this.genAdds(e)),Gp(e)&&Mp.childNodes(Mp.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAttributeFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","captureAdoptedStyleSheets"].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 cf(e,t){e.delete(t),Mp.childNodes(t).forEach(t=>cf(e,t))}function uf(e,t,r){return 0!==e.size&&function(e,t){const r=Mp.parentNode(t);return!!r&&e.has(r)}(e,t)}function hf(e,t){return 0!==e.size&&df(e,t)}function df(e,t){const r=Mp.parentNode(t);return!!r&&(!!e.has(r)||df(e,r))}let pf;const ff=e=>{if(!pf)return e;return(...t)=>{try{return e(...t)}catch(e){if(pf&&!0===pf(e))return;throw e}}};function mf(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const gf=[];function vf(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 yf(e,t){const r=new lf;gf.push(r),r.init(e);const n=new(Ep())(ff(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function bf({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const o=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,a=[];let l=null;return Object.keys(Zp).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]).forEach(i=>{let o=Oc(i);const c=(t=>i=>{const o=vf(i);if(Up(o,n,s,!0))return;let a=null,c=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=ef.Mouse;break;case"touch":a=ef.Touch;break;case"pen":a=ef.Pen}a===ef.Touch?Zp[t]===Zp.MouseDown?c="TouchStart":Zp[t]===Zp.MouseUp&&(c="TouchEnd"):ef.Pen}else Wp(i)&&(a=ef.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===ef.Touch||c.startsWith("Mouse")&&a===ef.Mouse)&&(a=null)):Zp[t]===Zp.Click&&(a=l,l=null);const u=Wp(i)?i.changedTouches[0]:i;if(!u)return;const h=r.getId(o),{clientX:d,clientY:p}=u;ff(e)({type:Zp[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}},i)})(i);if(window.PointerEvent)switch(Zp[i]){case Zp.MouseDown:case Zp.MouseUp:o=o.replace("mouse","pointer");break;case Zp.TouchStart:case Zp.TouchEnd:return}a.push(Rp(o,c,t))}),ff(()=>{a.forEach(e=>e())})}function wf({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){const o=ff(Tp(ff(i=>{const o=vf(i);if(!o||Up(o,n,s,!0))return;const a=r.getId(o);if(o===t&&t.defaultView){const r=Dp(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}),i.scroll||100));return Rp("scroll",o,t)}const Sf=["INPUT","TEXTAREA","SELECT"],Cf=new WeakMap;function kf(e){return function(e,t){if(Ef("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ef("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ef("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ef("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 xf(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Of({mirror:e,stylesheetManager:t},r){var n,s,i;let o=null;o="#document"===r.nodeName?e.getId(r):e.getId(Mp.host(r));const a="#document"===r.nodeName?null==(n=r.defaultView)?void 0:n.Document:null==(i=null==(s=r.ownerDocument)?void 0:s.defaultView)?void 0:i.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==o&&-1!==o&&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!==o&&-1!==o)try{t.adoptStyleSheets(e,o)}catch(e){}return n}}),ff(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function If(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:i,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,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),s(e[0])},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),o(...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),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...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=yf(e,e.doc));const s=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const s="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let o,a=[];const l=Tp(ff(t=>{const r=Date.now()-o;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],o=null}),i),c=ff(Tp(ff(e=>{const t=vf(e),{clientX:r,clientY:s}=Wp(e)?e.changedTouches[0]:e;o||(o=_p()),a.push({x:r,y:s,id:n.getId(t),timeOffset:_p()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Qp.Drag:e instanceof MouseEvent?Qp.MouseMove:Qp.TouchMove)}),s,{trailing:!1})),u=[Rp("mousemove",c,r),Rp("touchmove",c,r),Rp("drag",c,r)];return ff(()=>{u.forEach(e=>e())})}(e),i=bf(e),o=wf(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Rp("resize",ff(Tp(ff(()=>{const t=Fp(),s=Bp();r===t&&n===s||(e({width:Number(s),height:Number(t)}),r=t,n=s)}),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:i,ignoreSelector:o,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function h(e){let r=vf(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=Mp.parentElement(r)),!r||!h||Sf.indexOf(h)<0||Up(r,n,s,!0))return;if(r.classList.contains(i)||o&&r.matches(o))return;let p=r.value,f=!1;const m=Ec(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(p=xc({element:r,maskInputOptions:a,tagName:h,type:m,value:p,maskInputFn:l})),d(r,u?{text:p,isChecked:f,userTriggered:c}:{text:p,isChecked:f});const g=r.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==r){const t=e.value;d(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function d(t,n){const s=Cf.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){Cf.set(t,n);const s=r.getId(t);ff(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>Rp(e,ff(h),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[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 m&&m.set&&p.push(...g.map(e=>Np(e[0],e[1],{set(){ff(h)({target:this,isTrusted:!1})}},!1,f))),ff(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:i}){const o=ff(i=>Tp(ff(s=>{const o=vf(s);if(!o||Up(o,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:h}=o;e({type:i,id:n.getId(o),currentTime:a,volume:l,muted:c,playbackRate:u,loop:h})}),s.media||500)),a=[Rp("play",o(rf.Play),i),Rp("pause",o(rf.Pause),i),Rp("seeked",o(rf.Seeked),i),Rp("volumechange",o(rf.VolumeChange),i),Rp("ratechange",o(rf.RateChange),i)];return ff(()=>{a.forEach(e=>e())})}(e);let u=()=>{},h=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:ff((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=xf(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:a}]}),mf(()=>n.apply(s,i))()})}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const s=`${e} { ${t} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[s,r])};const i=n.CSSStyleSheet.prototype.deleteRule;let o,a;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:ff((n,s,i)=>{const[o]=i,{id:a,styleId:l}=xf(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:o}]}),mf(()=>n.apply(s,i))()})}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(o=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:ff((n,s,i)=>{const[o]=i,{id:a,styleId:l}=xf(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:o}),n.apply(s,i)})})),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:ff((n,s,i)=>{const[o]=i,{id:a,styleId:l}=xf(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:o}),n.apply(s,i)})}));const l={};Mf("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Mf("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Mf("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Mf("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(l).forEach(([n,s])=>{c[n]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[n].insertRule,{apply:ff((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=xf(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:[...kf(s),a||0]}]}),n.apply(s,i)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:ff((n,s,i)=>{const[o]=i,{id:a,styleId:l}=xf(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...kf(s),o]}]}),n.apply(s,i)})})}),ff(()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=i,o&&(n.CSSStyleSheet.prototype.replace=o),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})})}(e,{win:r}),h=Of(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:ff((s,o,a)=>{var l;const[c,u,h]=a;if(r.has(c))return i.apply(o,[c,u,h]);const{id:d,styleId:p}=xf(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:c,value:u,priority:h},index:kf(o.parentRule)}),s.apply(o,a)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:ff((s,i,a)=>{var l;const[c]=a;if(r.has(c))return o.apply(i,[c]);const{id:u,styleId:h}=xf(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(u&&-1!==u||h&&-1!==h)&&e({id:u,styleId:h,remove:{property:c},index:kf(i.parentRule)}),s.apply(i,a)})}),ff(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],s=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,r){const n=new i(e,t,r);return s.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const o=Lp(t.fonts,"add",function(t){return function(r){return setTimeout(ff(()=>{const t=s.get(r);t&&(e(t),s.delete(r))}),0),t.apply(this,[r])}});return n.push(()=>{r.FontFace=i}),n.push(o),ff(()=>{n.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:i}=e;let o=!0;const a=ff(()=>{const e=t.getSelection();if(!e||o&&(null==e?void 0:e.isCollapsed))return;o=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const i=e.getRangeAt(t),{startContainer:o,startOffset:l,endContainer:c,endOffset:u}=i;Up(o,n,s,!0)||Up(c,n,s,!0)||a.push({start:r.getId(o),startOffset:l,end:r.getId(c),endOffset:u})}i({ranges:a})});return a(),Rp("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?Lp(r.customElements,"define",function(e){return function(r,n,s){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,s])}}):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,r,t.options));return ff(()=>{gf.forEach(e=>e.reset()),null==n||n.disconnect(),s(),i(),o(),a(),l(),c(),u(),h(),d(),p(),f(),m(),g.forEach(e=>e())})}function Ef(e){return void 0!==window[e]}function Mf(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Rf{constructor(e){ic(this,"iframeIdToRemoteIdMap",new WeakMap),ic(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){const s=r||this.getIdToRemoteIdMap(e),i=n||this.getRemoteIdToIdMap(e);let o=s.get(t);return o||(o=this.generateIdFn(),s.set(t,o),i.set(o,t)),o}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 s=n.get(t);return s||-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 Pf{constructor(e){ic(this,"iframes",new WeakMap),ic(this,"crossOriginIframeMap",new WeakMap),ic(this,"crossOriginIframeMirror",new Rf(jc)),ic(this,"crossOriginIframeStyleMirror"),ic(this,"crossOriginIframeRootIdMap",new WeakMap),ic(this,"mirror"),ic(this,"mutationCb"),ic(this,"wrappedEmit"),ic(this,"loadListener"),ic(this,"stylesheetManager"),ic(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Rf(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 Xp.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:Xp.IncrementalSnapshot,data:{source:Qp.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Xp.Meta:case Xp.Load:case Xp.DomContentLoaded:return!1;case Xp.Plugin:return t;case Xp.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Xp.IncrementalSnapshot:switch(t.data.source){case Qp.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 Qp.Drag:case Qp.TouchMove:case Qp.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Qp.ViewportResize:return!1;case Qp.MediaInteraction:case Qp.MouseInteraction:case Qp.Scroll:case Qp.CanvasMutation:case Qp.Input:return this.replaceIds(t.data,e,["id"]),t;case Qp.StyleSheetRule:case Qp.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Qp.Font:return t;case Qp.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Qp.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 s of n)(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(r,t[s]):t[s]=e.getId(r,t[s]));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===nf.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Af{constructor(e){ic(this,"shadowDoms",new WeakSet),ic(this,"mutationCb"),ic(this,"scrollCb"),ic(this,"bypassOptions"),ic(this,"mirror"),ic(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(!wc(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=yf({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(wf({...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(Mp.host(e))),this.restoreHandlers.push(Of({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(Lp(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),i=Mp.shadowRoot(this);return i&&Yp(this)&&r.addShadowRoot(i,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Tf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nf="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Lf=0;Lf<64;Lf++)Nf[Tf.charCodeAt(Lf)]=Lf;const _f=new Map;const Df=(e,t,r)=>{if(!e||!jf(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=_f.get(e);return r||(r=new Map,_f.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let s=n.indexOf(e);return-1===s&&(s=n.length,n.push(e)),s};function Ff(e,t,r){if(e instanceof Array)return e.map(e=>Ff(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,s="";for(t=0;t<n;t+=3)s+=Tf[r[t]>>2],s+=Tf[(3&r[t])<<4|r[t+1]>>4],s+=Tf[(15&r[t+1])<<2|r[t+2]>>6],s+=Tf[63&r[t+2]];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Ff(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:[Ff(e.data,t,r),e.width,e.height]}}if(jf(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Df(e,t,r)}}return e}const Bf=(e,t,r)=>e.map(e=>Ff(e,t,r)),jf=(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 Uf(e,t,r,n){const s=[];try{const i=Lp(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...i){if(!Up(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(s);if("__context"in this||(this.__context=e),n&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[s,...i])}});s.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(e=>e())}}function $f(e,t,r,n,s,i){const o=[],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=Lp(e,l,function(e){return function(...o){const a=e.apply(this,o);if(Df(a,i,this),"tagName"in this.canvas&&!Up(this.canvas,n,s,!0)){const e=Bf(o,i,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});o.push(a)}catch{const n=Np(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});o.push(n)}return o}const zf='(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',Wf="undefined"!=typeof self&&self.Blob&&new Blob([zf],{type:"text/javascript;charset=utf-8"});function qf(e){let t;try{if(t=Wf&&(self.URL||self.webkitURL).createObjectURL(Wf),!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(zf),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Vf{constructor(e){ic(this,"pendingCanvasMutations",new Map),ic(this,"rafStamps",{latestId:0,invokeId:null}),ic(this,"mirror"),ic(this,"mutationCb"),ic(this,"resetObservers"),ic(this,"frozen",!1),ic(this,"locked",!1),ic(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:s,recordCanvas:i,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(r,n,s),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,s,{dataURLOptions:o})}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,s){const i=Uf(t,r,n,!0),o=new Map,a=new qf;a.onmessage=e=>{const{id:t}=e.data;if(o.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:s,height:i}=e.data;this.mutationCb({id:t,type:tf["2D"],commands:[{property:"clearRect",args:[0,0,s,i]},{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 c,u=0;const h=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Up(t,r,n,!0)||e.push(t)}),e})().forEach(async e=>{var t;const r=this.mirror.getId(e);if(o.get(r))return;if(0===e.width||0===e.height)return;if(o.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:s.dataURLOptions},[n])})),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{i(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Uf(e,t,r,!1),s=function(e,t,r,n){const s=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const o of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])continue;const i=Lp(t.CanvasRenderingContext2D.prototype,o,function(s){return function(...i){return Up(this.canvas,r,n,!0)||setTimeout(()=>{const r=Bf(i,t,this);e(this.canvas,{type:tf["2D"],property:o,args:r})},0),s.apply(this,i)}});s.push(i)}catch{const r=Np(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:tf["2D"],property:o,args:[t],setter:!0})}});s.push(r)}return()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),i=function(e,t,r,n){const s=[];return s.push(...$f(t.WebGLRenderingContext.prototype,tf.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...$f(t.WebGL2RenderingContext.prototype,tf.WebGL2,e,r,n,t)),()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),s(),i()}}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:s}=r[0];this.mutationCb({id:t,type:s,commands:n}),this.pendingCanvasMutations.delete(e)}}class Gf{constructor(e){ic(this,"trackedLinkElements",new WeakSet),ic(this,"mutationCb"),ic(this,"adoptedStyleSheetCb"),ic(this,"styleMirror",new Hp),ic(this,"inlinedAdoptedStyleSheetRuleIds",new Set),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}getInlinedAdoptedStyleSheetRuleIds(){return this.inlinedAdoptedStyleSheetRuleIds}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;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);let r=[];try{r=Array.from(t.cssRules,(e,r)=>({rule:Cc(e,t.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}n.push({styleId:e,rules:r})}r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.inlinedAdoptedStyleSheetRuleIds.clear()}trackStylesheetInLinkElement(e){}}class Hf{constructor(){ic(this,"nodeMap",new WeakMap),ic(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 Jf,Kf,Yf,Xf=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(rc=e.contentWindow)?void 0:rc.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Qf=new kc;function Zf(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:i=null,ignoreClass:o="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:m,maskAttributeFn:g,hooks:v,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:S,recordDOM:C=!0,recordCanvas:k=!1,recordCrossOriginIframes:x=!1,recordAfter:O=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:I=!1,collectFonts:E=!1,inlineImages:M=!1,captureAdoptedStyleSheets:R=!1,plugins:P,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:T=new Set([]),errorHandler:N,applyBackgroundColorToBlockedElements:L=!1}=e;pf=N;const _=!x||window.parent===window;let D=!1;if(!_)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(_&&!t)throw new Error("emit function is required");if(!_&&!D)return()=>{};void 0!==S&&void 0===b.mousemove&&(b.mousemove=S),Qf.reset();const F=!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},B=!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 j;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let U=0;const $=e=>{for(const t of P||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!D&&(e=y(e)),e};Jf=(e,s)=>{var i;const o=e;if(o.timestamp=_p(),!(null==(i=gf[0])?void 0:i.isFrozen())||o.type===Xp.FullSnapshot||o.type===Xp.IncrementalSnapshot&&o.data.source===Qp.Mutation||gf.forEach(e=>e.unfreeze()),_)null==t||t($(o),s);else if(D){const e={type:"rrweb",event:$(o),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(o.type===Xp.FullSnapshot)j=o,U=0;else if(o.type===Xp.IncrementalSnapshot){if(o.data.source===Qp.Mutation&&o.data.isAttachIframe)return;U++;const e=n&&U>=n,t=r&&o.timestamp-j.timestamp>r;(e||t)&&Kf(!0)}};const z=e=>{Jf({type:Xp.IncrementalSnapshot,data:{source:Qp.Mutation,...e}})},W=e=>Jf({type:Xp.IncrementalSnapshot,data:{source:Qp.Scroll,...e}}),q=e=>Jf({type:Xp.IncrementalSnapshot,data:{source:Qp.CanvasMutation,...e}}),V=new Gf({mutationCb:z,adoptedStyleSheetCb:e=>Jf({type:Xp.IncrementalSnapshot,data:{source:Qp.AdoptedStyleSheet,...e}})}),G=new Pf({mirror:Qf,mutationCb:z,stylesheetManager:V,recordCrossOriginIframes:x,wrappedEmit:Jf});for(const e of P||[])e.getMirror&&e.getMirror({nodeMirror:Qf,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const H=new Hf;Yf=new Vf({recordCanvas:k,mutationCb:q,win:window,blockClass:s,blockSelector:i,mirror:Qf,sampling:b.canvas,dataURLOptions:w});const J=new Af({mutationCb:z,scrollCb:W,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:F,dataURLOptions:w,maskTextFn:m,maskInputFn:f,maskAttributeFn:g,recordCanvas:k,inlineImages:M,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:V,canvasManager:Yf,keepIframeSrcFn:A,processedNodeManager:H,captureAdoptedStyleSheets:R},mirror:Qf});Kf=(e=!1)=>{if(!C)return;Jf({type:Xp.Meta,data:{href:window.location.href,width:Bp(),height:Fp()}},e),V.reset(),J.init(),gf.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new kc,blockClass:n="rr-block",blockSelector:s=null,maskTextClass:i="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:h,maskInputFn:d,maskAttributeFn:p,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:g,onSerialize:v,onAdoptedStyleSheet:y,_emittedStyleIds:b,onIframeLoad:w,iframeLoadTimeout:S,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:x=()=>!1,applyBackgroundColorToBlockedElements:O=!1}=t||{};return tu(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,maskTextClass:i,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:h,maskInputFn:d,maskAttributeFn:p,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:v,onAdoptedStyleSheet:y,_emittedStyleIds:b,onIframeLoad:w,iframeLoadTimeout:S,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:x,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:O})}(document,{mirror:Qf,blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:F,maskTextFn:m,maskInputFn:f,maskAttributeFn:g,slimDOM:B,dataURLOptions:w,recordCanvas:k,inlineImages:M,applyBackgroundColorToBlockedElements:L,onSerialize:e=>{qp(e,Qf)&&G.addIframe(e),Vp(e,Qf)&&V.trackLinkElement(e),Gp(e)&&J.addShadowRoot(Mp.shadowRoot(e),document)},onAdoptedStyleSheet:R?e=>V.styleMirror.add(e):void 0,_emittedStyleIds:R?V.getInlinedAdoptedStyleSheetRuleIds():void 0,onIframeLoad:(e,t)=>{G.attachIframe(e,t),J.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");Jf({type:Xp.FullSnapshot,data:{node:t,initialOffset:Dp(window)}},e),gf.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,Qf.getId(document))};try{const e=[],t=e=>{var t;return ff(If)({mutationCb:z,mousemoveCb:(e,t)=>Jf({type:Xp.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Jf({type:Xp.IncrementalSnapshot,data:{source:Qp.MouseInteraction,...e}}),scrollCb:W,viewportResizeCb:e=>Jf({type:Xp.IncrementalSnapshot,data:{source:Qp.ViewportResize,...e}}),inputCb:e=>Jf({type:Xp.IncrementalSnapshot,data:{source:Qp.Input,...e}}),mediaInteractionCb:e=>Jf({type:Xp.IncrementalSnapshot,data:{source:Qp.MediaInteraction,...e}}),styleSheetRuleCb:e=>Jf({type:Xp.IncrementalSnapshot,data:{source:Qp.StyleSheetRule,...e}}),styleDeclarationCb:e=>Jf({type:Xp.IncrementalSnapshot,data:{source:Qp.StyleDeclaration,...e}}),canvasMutationCb:q,fontCb:e=>Jf({type:Xp.IncrementalSnapshot,data:{source:Qp.Font,...e}}),selectionCb:e=>{Jf({type:Xp.IncrementalSnapshot,data:{source:Qp.Selection,...e}})},customElementCb:e=>{Jf({type:Xp.IncrementalSnapshot,data:{source:Qp.CustomElement,...e}})},blockClass:s,ignoreClass:o,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:F,inlineStylesheet:u,sampling:b,recordDOM:C,recordCanvas:k,inlineImages:M,userTriggeredOnInput:I,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:m,maskAttributeFn:g,keepIframeSrcFn:A,blockSelector:i,slimDOMOptions:B,dataURLOptions:w,mirror:Qf,iframeManager:G,stylesheetManager:V,shadowDomManager:J,processedNodeManager:H,captureAdoptedStyleSheets:R,canvasManager:Yf,ignoreCSSAttributes:T,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=>Jf({type:Xp.Plugin,data:{plugin:e.name,payload:t}})})))||[]},v)};G.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{Kf(),e.push(t(document)),Xf=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Rp("DOMContentLoaded",()=>{Jf({type:Xp.DomContentLoaded,data:{}}),"DOMContentLoaded"===O&&r()})),e.push(Rp("load",()=>{Jf({type:Xp.Load,data:{}}),"load"===O&&r()},window))),()=>{e.forEach(e=>e()),H.destroy(),Xf=!1,pf=void 0}}catch(e){console.warn(e)}}var em;Zf.addCustomEvent=(e,t)=>{if(!Xf)throw new Error("please add custom event after start recording");Jf({type:Xp.Custom,data:{tag:e,payload:t}})},Zf.freezePage=()=>{gf.forEach(e=>e.freeze())},Zf.takeFullSnapshot=e=>{if(!Xf)throw new Error("please take full snapshot after start recording");Kf(e)},Zf.mirror=Qf,Zf.supportsNativeMouseInteraction=!0,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(em||(em={}));var tm=Object.freeze({__proto__:null,record:Zf});const rm=e=>void 0!==e&&("boolean"==typeof e?e:!1!==e.enabled),nm=(e,t,r,n)=>{const{allowlist:s,excludelist:i}=(e=>{var t;return"object"==typeof e&&null!==e?{allowlist:null!==(t=e.allowlist)&&void 0!==t?t:[],excludelist:e.excludelist||e.blocklist||[]}:{allowlist:[],excludelist:[]}})(t),o=((e,t,r)=>{if(0===t.length&&0===r.length)return e;const n=t.length>0?t:["/**"];try{const t=JSON.parse(e);return Q(t,n,r),JSON.stringify(t)}catch(t){return e}})(e,s,i);return n(o,r)},sm=["image/","audio/","video/","application/octet-stream","font/"];function im(e,t){return function(e,t){t<0&&(t=0);const r=e.length;let n=0,s=0;for(;s<r;s++){const i=e.charCodeAt(s);let o=1,a=1;if(i<=127)o=1;else if(i<=2047)o=2;else if(i>=55296&&i<=56319){const t=s+1<r?e.charCodeAt(s+1):NaN;t>=56320&&t<=57343?(o=4,a=2):o=3}else o=3;if(n+o>t)break;n+=o,2===a&&s++}return s>=r?{value:e,truncated:!1}:{value:e.slice(0,s),truncated:!0}}(e,t)}var om=Object.freeze({__proto__:null,NetworkObservers:class{constructor(){this.fetchObserver=null}start(e,t){this.eventCallback=e,this.networkConfig=t,this.observeFetch()}stop(){var e;null===(e=this.fetchObserver)||void 0===e||e.call(this),this.fetchObserver=null,this.eventCallback=void 0,this.networkConfig=void 0}notifyEvent(e){var t;null===(t=this.eventCallback)||void 0===t||t.call(this,e)}observeFetch(){const e=m();if(!e)return;const t=e.fetch;t&&(e.fetch=(e,r)=>a(this,void 0,void 0,function*(){var n,s;const i=Date.now(),o={timestamp:i,type:"fetch",method:(null==r?void 0:r.method)||"GET",url:e.toString(),requestHeaders:null==r?void 0:r.headers},a=null===(n=this.networkConfig)||void 0===n?void 0:n.body;if(a&&rm(a.request)){const e=function(e){if(null!=e){if("string"==typeof e)return e;if(e instanceof URLSearchParams)return e.toString();if(e instanceof FormData){const t=[];return e.forEach((e,r)=>{t.push(`${r}=${"string"==typeof e?e:"[File]"}`)}),t.join("&")}}}(null==r?void 0:r.body);if(void 0!==e){const t=null!==(s=a.maxBodySizeBytes)&&void 0!==s?s:10240;o.requestBody=nm(e,a.request,t,im).value}}try{const n=yield t(e,r),s=Date.now();o.status=n.status,o.duration=s-i;const l={};if(n.headers.forEach((e,t)=>{l[t]=e}),o.responseHeaders=l,a&&rm(a.response)){if(function(e){return!!e&&sm.some(t=>e.toLowerCase().startsWith(t))}(l["content-type"]||null))o.responseBodyStatus="skipped_binary",this.notifyEvent(o);else{n.clone().text().then(e=>{var t;const r=null!==(t=a.maxBodySizeBytes)&&void 0!==t?t:10240,{value:n,truncated:s}=nm(e,a.response,r,im);o.responseBody=n,o.responseBodyStatus=s?"truncated":"captured",this.notifyEvent(o)},()=>{o.responseBodyStatus="error",this.notifyEvent(o)})}}else this.notifyEvent(o);return n}catch(e){const t=Date.now();o.duration=t-i;const r=e;throw o.error={name:r.name||"UnknownError",message:r.message||"An unknown error occurred"},this.notifyEvent(o),e}}),this.fetchObserver=()=>{e.fetch=t})}}});return e.SafeLoggerProvider=Pe,e.evaluateTargetingAndCapture=es,e.flush=Yn,e.getSessionId=Jn,e.getSessionReplayProperties=Kn,e.init=Gn,e.setSessionId=Hn,e.shutdown=Zn,e.start=Xn,e.stop=Qn,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
1
+ var sessionReplay=function(e){"use strict";function t(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(e)}var r=function(e,t){return r=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])},r(e,t)};var n,s,i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)};function o(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 s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r}function a(e,t,r,n){return new(r||(r=Promise))(function(s,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function l(e,t){var r,n,s,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(s=i.trys,(s=s.length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(6===a[0]&&i.label<s[1]){i.label=s[1],s=a;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(a);break}s[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function c(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 u(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function h(e,t,r){if(r||2===arguments.length)for(var n,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);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"}(s||(s={}));var d,p="$default_instance",f="https://api2.amplitude.com/2/httpapi";!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"}(d||(d={}));var m=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},g=h([],u(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),y=function(e){var t,r=m();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,y)}(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,h([],u(n.entries()),!1).map(function(e){var t=u(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(g[n]):g[n]}).join("")},v={},w={get exports(){return v},set exports(e){v=e}},b=Object.prototype.hasOwnProperty;function S(e){return"[Throws: "+(e?e.message:"?")+"]"}function C(e){var t=[];return function e(r){if(null===r||"object"!=typeof r)return r;if(-1!==t.indexOf(r))return"[Circular]";if(t.push(r),"function"==typeof r.toJSON)try{var n=e(r.toJSON());return t.pop(),n}catch(e){return S(e)}if(Array.isArray(r)){var s=r.map(e);return t.pop(),s}var i=Object.keys(r).reduce(function(t,n){return t[n]=e(function(e,t){if(b.call(e,t))try{return e[t]}catch(e){return S(e)}return e[t]}(r,n)),t},{});return t.pop(),i}(e)}w.exports=function(e,t,r){return JSON.stringify(C(e),t,r)};var k,x=v.ensureProperties=C,O=v||t({__proto__:null,ensureProperties:x,get default(){return v}},[v]),I=function(e){return{promise:e||Promise.resolve()}};!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 E="Amplitude Logger ",M=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(E,"[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(E,"[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(E,"[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(E,"[Debug]: ").concat(e.join(" ")))},e}(),R=function(e){return void 0===e||""===e?p:e},P=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:p,logLevel:k.Warn,loggerProvider:new M,offline:!1,optOut:!1,serverUrl:f,serverZone:"US",useBatch:!1}},A=function(){function e(e){var t,r,n,s;this._optOut=!1;var i=P();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:i.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||i.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||i.flushQueueSize,this.instanceName=R(e.instanceName),this.loggerProvider=e.loggerProvider||i.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:i.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:i.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:i.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||i.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(s=e.useBatch)&&void 0!==s?s:i.useBatch,this.loggerProvider.enable(this.logLevel);var o=L(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),T=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":f},L=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=P().serverZone),void 0===r&&(r=P().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:P().serverZone;return{serverZone:n,serverUrl:T(n,r)}};var N=function(e,t,r,n,s){return void 0===s&&(s=null),function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var a=r(),l=a.logger,c=a.logLevel;if(c&&c<k.Debug||!c||!l)return e.apply(s,i);var u,h={type:"invoke public method",name:t,args:i,stacktrace:(u=1,void 0===u&&(u=0),((new Error).stack||"").split("\n").slice(2+u).map(function(e){return e.trim()})),time:{start:(new Date).toISOString()},states:{}};n&&h.states&&(h.states.before=n());var d=e.apply(s,i);return d&&d.promise?d.promise.then(function(){n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))}):(n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))),d}};class F{getApplicationContext(){return{versionName:this.versionName,language:_(),platform:"Web",os:void 0,deviceModel:void 0}}}const _=()=>"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||"";class D{constructor(){this.queue=[]}logEvent(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)}setEventReceiver(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(t=>{e(t)}),this.queue=[])}}const B=(e,t)=>{const r=["string","number","boolean","undefined"],n=typeof e;if(n!==typeof t)return!1;for(const s of r)if(s===n)return e===t;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;const s=Array.isArray(e),i=Array.isArray(t);if(s!==i)return!1;if(!s||!i){const r=Object.keys(e).sort(),n=Object.keys(t).sort();if(!B(r,n))return!1;let s=!0;return Object.keys(e).forEach(r=>{B(e[r],t[r])||(s=!1)}),s}for(let r=0;r<e.length;r++)if(!B(e[r],t[r]))return!1;return!0};Object.entries||(Object.entries=function(e){const t=Object.keys(e);let r=t.length;const n=new Array(r);for(;r--;)n[r]=[t[r],e[t[r]]];return n});class j{constructor(){this.identity={userProperties:{}},this.listeners=new Set}editIdentity(){const e=this,t=Object.assign({},this.identity.userProperties),r=Object.assign(Object.assign({},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(e){return r.optOut=e,this},updateUserProperties:function(e){let t=r.userProperties||{};for(const[r,n]of Object.entries(e))switch(r){case"$set":for(const[e,r]of Object.entries(n))t[e]=r;break;case"$unset":for(const e of Object.keys(n))delete t[e];break;case"$clearAll":t={}}return r.userProperties=t,this},commit:function(){return e.setIdentity(r),this}}}getIdentity(){return Object.assign({},this.identity)}setIdentity(e){const t=Object.assign({},this.identity);this.identity=Object.assign({},e),B(t,this.identity)||this.listeners.forEach(t=>{t(e)})}addIdentityListener(e){this.listeners.add(e)}removeIdentityListener(e){this.listeners.delete(e)}}const U="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self;class ${constructor(){this.identityStore=new j,this.eventBridge=new D,this.applicationContextProvider=new F}static getInstance(e){return U.analyticsConnectorInstances||(U.analyticsConnectorInstances={}),U.analyticsConnectorInstances[e]||(U.analyticsConnectorInstances[e]=new $),U.analyticsConnectorInstances[e]}}var z=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},W=function(){function e(){}return e.prototype.send=function(e,t,r){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,i,o,a,l,c,u,h,p,f,m,g,y,v,w,b,S,C,k;if("object"!=typeof e)return null;var x=e.code||0,O=this.buildStatus(x);switch(O){case d.Success:return{status:O,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 d.Invalid:return{status:O,statusCode:x,body:{error:null!==(s=e.error)&&void 0!==s?s:"",missingField:null!==(i=e.missing_field)&&void 0!==i?i:"",eventsWithInvalidFields:null!==(o=e.events_with_invalid_fields)&&void 0!==o?o:{},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!==(c=e.eps_threshold)&&void 0!==c?c:0,exceededDailyQuotaDevices:null!==(u=e.exceeded_daily_quota_devices)&&void 0!==u?u:{},silencedDevices:null!==(h=e.silenced_devices)&&void 0!==h?h:[],silencedEvents:null!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(m=e.throttled_events)&&void 0!==m?m:[]}};case d.PayloadTooLarge:return{status:O,statusCode:x,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case d.RateLimit:return{status:O,statusCode:x,body:{error:null!==(y=e.error)&&void 0!==y?y:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(w=e.throttled_devices)&&void 0!==w?w:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(S=e.exceeded_daily_quota_devices)&&void 0!==S?S:{},exceededDailyQuotaUsers:null!==(C=e.exceeded_daily_quota_users)&&void 0!==C?C:{},throttledEvents:null!==(k=e.throttled_events)&&void 0!==k?k:[]}};case d.Timeout:default:return{status:O,statusCode:x}}},e.prototype.buildStatus=function(e){return function(e){return e>=200&&e<300}(e)?d.Success:429===e?d.RateLimit:413===e?d.PayloadTooLarge:408===e?d.Timeout:e>=400&&e<500?d.Invalid:e>=500?d.Failed:d.Unknown},e}(),q=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,function(){var r,n,s;return l(this,function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:i({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=o.sent()).text()];case 2:s=o.sent();try{return[2,this.buildResponse(JSON.parse(s))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}})})},t}(W),V=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t;try{this.isSupported="undefined"!=typeof localStorage}catch(e){this.logger.debug("Remote config localstorage failed to access: ",e),this.isSupported=!1}}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};if(!this.isSupported)return Promise.resolve(t);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(O(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){if(!this.isSupported)return Promise.resolve(!1);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}();var G,H=401,J=403,K=429,Y=function(){function e(t,r,n,s,i,o,a){void 0===n&&(n="US"),void 0===o&&(o=e.DEFAULT_CONFIG_GROUP),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=t,this.configGroup=o,this.serverUrl=s||("US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=r,this.storage=a||new V(t,r),this.customFetch=i}return e.prototype.subscribe=function(e,t,r){var n=y(),s={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(s),"all"===t?this.subscribeAll(s):this.subscribeWaitForRemote(s,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.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null}),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,s=this;return l(this,function(i){switch(i.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){s.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),s.sendCallback(e,t,"remote"),s.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=i.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 i.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return a(this,void 0,void 0,function(){var r,n;return l(this,function(s){switch(s.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),s.label=1;case 1:return s.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=s.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 s.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=s.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,s,i,o,a,c=this;return l(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},s=function(n){var s,o,a,u,h,d,p,f,m;return l(this,function(l){switch(l.label){case 0:s=!0,o=new AbortController,a=setTimeout(function(){return o.abort()},t),l.label=1;case 1:return l.trys.push([1,10,11,12]),u=i.getUrlParams(),h={Accept:"*/*"},i.customFetch?[4,(g=i.customFetch({url:u,method:"GET",headers:h,signal:o.signal}),y=o.signal,new Promise(function(e,t){var r=function(){var e=new Error("Remote config custom fetch aborted by timeout");e.name="AbortError",t(e)};y.addEventListener("abort",r,{once:!0}),g.then(function(t){y.removeEventListener("abort",r),e(t)},function(e){y.removeEventListener("abort",r),t(e)})}))]:[3,3];case 2:return p=l.sent(),[3,5];case 3:return[4,fetch(u,{method:"GET",headers:h,signal:o.signal})];case 4:p=l.sent(),l.label=5;case 5:return(d=p).ok||d.status>=200&&d.status<300?[3,7]:[4,d.text()];case 6:return f=l.sent(),i.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(d.status,": ").concat(f)),d.status===H||d.status===J?(i.logger.error("Remote config client fetch failed with ".concat(d.status,". Invalid API key; future fetches will be skipped.")),i.isLastFetchInvalidApiKey=!0,s=!1):d.status>=400&&d.status<500&&d.status!==K&&(s=!1),[3,9];case 7:return[4,d.json()];case 8:return[2,{value:{remoteConfig:l.sent(),lastFetch:new Date}}];case 9:return[3,12];case 10:return(m=l.sent())instanceof Error&&"AbortError"===m.name?i.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):i.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),m),[3,12];case 11:return clearTimeout(a),[7];case 12:return s?n<e-1?[4,new Promise(function(e){return setTimeout(e,c.getJitterDelay(r))})]:[3,14]:[2,"break"];case 13:l.sent(),l.label=14;case 14:return[2]}var g,y})},i=this,o=0,u.label=1;case 1:return o<e?[5,s(o)]:[3,4];case 2:if("object"==typeof(a=u.sent()))return[2,a.value];if("break"===a)return[3,4];u.label=3;case 3:return o++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var e=encodeURIComponent(this.apiKey),t=new URLSearchParams;return t.append("config_group",this.configGroup),"".concat(this.serverUrl,"/").concat(e,"?").concat(t.toString())},e.DEFAULT_CONFIG_GROUP="browser",e}();function Q(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function X(e,t,r){e&&Z({json:e,allowlist:t.map(ee),excludelist:r.map(ee),ancestors:[]})}function Z(e){var t,r,n=e.json,s=e.targetObject,i=e.allowlist,o=e.excludelist,a=e.ancestors,l=e.parentObject,d=e.targetKey;s||(s=n);var p=Object.keys(s);try{for(var f=c(p),m=f.next();!m.done;m=f.next()){var g=m.value,y=h(h([],u(a),!1),[g],!1);Q(s[g])?re(y,i)&&!re(y,o)||delete s[g]:Z({json:n,targetObject:s[g],allowlist:i,excludelist:o,ancestors:y,parentObject:s,targetKey:g})}}catch(e){t={error:e}}finally{try{m&&!m.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}0===Object.keys(s).length&&l&&d&&delete l[d]}function ee(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function te(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 s=t[n];if("**"===s){if(n+1===t.length)return!0;for(var i=r;i<=e.length;i++)if(te(e,t,i,n+1))return!0;return!1}return("*"===s||s===e[r])&&te(e,t,r+1,n+1)}function re(e,t){return t.some(function(t){return te(e,t)})}!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(G||(G={}));var ne,se="https://app.amplitude.com",ie={US:se,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var oe="__AMPLITUDE_MESSENGER_INSTANCE__",ae="__AMPLITUDE_MESSENGER__",le=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?se:t;this[ne]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=r}return e.prototype.notify=function(e){var t,r,n,s;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===(s=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===s||s.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var s="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),i={id:s,action:e,args:t};return new Promise(function(t,o){n.requestCallbacks[s]={resolve:t,reject:o},n.notify(i),r.timeout>0&&setTimeout(function(){o(new Error("".concat(e," timed out (id: ").concat(s,")"))),delete n.requestCallbacks[s]},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.registerActionHandler=function(e,t){var r,n,s,i;this.actionHandlers.has(e)&&(null===(i=null===(s=this.logger)||void 0===s?void 0:s.warn)||void 0===i||i.call(s,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var o=this.pendingMessages.get(e);if(o){this.pendingMessages.delete(e);try{for(var a=c(o),l=a.next();!l.done;l=a.next()){t(l.value)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return a(this,void 0,void 0,function(){var t,r,n;return l(this,function(s){switch(s.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,r){var n;try{var s=document.createElement("script");s.type="text/javascript",s.async=!0,s.src=e,s.addEventListener("load",function(){t({status:!0})},{once:!0}),s.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),null===(n=document.head)||void 0===n||n.appendChild(s)}catch(e){r(e)}})}(e).then(function(){}),this.scriptLoadPromises.set(e,r),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,r];case 2:return s.sent(),[3,4];case 3:throw n=s.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}})})},e.prototype.setup=function(e){var t,r,n=this,s=void 0===e?{}:e,i=s.logger,o=s.endpoint;i&&(this.logger=i),o&&this.endpoint===se&&(this.endpoint=o),this.isSetup||(this.isSetup=!0,null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,r,s,i,o;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 a=e.data,l=null==a?void 0:a.action;if(l)if("id"in a&&a.id)null===(i=null===(s=n.logger)||void 0===s?void 0:s.debug)||void 0===i||i.call(s,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(a);else{if("ping"===l)return void n.notify({action:"pong"});var c=n.actionHandlers.get(l);if(c)c(a.data);else{var u=null!==(o=n.pendingMessages.get(l))&&void 0!==o?o:[];u.push(a.data),n.pendingMessages.set(l,u)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=m();(null==e?void 0:e[ae])===this&&delete e[ae]},e}();function ce(e){var t,r=m(),n=null==r?void 0:r[ae];if("object"==typeof(t=n)&&null!==t&&oe in t&&!0===t[oe])return n;var s=new le(e);return r&&(r[ae]=s),s}ne=oe;var ue=["desktop","tablet","mobile"],he="__AMPLITUDE_BACKGROUND_CAPTURE__";function de(e,t){var r,n=e;if(!0!==n[he]){n[he]=!0;var s=null!==(r=null==t?void 0:t.scriptUrl)&&void 0!==r?r:"https://cdn.amplitude.com/libs/background-capture-1.1.0.js.gz",o=null,a=function(t,r){var n,s;"background-capture-complete"===t&&(null===(s=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===s||s.call(n,"Background capture complete"),e.notify({action:"background-capture-complete",data:r}))};e.registerActionHandler("initialize-background-capture",function(t){var r,n;null===(n=null===(r=e.logger)||void 0===r?void 0:r.debug)||void 0===n||n.call(r,"Initializing background capture (external script)");var l=new URL(s,e.endpoint).toString(),c=t&&"object"==typeof t?function(e){if("string"==typeof e)return ue.includes(e)?e:void 0}(t.deviceMode):void 0;e.loadScriptOnce(l).then(function(){var t,r,n;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Background capture script loaded (external)"),o=null===(n=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===n?void 0:n.call(window,i({messenger:e,onBackgroundCapture:a},void 0!==c?{initialDeviceMode:c}:{})),e.notify({action:"background-capture-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var e;null===(e=null==o?void 0:o.close)||void 0===e||e.call(o),o=null})}}const pe="[Amplitude]",fe=`${pe} Session Replay ID`,me=G.US,ge={enabled:!0},ye=1e3,ve=`${pe} Session Replay Debug`,we="https://api-sr.amplitude.com/sessions/v2/track",be="https://api-sr.eu.amplitude.com/sessions/v2/track",Se="https://api-sr.stag2.amplitude.com/sessions/v2/track",Ce=9e6,ke=/payload.*exceed/i,xe=500,Oe=1e4,Ie=1024,Ee="X-Session-Replay-Event-Skipped",Me="amplitude-sr-iframe";var Re;!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",e.REPLAY_GATE_DECISION="replay-gate-decision"}(Re||(Re={}));class Pe{constructor(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}getSafeMethod(e){var t;if(!this.logger)return()=>{};const r=this.logger[e];if("function"==typeof r){return(null!==(t=r.__rrweb_original__)&&void 0!==t?t:r).bind(this.logger)}return()=>{}}enable(e){this.logger.enable(e)}disable(){this.logger.disable()}}var Ae="medium";var Te=new Map,Le=function(e){var t=Te.get(e);if(t)return t;var r="\0TRAIL\0",n="\0MID\0",s="\0DS\0",i="\0ST\0",o="\0QU\0",a=e;a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=a.replace(/\/\*\*$/,r)).replace(/\/\*\*\//g,n)).replace(/\*\*/g,s)).replace(/\*/g,i)).replace(/\?/g,o)).replace(/[.+^${}()|[\]\\]/g,"\\$&")).split(r).join("(/.*)?")).split(n).join("/(.*\\/)?")).split(s).join(".*")).split(i).join(".*")).split(o).join(".");var l=new RegExp("^".concat(a,"$"));return Te.set(e,l),l},Ne=function(e,t,r){switch(t){case"light":if("input"!==e)return!1;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":return"input"===e;case"conservative":return!0;default:return Ne(e,Ae,r)}},Fe=function(e,t){var r,n,s;if(e&&t.urlMaskLevels)try{for(var i=c(t.urlMaskLevels),o=i.next();!o.done;o=i.next()){var a=o.value;if(Le(a.match).test(e))return a.maskLevel}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return null!==(s=t.defaultMaskLevel)&&void 0!==s?s:Ae},_e=function(e,t,r,n){var s,i;if(void 0===t&&(t={defaultMaskLevel:Ae}),r){if(r.closest(".amp-mask, [data-amp-mask]"))return!0;var o=(null!==(s=t.maskSelector)&&void 0!==s?s:[]).some(function(e){return r.closest(e)});if(o)return!0;if(r.closest(".amp-unmask, [data-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 Ne(e,Fe(n,t),r)},De=function(e,t,r){return function(n,s){return _e(e,t,s,null==r?void 0:r())?n.replace(/[^\s]/g,"*"):n}},Be=function(e,t){return function(r,n,s){var i;if("style"===r)return n;if(!(null!==(i=null==e?void 0:e.maskAttributes)&&void 0!==i?i:[]).includes(r))return n;var o=["INPUT","SELECT","TEXTAREA"].includes(s.tagName)?"input":"text";return _e(o,e,s,null==t?void 0:t())?n.replace(/[^\s]/g,"*"):n}},je=function(e){var t=null==e?void 0:e.blockSelector;return h(h([],u("string"==typeof t?t?[t]:[]:null!=t?t:[]),!1),["[data-amp-block]"],!1).join(",")},Ue=function(e,t){var r,n;return e&&("conservative"===Fe(t,e)||"conservative"===e.defaultMaskLevel||(null===(r=e.urlMaskLevels)||void 0===r?void 0:r.some(function(e){return"conservative"===e.maskLevel})))?"*":h(h([],u(null!==(n=null==e?void 0:e.maskSelector)&&void 0!==n?n:[]),!1),["[data-amp-mask]"],!1).join(",")};function $e(e,t){return t||("STAGING"===e?Se:"EU"===e?be:we)}const ze=()=>{const e=m();return(null==e?void 0:e.location)?e.location.href:""},We=(e,t)=>{for(const r of t){const t=Le(r.selector);if(t.test(e))return e.replace(t,r.replacement)}return e},qe=()=>a(void 0,void 0,void 0,function*(){try{const e=m();if(e){const{usage:t,quota:r,usageDetails:n}=yield e.navigator.storage.estimate(),s=t?Math.round(t/Ie):0;return{totalStorageSize:s,percentOfQuota:t&&r?Math.round(1e3*(t/r+Number.EPSILON))/1e3:0,usageDetails:JSON.stringify(n)}}}catch(e){}return{totalStorageSize:0,percentOfQuota:0,usageDetails:""}}),Ve=e=>{const t=o(e,["loggerProvider"]),r=Object.assign(Object.assign({},t),{apiKey:`****${e.apiKey.substring(e.apiKey.length-4)}`});return JSON.parse(JSON.stringify(r))},Ge=()=>({flushMaxRetries:2,logLevel:k.Warn,loggerProvider:new M,transportProvider:new q});class He extends A{constructor(e,t){var r,n,s,i,o,a,l,c,u,h,d,p,f,m;const g=Ge();super(Object.assign(Object.assign({transportProvider:g.transportProvider,loggerProvider:new Pe(t.loggerProvider||g.loggerProvider)},t),{apiKey:e})),this.flushMaxRetries=void 0!==t.flushMaxRetries&&t.flushMaxRetries<=g.flushMaxRetries?t.flushMaxRetries:g.flushMaxRetries,this.apiKey=e,this.sampleRate=t.sampleRate||0,this.semanticCapture=t.semanticCapture,this.semanticAnalyticsContext=t.semanticAnalyticsContext,this.serverZone=t.serverZone||me,this.configServerUrl=t.configServerUrl,this.trackServerUrl=t.trackServerUrl,this.shouldInlineStylesheet=t.shouldInlineStylesheet,this.inlineImages=t.inlineImages,this.version=t.version,this.performanceConfig=t.performanceConfig||ge,this.storeType=null!==(r=t.storeType)&&void 0!==r?r:"memory",this.applyBackgroundColorToBlockedElements=null!==(n=t.applyBackgroundColorToBlockedElements)&&void 0!==n&&n,this.enableUrlChangePolling=null!==(s=t.enableUrlChangePolling)&&void 0!==s&&s,this.urlChangePollingInterval=null!==(i=t.urlChangePollingInterval)&&void 0!==i?i:ye,this.captureDocumentTitle=null!==(o=t.captureDocumentTitle)&&void 0!==o&&o,void 0!==t.fullSnapshotIntervalMs&&(this.fullSnapshotIntervalMs=t.fullSnapshotIntervalMs),void 0!==t.eagerFullSnapshotSend&&(this.eagerFullSnapshotSend=t.eagerFullSnapshotSend),this.captureFullSnapshotOnFocus=null!==(a=t.captureFullSnapshotOnFocus)&&void 0!==a&&a,void 0!==t.maxPersistedEventsSizeBytes&&(this.maxPersistedEventsSizeBytes=Xe(t.maxPersistedEventsSizeBytes,Ke,Ye,"maxPersistedEventsSizeBytes",this.loggerProvider)),void 0!==t.maxSingleEventSizeBytes&&(this.maxSingleEventSizeBytes=Xe(t.maxSingleEventSizeBytes,Ke,Qe,"maxSingleEventSizeBytes",this.loggerProvider)),this.privacyConfig=Object.assign(Object.assign({},null!==(l=t.privacyConfig)&&void 0!==l?l:{}),{unmaskSelector:Array.from(new Set([".amp-unmask",...null!==(u=null===(c=t.privacyConfig)||void 0===c?void 0:c.unmaskSelector)&&void 0!==u?u:[]]))}),t.interactionConfig&&(this.interactionConfig=t.interactionConfig,this.interactionConfig.ugcFilterRules&&(e=>{if(!e.every(e=>"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(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")})(this.interactionConfig.ugcFilterRules)),t.debugMode&&(this.debugMode=t.debugMode);const y=t;this.useWebWorker=null===(p=null!==(h=t.useWebWorker)&&void 0!==h?h:null===(d=y.experimental)||void 0===d?void 0:d.useWebWorker)||void 0===p||p,this.enableTransportCompression=null===(f=t.enableTransportCompression)||void 0===f||f,this.sendTimeoutMs=t.sendTimeoutMs,this.captureAdoptedStyleSheets=null===(m=t.captureAdoptedStyleSheets)||void 0===m||m,t.crossOriginIframes&&(this.crossOriginIframes=t.crossOriginIframes),t.flushIntervalConfig?this.flushIntervalConfig=function(e,t){var r,n;const s={};void 0!==e.minIntervalMs&&(!Number.isFinite(e.minIntervalMs)||e.minIntervalMs<Je?(t.warn(`flushIntervalConfig.minIntervalMs ${e.minIntervalMs} is below floor ${Je}ms; clamping.`),s.minIntervalMs=Je):s.minIntervalMs=e.minIntervalMs);void 0!==e.maxIntervalMs&&(Number.isNaN(e.maxIntervalMs)||e.maxIntervalMs<Je?(t.warn(`flushIntervalConfig.maxIntervalMs ${e.maxIntervalMs} is below floor ${Je}ms; clamping.`),s.maxIntervalMs=Je):s.maxIntervalMs=e.maxIntervalMs);if(void 0!==s.minIntervalMs||void 0!==s.maxIntervalMs){const e=null!==(r=s.minIntervalMs)&&void 0!==r?r:xe,i=null!==(n=s.maxIntervalMs)&&void 0!==n?n:Oe;i<e&&(void 0===s.maxIntervalMs?(t.warn(`flushIntervalConfig.minIntervalMs (${e}) exceeds the default maxIntervalMs (10000); raising max to match min.`),s.maxIntervalMs=e):void 0===s.minIntervalMs?(t.warn(`flushIntervalConfig.maxIntervalMs (${i}) is below the default minIntervalMs (500); lowering min to match max.`),s.minIntervalMs=i):(t.warn(`flushIntervalConfig.maxIntervalMs (${s.maxIntervalMs}) is less than minIntervalMs (${s.minIntervalMs}); raising max to match min.`),s.maxIntervalMs=s.minIntervalMs))}return s}(t.flushIntervalConfig,this.loggerProvider):this.flushIntervalConfig={minIntervalMs:1e3,maxIntervalMs:1e4},this.handleSendEvents=t.handleSendEvents,this.handleFetchConfig=t.handleFetchConfig}}const Je=100,Ke=1e3,Ye=8e6,Qe=1e7;function Xe(e,t,r,n,s){if(Number.isFinite(e))return e<t?(s.warn(`${n} ${e} is below floor ${t}; clamping.`),t):e>r?(s.warn(`${n} ${e} exceeds ceiling ${r}; clamping.`),r):e;s.warn(`${n} value is not a finite number (got ${String(e)}); ignoring.`)}var Ze=(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))(Ze||{}),et=(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))(et||{}),tt=(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))(tt||{});class rt{constructor(e,t){this.createCapture=e,this.ready=!1,this.pendingSnapshots=0,this.config={enabled:!1},this.capture=e(this.config,t)}prepare(e,t){this.stop(),this.config=e,this.capture.updateConfig(e),this.sessionId!==t&&this.capture.resetSession(),this.sessionId=t}recordingReady(){if(!this.config.enabled||this.ready)return;this.ready=!0,this.capture.start();const e=this.pendingSnapshots;this.pendingSnapshots=0;for(let t=0;t<e;t++)this.snapshot()}event(e){e.type===Ze.FullSnapshot&&this.snapshot()}snapshot(){this.config.enabled&&(this.ready?this.capture.isActive()&&this.capture.notify("snapshot",void 0):this.pendingSnapshots=Math.min(this.pendingSnapshots+1,200))}stop(){this.ready=!1,this.pendingSnapshots=0,this.capture.stop()}}const nt="AMP_semantic_tab_v1",st=new WeakMap,it=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;const ot=(e,t)=>{const r=document.createDocumentFragment();return function(e,t,r){var n,s,o=i({},e);try{for(var a=c(["blockSelector","maskSelector","unmaskSelector"]),l=a.next();!l.done;l=a.next()){var u=l.value,h=e[u],d=("string"==typeof h?[h]:null!=h?h:[]).filter(function(e){try{return t(e),!0}catch(t){if(!r)throw new Error("Invalid privacy selector: ".concat(e));return r(e),!1}});o[u]=d.length?d:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}return o}(e,e=>{r.querySelector(e)},e=>{t.warn(`[session-replay-browser] omitting selector "${e}" because it is invalid`)})};class at{constructor(e,t){this.localConfig=t,this.remoteConfigClient=e}generateJoinedConfig(){var e,t,r,n,s,i,o,l;return a(this,void 0,void 0,function*(){const a=Object.assign({},this.localConfig);let c;a.optOut=this.localConfig.optOut,a.captureEnabled=!0;try{yield new Promise((e,t)=>{this.remoteConfigClient.subscribe("configs.sessionReplay",{timeout:1500},(r,n)=>{var s;if(this.localConfig.loggerProvider.debug(`Session Replay remote configuration received from ${n}:`,JSON.stringify(r,null,2)),!r)return void t(new Error("No remote config received"));const i=r,o=i.sr_sampling_config,l=i.sr_privacy_config,u=i.sr_targeting_config,h=i.sr_semantic_config,d=null===(s=a.interactionConfig)||void 0===s?void 0:s.ugcFilterRules;a.interactionConfig=i.sr_interaction_config,a.interactionConfig&&d&&(a.interactionConfig.ugcFilterRules=d),a.loggingConfig=i.sr_logging_config,(o||l||u||h)&&(c={},h&&(c.sr_semantic_config=h),o&&(c.sr_sampling_config=o),l&&(c.sr_privacy_config=l),u&&(c.sr_targeting_config=u)),e()})})}catch(e){return this.localConfig.loggerProvider.error("Failed to generate joined config: ",e),a.captureEnabled=!1,{localConfig:this.localConfig,joinedConfig:a,remoteConfig:void 0}}if(!c)return{localConfig:this.localConfig,joinedConfig:a,remoteConfig:c};const{sr_sampling_config:u,sr_privacy_config:h,sr_targeting_config:d,sr_semantic_config:p}=c;if(p&&(a.semanticCapture=Object.assign(Object.assign(Object.assign(Object.assign({enabled:!1},a.semanticCapture),void 0!==p.enabled?{enabled:p.enabled}:{}),void 0!==p.sampleRate?{sampleRate:this.sanitizeSemanticSampleRate(p.sampleRate)}:{}),{families:Object.assign(Object.assign({},null===(e=a.semanticCapture)||void 0===e?void 0:e.families),p.families)})),u&&Object.keys(u).length>0?(Object.prototype.hasOwnProperty.call(u,"capture_enabled")?a.captureEnabled=u.capture_enabled:a.captureEnabled=!1,Object.prototype.hasOwnProperty.call(u,"sample_rate")&&(a.sampleRate=u.sample_rate),Object.prototype.hasOwnProperty.call(u,"min_session_duration_ms")&&(a.minSessionDurationMs=this.sanitizeMinSessionDurationMs(u.min_session_duration_ms))):(a.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),h){const e=null!==(t=a.privacyConfig)&&void 0!==t?t:{},c={defaultMaskLevel:null!==(n=null!==(r=h.defaultMaskLevel)&&void 0!==r?r:e.defaultMaskLevel)&&void 0!==n?n:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[],maskAttributes:[...new Set([...null!==(s=e.maskAttributes)&&void 0!==s?s:[],...null!==(i=h.maskAttributes)&&void 0!==i?i:[]])],urlMaskLevels:[...null!==(o=h.urlMaskLevels)&&void 0!==o?o:[],...null!==(l=e.urlMaskLevels)&&void 0!==l?l:[]]},u=e=>{var t,r,n;const s={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);for(const r of null!==(t=e.blockSelector)&&void 0!==t?t:[])s[r]="block";for(const t of null!==(r=e.maskSelector)&&void 0!==r?r:[])s[t]="mask";for(const t of null!==(n=e.unmaskSelector)&&void 0!==n?n:[])s[t]="unmask";return s},d=Object.assign(Object.assign({},u(e)),u(h));for(const[e,t]of Object.entries(d))"mask"===t?c.maskSelector.push(e):"block"===t?c.blockSelector.push(e):"unmask"===t&&c.unmaskSelector.push(e);a.privacyConfig=ot(c,this.localConfig.loggerProvider)}return d&&Object.keys(d).length>0&&(a.targetingConfig=d),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:Ve(a)},null,2)),{localConfig:this.localConfig,joinedConfig:a,remoteConfig:c}})}sanitizeSemanticSampleRate(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0&&e<=1?e:(this.localConfig.loggerProvider.warn(`Invalid semantic sampleRate remote value (${String(e)}); disabling capture.`),0)}sanitizeMinSessionDurationMs(e){if("number"==typeof e&&Number.isFinite(e)){if(!(e<0))return e>lt?(this.localConfig.loggerProvider.warn(`min_session_duration_ms remote value ${e} exceeds ${lt}ms ceiling; clamping.`),lt):e;this.localConfig.loggerProvider.warn(`min_session_duration_ms remote value is negative (${e}); ignoring.`)}else this.localConfig.loggerProvider.warn(`min_session_duration_ms remote value is not a finite number (got ${String(e)}); ignoring.`)}}const lt=6e4;function ct(e){const t=e.length;let r=0;for(;r<t&&!(e.charCodeAt(r)>127);r++);if(r===t)return t;let n=r;for(;r<t;r++){const s=e.charCodeAt(r);if(s<=127)n++;else if(s<=2047)n+=2;else if(s>=55296&&s<=56319){const s=r+1<t?e.charCodeAt(r+1):NaN;s>=56320&&s<=57343?(n+=4,r++):n+=3}else n+=3}return n}function ut(e){let t=0;for(let r=0;r<e.length;r++)t+=ct(e[r]);return t}function ht(e,t){if(3*e.length<=t)return;const r=ct(e);return r>t?r:void 0}function dt(e){if(e.type!==Ze.IncrementalSnapshot)return!1;const t=e.data;return t.source===et.Mutation&&!t.isAttachIframe}function pt(e){const t={};for(const r of e)for(const e of Object.keys(r))t[e]=r[e];return t}function ft(e){const t=new Map;if(e.forEach((e,r)=>{if(e.attributes&&"style"in e.attributes){const n=t.get(e.id);n?n.push(r):t.set(e.id,[r])}}),0===t.size)return e;const r=t=>e[t].attributes.style,n=new Set,s=new Map;for(const e of t.values()){if(1===e.length)continue;let t=-1;e.forEach((e,n)=>{var s;("object"!=typeof(s=r(e))||null===s)&&(t=n)});const i=[];if(e.forEach((e,r)=>{r!==t&&(n.add(e),r>t&&i.push(e))}),i.length>0){const e=i[i.length-1],t=pt(i.map(e=>r(e)));n.delete(e),s.set(e,t)}}if(0===n.size&&0===s.size)return e;const i=[];return e.forEach((e,t)=>{const r=s.get(t);if(void 0!==r)return void i.push(Object.assign(Object.assign({},e),{attributes:Object.assign(Object.assign({},e.attributes),{style:r})}));if(!n.has(t))return void i.push(e);const o=Object.assign({},e.attributes);delete o.style,Object.keys(o).length>0&&i.push(Object.assign(Object.assign({},e),{attributes:o}))}),i}function mt(e){const t=e[0],r=new Map,n=new Map,s=new Map,i=new Map,o=new Map;e.forEach((e,t)=>{const a=e.data;for(const e of a.adds)r.has(e.node.id)||r.set(e.node.id,t),n.set(e.node.id,t),o.set(e.node.id,e.parentId);for(const e of a.removes)s.has(e.id)||s.set(e.id,t),i.set(e.id,t)});const a=new Set,l=new Set;for(const[e,t]of r){const r=s.get(e);if(void 0===r)continue;n.get(e)>=i.get(e)||(t<r?a.add(e):r<t&&l.add(e))}const c=new Set;if(a.size>0||l.size>0){let e=!0;for(;e;){e=!1;for(const[t,n]of o)if(!a.has(t)&&!l.has(t)&&!c.has(t)&&(a.has(n)||l.has(n)||c.has(n))){const n=s.get(t),i=r.get(t);void 0!==n&&void 0!==i&&n<i?l.add(t):void 0!==n&&void 0!==i&&n===i?c.add(t):a.add(t),e=!0}}}const u=a.size>0||l.size>0||c.size>0,h=[];e.forEach((e,t)=>{for(const n of e.data.removes)a.has(n.id)||l.has(n.id)&&t>=r.get(n.id)||c.has(n.id)&&(a.has(n.parentId)||l.has(n.parentId)||c.has(n.parentId))||h.push(n)});const d=e.flatMap(e=>e.data.adds),p=e.flatMap(e=>e.data.texts),f=e.flatMap(e=>e.data.attributes),m=u?f.filter(e=>!a.has(e.id)&&!l.has(e.id)&&!c.has(e.id)):f,g={source:et.Mutation,removes:h,adds:u?d.filter(e=>!a.has(e.node.id)&&!l.has(e.node.id)&&!c.has(e.node.id)):d,texts:u?p.filter(e=>!a.has(e.id)&&!l.has(e.id)&&!c.has(e.id)):p,attributes:ft(m)};return Object.assign(Object.assign({},t),{data:g})}function gt(e){if(e.length<=1)return e;const t=[];let r=0;for(;r<e.length;){if(!dt(e[r])){t.push(e[r]),r++;continue}let n=r+1;for(;n<e.length&&dt(e[n]);)n++;t.push(n>r+1?mt(e.slice(r,n)):e[r]),r=n}return t}class yt{constructor(e,t,r,n,s){var i;this.taskQueue=[],this.pendingQueue=[],this.isProcessing=!1,this.compressEvent=e=>{const{type:t,timestamp:r,delay:n,data:s}=e;return null!=n?JSON.stringify({type:t,timestamp:r,delay:n,data:s}):JSON.stringify({type:t,timestamp:r,data:s})},this.addCompressedEventToManager=(e,t)=>{var r;const n=ht(e,null!==(r=this.config.maxSingleEventSizeBytes)&&void 0!==r?r:Ce);void 0===n?this.eventsManager&&this.deviceId&&this.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:this.deviceId}):this.config.loggerProvider.warn(`Session replay event dropped: serialized size ${Math.round(n/1024)} KB exceeds maximum allowed event size. If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support.`)},this.addCompressedEvent=(e,t)=>{if(this.worker)try{this.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?this.worker.postMessage(JSON.stringify({event:e,sessionId:t})):this.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{const r=this.compressEvent(e);this.addCompressedEventToManager(r,t)}},this.flushQueue=()=>{for(this.pendingQueue.length>0&&this.taskQueue.push(...this.mergeMutationTasks(this.pendingQueue.splice(0)));this.taskQueue.length>0;){const e=this.taskQueue.shift();if(e){const{event:t,sessionId:r}=e,n=this.compressEvent(t);this.addCompressedEventToManager(n,r)}}this.isProcessing=!1},this.terminate=()=>{var e;null===(e=this.worker)||void 0===e||e.terminate()};const o=m();if(this.canUseIdleCallback=o&&"requestIdleCallback"in o,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(i=t.performanceConfig)||void 0===i?void 0:i.timeout)||2e3,this.onFullSnapshotProcessed=s,n){t.loggerProvider.log("Enabling web worker for compression");try{const e=new Blob([n],{type:"application/javascript"}),r=URL.createObjectURL(e),s=new Worker(r);s.onerror=e=>{e.preventDefault(),t.loggerProvider.error(`Worker failed, falling back to non-worker compression: ${e.message} (${e.filename}:${e.lineno})`),s.terminate(),this.worker=void 0},s.onmessage=e=>{const{compressedEvent:t,sessionId:r}=e.data;this.addCompressedEventToManager(t,r)},this.worker=s}catch(e){t.loggerProvider.error("Failed to create worker, falling back to non-worker compression:",e)}}}scheduleIdleProcessing(){this.isProcessing||(this.isProcessing=!0,requestIdleCallback(e=>{this.processQueue(e)},{timeout:this.timeout}))}enqueueEvent(e,t){var r,n;if(e.type===Ze.FullSnapshot){if(this.config.loggerProvider.debug("Processing full snapshot immediately."),this.taskQueue.length>0||this.pendingQueue.length>0){const e=[...this.taskQueue.splice(0),...this.mergeMutationTasks(this.pendingQueue.splice(0))];for(const t of e){const e=this.compressEvent(t.event);this.addCompressedEventToManager(e,t.sessionId)}this.isProcessing=!1}const n=this.compressEvent(e);return this.addCompressedEventToManager(n,t),void(null===(r=this.onFullSnapshotProcessed)||void 0===r||r.call(this))}this.canUseIdleCallback&&(null===(n=this.config.performanceConfig)||void 0===n?void 0:n.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.pendingQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))}processQueue(e){for(this.pendingQueue.length>0&&this.taskQueue.push(...this.mergeMutationTasks(this.pendingQueue.splice(0)));this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){const e=this.taskQueue.shift();if(e){const{event:t,sessionId:r}=e;this.addCompressedEvent(t,r)}}this.taskQueue.length>0||this.pendingQueue.length>0?requestIdleCallback(e=>{this.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1}mergeMutationTasks(e){var t;if(!1===(null===(t=this.config.performanceConfig)||void 0===t?void 0:t.mergeMutations))return e;if(e.length<=1)return e;const r=[];let n=0;for(;n<e.length;){const t=e[n].sessionId;let s=n+1;for(;s<e.length&&e[s].sessionId===t;)s++;const i=gt(e.slice(n,s).map(e=>e.event));for(const e of i)r.push({event:e,sessionId:t});n=s}return r}}const vt="Session replay event batch rejected due to exceeded retry count",wt="Failed to store session replay events in IndexedDB",bt="Session replay event batch dropped: server signalled capture disabled or session out of valid range for this session",St="1.52.0";class Ct{constructor({trackServerUrl:e,loggerProvider:t,payloadBatcher:r,workerScript:n,enableTransportCompression:s,sendTimeoutMs:i,handleSendEvents:o}){if(this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.sendIdCounter=0,this.pendingWorkerRequests=new Map,this.timedOutWorkerRequests=new Map,this.flushPauseUntilMs=0,this.mergeOnNextFlush=!1,this.coalesceNextFlush=!1,this.mergeLogFiredThisPause=!1,this.killedSessions=new Set,this.loggerProvider=t,this.payloadBatcher=r||(e=>e),this.trackServerUrl=e,this.enableTransportCompression=null==s||s,this.sendTimeoutMs=null!=i?i:1e4,this.handleSendEvents=o,n)try{const e=new Blob([n],{type:"application/javascript"}),r=URL.createObjectURL(e),s=new Worker(r);s.onerror=e=>{e.preventDefault(),t.error(`Track destination worker failed, falling back to main-thread sending: ${e.message} (${e.filename}:${e.lineno})`),s.terminate(),this.worker=void 0;for(const[,r]of this.pendingWorkerRequests)r.timeout&&clearTimeout(r.timeout),t.warn(`Session replay event send failed due to worker crash: ${e.message}`),r.resolve();this.pendingWorkerRequests.clear(),this.timedOutWorkerRequests.clear()},s.onmessage=e=>{const r=e.data;if("log"===r.type)t.log(r.message);else if("warn"===r.type)t.warn(r.message);else if("payload_too_large"===r.type){const e=this.pendingWorkerRequests.get(r.id);if(e)e.timeout&&clearTimeout(e.timeout),this.handlePayloadTooLargeResponse(e.context,r.isWaf),e.resolve(),this.pendingWorkerRequests.delete(r.id);else{const e=this.timedOutWorkerRequests.get(r.id);e&&(this.timedOutWorkerRequests.delete(r.id),this.handlePayloadTooLargeResponse(e,r.isWaf))}}else if("complete"===r.type){const e=this.pendingWorkerRequests.get(r.id);if(e)e.timeout&&clearTimeout(e.timeout),void 0!==r.skipCode&&this.applyServerDirective(e.context.sessionId,r.skipCode),this.completeRequest({context:e.context}),e.resolve(),this.pendingWorkerRequests.delete(r.id);else{const e=this.timedOutWorkerRequests.get(r.id);e&&(this.timedOutWorkerRequests.delete(r.id),void 0!==r.skipCode&&this.applyServerDirective(e.sessionId,r.skipCode),this.completeRequest({context:e}))}}else"fetch-request"===r.type&&this.handleDelegatedFetch(s,r).catch(e=>{t.warn("Failed to handle delegated session replay fetch:",e)})},this.worker=s}catch(e){t.error("Failed to create track destination worker, falling back to main-thread sending:",e)}}sendEventsList(e){this.addToQueue(Object.assign(Object.assign({},e),{attempts:0,timeout:0}))}markCoalesceNextFlush(){this.coalesceNextFlush=!0,this.schedule(0)}sendBeacon({events:e,sessionId:t,deviceId:r,apiKey:n,serverZone:s}){var i,o;const a=e=>ct(e);let l=e,c=JSON.stringify({version:2,events:l});if(a(c)>65536){let t=0,r=l.length;for(;t<r;){const e=Math.floor((t+r+1)/2);a(JSON.stringify({version:2,events:l.slice(0,e)}))<=65536?t=e:r=e-1}l=l.slice(0,t),c=JSON.stringify({version:2,events:l}),this.loggerProvider.warn(`sendBeacon payload exceeded 64 KB limit, trimmed from ${e.length} to ${l.length} events`)}if(0===l.length)return;if(this.handleSendEvents){const e=new URLSearchParams({device_id:r,session_id:String(t),type:"replay"}),i=`${$e(s,this.trackServerUrl)}?${e.toString()}`,o={"Content-Type":"application/json",Accept:"*/*",Authorization:`Bearer ${n}`};this.loggerProvider.debug(`Routing session replay exit batch (${l.length} events) through custom transport for session id ${t}.`);try{this.handleSendEvents({url:i,method:"POST",headers:o,body:c,keepalive:!0}).catch(e=>{this.loggerProvider.warn("Custom transport failed to send session replay exit batch:",e)})}catch(e){this.loggerProvider.warn("Custom transport threw while sending session replay exit batch:",e)}return}const u=new URLSearchParams({device_id:r,session_id:String(t),type:"replay",api_key:n}),h=`${$e(s,this.trackServerUrl)}?${u.toString()}`,d=m();try{const e=new Blob([c],{type:"application/json"});!1===(null===(o=null===(i=null==d?void 0:d.navigator)||void 0===i?void 0:i.sendBeacon)||void 0===o?void 0:o.call(i,h,e))&&this.loggerProvider.warn("sendBeacon failed to queue session replay payload")}catch(e){}}addToQueue(...e){e.filter(e=>this.killedSessions.has(e.sessionId)?(this.completeRequest({context:e,err:bt}),!1):e.attempts<(e.flushMaxRetries||0)?(e.attempts+=1,!0):(this.completeRequest({context:e,err:vt}),!1)).forEach(e=>{this.queue=this.queue.concat(e),this.schedule(0)})}schedule(e){if(this.scheduled)return;const t=this.flushPauseUntilMs-Date.now(),r=t>e?t:e;t>0&&(this.mergeOnNextFlush=!0),this.scheduled=setTimeout(()=>{this.flush(!0).then(()=>{this.queue.length>0&&this.schedule(e)})},r)}flush(e=!1){return a(this,void 0,void 0,function*(){let t=this.queue;this.queue=[],this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),this.mergeOnNextFlush?(this.mergeOnNextFlush=!1,this.coalesceNextFlush=!1,t=this.mergeQueueAfterThrottle(t)):this.coalesceNextFlush&&(this.coalesceNextFlush=!1,t=this.mergeDrainBacklog(t));for(const r of t)yield this.send(r,e)})}mergeQueueAfterThrottle(e){const t=this.coalesceByIdentity(e);return t.length<e.length&&!this.mergeLogFiredThisPause&&(this.mergeLogFiredThisPause=!0,this.loggerProvider.log(`Session replay throttle pause ended; merged ${e.length} queued batches into ${t.length} request(s)`)),t}mergeDrainBacklog(e){const t=this.coalesceByIdentity(e);return t.length<e.length&&this.loggerProvider.log(`Session replay coalesced ${e.length} persisted page-load backlog batches into ${t.length} request(s)`),t}coalesceByIdentity(e){var t,r,n,s,i,o,l;if(e.length<=1)return e;const c=new Map;for(const a of e){const e=[a.sessionId,null!==(t=a.deviceId)&&void 0!==t?t:"",null!==(r=a.apiKey)&&void 0!==r?r:"",a.type,null!==(n=a.serverZone)&&void 0!==n?n:"",a.sampleRate,null!==(i=null===(s=a.version)||void 0===s?void 0:s.type)&&void 0!==i?i:"",null!==(l=null===(o=a.version)||void 0===o?void 0:o.version)&&void 0!==l?l:""].join("|"),u=c.get(e);u?u.push(a):c.set(e,[a])}const u=[];for(const e of c.values()){if(1===e.length){u.push(e[0]);continue}let t=null,r=0;const n=()=>{t&&u.push(t),t=null,r=0};for(const s of e){const e=ut(s.events);if(null===t){t=Object.assign(Object.assign({},s),{events:[...s.events],attempts:0}),r=e;continue}if(r+e>4e6){n(),t=Object.assign(Object.assign({},s),{events:[...s.events],attempts:0}),r=e;continue}const i=t.onComplete,o=s.onComplete;t.events=t.events.concat(s.events),r+=e,t.onComplete=()=>a(this,void 0,void 0,function*(){yield Promise.allSettled([i(),o()])})}n()}return u}send(e,t=!0){return a(this,void 0,void 0,function*(){if(this.killedSessions.has(e.sessionId))return this.completeRequest({context:e,err:bt});const r=e.apiKey;if(!r)return this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"});const n=e.deviceId;if(!n)return this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"});const s=this.payloadBatcher({version:1,events:e.events});if(0===s.events.length)return void this.completeRequest({context:e});const{worker:i}=this;return i?this.sendViaWorker(i,e,s,t):this.sendOnMainThread(r,n,e,s,t)})}sendViaWorker(e,t,r,n){return a(this,void 0,void 0,function*(){const s=""+ ++this.sendIdCounter;return new Promise(i=>{var o;const a=this.sendTimeoutMs>0?setTimeout(()=>{const e=this.pendingWorkerRequests.get(s);e&&(this.pendingWorkerRequests.delete(s),this.rememberTimedOutRequest(s,e.context),this.loggerProvider.warn(`Session replay worker send timed out after ${this.sendTimeoutMs}ms; leaving events for retry`),e.resolve())},this.sendTimeoutMs):void 0;this.pendingWorkerRequests.set(s,{context:t,resolve:i,timeout:a}),e.postMessage({type:"send",id:s,payload:r,useRetry:n,useCustomTransport:!!this.handleSendEvents,context:{apiKey:t.apiKey,deviceId:t.deviceId,sessionId:t.sessionId,events:t.events,eventType:t.type,flushMaxRetries:null!==(o=t.flushMaxRetries)&&void 0!==o?o:0,sampleRate:t.sampleRate,serverZone:t.serverZone,trackServerUrl:this.trackServerUrl,version:t.version,currentUrl:ze(),sdkVersion:St,enableTransportCompression:this.enableTransportCompression,sendTimeoutMs:this.sendTimeoutMs}})})})}rememberTimedOutRequest(e,t){if(this.timedOutWorkerRequests.set(e,t),this.timedOutWorkerRequests.size>256)for(const e of this.timedOutWorkerRequests.keys()){this.timedOutWorkerRequests.delete(e);break}}handleDelegatedFetch(e,t){var r,n,s;return a(this,void 0,void 0,function*(){const{requestId:i,url:o,method:a,headers:l,body:c,keepalive:u}=t;try{let t;this.handleSendEvents?t=yield this.handleSendEvents({url:o,method:a,headers:l,body:c,keepalive:u}):(this.loggerProvider.warn("Delegated session replay fetch received without a custom transport configured; falling back to built-in fetch."),t=yield fetch(o,{method:a,headers:l,body:c,keepalive:u}));const h=t.status;let d=null,p="";if(h>=200&&h<300&&(d=null!==(s=null===(n=null===(r=t.headers)||void 0===r?void 0:r.get)||void 0===n?void 0:n.call(r,Ee))&&void 0!==s?s:null),413===h)try{p=yield t.text()}catch(e){}this.loggerProvider.debug(`Delegated session replay fetch (request ${i}) returned status ${h}.`),e.postMessage({type:"fetch-response",requestId:i,status:h,skipHeader:d,body:p})}catch(t){this.loggerProvider.debug(`Delegated session replay fetch (request ${i}) failed:`,t),e.postMessage({type:"fetch-response",requestId:i,status:0,skipHeader:null,body:String(t),error:!0})}})}sendOnMainThread(e,t,r,n,s){var i,o,l,c,u,h,d;return a(this,void 0,void 0,function*(){const p=ze(),f=St,g=r.sampleRate,y=new URLSearchParams({device_id:t,session_id:`${r.sessionId}`,type:`${r.type}`}),v=`${null!==(o=null===(i=r.version)||void 0===i?void 0:i.type)&&void 0!==o?o:"standalone"}/${null!==(c=null===(l=r.version)||void 0===l?void 0:l.version)&&void 0!==c?c:f}`;try{const t=JSON.stringify(n),i=m(),o=this.enableTransportCompression&&i&&"CompressionStream"in i?yield function(e,t){return a(this,void 0,void 0,function*(){try{const r=new(0,t.CompressionStream)("gzip"),n=r.writable.getWriter(),s=r.readable.getReader(),i=[],o=(()=>a(this,void 0,void 0,function*(){for(;;){const{done:e,value:t}=yield s.read();if(e)break;i.push(t)}}))();yield n.write((new TextEncoder).encode(e)),yield n.close(),yield o;const l=i.reduce((e,t)=>e+t.length,0),c=new Uint8Array(l);let u=0;for(const e of i)c.set(e,u),u+=e.length;return c}catch(e){return null}})}(t,i):null,l=o?o.byteLength:ct(t),c=new AbortController,S=Object.assign({"Content-Type":"application/json",Accept:"*/*",Authorization:`Bearer ${e}`,"X-Client-Version":f,"X-Client-Library":v,"X-Client-Url":p.substring(0,1e3),"X-Client-Sample-Rate":`${g}`,"X-Sampling-Hash-Alg":"xxhash32"},o?{"Content-Encoding":"gzip"}:{}),C=null!=o?o:t,k=l<=65536,x={headers:S,body:C,method:"POST",keepalive:k,signal:c.signal},O=`${$e(r.serverZone,this.trackServerUrl)}?${y.toString()}`;if(0===n.events.length)return void this.completeRequest({context:r});const I=this.sendTimeoutMs>0?setTimeout(()=>{c.abort()},this.sendTimeoutMs):void 0;let E;try{E=this.handleSendEvents?yield(w=this.handleSendEvents({url:O,method:"POST",headers:S,body:C,keepalive:k}),b=c.signal,new Promise((e,t)=>{const r=()=>{const e=new Error("Custom session replay transport aborted by send timeout");e.name="AbortError",t(e)};b.addEventListener("abort",r,{once:!0}),w.then(t=>{b.removeEventListener("abort",r),e(t)},e=>{b.removeEventListener("abort",r),t(e)})})):yield fetch(O,x)}finally{I&&clearTimeout(I)}if(null===E)return void this.completeRequest({context:r,err:"Unexpected error occurred"});if(E.status>=200&&E.status<300){const e=null!==(d=null===(h=null===(u=E.headers)||void 0===u?void 0:u.get)||void 0===h?void 0:h.call(u,Ee))&&void 0!==d?d:null;this.applyServerDirective(r.sessionId,e)}if(s){let e="";if(413===E.status)try{e=yield E.text()}catch(e){}yield this.handleReponse(E.status,r,e)}else{let e="";try{e=JSON.stringify(E.body,null,2)}catch(e){}this.completeRequest({context:r,success:`${E.status}: ${e}`})}}catch(e){!!e&&"object"==typeof e&&"AbortError"===e.name&&s?yield this.handleOtherResponse(r):this.completeRequest({context:r,err:e})}var w,b})}handleReponse(e,t,r=""){return a(this,void 0,void 0,function*(){switch((new W).buildStatus(e)){case d.Success:this.handleSuccessResponse(t);break;case d.Failed:case d.Timeout:case d.RateLimit:yield this.handleOtherResponse(t);break;case d.PayloadTooLarge:this.handlePayloadTooLargeResponse(t,ke.test(r));break;default:if(499===e){yield this.handleOtherResponse(t);break}this.completeRequest({context:t,err:"Network error occurred, event batch rejected"})}})}handlePayloadTooLargeResponse(e,t){const r=t?"WAF (compressed payload too large)":"server (event too large)",n=Math.round(e.events.reduce((e,t)=>e+t.length,0)/Ie);if(!t)return void this.completeRequest({context:e,err:`Session replay event batch dropped: ${r} rejected payload (${e.events.length} events, ${n} KB) — not retrying non-WAF 413`});if(1===e.events.length)return void this.completeRequest({context:e,err:`Session replay event dropped: single event (${n} KB, 1 event) rejected by ${r} — cannot split further`});this.loggerProvider.warn(`Session replay event batch rejected by ${r} (${e.events.length} events, ${n} KB total) — splitting and retrying`),e.onComplete();const s=()=>Promise.resolve(),i=Math.floor(e.events.length/2);this.sendEventsList(Object.assign(Object.assign({},e),{events:e.events.slice(0,i),onComplete:s})),this.sendEventsList(Object.assign(Object.assign({},e),{events:e.events.slice(i),onComplete:s}))}handleSuccessResponse(e){const t=Math.round(ut(e.events)/Ie);this.completeRequest({context:e,success:`Session replay event batch tracked successfully for session id ${e.sessionId}, size of events: ${t} KB`})}handleOtherResponse(e){return a(this,void 0,void 0,function*(){const t=Math.random()*e.attempts*this.retryTimeout;e.attempts++,e.attempts>(e.flushMaxRetries||0)?this.completeRequest({context:e,err:vt}):(yield new Promise(e=>setTimeout(e,t)),yield this.send(e,!0))})}completeRequest({context:e,err:t,success:r}){e.onComplete(),t?this.loggerProvider.warn(t):r&&this.loggerProvider.log(r)}applyServerDirective(e,t){if(null===t)return this.flushPauseUntilMs=0,void(this.mergeLogFiredThisPause=!1);if("429"===t){const e=this.flushPauseUntilMs>Date.now();return this.flushPauseUntilMs=Date.now()+6e4,void(e||this.loggerProvider.log("Session replay throttled by server; pausing flush schedule for 60s"))}"4005"!==t&&"4004"!==t||this.killSession(e,t)}killSession(e,t){if(this.killedSessions.has(e))return;if(this.killedSessions.add(e),this.killedSessions.size>256)for(const e of this.killedSessions){this.killedSessions.delete(e);break}this.loggerProvider.log(`Session replay capture stopped for session ${e} by server directive ${t}; remaining events will be dropped`);const r=[];for(const t of this.queue)t.sessionId===e?this.completeRequest({context:t,err:bt}):r.push(t);this.queue=r}}const kt=(e,t)=>t.some(t=>e instanceof t);let xt,Ot;const It=new WeakMap,Et=new WeakMap,Mt=new WeakMap;let Rt={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return It.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Lt(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Pt(e){Rt=e(Rt)}function At(e){return(Ot||(Ot=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Nt(this),t),Lt(this.request)}:function(...t){return Lt(e.apply(Nt(this),t))}}function Tt(e){return"function"==typeof e?At(e):(e instanceof IDBTransaction&&function(e){if(It.has(e))return;const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",i),e.removeEventListener("abort",i)},s=()=>{t(),n()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",s),e.addEventListener("error",i),e.addEventListener("abort",i)});It.set(e,t)}(e),kt(e,xt||(xt=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Rt):e)}function Lt(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{t(Lt(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",i)});return Mt.set(t,e),t}(e);if(Et.has(e))return Et.get(e);const t=Tt(e);return t!==e&&(Et.set(e,t),Mt.set(t,e)),t}const Nt=e=>Mt.get(e);function Ft(e,t,{blocked:r,upgrade:n,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=Lt(o);return n&&o.addEventListener("upgradeneeded",e=>{n(Lt(o.result),e.oldVersion,e.newVersion,Lt(o.transaction),e)}),r&&o.addEventListener("blocked",e=>r(e.oldVersion,e.newVersion,e)),a.then(e=>{i&&e.addEventListener("close",()=>i()),s&&e.addEventListener("versionchange",e=>s(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}const _t=["get","getKey","getAll","getAllKeys","count"],Dt=["put","add","delete","clear"],Bt=new Map;function jt(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Bt.get(t))return Bt.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=Dt.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!_t.includes(r))return;const i=async function(e,...t){const i=this.transaction(e,s?"readwrite":"readonly");let o=i.store;return n&&(o=o.index(t.shift())),(await Promise.all([o[r](...t),s&&i.done]))[0]};return Bt.set(t,i),i}Pt(e=>({...e,get:(t,r,n)=>jt(t,r)||e.get(t,r,n),has:(t,r)=>!!jt(t,r)||e.has(t,r)}));const Ut=["continue","continuePrimaryKey","advance"],$t={},zt=new WeakMap,Wt=new WeakMap,qt={get(e,t){if(!Ut.includes(t))return e[t];let r=$t[t];return r||(r=$t[t]=function(...e){zt.set(this,Wt.get(this)[t](...e))}),r}};async function*Vt(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,qt);for(Wt.set(r,t),Mt.set(r,Nt(t));t;)yield r,t=await(zt.get(r)||t.continue()),zt.delete(r)}function Gt(e,t){return t===Symbol.asyncIterator&&kt(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&kt(e,[IDBIndex,IDBObjectStore])}Pt(e=>({...e,get:(t,r,n)=>Gt(t,r)?Vt:e.get(t,r,n),has:(t,r)=>Gt(t,r)||e.has(t,r)}));class Ht{get timeAtLastSplit(){return this._timeAtLastSplit}constructor(e){var t,r,n;this.minInterval=xe,this.maxInterval=Oe,this.maxPersistedEventsSize=6e6,this._timeAtLastSplit=Date.now(),this.eventsContentBytes=new WeakMap,this.sequenceContentBytes=new Map,this.shouldSplitEventsList=(e,t)=>{const r=this.getEventsArraySize(e),n=this.maxPersistedEventsSize-r;let s=t.length>=n;return!s&&3*t.length>=n&&(s=ct(t)>=n),!!s||!!(Date.now()-this.timeAtLastSplit>this.interval&&e.length)&&(this.interval=Math.min(this.maxInterval,this.interval+this.minInterval),this._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,this.interval=this.minInterval}isPrefixOf(e,t){return!(t.length<e.length)&&(0===e.length||t[e.length-1]===e.tail)}measureContentBytes(e,t){if(e&&e.length===t.length&&this.isPrefixOf(e,t))return e;let r=0,n=0;e&&this.isPrefixOf(e,t)&&(r=e.contentBytes,n=e.length);for(let e=n;e<t.length;e++)r+=ct(t[e]);return{length:t.length,contentBytes:r,tail:t.length>0?t[t.length-1]:void 0}}getEventsContentBytes(e){const t=this.measureContentBytes(this.eventsContentBytes.get(e),e);return this.eventsContentBytes.set(e,t),t.contentBytes}getEventsArraySize(e){return this.getEventsContentBytes(e)+(2+Math.max(0,e.length-1)+2*e.length)}recallSequenceContentBytes(e,t){const r=this.sequenceContentBytes.get(e);r&&r.length===t.length&&this.isPrefixOf(r,t)&&this.eventsContentBytes.set(t,r)}rememberSequenceContentBytes(e,t){const r=this.measureContentBytes(this.sequenceContentBytes.get(e),t);this.sequenceContentBytes.set(e,r),this.eventsContentBytes.set(t,r)}forgetSequenceContentBytes(e){this.sequenceContentBytes.delete(e)}}const Jt=(e,t,r)=>{var n;"object"==typeof(n=r)&&null!==n&&"AbortError"===n.name?e.debug(t):e.warn(t)};const Kt="sessionCurrentSequence",Yt="sequencesToSend",Qt=5e3;function Xt(e,t,r){const n=setTimeout(r,t);return e.then(()=>clearTimeout(n),()=>clearTimeout(n)),()=>clearTimeout(n)}const Zt=e=>{let t,r;return e.objectStoreNames.contains(Kt)||(r=e.createObjectStore(Kt,{keyPath:"sessionId"})),e.objectStoreNames.contains(Yt)||(t=e.createObjectStore(Yt,{keyPath:"sequenceId",autoIncrement:!0}),t.createIndex("sessionId","sessionId")),{sequencesStore:t,currentSequenceStore:r}},er=e=>a(void 0,void 0,void 0,function*(){return yield function(e,t,r="IDB operation timed out"){return new Promise((n,s)=>{const i=setTimeout(()=>s(new Error(`${r} after ${t}ms`)),t);e.then(e=>{clearTimeout(i),n(e)},e=>{clearTimeout(i),s(e)})})}(Ft(e,1,{upgrade:Zt}),2e3,"IDB openDB timed out")});class tr extends Ht{maybeLogEmptyFiltered(e){this.emptyFilteredCount++%100==0&&this.loggerProvider.debug(`Filtered empty session replay sequence at ${e} (idb store)`)}constructor(e){var t;super(e),this.consecutiveFailures=0,this.hasTriggeredFallback=!1,this.emptyFilteredCount=0,this.getSequencesToSend=()=>a(this,void 0,void 0,function*(){let e=!1,t=!1;try{const r=[],n=this.db.transaction("sequencesToSend","readwrite");n.done.catch(r=>{e||t||(Jt(this.loggerProvider,`${wt}: ${r}`,r),this.recordFailure())});const s=Xt(n.done,Qt,()=>{e||t||(t=!0,Jt(this.loggerProvider,`${wt}: transaction timed out`),this.recordFailure())});let i=yield n.store.openCursor();for(;i;){const{sessionId:e,events:t}=i.value;0===t.length?(this.maybeLogEmptyFiltered("getSequencesToSend"),yield i.delete()):r.push({events:t,sequenceId:i.key,sessionId:e}),i=yield i.continue()}return this.recordSuccess(),s(),r}catch(r){t||(e=!0,Jt(this.loggerProvider,`${wt}: ${r}`,r),this.recordFailure())}}),this.storeCurrentSequence=e=>a(this,void 0,void 0,function*(){let t=!1,r=!1;try{const n=this.db.transaction([Kt,Yt],"readwrite");n.done.catch(e=>{t||r||(Jt(this.loggerProvider,`${wt}: ${e}`,e),this.recordFailure())});const s=Xt(n.done,Qt,()=>{t||r||(r=!0,Jt(this.loggerProvider,`${wt}: transaction timed out`),this.recordFailure())}),i=yield n.objectStore(Kt).get(e);if(!i||i.tabId&&i.tabId!==this.tabId)return void s();if(0===i.events.length)return this.maybeLogEmptyFiltered("storeCurrentSequence"),void s();const a=yield n.objectStore(Yt).put({sessionId:e,events:i.events,tabId:this.tabId});yield n.objectStore(Kt).put({sessionId:e,events:[],tabId:this.tabId}),this.rememberSequenceContentBytes(e,[]),this.recordSuccess(),s();const{tabId:l}=i,c=o(i,["tabId"]);return Object.assign(Object.assign({},c),{sessionId:e,sequenceId:a})}catch(n){this.forgetSequenceContentBytes(e),r||(t=!0,Jt(this.loggerProvider,`${wt}: ${n}`,n),this.recordFailure())}}),this.addEventToCurrentSequence=(e,t)=>a(this,void 0,void 0,function*(){let r=!1,n=!1;try{const s=this.db.transaction([Kt,Yt],"readwrite");s.done.catch(e=>{r||n||(Jt(this.loggerProvider,`${wt}: ${e}`,e),this.recordFailure())});const i=Xt(s.done,Qt,()=>{r||n||(n=!0,Jt(this.loggerProvider,`${wt}: transaction timed out`),this.recordFailure())}),o=yield s.objectStore(Kt).get(e);if((null==o?void 0:o.tabId)&&o.tabId!==this.tabId){o.events.length>0&&(yield s.objectStore(Yt).put({sessionId:e,events:o.events,tabId:o.tabId}));const r=[t];return yield s.objectStore(Kt).put({sessionId:e,events:r,tabId:this.tabId}),this.rememberSequenceContentBytes(e,r),this.recordSuccess(),void i()}const a=o;if(!a){const r=[t];return yield s.objectStore(Kt).put({sessionId:e,events:r,tabId:this.tabId}),this.rememberSequenceContentBytes(e,r),this.recordSuccess(),void i()}if(this.recallSequenceContentBytes(e,a.events),!this.shouldSplitEventsList(a.events,t)){const r=a.events.concat(t);return yield s.objectStore(Kt).put({sessionId:e,events:r,tabId:this.tabId}),this.rememberSequenceContentBytes(e,r),this.recordSuccess(),void i()}const l=a.events;if(0===l.length){this.maybeLogEmptyFiltered("addEventToCurrentSequence");const r=[t];return yield s.objectStore(Kt).put({sessionId:e,events:r,tabId:this.tabId}),this.rememberSequenceContentBytes(e,r),this.recordSuccess(),void i()}const c=[t];yield s.objectStore(Kt).put({sessionId:e,events:c,tabId:this.tabId}),this.rememberSequenceContentBytes(e,c);const u=yield s.objectStore(Yt).put({sessionId:e,events:l,tabId:this.tabId});return this.recordSuccess(),i(),{events:l,sessionId:e,sequenceId:u}}catch(t){this.forgetSequenceContentBytes(e),n||(r=!0,Jt(this.loggerProvider,`${wt}: ${t}`,t),this.recordFailure())}}),this.storeSendingEvents=(e,t)=>a(this,void 0,void 0,function*(){try{const r=yield this.db.put(Yt,{sessionId:e,events:t,tabId:this.tabId});return this.recordSuccess(),r}catch(e){Jt(this.loggerProvider,`${wt}: ${e}`,e),this.recordFailure()}}),this.cleanUpSessionEventsStore=(e,t)=>a(this,void 0,void 0,function*(){if(t)try{yield this.db.delete(Yt,t),this.recordSuccess()}catch(e){Jt(this.loggerProvider,`${wt}: ${e}`,e),this.recordFailure()}}),this.db=e.db,this.tabId=e.tabId,this.onPersistentFailure=e.onPersistentFailure,this.consecutiveFailureThreshold=null!==(t=e.consecutiveFailureThreshold)&&void 0!==t?t:1}recordFailure(){var e;this.consecutiveFailures++,!this.hasTriggeredFallback&&this.consecutiveFailures>=this.consecutiveFailureThreshold&&(this.hasTriggeredFallback=!0,null===(e=this.onPersistentFailure)||void 0===e||e.call(this))}recordSuccess(){this.consecutiveFailures=0}static new(e,t){var r;return a(this,void 0,void 0,function*(){try{const n="replay"===e?"":`_${e}`,s=`${t.apiKey.substring(0,10)}_amp_session_replay_events${n}`,i=yield er(s),o=null!==(r=t.tabId)&&void 0!==r?r:function(){try{return crypto.randomUUID()}catch(e){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}();return new tr(Object.assign(Object.assign({},t),{db:i,tabId:o}))}catch(e){Jt(t.loggerProvider,`${wt}: ${e}`,e)}})}getCurrentSequenceEvents(e){return a(this,void 0,void 0,function*(){if(e){const t=yield this.db.get("sessionCurrentSequence",e);if(!t)return;if(t.tabId&&t.tabId!==this.tabId)return;return[o(t,["tabId"])]}const t=[];for(const e of yield this.db.getAll("sessionCurrentSequence")){if(e.tabId&&e.tabId!==this.tabId)continue;const r=o(e,["tabId"]);t.push(r)}return t})}}class rr extends Ht{constructor(){super(...arguments),this.finalizedSequences={},this.sequences={},this.sequenceId=0,this.emptyFilteredCount=0}resetCurrentSequence(e){this.sequences[e]=[]}addSequence(e){const t=this.sequenceId++,r=[...this.sequences[e]];return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}}maybeLogEmptyFiltered(e){this.emptyFilteredCount++%100==0&&this.loggerProvider.debug(`Filtered empty session replay sequence at ${e} (in-memory store)`)}getSequencesToSend(){return a(this,void 0,void 0,function*(){const e=[];for(const[t,{sessionId:r,events:n}]of Object.entries(this.finalizedSequences))0!==n.length?e.push({sequenceId:Number(t),sessionId:r,events:n}):(this.maybeLogEmptyFiltered("getSequencesToSend"),delete this.finalizedSequences[Number(t)]);return e})}storeCurrentSequence(e){return a(this,void 0,void 0,function*(){const t=this.sequences[e];if(t){if(0!==t.length)return this.addSequence(e);this.maybeLogEmptyFiltered("storeCurrentSequence")}})}addEventToCurrentSequence(e,t){return a(this,void 0,void 0,function*(){let r;return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(0===this.sequences[e].length?this.maybeLogEmptyFiltered("addEventToCurrentSequence"):r=this.addSequence(e)),this.sequences[e].push(t),r})}storeSendingEvents(e,t){return a(this,void 0,void 0,function*(){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},this.sequenceId++})}cleanUpSessionEventsStore(e,t){return a(this,void 0,void 0,function*(){void 0!==t&&delete this.finalizedSequences[t]})}}const nr=({config:e,minInterval:t,maxInterval:r,maxPersistedEventsSize:n,type:s,payloadBatcher:i,storeType:o,trackDestinationWorkerScript:l,shouldSend:c})=>a(void 0,void 0,void 0,function*(){var u;const h=null!==(u=e.maxSingleEventSizeBytes)&&void 0!==u?u:Ce,d=new Ct(Object.assign(Object.assign({},e),{loggerProvider:e.loggerProvider,payloadBatcher:i,workerScript:l})),p=()=>new rr({loggerProvider:e.loggerProvider,maxInterval:r,minInterval:t,maxPersistedEventsSize:n});let f,m,g=!1;m="idb"===o?yield a(void 0,void 0,void 0,function*(){const i=yield tr.new(s,{loggerProvider:e.loggerProvider,minInterval:t,maxInterval:r,maxPersistedEventsSize:n,apiKey:e.apiKey,onPersistentFailure:()=>{a(void 0,void 0,void 0,function*(){if(!g)return;g=!1,e.loggerProvider.warn("IDB store is experiencing repeated failures; falling back to in-memory event store.");const t=f?yield m.getSequencesToSend():void 0;if(m=p(),t&&f){const e=f;t.forEach(t=>{b({sequenceId:t.sequenceId,events:t.events,sessionId:t.sessionId,deviceId:e})})}})}});return i?(g=!0,i):(e.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),p())}):p();const y=[];let v=0;const w=e=>{if(e<=v)return;const t=Math.min(e-v,y.length);t>0&&(y.splice(0,t),v=e)},b=({events:t,sessionId:r,deviceId:n,sequenceId:i})=>{let o=t;const l=[];for(let e=0;e<t.length;e++){const r=ht(t[e],h);void 0!==r?(0===l.length&&(o=t.slice(0,e)),l.push(r)):o!==t&&o.push(t[e])}l.length>0&&e.loggerProvider.warn(`Dropping ${l.length} oversized event(s) from session replay sequence before send. Sizes: ${l.map(e=>`${Math.round(e/1024)} KB`).join(", ")}. If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support.`),0!==o.length?(e.debugMode&&qe().then(({totalStorageSize:t,percentOfQuota:r,usageDetails:n})=>{e.loggerProvider.debug(`Total storage size: ${t} KB, percentage of quota: ${r}%, usage details: ${n}`)}).catch(()=>{}),d.sendEventsList({events:o,sessionId:r,flushMaxRetries:e.flushMaxRetries,apiKey:e.apiKey,deviceId:n,sampleRate:e.sampleRate,serverZone:e.serverZone,version:e.version,type:s,onComplete:()=>a(void 0,void 0,void 0,function*(){yield m.cleanUpSessionEventsStore(r,i)})})):m.cleanUpSessionEventsStore(r,i).catch(t=>{e.loggerProvider.warn("Failed to clean up session replay events store:",t)})};return{sendCurrentSequenceEvents:({sessionId:t,deviceId:r})=>{if(f=r,c&&!c())return;const n=v+y.length;m.storeCurrentSequence(t).then(e=>{e&&(w(n),b({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:r}))}).catch(t=>{e.loggerProvider.warn("Failed to get current sequence of session replay events for session:",t)})},addEvent:({event:t,sessionId:r,deviceId:n})=>{f=n;const s=!c||c(),i=v+y.length;y.push(t.data),m.addEventToCurrentSequence(r,t.data).then(t=>{if(t){if(!s)return m.cleanUpSessionEventsStore(t.sessionId,t.sequenceId).catch(t=>{e.loggerProvider.warn("Failed to clean up dropped session replay sequence:",t)}),void w(i);w(i),b({sequenceId:t.sequenceId,events:t.events,sessionId:t.sessionId,deviceId:n})}}).catch(t=>{e.loggerProvider.warn("Failed to add event to session replay capture:",t)})},sendStoredEvents:({deviceId:t})=>a(void 0,void 0,void 0,function*(){f=t;const r=yield m.getSequencesToSend();(null==r?void 0:r.length)&&(e.loggerProvider.log(`Draining ${r.length} stored sequence(s) from previous session.`),r.length>1&&d.markCoalesceNextFlush(),r.forEach(e=>{b({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}))}),flush:function(e=!1){return a(this,void 0,void 0,function*(){return d.flush(e)})},getBeaconEvents:()=>[...y],dropPendingBeaconEvents:()=>{w(v+y.length)},trackDestination:d}});class sr{constructor(...e){const t=new Map;e.forEach(e=>{t.set(e.name,e.manager)}),this.managers=t}sendStoredEvents(e){return a(this,void 0,void 0,function*(){const t=[];this.managers.forEach(r=>{t.push(r.sendStoredEvents(e))}),yield Promise.all(t)})}addEvent({sessionId:e,event:t,deviceId:r}){var n;null===(n=this.managers.get(t.type))||void 0===n||n.addEvent({sessionId:e,event:t,deviceId:r})}sendCurrentSequenceEvents({sessionId:e,deviceId:t}){this.managers.forEach(r=>{r.sendCurrentSequenceEvents({sessionId:e,deviceId:t})})}flush(e){return a(this,void 0,void 0,function*(){const t=[];this.managers.forEach(r=>{t.push(r.flush(e))}),yield Promise.all(t)})}}let ir,or,ar;function lr(e,t){if(ar=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";const r={root:document.body,idName:e=>!0,className:e=>!0,tagName:e=>!0,attr:(e,t)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};ir=Object.assign(Object.assign({},r),t),or=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(ir.root,r);let n=cr(e,"all",()=>cr(e,"two",()=>cr(e,"one",()=>cr(e,"none"))));if(n){const t=Or(Ir(n,e));return t.length>0&&(n=t[0]),hr(n)}throw new Error("Selector was not found.")}function cr(e,t,r){let n=null,s=[],i=e,o=0;for(;i;){const e=(new Date).getTime()-ar.getTime();if(void 0!==ir.timeoutMs&&e>ir.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${e}ms`);let a=Cr(fr(i))||Cr(...mr(i))||Cr(...gr(i))||Cr(yr(i))||[vr()];const l=wr(i);if("all"==t)l&&(a=a.concat(a.filter(Sr).map(e=>br(e,l))));else if("two"==t)a=a.slice(0,1),l&&(a=a.concat(a.filter(Sr).map(e=>br(e,l))));else if("one"==t){const[e]=a=a.slice(0,1);l&&Sr(e)&&(a=[br(e,l)])}else"none"==t&&(a=[vr()],l&&(a=[br(a[0],l)]));for(let e of a)e.level=o;if(s.push(a),s.length>=ir.seedMinLength&&(n=ur(s,r),n))break;i=i.parentElement,o++}return n||(n=ur(s,r)),!n&&r?r():n}function ur(e,t){const r=Or(xr(e));if(r.length>ir.threshold)return t?t():null;for(let e of r)if(pr(e))return e;return null}function hr(e){let t=e[0],r=t.name;for(let n=1;n<e.length;n++){const s=e[n].level||0;r=t.level===s-1?`${e[n].name} > ${r}`:`${e[n].name} ${r}`,t=e[n]}return r}function dr(e){return e.map(e=>e.penalty).reduce((e,t)=>e+t,0)}function pr(e){const t=hr(e);switch(or.querySelectorAll(t).length){case 0:throw new Error(`Can't select any node with this selector: ${t}`);case 1:return!0;default:return!1}}function fr(e){const t=e.getAttribute("id");return t&&ir.idName(t)?{name:"#"+CSS.escape(t),penalty:0}:null}function mr(e){const t=Array.from(e.attributes).filter(e=>ir.attr(e.name,e.value));return t.map(e=>({name:`[${CSS.escape(e.name)}="${CSS.escape(e.value)}"]`,penalty:.5}))}function gr(e){return Array.from(e.classList).filter(ir.className).map(e=>({name:"."+CSS.escape(e),penalty:1}))}function yr(e){const t=e.tagName.toLowerCase();return ir.tagName(t)?{name:t,penalty:2}:null}function vr(){return{name:"*",penalty:3}}function wr(e){const t=e.parentNode;if(!t)return null;let r=t.firstChild;if(!r)return null;let n=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&n++,r!==e);)r=r.nextSibling;return n}function br(e,t){return{name:e.name+`:nth-child(${t})`,penalty:e.penalty+1}}function Sr(e){return"html"!==e.name&&!e.name.startsWith("#")}function Cr(...e){const t=e.filter(kr);return t.length>0?t:null}function kr(e){return null!=e}function*xr(e,t=[]){if(e.length>0)for(let r of e[0])yield*xr(e.slice(1,e.length),t.concat(r));else yield t}function Or(e){return[...e].sort((e,t)=>dr(e)-dr(t))}function*Ir(e,t,r={counter:0,visited:new Map}){if(e.length>2&&e.length>ir.optimizedMinLength)for(let n=1;n<e.length-1;n++){if(r.counter>ir.maxNumberOfTries)return;r.counter+=1;const s=[...e];s.splice(n,1);const i=hr(s);if(r.visited.has(i))return;pr(s)&&Er(s,t)&&(yield s,r.visited.set(i,!0),yield*Ir(s,t,r))}}function Er(e,t){return or.querySelector(hr(e))===t}const Mr=({version:e,events:t})=>{const r=[];return t.forEach(e=>{const t=JSON.parse(e);t.count=1,"click"===t.type&&r.push(t)}),{version:e,events:r}},Rr=({version:e,events:t})=>{const r=[];t.forEach(e=>{const t=JSON.parse(e);"click"===t.type&&r.push(t)});const n=r.reduce((e,t)=>{const{x:r,y:n,selector:s,timestamp:i}=t,o=i-i%36e5,a=`${r}:${n}:${null!=s?s:""}:${o}`;return e[a]?e[a].count+=1:e[a]=Object.assign(Object.assign({},t),{timestamp:o,count:1}),e},{});return{version:e,events:Object.values(n)}};class Pr{constructor(e,t){this.createHook=({eventsManager:e,sessionId:t,deviceIdFn:r,mirror:n,ugcFilterRules:s,performanceOptions:i})=>o=>{if(o.type!==tt.Click)return;const a=m();if(!a)return;const{location:l,innerHeight:c,innerWidth:u}=a;if(!l)return;const{x:h,y:d}=o;if(void 0===h||void 0===d)return;const p=n.getNode(o.id);let f;if(p)try{f=lr(p,i)}catch(e){this.logger.debug("error resolving selector from finder")}const g=We(l.href,s),y={x:h+this.scrollWatcher.currentScrollX,y:d+this.scrollWatcher.currentScrollY,selector:f,viewportHeight:c,viewportWidth:u,pageUrl:g,timestamp:Date.now(),type:"click"},v=r();v&&e.addEvent({sessionId:t,event:{type:"interaction",data:JSON.stringify(y)},deviceId:v})},this.logger=e,this.scrollWatcher=t}}function Ar(){const e=m();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function Tr(){const e=m();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}class Lr{constructor(e,t){const r=m();r&&r.navigator&&"function"==typeof r.navigator.sendBeacon?this.sendBeacon=(e,t)=>{try{if(r.navigator.sendBeacon(e,JSON.stringify(t)))return!0}catch(e){}return!1}:this.sendBeacon=()=>!1,this.sendXhr=(e,t)=>{const r=new XMLHttpRequest;return r.open("POST",e,!0),r.setRequestHeader("Accept","*/*"),r.send(JSON.stringify(t)),!0},this.basePageUrl=$e(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e,this.handleSendEvents=t.handleSendEvents,this.loggerProvider=t.loggerProvider}send(e,t){var r;const{sessionId:n,type:s}=this.context;if(this.handleSendEvents){const i=new URLSearchParams({device_id:e,session_id:String(n),type:String(s)}),o=`${this.basePageUrl}?${i.toString()}`,a={"Content-Type":"application/json",Accept:"*/*",Authorization:`Bearer ${this.apiKey}`};try{this.handleSendEvents({url:o,method:"POST",headers:a,body:JSON.stringify(t),keepalive:!0}).catch(e=>{var t;null===(t=this.loggerProvider)||void 0===t||t.warn("Custom transport failed to send session replay interaction beacon:",e)})}catch(e){null===(r=this.loggerProvider)||void 0===r||r.warn("Custom transport threw while sending session replay interaction beacon:",e)}return}const i=new URLSearchParams({device_id:e,session_id:String(n),type:String(s),api_key:this.apiKey}),o=`${this.basePageUrl}?${i.toString()}`;this.sendBeacon(o,t)||this.sendXhr(o,t)}}class Nr{static default(e,t){return new Nr(new Lr(e,t),t)}constructor(e,t){this.timestamp=Date.now(),this.hook=e=>{this.update(e)},this.send=e=>t=>{var r,n,s,i;const o=e(),a=m();if(a&&o){const e=null!==(r=a.scrollX)&&void 0!==r?r:0,t=null!==(n=a.scrollY)&&void 0!==n?n:0;(e>0||t>0)&&this.update({id:1,x:e,y:t}),this.transport.send(o,{version:1,events:[{maxScrollX:this._maxScrollX,maxScrollY:this._maxScrollY,maxScrollWidth:this._maxScrollWidth,maxScrollHeight:this._maxScrollHeight,viewportHeight:Ar(),viewportWidth:Tr(),pageUrl:We(a.location.href,null!==(i=null===(s=this.config.interactionConfig)||void 0===s?void 0:s.ugcFilterRules)&&void 0!==i?i:[]),timestamp:this.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=Tr(),this._maxScrollHeight=Ar(),this.config=t,this.transport=e}get maxScrollX(){return this._maxScrollX}get maxScrollY(){return this._maxScrollY}get maxScrollWidth(){return this._maxScrollWidth}get maxScrollHeight(){return this._maxScrollHeight}get currentScrollX(){return this._currentScrollX}get currentScrollY(){return this._currentScrollY}update(e){const t=Date.now();if(this._currentScrollX=e.x,this._currentScrollY=e.y,e.x>this._maxScrollX){const r=Tr();this._maxScrollX=e.x;const n=e.x+r;n>this._maxScrollWidth&&(this._maxScrollWidth=n),this.timestamp=t}if(e.y>this._maxScrollY){const r=Ar();this._maxScrollY=e.y;const n=e.y+r;n>this._maxScrollHeight&&(this._maxScrollHeight=n),this.timestamp=t}}}class Fr{constructor({sessionId:e,deviceId:t}){this.deviceId=t,this.sessionId=e,e&&t&&(this.sessionReplayId=((e,t)=>`${t}/${e}`)(e,t))}}const _r=864e5,Dr=e=>`AMP_SR_START_${e.substring(0,10)}_`,Br=(e,t)=>`${Dr(e)}${t}`,jr=()=>{try{const e=m();return null==e?void 0:e.localStorage}catch(e){return}};const Ur=new class{constructor(){this.dbs={},this.createStore=e=>a(this,void 0,void 0,function*(){return yield Ft(e,1,{upgrade:e=>{e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})}),this.openOrCreateDB=e=>a(this,void 0,void 0,function*(){if(this.dbs&&this.dbs[e])return this.dbs[e];const t=`${e.substring(0,10)}_amp_session_replay_targeting`,r=yield this.createStore(t);return this.dbs[e]=r,r}),this.getTargetingMatchForSession=({loggerProvider:e,apiKey:t,sessionId:r})=>a(this,void 0,void 0,function*(){try{const e=yield this.openOrCreateDB(t),n=String(r),s=yield e.get("sessionTargetingMatch",n);return null==s?void 0:s.targetingMatch}catch(t){Jt(e,`Failed to get targeting match for session id ${r}: ${t}`,t)}}),this.storeTargetingMatchForSession=({loggerProvider:e,apiKey:t,sessionId:r,targetingMatch:n})=>a(this,void 0,void 0,function*(){try{const e=yield this.openOrCreateDB(t),s=String(r);return yield e.put("sessionTargetingMatch",{targetingMatch:n,sessionId:s,lastUpdated:Date.now()})}catch(t){Jt(e,`Failed to store targeting match for session id ${r}: ${t}`,t)}}),this.clearStoreOfOldSessions=({loggerProvider:e,apiKey:t,currentSessionId:r})=>a(this,void 0,void 0,function*(){try{const e=yield this.openOrCreateDB(t),n=String(r),s=e.transaction("sessionTargetingMatch","readwrite"),i=yield s.store.getAll();for(let e=0;e<i.length;e++){const t=i[e],r=Date.now()-t.lastUpdated;t.sessionId!==n&&r>1728e5&&(yield s.store.delete(t.sessionId))}yield s.done}catch(t){Jt(e,`Failed to clear old targeting matches for sessions: ${t}`,t)}})}},$r=2654435761,zr=2246822519,Wr=3266489917,qr=374761393;function Vr(e,t){return(e<<t|e>>>32-t)>>>0}function Gr(e,t){return e=Vr(e=e+Math.imul(t,zr)>>>0,13),e=Math.imul(e,$r)>>>0}function Hr(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Jr(e,t=0){const r=function(e){const t=[];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>=55296&&n<=56319&&r+1<e.length){const t=e.charCodeAt(r+1);t>=56320&&t<=57343&&(n=t-56320+(n-55296<<10)+65536,r++)}n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<65536?t.push(224|n>>12,128|n>>6&63,128|63&n):t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n)}return new Uint8Array(t)}(e),n=r.length;let s,i=0;if(n>=16){let e=t+$r+zr>>>0,o=t+zr>>>0,a=t>>>0,l=t-$r>>>0;for(;i<=n-16;)e=Gr(e,Hr(r,i)),i+=4,o=Gr(o,Hr(r,i)),i+=4,a=Gr(a,Hr(r,i)),i+=4,l=Gr(l,Hr(r,i)),i+=4;s=Vr(e,1)+Vr(o,7)+Vr(a,12)+Vr(l,18)>>>0}else s=t+qr>>>0;for(s=s+n>>>0;i<=n-4;)s=s+Math.imul(Hr(r,i),Wr)>>>0,s=Math.imul(Vr(s,17),668265263)>>>0,i+=4;for(;i<n;)s=s+Math.imul(r[i],qr)>>>0,s=Math.imul(Vr(s,11),$r)>>>0,i++;return s^=s>>>15,s=Math.imul(s,zr)>>>0,s^=s>>>13,s=Math.imul(s,Wr)>>>0,s^=s>>>16,s>>>0}const Kr="__amplitude_url_tracking_patched__",Yr=new WeakMap;function Qr(e,t,r={}){if(!(null==e?void 0:e.location))return()=>{};const{enablePolling:n=!1,pollingInterval:s=ye}=r;if(n){const r=()=>{var t;return null!==(t=e.location.href)&&void 0!==t?t:""};let n=r();const i=e.setInterval(()=>{const e=r();e!==n&&(n=e,t(e))},s);return()=>{null!=i&&e.clearInterval(i)}}let i=Yr.get(e);if(!i){let t;const r=new Set,n=()=>{var t;return null!==(t=e.location.href)&&void 0!==t?t:""},s=()=>{const e=n();void 0!==t&&e===t||(t=e,r.forEach(t=>t(e)))},o=e=>{const t=function(...t){const r=e.apply(this,t);return s(),r};return t[Kr]=!0,t},a=e.history;if(null==a?void 0:a.pushState){const e=Reflect.get(a,"pushState");e[Kr]||(a.pushState=o(e))}if(null==a?void 0:a.replaceState){const e=Reflect.get(a,"replaceState");e[Kr]||(a.replaceState=o(e))}i={callbacks:r,notify:s,onPopStateOrHashChange:()=>s(),listenersAttached:!1},Yr.set(e,i)}const o=i;return o.listenersAttached||(e.addEventListener("popstate",o.onPopStateOrHashChange),e.addEventListener("hashchange",o.onPopStateOrHashChange),o.listenersAttached=!0),o.callbacks.add(t),()=>{o.callbacks.delete(t),0===o.callbacks.size&&o.listenersAttached&&(e.removeEventListener("popstate",o.onPopStateOrHashChange),e.removeEventListener("hashchange",o.onPopStateOrHashChange),o.listenersAttached=!1)}}function Xr(e={}){return{name:"amplitude/url-tracking@1",observer(t,r,n){var s,i,o;const a=Object.assign(Object.assign({},e),n),l=a.ugcFilterRules||[],c=null!==(s=a.enablePolling)&&void 0!==s&&s,u=null!==(i=a.pollingInterval)&&void 0!==i?i:ye,h=null!==(o=a.captureDocumentTitle)&&void 0!==o&&o;if(!r)return()=>{};let d;const p=()=>r.location&&r.location.href||"",f=()=>{const e=p();if(void 0===d||e!==d){d=e;const n=(()=>{const{innerHeight:e,innerWidth:t,document:n}=r,s=p();let i="";return h&&(i=(null==n?void 0:n.title)||""),{href:l.length>0?We(s,l):s,title:i,viewportHeight:e,viewportWidth:t,type:"url-change-event"}})();t(n)}},m=Qr(r,()=>f(),c?{enablePolling:!0,pollingInterval:u}:{});return f(),()=>m()},options:e}}class Zr{constructor(){this.pendingLoadListeners=new Map}start(){var e;null===(e=this.mutationObserver)||void 0===e||e.disconnect();m()&&(this.sendToAllIframes({type:Me,action:"start"}),this.mutationObserver=new MutationObserver(e=>{for(const t of e){for(const e of Array.from(t.addedNodes))e instanceof HTMLIFrameElement?this.sendToIframeAfterLoad(e):e instanceof Element&&e.querySelectorAll("iframe").forEach(e=>{this.sendToIframeAfterLoad(e)});for(const e of Array.from(t.removedNodes))if(e instanceof HTMLIFrameElement){const t=this.pendingLoadListeners.get(e);t&&(e.removeEventListener("load",t),this.pendingLoadListeners.delete(e))}}}),this.mutationObserver.observe(document.documentElement,{childList:!0,subtree:!0}))}stop(){var e;null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=void 0,this.pendingLoadListeners.forEach((e,t)=>{t.removeEventListener("load",e)}),this.pendingLoadListeners.clear(),this.sendToAllIframes({type:Me,action:"stop"})}sendToIframeAfterLoad(e){const t=()=>{this.pendingLoadListeners.delete(e),this.sendToIframe(e,{type:Me,action:"start"})};this.pendingLoadListeners.set(e,t),e.addEventListener("load",t,{once:!0})}sendToAllIframes(e){document.querySelectorAll("iframe").forEach(t=>this.sendToIframe(t,e))}sendToIframe(e,t){var r;try{null===(r=e.contentWindow)||void 0===r||r.postMessage(t,"*")}catch(e){}}}class en{constructor(){this.focusLeftWindow=!1}noteBlur(){this.focusLeftWindow=!1,this.cancelFocusDestinationCheck();const e=m();this.scheduleFocusInspect(e,()=>{var t;const r=null===(t=null==e?void 0:e.document)||void 0===t?void 0:t.activeElement;"IFRAME"!==(null==r?void 0:r.tagName)?(this.releaseFocusedFrame(),this.focusLeftWindow=!0):this.watchFocusedFrame(r)})}onDocumentHidden(){this.releaseFocusedFrame()}onDocumentVisible(){this.focusLeftWindow=!1,this.cancelFocusDestinationCheck(),this.releaseFocusedFrame()}consumeArrivedFromOutside(){var e,t;const r=this.focusLeftWindow&&"visible"===(null===(t=null===(e=m())||void 0===e?void 0:e.document)||void 0===t?void 0:t.visibilityState);return this.focusLeftWindow=!1,this.releaseFocusedFrame(),r}stop(){this.focusLeftWindow=!1,this.cancelFocusDestinationCheck(),this.releaseFocusedFrame()}noteFrameBlur(){this.cancelFocusDestinationCheck();const e=m();this.scheduleFocusInspect(e,()=>{var t;const r=null===(t=null==e?void 0:e.document)||void 0===t?void 0:t.activeElement,n=null==e?void 0:e.document;if("function"==typeof(null==n?void 0:n.hasFocus)&&n.hasFocus()||"IFRAME"!==(null==r?void 0:r.tagName))return void this.releaseFocusedFrame();const s=this.focusHolder(r);s?this.watchFocusedFrame(s):this.focusLeftWindow=!0})}focusHolder(e,t){if(null==t?void 0:t.has(e))return e;const r=null!=t?t:new Set;let n;r.add(e);try{n=e.contentDocument}catch(t){return e}if(null==n)return e;if("function"==typeof n.hasFocus&&n.hasFocus())return e;const s=n.activeElement;return"IFRAME"===(null==s?void 0:s.tagName)?this.focusHolder(s,r):void 0}watchFocusedFrame(e){let t;this.releaseFocusedFrame();const r=()=>{this.noteFrameBlur()};try{if(t=e.contentWindow,null==t||"function"!=typeof t.addEventListener)return;t.addEventListener("blur",r)}catch(e){return}this.focusedFrameWindow=t,this.focusedFrameBlur=r}releaseFocusedFrame(){const e=this.focusedFrameWindow,t=this.focusedFrameBlur;if(this.focusedFrameWindow=void 0,this.focusedFrameBlur=void 0,void 0!==e)try{e.removeEventListener("blur",t)}catch(e){}}scheduleFocusInspect(e,t){const r=()=>{this.focusDestinationFrame=void 0;try{t()}catch(e){this.releaseFocusedFrame()}};"function"!=typeof(null==e?void 0:e.requestAnimationFrame)?r():this.focusDestinationFrame=e.requestAnimationFrame(r)}cancelFocusDestinationCheck(){if(void 0===this.focusDestinationFrame)return;const e=m();"function"==typeof(null==e?void 0:e.cancelAnimationFrame)&&e.cancelAnimationFrame(this.focusDestinationFrame),this.focusDestinationFrame=void 0}}class tn{constructor(){this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,this.recordFunction=null,this.recordEventsInFlight=!1,this.recordingEnabled=!0,this.recordingGeneration=0,this.startChildRecordingOnSetup=!1,this.pendingEmitEvents=[],this.windowFocus=new en,this.currentPageUrl="",this.recordEventsPendingShouldLogMetadata=null,this.urlChangeCleanup=null,this.crossOriginIframeCoordinator=null,this.crossOriginParentSignalCleanup=null,this.latestUrlChangeTargetingEvaluationId=0,this.teardownEventListeners=e=>{const t=m();if(t){t.removeEventListener("blur",this.blurListener),t.removeEventListener("focus",this.focusListener),!e&&t.addEventListener("blur",this.blurListener),!e&&t.addEventListener("focus",this.focusListener),t.self&&"onpagehide"in t.self?(t.removeEventListener("pagehide",this.pageLeaveListener),!e&&t.addEventListener("pagehide",this.pageLeaveListener)):(t.removeEventListener("beforeunload",this.pageLeaveListener),!e&&t.addEventListener("beforeunload",this.pageLeaveListener));const r=t.document;(null==r?void 0:r.addEventListener)&&r.removeEventListener&&(r.removeEventListener("visibilitychange",this.visibilityListener),!e&&r.addEventListener("visibilitychange",this.visibilityListener))}},this.blurListener=()=>{this.scheduleHiddenSend(),this.windowFocus.noteBlur()},this.visibilityListener=()=>{var e,t;const r=null===(t=null===(e=m())||void 0===e?void 0:e.document)||void 0===t?void 0:t.visibilityState;if("hidden"===r)return this.windowFocus.onDocumentHidden(),void this.scheduleHiddenSend();"visible"===r&&(this.windowFocus.onDocumentVisible(),this.cancelHiddenSend(),this.captureVisibleTab())},this.focusListener=()=>{var e;if(!this.recordingEnabled)return;if(this.windowFocus.consumeArrivedFromOutside())this.captureVisibleTab();else if(this.recordCancelCallback&&this.recordFunction){if(!1===(null===(e=this.config)||void 0===e?void 0:e.captureFullSnapshotOnFocus))return;try{this.recordFunction.takeFullSnapshot(!0)}catch(e){this.loggerProvider.warn("Failed to take full snapshot on focus:",e)}}else this.recordEventsInFlight||this.recordEvents(!1)},this.pageLeaveListener=e=>{this.cancelHiddenSend(),this.flushPendingReplayEvents(),this.pageLeaveFns.forEach(t=>{t(e)})},this.evaluateTargetingAndCapture=(e,t=!1,r=!1,n=!1)=>a(this,void 0,void 0,function*(){var i,o,l,c,u,h;if(!this.identifiers||!this.identifiers.sessionId||!this.config)return void(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."));if(!this.config.targetingConfig){if(!t)return void this.loggerProvider.log("No targeting config set, skipping initialization/recording for event.");this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.")}this.lastTargetingParams=e;const d=this.config.targetingConfig;if(d&&!this.sessionTargetingMatch){const t=n?this.latestUrlChangeTargetingEvaluationId:void 0;let r=e.event;r&&Object.values(s).includes(r.event_type)&&(r=void 0);const p=null!==(u=null!==(o=null===(i=e.page)||void 0===i?void 0:i.url)&&void 0!==o?o:null===(c=null===(l=m())||void 0===l?void 0:l.location)||void 0===c?void 0:c.href)&&void 0!==u?u:"",f=null!==(h=e.page)&&void 0!==h?h:""!==p?{url:p}:void 0,g=yield(({sessionId:e,targetingConfig:t,loggerProvider:r,apiKey:n,targetingParams:s,urlChange:i=!1})=>a(void 0,void 0,void 0,function*(){if(yield Ur.clearStoreOfOldSessions({loggerProvider:r,apiKey:n,currentSessionId:e}),!0===(yield Ur.getTargetingMatchForSession({loggerProvider:r,apiKey:n,sessionId:e}))&&!i)return!0;let o=!0;try{const{evaluateTargeting:i}=yield Promise.resolve().then(function(){return Zn}),a=Object.assign(Object.assign({},s),{flag:t,sessionId:"string"==typeof e?parseInt(e,10):e,apiKey:n,loggerProvider:r}),l=yield i(a);l&&l.sr_targeting_config&&(o="on"===l.sr_targeting_config.key),Ur.storeTargetingMatchForSession({loggerProvider:r,apiKey:n,sessionId:e,targetingMatch:o})}catch(e){const t=e;r.warn(t.message)}return o}))({sessionId:this.identifiers.sessionId,targetingConfig:d,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:e.userProperties,event:r,page:f},urlChange:n});if(n&&void 0!==t&&t!==this.latestUrlChangeTargetingEvaluationId)return void this.loggerProvider.debug(`Ignoring stale URL-change targeting result #${t}; latest is #${this.latestUrlChangeTargetingEvaluationId}.`);this.sessionTargetingMatch=this.sessionTargetingMatch||g,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:r,targetingParams:e},null,2))}t?this.initialize(!0):!r&&this.recordCancelCallback||(this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),yield this.recordEvents())}),this.addCustomRRWebEvent=(e,t={},r=!0)=>a(this,void 0,void 0,function*(){try{let n;const s=this.config;if(s&&e!==Re.METADATA&&(n={config:Ve(s),version:St},r)){const e=yield qe();n=Object.assign(Object.assign({},e),n)}this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(e,Object.assign(Object.assign({},t),n)):this.loggerProvider.debug(`Not able to add custom replay capture event ${e} due to no ongoing recording.`)}catch(e){this.loggerProvider.debug("Error while adding custom replay capture event: ",e)}}),this.stopRecordingEvents=()=>{var e,t,r;try{this.useSemanticAdapter(e=>e.stop()),this.loggerProvider.log("Session Replay capture stopping."),this.recordCancelCallback&&this.recordCancelCallback(),this.recordCancelCallback=null,null===(e=this.networkObservers)||void 0===e||e.stop(),null===(t=this.crossOriginIframeCoordinator)||void 0===t||t.stop(),this.crossOriginIframeCoordinator=null,null===(r=this.crossOriginParentSignalCleanup)||void 0===r||r.call(this),this.crossOriginParentSignalCleanup=null}catch(e){const t=e;this.loggerProvider.warn(`Error occurred while stopping replay capture: ${t.toString()}`)}},this.loggerProvider=new Pe(new M)}init(e,t){return I(this._init(e,t))}setupUrlChangeListener(){var e,t;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this);const r=m();if(!(null==r?void 0:r.location))return;const n=!!(null===(t=this.config)||void 0===t?void 0:t.targetingConfig),s=Qr(r,e=>{if(this.currentPageUrl=e,n){const t=++this.latestUrlChangeTargetingEvaluationId;this.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:e}},!1,!1,!0),this.loggerProvider.debug(`Queued URL-change targeting re-evaluation #${t} for ${e}.`)}});this.urlChangeCleanup=()=>{s(),this.urlChangeCleanup=null}}isBelowMinSessionDuration(){var e;const t=null===(e=this.config)||void 0===e?void 0:e.minSessionDurationMs;return void 0!==t&&void 0!==this.sessionStartTime&&Date.now()-this.sessionStartTime<t}getCurrentPageForTargeting(){var e,t;const r=null===(t=null===(e=m())||void 0===e?void 0:e.location)||void 0===t?void 0:t.href;return null!=r?{url:r}:void 0}_init(e,t){var r,n,s,i,o,l,c,u,h,d,p,f,g,y;return a(this,void 0,void 0,function*(){null===(r=this.urlChangeCleanup)||void 0===r||r.call(this),this.useSemanticAdapter(e=>e.stop()),this.semanticAdapter=void 0,this.recordingEnabled=!0,this.startChildRecordingOnSetup=!1,this.loggerProvider=new Pe(t.loggerProvider||new M),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.currentPageUrl=ze(),this.identifiers=new Fr({sessionId:t.sessionId,deviceId:t.deviceId});const v=Date.now();((e,t,r)=>{const n=jr();if(!n)return;const s=Dr(e);try{const e=[];for(let r=0;r<n.length;r++){const i=n.key(r);if(!i||!i.startsWith(s))continue;const o=n.getItem(i);if(null===o)continue;const a=Number(o);(!Number.isFinite(a)||a<=0||t-a>=_r)&&e.push(i)}for(const t of e)n.removeItem(t)}catch(e){null==r||r.debug(`Failed to prune stale replay start times: ${String(e)}`)}})(e,v,this.loggerProvider),this.sessionStartTime=void 0!==t.sessionId&&null!==(n=((e,t,r,n)=>{const s=jr();if(!s)return;const i=Br(e,t);try{const e=s.getItem(i);if(null!==e){const t=Number(e);if(Number.isFinite(t)&&t>0&&t<=r&&r-t<_r)return t}return s.setItem(i,String(r)),r}catch(e){return void(null==n||n.debug(`Failed to read/write replay start time from storage: ${String(e)}`))}})(e,t.sessionId,v,this.loggerProvider))&&void 0!==n?n:v,this.joinedConfigGenerator=yield((e,t)=>a(void 0,void 0,void 0,function*(){const r=new He(e,t),n=new Y(e,r.loggerProvider,r.serverZone,t.configServerUrl,t.handleFetchConfig);return new at(n,r)}))(e,t);const{joinedConfig:w,localConfig:b,remoteConfig:S}=yield this.joinedConfigGenerator.generateJoinedConfig();if(this.config=w,this.setMetadata(t.sessionId,w,b,S,null===(s=t.version)||void 0===s?void 0:s.version,St,null===(i=t.version)||void 0===i?void 0:i.type),this.pageLeaveFns=[],t.sessionId&&(null===(o=this.config.interactionConfig)||void 0===o?void 0:o.enabled)){const e=Nr.default({sessionId:t.sessionId,type:"interaction"},this.config);this.pageLeaveFns=[e.send(this.getDeviceId.bind(this)).bind(e)],this.scrollHook=e.hook.bind(e),this.clickHandler=new Pr(this.loggerProvider,e)}const C=[];let k,x,{storeType:O}=this.config;"idb"!==O||(null===(l=m())||void 0===l?void 0:l.indexedDB)||(O="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log(`Using ${O} for event storage.`);const I=m();if(this.config.useWebWorker&&I&&I.Worker){const{compressionScript:e,trackDestinationScript:t}=yield Promise.resolve().then(function(){return ts});k=e,x=t}let E;try{E=yield nr({config:this.config,type:"replay",minInterval:null===(c=this.config.flushIntervalConfig)||void 0===c?void 0:c.minIntervalMs,maxInterval:null===(u=this.config.flushIntervalConfig)||void 0===u?void 0:u.maxIntervalMs,maxPersistedEventsSize:this.config.maxPersistedEventsSizeBytes,storeType:O,trackDestinationWorkerScript:x,shouldSend:()=>!this.isBelowMinSessionDuration()}),this.rrwebEventManager=E,C.push({name:"replay",manager:E})}catch(e){const t=e;this.loggerProvider.warn(`Error occurred while creating replay events manager: ${t.toString()}`)}if(null===(h=this.config.interactionConfig)||void 0===h?void 0:h.enabled){const e=this.config.interactionConfig.batch?Rr:Mr;try{const t=yield nr({config:this.config,type:"interaction",minInterval:null!==(d=this.config.interactionConfig.trackEveryNms)&&void 0!==d?d:3e4,maxInterval:6e4,maxPersistedEventsSize:this.config.maxPersistedEventsSizeBytes,payloadBatcher:e,storeType:O,trackDestinationWorkerScript:x});C.push({name:"interaction",manager:t})}catch(e){const t=e;this.loggerProvider.warn(`Error occurred while creating interaction events manager: ${t.toString()}`)}}this.eventsManager=new sr(...C),this.eventCompressor&&this.eventCompressor.terminate();const R=!0===this.config.eagerFullSnapshotSend?()=>this.sendEvents():void 0;if(this.eventCompressor=new yt(this.eventsManager,this.config,this.getDeviceId(),k,R),this.pendingEmitEvents.length>0){const e=this.pendingEmitEvents.splice(0);for(const{event:t,sessionId:r}of e)this.eventCompressor.enqueueEvent(t,r)}if(this.pageLeaveFns=[...this.pageLeaveFns,()=>{var e;if(!this.config||!(null===(e=this.identifiers)||void 0===e?void 0:e.sessionId)||!E)return;const t=E.getBeaconEvents();if(!t.length)return;const r=this.getDeviceId();r&&(this.isBelowMinSessionDuration()||E.trackDestination.sendBeacon({events:t,sessionId:this.identifiers.sessionId,deviceId:r,apiKey:this.config.apiKey,serverZone:this.config.serverZone}))}],yield this.initializeNetworkObservers(),null===(p=m())||void 0===p?void 0:p.opener){const e=ce();de(e),e.setup(Object.assign({logger:this.loggerProvider},this.config.serverZone&&{endpoint:ie[this.config.serverZone]}))}this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),yield this.evaluateTargetingAndCapture({userProperties:t.userProperties,page:this.getCurrentPageForTargeting()},!0);(this.config.targetingConfig||(null!==(y=null===(g=null===(f=this.config.privacyConfig)||void 0===f?void 0:f.urlMaskLevels)||void 0===g?void 0:g.length)&&void 0!==y?y:0)>0)&&this.setupUrlChangeListener()})}setSessionId(e,t){return I(this.asyncSetSessionId(e,t))}asyncSetSessionId(e,t,r){var n,s,i,o,l,c;return a(this,void 0,void 0,function*(){const a=null===(n=this.identifiers)||void 0===n?void 0:n.sessionId,u=this.getDeviceId();if(!(void 0===a||a!==e||void 0!==t&&t!==u||void 0!==(null==r?void 0:r.userProperties)&&0!==Object.keys(r.userProperties).length))return;this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,a&&this.sendEvents(a);const h=a!==e;h&&(null===(i=null===(s=this.config)||void 0===s?void 0:s.semanticCapture)||void 0===i?void 0:i.enabled)&&this.semanticAdapter&&this.useSemanticAdapter(e=>e.stop()),h&&(null===(o=this.rrwebEventManager)||void 0===o||o.dropPendingBeaconEvents());const d=t||this.getDeviceId();if(this.identifiers=new Fr({sessionId:e,deviceId:d}),h&&(this.sessionStartTime=Date.now(),this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,(null===(l=this.config)||void 0===l?void 0:l.apiKey)&&(((e,t,r,n)=>{const s=jr();if(s)try{s.setItem(Br(e,t),String(r))}catch(e){null==n||n.debug(`Failed to write replay start time to storage: ${String(e)}`)}})(this.config.apiKey,e,this.sessionStartTime,this.loggerProvider),void 0!==a&&((e,t,r)=>{const n=jr();if(n)try{n.removeItem(Br(e,t))}catch(e){null==r||r.debug(`Failed to remove replay start time from storage: ${String(e)}`)}})(this.config.apiKey,a,this.loggerProvider))),this.joinedConfigGenerator&&a){const{joinedConfig:e}=yield this.joinedConfigGenerator.generateJoinedConfig();this.config=e}(null===(c=this.config)||void 0===c?void 0:c.targetingConfig)?yield this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties,page:this.getCurrentPageForTargeting()},!1,!0):yield this.recordEvents()})}getSessionReplayProperties(){const e=this.config,t=this.identifiers;if(!e||!t)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};const r=this.getShouldRecord();let n={};return r&&(n={[fe]:t.sessionReplayId?t.sessionReplayId:null},e.debugMode&&(n[ve]=JSON.stringify({appHash:z(e.apiKey).toString()}))),this.addCustomRRWebEvent(Re.GET_SR_PROPS,{shouldRecord:r,eventProperties:n},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,n}flushPendingReplayEvents(){var e;null===(e=this.eventCompressor)||void 0===e||e.flushQueue(),this.sendEvents()}scheduleHiddenSend(){var e;if(null===(e=this.eventCompressor)||void 0===e||e.flushQueue(),void 0!==this.hiddenFlushTimer)return;const t=this.hostSetTimeout();this.hiddenFlushTimer=t(()=>{this.hiddenFlushTimer=void 0,this.sendEvents()},0)}cancelHiddenSend(){void 0!==this.hiddenFlushTimer&&(this.hostClearTimeout()(this.hiddenFlushTimer),this.hiddenFlushTimer=void 0)}hostSetTimeout(){const e=m();return"function"==typeof(null==e?void 0:e.setTimeout)?e.setTimeout.bind(e):setTimeout}hostClearTimeout(){const e=m();return"function"==typeof(null==e?void 0:e.clearTimeout)?e.clearTimeout.bind(e):clearTimeout}captureVisibleTab(){var e;if(this.recordingEnabled)if(null===(e=this.eventCompressor)||void 0===e||e.flushQueue(),this.recordCancelCallback&&this.recordFunction){try{this.recordFunction.takeFullSnapshot(!0)}catch(e){this.loggerProvider.warn("Failed to take full snapshot when the tab became visible:",e)}this.sendEvents()}else this.recordEventsInFlight||this.recordEvents(!1)}sendEvents(e){var t,r;const n=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),s=this.getDeviceId();if(this.eventsManager&&n&&s){if(this.isBelowMinSessionDuration()){const e=this.sessionStartTime,t=this.config.minSessionDurationMs;return this.loggerProvider.log(`Session ${n} not sent: duration ${Date.now()-e}ms is below minimum ${t}ms.`),void this.suppressedSendCount++}if(!this.hasEmittedGateDecision&&void 0!==(null===(r=this.config)||void 0===r?void 0:r.minSessionDurationMs)&&this.recordCancelCallback&&this.recordFunction){this.hasEmittedGateDecision=!0;const e=void 0!==this.sessionStartTime?Date.now()-this.sessionStartTime:void 0;this.addCustomRRWebEvent(Re.REPLAY_GATE_DECISION,{sessionId:n,suppressedSendCount:this.suppressedSendCount,elapsedMs:e,minSessionDurationMs:this.config.minSessionDurationMs},!1)}this.eventsManager.sendCurrentSequenceEvents({sessionId:n,deviceId:s})}}initialize(e=!1){var t;return a(this,void 0,void 0,function*(){if(!(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId))return this.loggerProvider.log("Session is not being recorded due to lack of session id."),Promise.resolve();const r=this.getDeviceId();return r?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:r}),this.recordEvents()):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),Promise.resolve())})}shouldOptOut(){var e,t;let r;if(null===(e=this.config)||void 0===e?void 0:e.instanceName){r=(n=this.config.instanceName,$.getInstance(R(n))).identityStore.getIdentity().optOut}var n;return void 0!==r?r:null===(t=this.config)||void 0===t?void 0:t.optOut}getShouldRecord(){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.recordingEnabled)return this.loggerProvider.log(`Session ${this.identifiers.sessionId} not being captured because recording was stopped.`),!1;if(!this.config.captureEnabled)return this.loggerProvider.log(`Session ${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 ${this.identifiers.sessionId} out of recording due to optOut config.`),!1;let e=!1,t="",r=!1;if(this.config.targetingConfig)this.sessionTargetingMatch?(t=`Capturing replays for session ${this.identifiers.sessionId} due to matching targeting conditions.`,this.loggerProvider.log(t),e=!0,r=!0):(t=`Not capturing replays for session ${this.identifiers.sessionId} due to not matching targeting conditions.`,this.loggerProvider.log(t),e=!1,r=!1);else{(n=this.identifiers.sessionId,s=this.config.sampleRate,Jr(n.toString())%1e6/1e6<s)?(e=!0,r=!0):(t=`Opting session ${this.identifiers.sessionId} out of recording due to sample rate.`,this.loggerProvider.log(t),e=!1,r=!1)}var n,s;return this.lastShouldRecordDecision!==e&&this.config.targetingConfig&&(this.addCustomRRWebEvent(Re.TARGETING_DECISION,{message:t,sessionId:this.identifiers.sessionId,matched:r,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=e),e}getBlockSelectors(){var e;return je(null===(e=this.config)||void 0===e?void 0:e.privacyConfig)}getMaskTextSelectors(){var e;return Ue(null===(e=this.config)||void 0===e?void 0:e.privacyConfig,this.currentPageUrl)}getRecordingPlugins(e){var t,r,n,s,i,o;return a(this,void 0,void 0,function*(){const a=[];try{const e=Xr({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===(s=this.config)||void 0===s?void 0:s.urlChangePollingInterval,captureDocumentTitle:null===(i=this.config)||void 0===i?void 0:i.captureDocumentTitle});a.push(e)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(null===(o=null==e?void 0:e.console)||void 0===o?void 0:o.enabled)try{const{getRecordConsolePlugin:t}=yield Promise.resolve().then(function(){return gl});a.push(t({level:e.console.levels}))}catch(e){this.loggerProvider.warn("Failed to load console plugin:",e)}return a.length>0?a:void 0})}getRecordFunction(){return a(this,void 0,void 0,function*(){if(this.recordFunction)return this.recordFunction;try{const{record:e}=yield Promise.resolve().then(function(){return ff});return this.recordFunction=e,e}catch(e){return this.loggerProvider.warn("Failed to load rrweb-record module:",e),null}})}recordEvents(e=!0){return a(this,void 0,void 0,function*(){if(this.recordEventsInFlight)this.recordEventsPendingShouldLogMetadata=e;else{this.recordEventsInFlight=!0;try{for(yield this._recordEvents(e);null!==this.recordEventsPendingShouldLogMetadata;){const e=this.recordEventsPendingShouldLogMetadata;this.recordEventsPendingShouldLogMetadata=null,yield this._recordEvents(e)}}finally{this.recordEventsInFlight=!1,this.recordEventsPendingShouldLogMetadata=null}}})}shouldAbandonRecordStart(e){return!this.recordingEnabled||e!==this.recordingGeneration}_recordEvents(e=!0){var t,r,n,s,i,o,l,c;return a(this,void 0,void 0,function*(){const a=this.config,u=this.getShouldRecord(),h=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId;if(!u||!h||!a)return void(this.semanticAdapter&&this.recordCancelCallback&&this.stopRecordingEvents());this.stopRecordingEvents();const d=this.recordingGeneration,p=yield this.getRecordFunction();if(!p||this.shouldAbandonRecordStart(d))return;if(yield this.initializeNetworkObservers(),this.shouldAbandonRecordStart(d))return;const f=null===(r=a.loggingConfig)||void 0===r?void 0:r.network,g=$e(a.serverZone,a.trackServerUrl),y=[we,be,Se,g];null===(n=this.networkObservers)||void 0===n||n.start(e=>{y.some(t=>e.url.startsWith(t))||this.addCustomRRWebEvent(Re.FETCH_REQUEST,e)},f);const{interactionConfig:v,loggingConfig:w}=a,b=(null==v?void 0:v.enabled)?{mouseInteraction:this.eventsManager&&(null===(s=this.clickHandler)||void 0===s?void 0:s.createHook({eventsManager:this.eventsManager,sessionId:h,deviceIdFn:this.getDeviceId.bind(this),mirror:p.mirror,ugcFilterRules:null!==(i=v.ugcFilterRules)&&void 0!==i?i:[],performanceOptions:null===(o=a.performanceConfig)||void 0===o?void 0:o.interaction})),scroll:this.scrollHook}:{},S=(null==v?void 0:v.enabled)&&v.ugcFilterRules?v.ugcFilterRules:[];this.loggerProvider.log(`Session Replay capture beginning for ${h}.`);try{const t=!!(null===(l=a.crossOriginIframes)||void 0===l?void 0:l.enabled),r=!1!==(null===(c=a.crossOriginIframes)||void 0===c?void 0:c.coordinateChildren),n=t&&function(){try{const e=m();return!!e&&e.parent!==e}catch(e){return!0}}();if(n&&r)return this.crossOriginParentSignalCleanup=function(e){const t=m();if(!t)return()=>{};const r=t.parent;function n(t){if(t.source!==r)return;const n=t.data;(null==n?void 0:n.type)===Me&&("start"===n.action?e.onStart():"stop"===n.action&&e.onStop())}return t.addEventListener("message",n),()=>t.removeEventListener("message",n)}({onStart:()=>{this.recordingEnabled&&this._recordEventsInChildMode(p,h,a,b)},onStop:()=>{try{this.recordCancelCallback&&this.recordCancelCallback(),this.recordCancelCallback=null}catch(e){const t=e;this.loggerProvider.warn(`Error occurred while stopping child iframe replay capture: ${t.toString()}`)}}}),void(this.startChildRecordingOnSetup&&(this.startChildRecordingOnSetup=!1,this._recordEventsInChildMode(p,h,a,b)));this.startChildRecordingOnSetup=!1;const s=yield this.getRecordingPlugins(w);if(this.shouldAbandonRecordStart(d))return;this.prepareSemanticCapture(a,h),this.recordCancelCallback=p(Object.assign(Object.assign({},this.buildRRWebRecordOptions(a,b,e=>{if(this.shouldOptOut()||!this.recordingEnabled)return this.loggerProvider.log(this.shouldOptOut()?`Opting session ${h} out of recording due to optOut config.`:`Session Replay capture stopping for ${h}.`),this.stopRecordingEvents(),void this.sendEvents();e.type===Ze.Meta&&(e.data.href=We(e.data.href,S)),this.eventCompressor?this.eventCompressor.enqueueEvent(e,h):this.pendingEmitEvents.push({event:e,sessionId:h}),this.useSemanticAdapter(t=>t.event(e))},"Error while capturing replay: ")),{plugins:s,recordCrossOriginIframes:t})),this.recordCancelCallback&&this.useSemanticAdapter(e=>e.recordingReady()),t&&!n&&r&&(this.crossOriginIframeCoordinator||(this.crossOriginIframeCoordinator=new Zr),this.crossOriginIframeCoordinator.start()),this.addCustomRRWebEvent(Re.DEBUG_INFO),e&&this.addCustomRRWebEvent(Re.METADATA,this.metadata)}catch(e){this.useSemanticAdapter(e=>e.stop()),this.loggerProvider.warn("Failed to initialize session replay:",e)}})}useSemanticAdapter(e){const t=this.semanticAdapter;if(t)try{e(t)}catch(e){this.semanticAdapter=void 0,this.loggerProvider.debug("Semantic capture failed:",e);try{t.stop()}catch(e){this.loggerProvider.debug("Semantic capture stop failed:",e)}}}prepareSemanticCapture(e,t){var r;const n=m();if(!(null==n?void 0:n.document))return;const s=e.semanticCapture,i=null==s?void 0:s.createCapture;if(!(null==s?void 0:s.enabled)||"function"!=typeof i)return this.useSemanticAdapter(e=>e.stop()),void this.useSemanticAdapter(e=>e.prepare({enabled:!1},t));if((null===(r=this.semanticAdapter)||void 0===r?void 0:r.createCapture)!==i){this.useSemanticAdapter(e=>e.stop()),this.semanticAdapter=void 0;try{this.semanticAdapter=new rt(i,{document:n.document,window:n,sdk:`@amplitude/session-replay-browser@${St}`,getPrivacy:()=>{var e,t;return null!==(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)&&void 0!==t?t:{}},getIdentity:()=>function(e){const t=e.document,r=st.get(t);if(r)return r;const n=Object.freeze({tab_id:y(),document_id:y()});let s=n;if(e.top===e)try{const t=e.sessionStorage,r=()=>{var e;try{const r=JSON.parse(null!==(e=t.getItem(nt))&&void 0!==e?e:"null");if(r&&it.test(r.tab_id)&&(null===r.owner||"string"==typeof r.owner))return r}catch(e){}},n=r();null===(null==n?void 0:n.owner)&&(s=Object.freeze(Object.assign(Object.assign({},s),{tab_id:n.tab_id})));const i=e=>{try{t.setItem(nt,JSON.stringify({tab_id:s.tab_id,owner:e}))}catch(e){}};t.setItem(nt,JSON.stringify({tab_id:s.tab_id,owner:s.document_id})),e.addEventListener("pagehide",()=>{var e;(null===(e=r())||void 0===e?void 0:e.owner)===s.document_id&&i(null)}),e.addEventListener("pageshow",e=>{e.persisted&&i(s.document_id)})}catch(e){s=n}return st.set(t,s),s}(n),getAnalyticsContext:()=>{var e,t;return null!==(t=null===(e=this.config)||void 0===e?void 0:e.semanticAnalyticsContext)&&void 0!==t?t:{present:!1,autocapture:[]}},inlineStylesheet:e.shouldInlineStylesheet,emit:e=>{if(this.recordCancelCallback&&this.recordFunction)try{this.recordFunction.addCustomEvent(`amp-semantic/${e.name}`,e.payload)}catch(e){this.loggerProvider.debug("Error while adding semantic replay capture event:",e)}},onError:e=>this.loggerProvider.debug("Semantic capture error:",e)})}catch(e){return void this.loggerProvider.debug("Semantic capture initialization failed:",e)}}this.useSemanticAdapter(e=>e.prepare(s,t))}buildRRWebRecordOptions(e,t,r,n){const{privacyConfig:s}=e;return Object.assign(Object.assign(Object.assign(Object.assign({emit:r,inlineStylesheet:e.shouldInlineStylesheet,inlineImages:e.inlineImages,hooks:t},function(e,t){return void 0===t&&(t=function(){return""}),{maskAllInputs:!0,maskTextClass:"amp-mask",blockClass:"amp-block",blockSelector:je(e),maskTextSelector:Ue(e,t()),maskInputFn:De("input",e,t),maskTextFn:De("text",e,t),maskAttributeFn:Be(e,t)}}(s,()=>this.currentPageUrl)),{applyBackgroundColorToBlockedElements:e.applyBackgroundColorToBlockedElements}),void 0!==e.fullSnapshotIntervalMs&&{checkoutEveryNms:e.fullSnapshotIntervalMs}),{recordCanvas:!1,captureAdoptedStyleSheets:e.captureAdoptedStyleSheets,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0},errorHandler:e=>{const t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return this.loggerProvider.warn(n,t.toString()),!0}})}_recordEventsInChildMode(e,t,r,n){try{this.recordCancelCallback&&this.recordCancelCallback(),this.recordCancelCallback=null,this.recordCancelCallback=e(Object.assign(Object.assign({},this.buildRRWebRecordOptions(r,n,()=>{},"Error while capturing replay (child iframe): ")),{recordCrossOriginIframes:!0})),this.loggerProvider.log(`Session Replay child iframe capture beginning for session ${t}.`)}catch(e){this.loggerProvider.warn("Failed to initialize session replay in child iframe mode:",e)}}getDeviceId(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.deviceId}getSessionId(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.sessionId}start(){return I(this._start())}_start(){return a(this,void 0,void 0,function*(){this.recordingEnabled=!0,this.startChildRecordingOnSetup=!0,yield this.recordEvents()})}stop(){this.recordingEnabled=!1,this.startChildRecordingOnSetup=!1,this.recordingGeneration++,this.cancelHiddenSend(),this.windowFocus.stop(),this.stopRecordingEvents(),this.sendEvents()}flush(e=!1){var t;return a(this,void 0,void 0,function*(){return null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)})}shutdown(){var e,t;this.recordingEnabled=!1,this.startChildRecordingOnSetup=!1,this.recordingGeneration++,this.cancelHiddenSend(),this.windowFocus.stop(),null===(e=this.urlChangeCleanup)||void 0===e||e.call(this),null===(t=this.crossOriginParentSignalCleanup)||void 0===t||t.call(this),this.crossOriginParentSignalCleanup=null,this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()}mapSDKType(e){return"plugin"===e?"@amplitude/plugin-session-replay-browser":"segment"===e?"@amplitude/segment-session-replay-plugin":null}setMetadata(e,t,r,n,s,i,o){const a=(null==e?void 0:e.toString())?z(e.toString()):void 0;this.metadata={joinedConfig:t,localConfig:r,remoteConfig:n,sessionId:e,hashValue:a,sampleRate:t.sampleRate,replaySDKType:this.mapSDKType(o),replaySDKVersion:s,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:i}}initializeNetworkObservers(){var e,t,r;return a(this,void 0,void 0,function*(){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)try{const{NetworkObservers:e}=yield Promise.resolve().then(function(){return wf});this.networkObservers=new e}catch(e){this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",e)}})}}const rn=e=>()=>{const{config:t}=e,{loggerProvider:r,logLevel:n}=t||Ge();return{logger:r,logLevel:n}};var nn=(()=>{const e=new tn;return{init:N(e.init.bind(e),"init",rn(e)),evaluateTargetingAndCapture:N(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",rn(e)),setSessionId:N(e.setSessionId.bind(e),"setSessionId",rn(e)),getSessionId:N(e.getSessionId.bind(e),"getSessionId",rn(e)),getSessionReplayProperties:N(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",rn(e)),flush:N(e.flush.bind(e),"flush",rn(e)),start:N(e.start.bind(e),"start",rn(e)),stop:N(e.stop.bind(e),"stop",rn(e)),shutdown:N(e.shutdown.bind(e),"shutdown",rn(e))}})();const{init:sn,setSessionId:on,getSessionId:an,getSessionReplayProperties:ln,flush:cn,start:un,stop:hn,shutdown:dn,evaluateTargetingAndCapture:pn}=nn;var fn=function(e,t){return fn=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])},fn(e,t)};var mn=function(){return mn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},mn.apply(this,arguments)};function gn(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 yn="is",vn="is not",wn="contains",bn="does not contain",Sn="less",Cn="less or equal",kn="greater",xn="greater or equal",On="version less",In="version less or equal",En="version greater",Mn="version greater or equal",Rn="set is",Pn="set is not",An="set contains",Tn="set does not contain",Ln="set contains any",Nn="set does not contain any",Fn="regex match",_n="regex does not match",Dn=-862048943,Bn=461845907,jn=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 s=e.charCodeAt(n);s<128?t[r++]=s:s<2048?(t[r++]=s>>6|192,t[r++]=63&s|128):55296==(64512&s)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++n)),t[r++]=s>>18|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128,t[r++]=63&s|128):(t[r++]=s>>12|224,t[r++]=s>>6&63|128,t[r++]=63&s|128)}return Uint8Array.from(t)}(e),n=r.length,s=n>>2,i=t,o=0;o<s;o++){var a=Wn(r,o<<2);i=Un(a,i)}var l=s<<2,c=0;switch(n-l){case 3:c^=r[l+2]<<16,c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Dn),c=zn(c,15),i^=c=Math.imul(c,Bn);break;case 2:c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Dn),c=zn(c,15),i^=c=Math.imul(c,Bn);break;case 1:c^=r[l],c=Math.imul(c,Dn),c=zn(c,15),i^=c=Math.imul(c,Bn)}return $n(i^=n)>>>0},Un=function(e,t){var r=e,n=t;return r=Math.imul(r,Dn),r=zn(r,15),r=Math.imul(r,Bn),n=zn(n^=r,13),(n=Math.imul(n,5))+-430675100|0},$n=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},zn=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},Wn=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 qn(r)},qn=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Vn=function(e,t){var r,n;if(t&&0!==t.length){try{for(var s=gn(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(!o||!e||"object"!=typeof e)return;e=e[o]}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e||void 0}},Gn="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),Hn=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(Gn).exec(t);if(r){var n=Number(r[1]),s=Number(r[2]);if(!isNaN(n)&&!isNaN(s))return new e(n,s,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}(),Jn=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,s={},i={context:e,result:s};try{for(var o=gn(t),a=o.next();!a.done;a=o.next()){var l=a.value,c=this.evaluateFlag(i,l);c&&(s[l.key]=c)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},e.prototype.evaluateFlag=function(e,t){var r,n,s;try{for(var i=gn(t.segments),o=i.next();!o.done;o=i.next()){var a=o.value;if(s=this.evaluateSegment(e,t,a)){var l=mn(mn(mn({},t.metadata),a.metadata),s.metadata);s=mn(mn({},s),{metadata:l});break}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s},e.prototype.evaluateSegment=function(e,t,r){var n,s,i,o;if(!r.conditions)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0;try{for(var a=gn(r.conditions),l=a.next();!l.done;l=a.next()){var c,u=l.value,h=!0;try{for(var d=(i=void 0,gn(u)),p=d.next();!p.done;p=d.next()){var f=p.value;if(!(h=this.matchCondition(e,f)))break}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}if(h)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}},e.prototype.matchCondition=function(e,t){var r=Vn(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 s=this.coerceString(r);return void 0!==s&&this.matchString(s,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return jn(e)},e.prototype.bucket=function(e,t){var r,n,s,i;if(!t.bucket)return t.variant;var o=this.coerceString(Vn(e,t.bucket.selector));if(!o||0===o.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(o),l=this.getHash(a),c=l%100,u=Math.floor(l/100);try{for(var h=gn(t.bucket.allocations),d=h.next();!d.done;d=h.next()){var p=d.value,f=p.range[0],m=p.range[1];if(c>=f&&c<m)try{for(var g=(s=void 0,gn(p.distributions)),y=g.next();!y.done;y=g.next()){var v=y.value,w=v.range[0],b=v.range[1];if(u>=w&&u<b)return v.variant}}catch(e){s={error:e}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(s)throw s.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 yn:case wn:case Sn:case Cn:case kn:case xn:case On:case In:case En:case Mn:case Rn:case An:case Ln:return r;case vn:case bn:case Tn:case Nn:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Rn:return this.setEquals(e,r);case Pn:return!this.setEquals(e,r);case An:return this.matchesSetContainsAll(e,r);case Tn:return!this.matchesSetContainsAll(e,r);case Ln:return this.matchesSetContainsAny(e,r);case Nn:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case yn:return this.matchesIs(e,r);case vn:return!this.matchesIs(e,r);case wn:return this.matchesContains(e,r);case bn:return!this.matchesContains(e,r);case Sn:case Cn:case kn:case xn:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case On:case In:case En:case Mn:return this.matchesComparable(e,t,r,function(e){return Hn.parse(e)},this.versionComparator);case Fn:return this.matchesRegex(e,r);case _n: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 s=gn(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(e.toLowerCase().includes(o.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,s){var i=this,o=n(e),a=r.map(function(e){return n(e)}).filter(function(e){return void 0!==e});return void 0===o||0===a.length?r.some(function(r){return i.comparator(e,t,r)}):a.some(function(e){return s(o,t,e)})},e.prototype.comparator=function(e,t,r){switch(t){case Sn:case On:return e<r;case Cn:case In:return e<=r;case kn:case En:return e>r;case xn:case Mn:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Sn:case On:return n<0;case Cn:case In:return n<=0;case kn:case En:return n>0;case xn:case Mn: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 Rn:case Pn:case An:case Tn:case Ln:case Nn: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,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);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,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}(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 s=gn(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(!this.matchesIs(o,e))return!1}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var s=gn(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(this.matchesIs(o,e))return!0}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}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 s=e.call(this,n)||this;return s.statusCode=r,Object.setPrototypeOf(s,t.prototype),s}(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}fn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var Kn=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,Ft(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,s=t.eventTime,o=t.loggerProvider,c=t.tx;return a(e,void 0,void 0,function(){var e,t,a,u,h,d,p,f,m;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=String(r),[4,c.store.get(e)];case 1:return t=l.sent(),a=t?t.eventTypes:{},u=a[n]||{},h=i(i({},a),((f={})[n]=i(i({},u),((m={})[s]={event_type:n},m)),f)),d={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,c.store.put(d)];case 2:return l.sent(),[2,h];case 3:return p=l.sent(),o.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,s=t.tx;return a(e,void 0,void 0,function(){var e,t,i,o,a,c;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),e=String(r),[4,s.store.getAll()];case 1:t=l.sent(),i=0,l.label=2;case 2:return i<t.length?(o=t[i],a=Date.now()-o.lastUpdated,o.sessionId!==e&&a>1728e5?[4,s.store.delete(o.sessionId)]:[3,4]):[3,5];case 3:l.sent(),l.label=4;case 4:return i++,[3,2];case 5:return[3,7];case 6:return c=l.sent(),n.warn("Failed to clear old session event types for targeting: ".concat(c)),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,s=t.eventType,i=t.eventTime,o=t.apiKey;return a(e,void 0,void 0,function(){var e,t,a,c;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,5,,6]),[4,this.openOrCreateDB(o)];case 1:return e=l.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:s,eventTime:i})]:[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 c=l.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(c)),[3,6];case 6:return[2,void 0]}})})}},Yn=new Kn,Qn=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,s=t.event,o=t.sessionId,c=t.userProperties,u=t.deviceId,h=t.page,d=t.flag;return a(e,void 0,void 0,function(){var e,t,a,p;return l(this,function(l){switch(l.label){case 0:return s&&s.time?[4,Yn.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:o,eventType:s.event_type,eventTime:s.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)),p={session_id:o,event:s,event_types:a&&Array.from(a),user:i(i({},c),{device_id:u,user_properties:c}),page:h},[2,this.evaluationEngine.evaluate(p,[d])]}})})},this.evaluationEngine=new Jn},Xn=function(){var e=new Qn;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,Zn=Object.freeze({__proto__:null,evaluateTargeting:Xn});var es,ts=Object.freeze({__proto__:null,compressionScript:'var WebWorker=function(e){"use strict";onmessage=function(e){var s="string"==typeof e.data?JSON.parse(e.data):e.data,t=s.event,a=s.sessionId,n=t.type,r=t.timestamp,i=t.delay,o=t.data,d=null!=i?JSON.stringify({type:n,timestamp:r,delay:i,data:o}):JSON.stringify({type:n,timestamp:r,data:o});postMessage({compressedEvent:d,sessionId:a})};var s=onmessage;return e.compressionOnMessage=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n',trackDestinationScript:'var WebWorker=function(e){"use strict";var t,r=function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},r.apply(this,arguments)};function n(e,t,r,n){return new(r||(r=Promise))(function(s,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function i(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,i)}u((n=n.apply(e,t||[])).next())})}function s(e,t){var r,n,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=i(0),a.throw=i(1),a.return=i(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(o=0)),o;)try{if(r=1,n&&(s=2&i[0]?n.return:i[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,i[1])).done)return s;switch(n=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:case 1:s=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){o.label=i[1];break}if(6===i[0]&&o.label<s[1]){o.label=s[1],s=i;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(i);break}s[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{r=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}"function"==typeof SuppressedError&&SuppressedError,function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(t||(t={})),t.US;var o,a=/payload.*exceed/i,i="X-Session-Replay-Event-Skipped";!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",e.REPLAY_GATE_DECISION="replay-gate-decision"}(o||(o={}));var u="Network error occurred, event batch rejected";function c(e,t){return n(this,void 0,void 0,function(){var r,o,a,i,u,c,l,d,p,f,v,h,y,b,g=this;return s(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),r=t.CompressionStream,o=new r("gzip"),a=o.writable.getWriter(),i=o.readable.getReader(),u=[],c=n(g,void 0,void 0,function(){var e,t,r;return s(this,function(n){switch(n.label){case 0:return[4,i.read()];case 1:if(e=n.sent(),t=e.done,r=e.value,t)return[3,3];u.push(r),n.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,a.write((new TextEncoder).encode(e))];case 1:return m.sent(),[4,a.close()];case 2:return m.sent(),[4,c];case 3:m.sent(),l=u.reduce(function(e,t){return e+t.length},0),d=new Uint8Array(l),p=0;try{for(f=function(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.")}(u),v=f.next();!v.done;v=f.next())h=v.value,d.set(h,p),p+=h.length}catch(e){y={error:e}}finally{try{v&&!v.done&&(b=f.return)&&b.call(f)}finally{if(y)throw y.error}}return[2,d];case 4:return m.sent(),[2,null];case 5:return[2]}})})}function l(e){for(var t=e.length,r=0;r<t&&!(e.charCodeAt(r)>127);r++);if(r===t)return t;for(var n=r;r<t;r++){var s=e.charCodeAt(r);if(s<=127)n++;else if(s<=2047)n+=2;else if(s>=55296&&s<=56319){var o=r+1<t?e.charCodeAt(r+1):NaN;o>=56320&&o<=57343?(n+=4,r++):n+=3}else n+=3}return n}var d=0,p=new Map,f=function(e,t){return fetch(e,t)},v=function(e,t){var r="".concat(++d);return new Promise(function(n,s){var o=t.signal,a=function(){p.delete(r);var e=new Error("Delegated session replay fetch aborted by send timeout");e.name="AbortError",s(e)};o.addEventListener("abort",a,{once:!0}),p.set(r,function(e){o.removeEventListener("abort",a),e.error?s(new Error(e.body)):n({status:e.status,headers:{get:function(t){return t===i?e.skipHeader:null}},text:function(){return Promise.resolve(e.body)}})}),postMessage({type:"fetch-request",requestId:r,url:e,method:"POST",headers:t.headers,body:t.body,keepalive:t.keepalive})})};function h(e,t,o){var d,p,f,v,h,y,b,g;return n(this,void 0,void 0,function(){var n,m,w,S,T,E,k,R,C,x,A,I,M,O,U;return s(this,function(s){switch(s.label){case 0:n=null!==(d=t.sendTimeoutMs)&&void 0!==d?d:1e4,s.label=1;case 1:return s.trys.push([1,14,,15]),!1!==t.enableTransportCompression&&"CompressionStream"in self?[4,c(e,self)]:[3,3];case 2:return w=s.sent(),[3,4];case 3:w=null,s.label=4;case 4:m=w,S="".concat(null!==(f=null===(p=t.version)||void 0===p?void 0:p.type)&&void 0!==f?f:"standalone","/").concat(null!==(h=null===(v=t.version)||void 0===v?void 0:v.version)&&void 0!==h?h:t.sdkVersion),T=new URLSearchParams({device_id:t.deviceId,session_id:"".concat(t.sessionId),type:t.eventType}),E="".concat((P=t.serverZone,_=t.trackServerUrl,_||("STAGING"===P?"https://api-sr.stag2.amplitude.com/sessions/v2/track":"EU"===P?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")),"?").concat(T.toString()),k=r({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(t.apiKey),"X-Client-Version":t.sdkVersion,"X-Client-Library":S,"X-Client-Url":t.currentUrl.substring(0,1e3),"X-Client-Sample-Rate":"".concat(t.sampleRate),"X-Sampling-Hash-Alg":"xxhash32"},m?{"Content-Encoding":"gzip"}:{}),R=m?m.byteLength:l(e),C=new AbortController,x=n>0?setTimeout(function(){C.abort()},n):void 0,A=void 0,s.label=5;case 5:return s.trys.push([5,,7,8]),[4,o(E,{method:"POST",headers:k,body:null!=m?m:e,keepalive:R<=65536,signal:C.signal})];case 6:return A=s.sent(),[3,8];case 7:return x&&clearTimeout(x),[7];case 8:if(null===A)return[2,{shouldRetry:!1,success:!1,message:"Unexpected error occurred"}];if(A.status>=200&&A.status<300)return I=Math.round(function(e){for(var t=0,r=0;r<e.length;r++)t+=l(e[r]);return t}(t.events)/1024),M=null!==(g=null===(b=null===(y=A.headers)||void 0===y?void 0:y.get)||void 0===b?void 0:b.call(y,i))&&void 0!==g?g:null,[2,{shouldRetry:!1,success:!0,message:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(I," KB"),skipCode:M}];if(413!==A.status)return[3,13];O="",s.label=9;case 9:return s.trys.push([9,11,,12]),[4,A.text()];case 10:return O=s.sent(),[3,12];case 11:return s.sent(),[3,12];case 12:return[2,{shouldRetry:!1,success:!1,message:u,payloadTooLarge:!0,isWaf:a.test(O)}];case 13:return A.status>=500||408===A.status||429===A.status||499===A.status?[2,{shouldRetry:!0,success:!1,message:"HTTP ".concat(A.status)}]:[2,{shouldRetry:!1,success:!1,message:u}];case 14:return(U=s.sent())&&"object"==typeof U&&"AbortError"===U.name?[2,{shouldRetry:!0,success:!1,message:"Session replay worker request timed out after ".concat(n,"ms")}]:[2,{shouldRetry:!1,success:!1,message:String(U)}];case 15:return[2]}var P,_})})}function y(e,t,r,o,a){var i;return n(this,void 0,void 0,function(){var n,u,c;return s(this,function(s){switch(s.label){case 0:n=1,s.label=1;case 1:return[4,h(t,r,a)];case 2:return(u=s.sent()).success?(postMessage({type:"log",id:e,message:u.message}),postMessage({type:"complete",id:e,skipCode:null!==(i=u.skipCode)&&void 0!==i?i:null}),[2]):u.payloadTooLarge&&o?(postMessage({type:"payload_too_large",id:e,isWaf:!0===u.isWaf}),[2]):o&&u.shouldRetry&&n<r.flushMaxRetries?[4,new Promise(function(e){return setTimeout(e,Math.random()*n*1e3)})]:[3,4];case 3:return s.sent(),n++,[3,5];case 4:return c=n>=r.flushMaxRetries?"Session replay event batch rejected due to exceeded retry count":u.message,postMessage({type:"warn",id:e,message:c}),postMessage({type:"complete",id:e}),[2];case 5:return[3,1];case 6:return[2]}})})}onmessage=function(e){return n(void 0,void 0,void 0,function(){var t,r,n,o,a,i,u,c;return s(this,function(s){switch(s.label){case 0:return"fetch-response"===(t=e.data).type?((r=p.get(t.requestId))&&(p.delete(t.requestId),r(t)),[2]):"send"!==t.type?[3,2]:(n=t.id,o=t.payload,a=t.context,i=t.useRetry,u=t.useCustomTransport,c=JSON.stringify(o),[4,y(n,c,a,i,u?v:f)]);case 1:s.sent(),s.label=2;case 2:return[2]}})})};var b=onmessage;return e.trackDestinationOnMessage=b,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n'}),rs=Object.defineProperty,ns=(e,t,r)=>((e,t,r)=>t in e?rs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),ss=Object.defineProperty,is=(e,t,r)=>((e,t,r)=>t in e?ss(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),os=Object.defineProperty,as=(e,t,r)=>((e,t,r)=>t in e?os(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const ls={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},cs={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},us={};function hs(e){if(us[e])return us[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 ls?ls[e]:void 0,s=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]"))})),i=e in cs?cs[e]:void 0,o=Boolean(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&o)return us[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const i=s[e].prototype;return document.body.removeChild(n),i?us[e]=i:r}catch{return r}}const ds={};function ps(e,t,r){var n;const s=`${e}.${String(r)}`;if(ds[s])return ds[s].call(t);const i=hs(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(ds[s]=o,o.call(t)):t[r]}const fs={};function ms(e,t,r){const n=`${e}.${String(r)}`;if(fs[n])return fs[n].bind(t);const s=hs(e)[r];return"function"!=typeof s?t[r]:(fs[n]=s,s.bind(t))}const gs={childNodes:function(e){return ps("Node",e,"childNodes")},parentNode:function(e){return ps("Node",e,"parentNode")},parentElement:function(e){return ps("Node",e,"parentElement")},textContent:function(e){return ps("Node",e,"textContent")},contains:function(e,t){return ms("Node",e,"contains")(t)},getRootNode:function(e){return ms("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ps("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ps("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ps("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ps("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return hs("MutationObserver").constructor}};class ys{constructor(){as(this,"idNodeMap",new Map),as(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 vs(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&vs(gs.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&vs(gs.parentNode(e),t,r)}function ws(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bs(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 Ss,Cs={exports:{}};function ks(){if(Ss)return Cs.exports;Ss=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return Cs.exports=t(),Cs.exports.createColors=t,Cs.exports}const xs=bs(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Os,Is,Es,Ms,Rs,Ps;function As(){if(Is)return Os;Is=1;let e=ks(),t=xs;class r extends Error{constructor(e,t,n,s,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),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);let s=e=>e,i=e=>e,o=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);i=e=>r(a(e)),s=e=>n(e),t&&(o=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+s(n)+o(l)+"\n "+c+i("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(n)+o(e)+"\n "+t+i("^")}return" "+s(n)+o(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Os=r,r.default=r,Os}function Ts(){if(Ms)return Es;Ms=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let i=t.parent;if("before"===n){if(!i||"root"===i.type&&i.first===t)return"";if(i&&"document"===i.type)return""}if(!i)return e[n];let o=t.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](o,t):o.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),o.rawCache[n]=s,s}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 Es=t,t.default=t,Es}function Ls(){if(Ps)return Rs;Ps=1;let e=Ts();function t(t,r){new e(r).stringify(t)}return Rs=t,t.default=t,Rs}var Ns,Fs,_s,Ds,Bs,js,Us,$s,zs,Ws,qs,Vs,Gs,Hs,Js,Ks,Ys,Qs,Xs,Zs,ei,ti,ri,ni,si,ii,oi,ai,li,ci,ui,hi,di,pi,fi,mi,gi,yi,vi,wi,bi,Si,Ci,ki,xi,Oi,Ii,Ei,Mi,Ri={};function Pi(){return Ns||(Ns=1,Ri.isClean=Symbol("isClean"),Ri.my=Symbol("my")),Ri}function Ai(){if(_s)return Fs;_s=1;let e=As(),t=Ts(),r=Ls(),{isClean:n,my:s}=Pi();function i(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 s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>i(e,r)):("object"===o&&null!==s&&(s=i(s)),r[n]=s)}return r}function o(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let i=0;i<e.length;i++){if(n===t.line&&r===t.column){s=i;break}"\n"===e[i]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=i(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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(o(r,this.source.start),o(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=o(n,this.source.start),i=s+e;for(let e=s;e<i;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:o(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:o(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(o(t,this.source.start),o(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:o(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:o(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,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=r){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)}}return Fs=a,a.default=a,Fs}function Ti(){if(Bs)return Ds;Bs=1;let e=Ai();class t extends e{constructor(e){super(e),this.type="comment"}}return Ds=t,t.default=t,Ds}function Li(){if(Us)return js;Us=1;let e=Ai();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return js=t,t.default=t,js}function Ni(){if(zs)return $s;zs=1;let e,t,r,n,s=Ti(),i=Li(),o=Ai(),{isClean:a,my:l}=Pi();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends o{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(r,o){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new i(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&o&&void 0!==o.raws.before&&(e.raws.before=o.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},$s=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,i.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},$s}function Fi(){if(qs)return Ws;qs=1;let e=Ni();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 Ws=t,t.default=t,e.registerAtRule(t),Ws}function _i(){if(Gs)return Vs;Gs=1;let e,t,r=Ni();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},Vs=n,n.default=n,Vs}function Di(){if(Js)return Hs;Js=1;return Hs={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},Hs}function Bi(){if(Ys)return Ks;Ys=1;let{existsSync:e,readFileSync:t}=xs,{dirname:r,join:n}=xs,{SourceMapConsumer:s,SourceMapGenerator:i}=xs;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Ks=o,o.default=o,Ks}function ji(){if(Xs)return Qs;Xs=1;let{nanoid:e}=Di(),{isAbsolute:t,resolve:r}=xs,{SourceMapConsumer:n,SourceMapGenerator:s}=xs,{fileURLToPath:i,pathToFileURL:o}=xs,a=As(),l=Bi(),c=xs,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);i=e.line,s=e.col}else i=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,i,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:s,line:i},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:i,endOffset:l,line:t,offset:c,source:this.css},this.file&&(o&&(u.input.url=o(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?o(u.source):new URL(u.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!i)throw new Error("file: protocol is not available in this PostCSS build");h.file=i(l)}let d=c.sourceContentFor(u.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}}return Qs=f,f.default=f,c&&c.registerInput&&c.registerInput(f),Qs}function Ui(){if(ei)return Zs;ei=1;let e,t,r=Ni();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},Zs=n,n.default=n,r.registerRoot(n),Zs}function $i(){if(ri)return ti;ri=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return ti=e,e.default=e,ti}function zi(){if(si)return ni;si=1;let e=Ni(),t=$i();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return ni=r,r.default=r,e.registerRule(r),ni}function Wi(){if(li)return ai;li=1;let{dirname:e,relative:t,resolve:r,sep:n}=xs,{SourceMapConsumer:s,SourceMapGenerator:i}=xs,{pathToFileURL:o}=xs,a=ji(),l=Boolean(s&&i),c=Boolean(e&&r&&t&&n);return ai=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 r,n=this.toUrl(this.path(t.file)),i=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=i.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new i({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 i({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),t=i.match(/\n/g),t?(r+=t.length,e=i.lastIndexOf("\n"),n=i.length-e):n+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let i=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=e(r(i,this.mapOpts.annotation)));let o=t(i,n);return this.memoizedPaths.set(n,o),o}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(o){let t=o(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function qi(){if(di)return hi;di=1;let e=Fi(),t=Ti(),r=Li(),n=Ui(),s=zi(),i=function(){if(ui)return ci;ui=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),i=" ".charCodeAt(0),o="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return ci=function(k,x={}){let O,I,E,M,R,P,A,T,L,N,F=k.css.valueOf(),_=x.ignoreErrors,D=F.length,B=0,j=[],U=[];function $(e){throw k.error("Unclosed "+e,B)}return{back:function(e){U.push(e)},endOfFile:function(){return 0===U.length&&B>=D},nextToken:function(k){if(U.length)return U.pop();if(B>=D)return;let x=!!k&&k.ignoreUnclosed;switch(O=F.charCodeAt(B),O){case s:case i:case a:case l:case o:M=B;do{M+=1,O=F.charCodeAt(M)}while(O===i||O===s||O===a||O===l||O===o);P=["space",F.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);P=[e,e,B];break}case h:if(N=j.length?j.pop()[1]:"",L=F.charCodeAt(B+1),"url"===N&&L!==e&&L!==t&&L!==i&&L!==s&&L!==a&&L!==o&&L!==l){M=B;do{if(A=!1,M=F.indexOf(")",M+1),-1===M){if(_||x){M=B;break}$("bracket")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",F.slice(B,M+1),B,M],B=M}else M=F.indexOf(")",B+1),I=F.slice(B,M+1),-1===M||S.test(I)?P=["(","(",B]:(P=["brackets",I,B,M],B=M);break;case e:case t:R=O===e?"'":'"',M=B;do{if(A=!1,M=F.indexOf(R,M+1),-1===M){if(_||x){M=B+1;break}$("string")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",F.slice(B,M+1),B,M],B=M;break;case v:w.lastIndex=B+1,w.test(F),M=0===w.lastIndex?F.length-1:w.lastIndex-2,P=["at-word",F.slice(B,M+1),B,M],B=M;break;case r:for(M=B,E=!0;F.charCodeAt(M+1)===r;)M+=1,E=!E;if(O=F.charCodeAt(M+1),E&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(M+=1,C.test(F.charAt(M)))){for(;C.test(F.charAt(M+1));)M+=1;F.charCodeAt(M+1)===i&&(M+=1)}P=["word",F.slice(B,M+1),B,M],B=M;break;default:O===n&&F.charCodeAt(B+1)===g?(M=F.indexOf("*/",B+2)+1,0===M&&(_||x?M=F.length:$("comment")),P=["comment",F.slice(B,M+1),B,M],B=M):(b.lastIndex=B+1,b.test(F),M=0===b.lastIndex?F.length-1:b.lastIndex-2,P=["word",F.slice(B,M+1),B,M],j.push(P),B=M)}return B++,P},position:function(){return B}}}}();const o={empty:!0,space:!0};return hi=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,i=new e;i.name=t[1].slice(1),""===i.name&&this.unnamedAtrule(i,t),this.init(i,t[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){i.source.end=this.getPosition(t[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(t=l[l.length-1],i.source.end=this.getPosition(t[3]||t[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(r=o,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,a=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}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 s,i,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],i=s[0],"space"!==i||e!==c-1||n?"comment"===i?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",o[l]||o[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},hi}function Vi(){if(fi)return pi;fi=1;let e=Ni(),t=ji(),r=qi();function n(e,n){let s=new t(e,n),i=new r(s);try{i.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 i.root}return pi=n,n.default=n,e.registerParse(n),pi}function Gi(){if(gi)return mi;gi=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 mi=e,e.default=e,mi}function Hi(){if(vi)return yi;vi=1;let e=Gi();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return yi=t,t.default=t,yi}function Ji(){if(bi)return wi;bi=1;let e={};return wi=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Ki(){if(Ci)return Si;Ci=1;let e=Ni(),t=_i(),r=Wi(),n=Vi(),s=Hi(),i=Ui(),o=Ls(),{isClean:a,my:l}=Pi(),c=Ji();const u={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=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let y={};class v{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"}constructor(t,r,i){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof s)o=g(r.root),r.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{let t=n;i.syntax&&(t=i.syntax.parse),i.parser&&(t=i.parser),t.parse&&(t=t.parse);try{o=t(r,i)}catch(e){this.processed=!0,this.error=e}o&&!o[l]&&e.rebuild(o)}else o=g(r);this.result=new s(t,o,i),this.helpers={...y,postcss:y,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,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return 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=o;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return v.registerPostcss=e=>{y=e},Si=v,v.default=v,i.registerLazyResult(v),t.registerLazyResult(v),Si}function Yi(){if(Ii)return Oi;Ii=1;let e=_i(),t=Ki(),r=function(){if(xi)return ki;xi=1;let e=Wi(),t=Vi();const r=Hi();let n=Ls(),s=Ji();class i{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,r=t;try{e=r(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"}constructor(t,s,i){let o;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=i,this._map=void 0;let a=n;this.result=new r(this._processor,o,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return ki=i,i.default=i,ki}(),n=Ui();class s{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Oi=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),Oi}const Qi=ws(function(){if(Mi)return Ei;Mi=1;let e=Fi(),t=Ti(),r=Ni(),n=As(),s=Li(),i=_i(),o=function(){if(oi)return ii;oi=1;let e=Fi(),t=Ti(),r=Li(),n=ji(),s=Bi(),i=Ui(),o=zi();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new i(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return ii=a,a.default=a,ii}(),a=ji(),l=Ki(),c=$i(),u=Ai(),h=Vi(),d=Yi(),p=Hi(),f=Ui(),m=zi(),g=Ls(),y=Gi();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return v.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return v([s(r)]).process(e,t)},s},v.stringify=g,v.parse=h,v.fromJSON=o,v.list=c,v.comment=e=>new t(e),v.atRule=t=>new e(t),v.decl=e=>new s(e),v.rule=e=>new m(e),v.root=e=>new f(e),v.document=e=>new i(e),v.CssSyntaxError=n,v.Declaration=s,v.Container=r,v.Processor=d,v.Document=i,v.Comment=t,v.Warning=y,v.AtRule=e,v.Result=p,v.Input=a,v.Rule=m,v.Root=f,v.Node=u,l.registerPostcss(v),Ei=v,v.default=v,Ei}());Qi.stringify,Qi.fromJSON,Qi.plugin,Qi.parse,Qi.list,Qi.document,Qi.comment,Qi.atRule,Qi.rule,Qi.decl,Qi.root,Qi.CssSyntaxError,Qi.Declaration,Qi.Container,Qi.Processor,Qi.Document,Qi.Comment,Qi.Warning,Qi.AtRule,Qi.Result,Qi.Input,Qi.Rule,Qi.Root,Qi.Node;var Xi=Object.defineProperty,Zi=(e,t,r)=>((e,t,r)=>t in e?Xi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function eo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function to(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 ro,no={exports:{}};function so(){if(ro)return no.exports;ro=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return no.exports=t(),no.exports.createColors=t,no.exports}const io=to(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var oo,ao,lo,co,uo,ho;function po(){if(ao)return oo;ao=1;let e=so(),t=io;class r extends Error{constructor(e,t,n,s,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),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);let s=e=>e,i=e=>e,o=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);i=e=>r(a(e)),s=e=>n(e),t&&(o=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+s(n)+o(l)+"\n "+c+i("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(n)+o(e)+"\n "+t+i("^")}return" "+s(n)+o(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return oo=r,r.default=r,oo}function fo(){if(co)return lo;co=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let i=t.parent;if("before"===n){if(!i||"root"===i.type&&i.first===t)return"";if(i&&"document"===i.type)return""}if(!i)return e[n];let o=t.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](o,t):o.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),o.rawCache[n]=s,s}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 lo=t,t.default=t,lo}function mo(){if(ho)return uo;ho=1;let e=fo();function t(t,r){new e(r).stringify(t)}return uo=t,t.default=t,uo}var go,yo,vo,wo,bo,So,Co,ko,xo,Oo,Io,Eo,Mo,Ro,Po,Ao,To,Lo,No,Fo,_o,Do,Bo,jo,Uo,$o,zo,Wo,qo,Vo,Go,Ho,Jo,Ko,Yo,Qo,Xo,Zo,ea,ta,ra,na,sa,ia,oa,aa,la,ca,ua,ha={};function da(){return go||(go=1,ha.isClean=Symbol("isClean"),ha.my=Symbol("my")),ha}function pa(){if(vo)return yo;vo=1;let e=po(),t=fo(),r=mo(),{isClean:n,my:s}=da();function i(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 s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>i(e,r)):("object"===o&&null!==s&&(s=i(s)),r[n]=s)}return r}function o(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let i=0;i<e.length;i++){if(n===t.line&&r===t.column){s=i;break}"\n"===e[i]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=i(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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(o(r,this.source.start),o(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=o(n,this.source.start),i=s+e;for(let e=s;e<i;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:o(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:o(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(o(t,this.source.start),o(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:o(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:o(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,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=r){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)}}return yo=a,a.default=a,yo}function fa(){if(bo)return wo;bo=1;let e=pa();class t extends e{constructor(e){super(e),this.type="comment"}}return wo=t,t.default=t,wo}function ma(){if(Co)return So;Co=1;let e=pa();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return So=t,t.default=t,So}function ga(){if(xo)return ko;xo=1;let e,t,r,n,s=fa(),i=ma(),o=pa(),{isClean:a,my:l}=da();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends o{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(r,o){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new i(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&o&&void 0!==o.raws.before&&(e.raws.before=o.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},ko=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,i.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},ko}function ya(){if(Io)return Oo;Io=1;let e=ga();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 Oo=t,t.default=t,e.registerAtRule(t),Oo}function va(){if(Mo)return Eo;Mo=1;let e,t,r=ga();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},Eo=n,n.default=n,Eo}function wa(){if(Po)return Ro;Po=1;return Ro={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},Ro}function ba(){if(To)return Ao;To=1;let{existsSync:e,readFileSync:t}=io,{dirname:r,join:n}=io,{SourceMapConsumer:s,SourceMapGenerator:i}=io;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Ao=o,o.default=o,Ao}function Sa(){if(No)return Lo;No=1;let{nanoid:e}=wa(),{isAbsolute:t,resolve:r}=io,{SourceMapConsumer:n,SourceMapGenerator:s}=io,{fileURLToPath:i,pathToFileURL:o}=io,a=po(),l=ba(),c=io,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);i=e.line,s=e.col}else i=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,i,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:s,line:i},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:i,endOffset:l,line:t,offset:c,source:this.css},this.file&&(o&&(u.input.url=o(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?o(u.source):new URL(u.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!i)throw new Error("file: protocol is not available in this PostCSS build");h.file=i(l)}let d=c.sourceContentFor(u.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}}return Lo=f,f.default=f,c&&c.registerInput&&c.registerInput(f),Lo}function Ca(){if(_o)return Fo;_o=1;let e,t,r=ga();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},Fo=n,n.default=n,r.registerRoot(n),Fo}function ka(){if(Bo)return Do;Bo=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return Do=e,e.default=e,Do}function xa(){if(Uo)return jo;Uo=1;let e=ga(),t=ka();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return jo=r,r.default=r,e.registerRule(r),jo}function Oa(){if(qo)return Wo;qo=1;let{dirname:e,relative:t,resolve:r,sep:n}=io,{SourceMapConsumer:s,SourceMapGenerator:i}=io,{pathToFileURL:o}=io,a=Sa(),l=Boolean(s&&i),c=Boolean(e&&r&&t&&n);return Wo=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 r,n=this.toUrl(this.path(t.file)),i=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=i.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new i({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 i({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),t=i.match(/\n/g),t?(r+=t.length,e=i.lastIndexOf("\n"),n=i.length-e):n+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let i=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=e(r(i,this.mapOpts.annotation)));let o=t(i,n);return this.memoizedPaths.set(n,o),o}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(o){let t=o(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function Ia(){if(Jo)return Ho;Jo=1;let e=ya(),t=fa(),r=ma(),n=Ca(),s=xa(),i=function(){if(Go)return Vo;Go=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),i=" ".charCodeAt(0),o="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Vo=function(k,x={}){let O,I,E,M,R,P,A,T,L,N,F=k.css.valueOf(),_=x.ignoreErrors,D=F.length,B=0,j=[],U=[];function $(e){throw k.error("Unclosed "+e,B)}return{back:function(e){U.push(e)},endOfFile:function(){return 0===U.length&&B>=D},nextToken:function(k){if(U.length)return U.pop();if(B>=D)return;let x=!!k&&k.ignoreUnclosed;switch(O=F.charCodeAt(B),O){case s:case i:case a:case l:case o:M=B;do{M+=1,O=F.charCodeAt(M)}while(O===i||O===s||O===a||O===l||O===o);P=["space",F.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);P=[e,e,B];break}case h:if(N=j.length?j.pop()[1]:"",L=F.charCodeAt(B+1),"url"===N&&L!==e&&L!==t&&L!==i&&L!==s&&L!==a&&L!==o&&L!==l){M=B;do{if(A=!1,M=F.indexOf(")",M+1),-1===M){if(_||x){M=B;break}$("bracket")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",F.slice(B,M+1),B,M],B=M}else M=F.indexOf(")",B+1),I=F.slice(B,M+1),-1===M||S.test(I)?P=["(","(",B]:(P=["brackets",I,B,M],B=M);break;case e:case t:R=O===e?"'":'"',M=B;do{if(A=!1,M=F.indexOf(R,M+1),-1===M){if(_||x){M=B+1;break}$("string")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",F.slice(B,M+1),B,M],B=M;break;case v:w.lastIndex=B+1,w.test(F),M=0===w.lastIndex?F.length-1:w.lastIndex-2,P=["at-word",F.slice(B,M+1),B,M],B=M;break;case r:for(M=B,E=!0;F.charCodeAt(M+1)===r;)M+=1,E=!E;if(O=F.charCodeAt(M+1),E&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(M+=1,C.test(F.charAt(M)))){for(;C.test(F.charAt(M+1));)M+=1;F.charCodeAt(M+1)===i&&(M+=1)}P=["word",F.slice(B,M+1),B,M],B=M;break;default:O===n&&F.charCodeAt(B+1)===g?(M=F.indexOf("*/",B+2)+1,0===M&&(_||x?M=F.length:$("comment")),P=["comment",F.slice(B,M+1),B,M],B=M):(b.lastIndex=B+1,b.test(F),M=0===b.lastIndex?F.length-1:b.lastIndex-2,P=["word",F.slice(B,M+1),B,M],j.push(P),B=M)}return B++,P},position:function(){return B}}}}();const o={empty:!0,space:!0};return Ho=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,i=new e;i.name=t[1].slice(1),""===i.name&&this.unnamedAtrule(i,t),this.init(i,t[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){i.source.end=this.getPosition(t[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(t=l[l.length-1],i.source.end=this.getPosition(t[3]||t[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(r=o,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,a=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}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 s,i,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],i=s[0],"space"!==i||e!==c-1||n?"comment"===i?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",o[l]||o[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},Ho}function Ea(){if(Yo)return Ko;Yo=1;let e=ga(),t=Sa(),r=Ia();function n(e,n){let s=new t(e,n),i=new r(s);try{i.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 i.root}return Ko=n,n.default=n,e.registerParse(n),Ko}function Ma(){if(Xo)return Qo;Xo=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 Qo=e,e.default=e,Qo}function Ra(){if(ea)return Zo;ea=1;let e=Ma();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return Zo=t,t.default=t,Zo}function Pa(){if(ra)return ta;ra=1;let e={};return ta=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Aa(){if(sa)return na;sa=1;let e=ga(),t=va(),r=Oa(),n=Ea(),s=Ra(),i=Ca(),o=mo(),{isClean:a,my:l}=da(),c=Pa();const u={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=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let y={};class v{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"}constructor(t,r,i){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof s)o=g(r.root),r.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{let t=n;i.syntax&&(t=i.syntax.parse),i.parser&&(t=i.parser),t.parse&&(t=t.parse);try{o=t(r,i)}catch(e){this.processed=!0,this.error=e}o&&!o[l]&&e.rebuild(o)}else o=g(r);this.result=new s(t,o,i),this.helpers={...y,postcss:y,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,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return 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=o;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return v.registerPostcss=e=>{y=e},na=v,v.default=v,i.registerLazyResult(v),t.registerLazyResult(v),na}function Ta(){if(la)return aa;la=1;let e=va(),t=Aa(),r=function(){if(oa)return ia;oa=1;let e=Oa(),t=Ea();const r=Ra();let n=mo(),s=Pa();class i{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,r=t;try{e=r(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"}constructor(t,s,i){let o;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=i,this._map=void 0;let a=n;this.result=new r(this._processor,o,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return ia=i,i.default=i,ia}(),n=Ca();class s{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return aa=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),aa}const La=eo(function(){if(ua)return ca;ua=1;let e=ya(),t=fa(),r=ga(),n=po(),s=ma(),i=va(),o=function(){if(zo)return $o;zo=1;let e=ya(),t=fa(),r=ma(),n=Sa(),s=ba(),i=Ca(),o=xa();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new i(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return $o=a,a.default=a,$o}(),a=Sa(),l=Aa(),c=ka(),u=pa(),h=Ea(),d=Ta(),p=Ra(),f=Ca(),m=xa(),g=mo(),y=Ma();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return v.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return v([s(r)]).process(e,t)},s},v.stringify=g,v.parse=h,v.fromJSON=o,v.list=c,v.comment=e=>new t(e),v.atRule=t=>new e(t),v.decl=e=>new s(e),v.rule=e=>new m(e),v.root=e=>new f(e),v.document=e=>new i(e),v.CssSyntaxError=n,v.Declaration=s,v.Container=r,v.Processor=d,v.Document=i,v.Comment=t,v.Warning=y,v.AtRule=e,v.Result=p,v.Input=a,v.Rule=m,v.Root=f,v.Node=u,l.registerPostcss(v),ca=v,v.default=v,ca}());La.stringify,La.fromJSON,La.plugin,La.parse,La.list,La.document,La.comment,La.atRule,La.rule,La.decl,La.root,La.CssSyntaxError,La.Declaration,La.Container,La.Processor,La.Document,La.Comment,La.Warning,La.AtRule,La.Result,La.Input,La.Rule,La.Root,La.Node;class Na{constructor(...e){Zi(this,"parentElement",null),Zi(this,"parentNode",null),Zi(this,"ownerDocument"),Zi(this,"firstChild",null),Zi(this,"lastChild",null),Zi(this,"previousSibling",null),Zi(this,"nextSibling",null),Zi(this,"ELEMENT_NODE",1),Zi(this,"TEXT_NODE",3),Zi(this,"nodeType"),Zi(this,"nodeName"),Zi(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 Na))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 Fa={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},_a={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Da={};function Ba(e){if(Da[e])return Da[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 Fa?Fa[e]:void 0,s=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]"))})),i=e in _a?_a[e]:void 0,o=Boolean(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&o)return Da[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const i=s[e].prototype;return document.body.removeChild(n),i?Da[e]=i:r}catch{return r}}const ja={};function Ua(e,t,r){var n;const s=`${e}.${String(r)}`;if(ja[s])return ja[s].call(t);const i=Ba(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(ja[s]=o,o.call(t)):t[r]}const $a={};function za(e,t,r){const n=`${e}.${String(r)}`;if($a[n])return $a[n].bind(t);const s=Ba(e)[r];return"function"!=typeof s?t[r]:($a[n]=s,s.bind(t))}const Wa={childNodes:function(e){return Ua("Node",e,"childNodes")},parentNode:function(e){return Ua("Node",e,"parentNode")},parentElement:function(e){return Ua("Node",e,"parentElement")},textContent:function(e){return Ua("Node",e,"textContent")},contains:function(e,t){return za("Node",e,"contains")(t)},getRootNode:function(e){return za("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ua("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ua("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ua("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ua("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ba("MutationObserver").constructor}};const qa="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 Va={map:{},getId:()=>(console.error(qa),-1),getNode:()=>(console.error(qa),null),removeNodeFromMap(){console.error(qa)},has:()=>(console.error(qa),!1),reset(){console.error(qa)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Va=new Proxy(Va,{get:(e,t,r)=>("map"===t&&console.error(qa),Reflect.get(e,t,r))}));let Ga=Date.now;function Ha(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Wa.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ga=()=>(new Date).getTime());function Ja(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Wa.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Wa.host(Wa.getRootNode(e))&&(r=Wa.host(Wa.getRootNode(e))),r}function Ka(e){let t,r=e;for(;t=Ja(r);)r=t;return r}function Ya(e){const t=e.ownerDocument;if(!t)return!1;const r=Ka(e);return Wa.contains(t,r)}const Qa=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){is(this,"id",1),is(this,"styleIDMap",new WeakMap),is(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 Va},closestElementOfNode:Ha,getBaseDimension:function e(t,r){var n,s;const i=null==(s=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:s.frameElement;if(!i||i===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),a=e(i,r),l=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.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:Ka,getShadowHost:Ja,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,s;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=Wa.parentElement(i.body))?void 0:t.scrollLeft)||(null==(r=null==i?void 0:i.body)?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(n=Wa.parentElement(i.body))?void 0:n.scrollTop)||(null==(s=null==i?void 0:i.body)?void 0:s.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof Na&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Wa.shadowRoot(e)))},hookSetter:function e(t,r,n,s,i=window){const o=i.Object.getOwnPropertyDescriptor(t,r);return i.Object.defineProperty(t,r,s?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>e(t,r,o||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(Wa.contains(t,e)||Ya(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&gs.host(e)||null;return Boolean(t&&"shadowRoot"in t&&gs.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=Wa.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))},isBlocked:function(e,t,r,n){if(!e)return!1;const s=Ha(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t))return!0;if(n&&null!==s.closest("."+t))return!0}else if(vs(s,t,n))return!0}catch(e){}if(r){if(s.matches(r))return!0;if(n&&null!==s.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 Ga},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],s=r(n);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{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 s of e){const{nextId:e,parentId:i}=s;if(e&&e in t){const i=t[e];if(i.parent){const e=i.parent.children.indexOf(i);i.parent.children.splice(e,0,r(s,i.parent))}else{const e=n.indexOf(i);n.splice(e,0,r(s,null))}continue}if(i in t){const e=t[i];e.children.push(r(s,e));continue}n.push(r(s,null))}return n},shadowHostInDom:Ya,throttle:function(e,t,r={}){let n=null,s=0;return function(...i){const o=Date.now();s||!1!==r.leading||(s=o);const a=t-(o-s),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),s=o,e.apply(l,i)):n||!1===r.trailing||(n=setTimeout(()=>{s=!1===r.leading?0:Date.now(),n=null,e.apply(l,i)},a))}},uniqueTextMutations:function(e){const t=new Set,r=[];for(let n=e.length;n--;){const s=e[n];t.has(s.id)||(r.push(s),t.add(s.id))}return r}},Symbol.toStringTag,{value:"Module"}));for(var Xa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Za="undefined"==typeof Uint8Array?[]:new Uint8Array(256),el=0;el<64;el++)Za[Xa.charCodeAt(el)]=el;"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==(es=e.contentWindow)?void 0:es.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var tl,rl;new ys,(rl=tl||(tl={}))[rl.NotStarted=0]="NotStarted",rl[rl.Running=1]="Running",rl[rl.Stopped=2]="Stopped";class nl{constructor(e){ns(this,"fileName"),ns(this,"functionName"),ns(this,"lineNumber"),ns(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 sl=/(^|@)\S+:\d+/,il=/^\s*at .*(\S+:\d+|\(native\))/m,ol=/^(eval@)?(\[native code])?$/,al={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(il)?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(il)},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),s=this.extractLocation(r?r[1]:n.pop()),i=n.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0];return new nl({functionName:i,fileName:o,lineNumber:s[1],columnNumber:s[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(ol)},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 nl({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new nl({functionName:n,fileName:s[0],lineNumber:s[1],columnNumber:s[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,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new nl({fileName:s[2],lineNumber:parseFloat(s[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,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new nl({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(sl)&&!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 nl({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function ll(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,s=[];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&&s.push(t)}s.length>1&&(r+=`:eq(${s.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function cl(e){return"[object Object]"===Object.prototype.toString.call(e)}function ul(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(cl(e[n])&&ul(e[n],t-1))return!0;return!1}function hl(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],s=[];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?s.splice(r,1/0,e):s.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+s.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(cl(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(cl(e)&&ul(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]=ll(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 dl={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 pl(e,t,r){const n=r?Object.assign({},dl,r):dl,s=n.logger;if(!s)return()=>{};let i;i="string"==typeof s?t[s]:s;let o=0,a=!1;const l=[];if(n.level.includes("error")){const r=t=>{const r=t.message,s=t.error,i=al.parse(s).map(e=>e.toString()),o=[hl(r,n.stringifyOptions)];e({level:"error",trace:i,payload:o})};t.addEventListener("error",r),l.push(()=>{t.removeEventListener("error",r)});const s=t=>{let r,s;t.reason instanceof Error?(r=t.reason,s=[hl(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[hl("Uncaught (in promise)",n.stringifyOptions),hl(t.reason,n.stringifyOptions)]);const i=al.parse(r).map(e=>e.toString());e({level:"error",trace:i,payload:s})};t.addEventListener("unhandledrejection",s),l.push(()=>{t.removeEventListener("unhandledrejection",s)})}for(const e of n.level)l.push(c(i,e));return()=>{l.forEach(e=>e())};function c(t,r){return t[r]?Qa.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=al.parse(new Error).map(e=>e.toString()).splice(1),i=("assert"===r?s.slice(1):s).map(e=>hl(e,n.stringifyOptions));o++,o<n.lengthThreshold?e({level:r,trace:t,payload:i}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[hl("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}const fl="rrweb/console@1";var ml,gl=Object.freeze({__proto__:null,PLUGIN_NAME:fl,getRecordConsolePlugin:e=>({name:fl,observer:pl,options:e})}),yl=Object.defineProperty,vl=(e,t,r)=>((e,t,r)=>t in e?yl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),wl=Object.defineProperty,bl=(e,t,r)=>((e,t,r)=>t in e?wl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Sl=(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))(Sl||{});const Cl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},kl={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},xl={};function Ol(e){if(xl[e])return xl[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 Cl?Cl[e]:void 0,s=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]"))})),i=e in kl?kl[e]:void 0,o=Boolean(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&o)return xl[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const i=s[e].prototype;return document.body.removeChild(n),i?xl[e]=i:r}catch{return r}}const Il={};function El(e,t,r){var n;const s=`${e}.${String(r)}`;if(Il[s])return Il[s].call(t);const i=Ol(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(Il[s]=o,o.call(t)):t[r]}const Ml={};function Rl(e,t,r){const n=`${e}.${String(r)}`;if(Ml[n])return Ml[n].bind(t);const s=Ol(e)[r];return"function"!=typeof s?t[r]:(Ml[n]=s,s.bind(t))}const Pl={childNodes:function(e){return El("Node",e,"childNodes")},parentNode:function(e){return El("Node",e,"parentNode")},parentElement:function(e){return El("Node",e,"parentElement")},textContent:function(e){return El("Node",e,"textContent")},contains:function(e,t){return Rl("Node",e,"contains")(t)},getRootNode:function(e){return Rl("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?El("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?El("Element",e,"shadowRoot"):null},querySelector:function(e,t){return El("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return El("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ol("MutationObserver").constructor}};function Al(e){return e.nodeType===e.ELEMENT_NODE}function Tl(e){const t=e&&"host"in e&&"mode"in e&&Pl.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Pl.shadowRoot(t)===e)}function Ll(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Nl(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 s=Array.from(r,e=>Fl(e,n)).join("");return(t=s).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 Fl(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Nl(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?Gl(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?Gl(r,t):r}}class _l{constructor(){bl(this,"idNodeMap",new Map),bl(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 Dl({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:i}){let o=s||"";const a=n&&Bl(n);return(t[r.toLowerCase()]||a&&t[a])&&(o=i?i(o,e):"*".repeat(o.length)),o}function Bl(e){return e.toLowerCase()}const jl="__rrweb_original__";function Ul(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Bl(t):null}function $l(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 zl=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Wl=/^(?:[a-z+]+:)?\/\//i,ql=/^www\..*/i,Vl=/^(data:)([^,]*),(.*)/i;function Gl(e,t){return(e||"").replace(zl,(e,r,n,s,i,o)=>{const a=n||i||o,l=r||s||"";if(!a)return e;if(Wl.test(a)||ql.test(a))return`url(${l}${a}${l})`;if(Vl.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 c=t.split("/"),u=a.split("/");c.pop();for(const e of u)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`})}function Hl(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Jl(e,t){return function(e,t,r=!1){const n=Array.from(t.childNodes),s=[];let i=0;if(n.length>1&&e&&"string"==typeof e){let t=Hl(e,r);const o=t.length/e.length;for(let a=1;a<n.length;a++)if(n[a].textContent&&"string"==typeof n[a].textContent){const l=Hl(n[a].textContent,r),c=100;let u=3;for(;u<l.length&&(l[u].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,u),1));u++);for(;u<l.length;u++){let h=l.substring(0,u),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 s.push(e),s;u=c+1}else u===l.length-1&&(p=t.indexOf(h));if(d.length>=2&&u>c){const e=n[a-1].textContent;if(e&&"string"==typeof e){const r=Hl(e).length;p=t.indexOf(h,r)}-1===p&&(p=d[0].length)}if(-1!==p){let a=Math.floor(p/o);for(;a>0&&a<e.length;){if(i+=1,i>50*n.length)return s.push(e),s;const l=Hl(e.substring(0,a),r);if(l.length===p){s.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)/o)):a-=Math.max(1,Math.floor((l.length-p)*o))}break}}}}return s.push(e),s}(e,t).join("/* rr_split */")}const Kl="lightgrey";let Yl=1;const Ql=new RegExp("[^a-z0-9-_:]");function Xl(){return Yl++}let Zl,ec;const tc=/^[^ \t\n\r\u000c]+/,rc=/^[, \t\n\r\u000c]+/;const nc=new WeakMap;function sc(e,t){return t&&""!==t.trim()?oc(e,t):t}function ic(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function oc(e,t){let r=nc.get(e);if(r||(r=e.createElement("a"),nc.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function ac(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?sc(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 s=e.exec(t.substring(r));return s?(n=s[0],r+=n.length,n):""}const s=[];for(;n(rc),!(r>=t.length);){let i=n(tc);if(","===i.slice(-1))i=sc(e,i.substring(0,i.length-1)),s.push(i);else{let n="";i=sc(e,i);let o=!1;for(;;){const e=t.charAt(r);if(""===e){s.push((i+n).trim());break}if(o)")"===e&&(o=!1);else{if(","===e){r+=1,s.push((i+n).trim());break}"("===e&&(o=!0)}n+=e,r+=1}}}return s.join(", ")}(e,n):"style"===r?Gl(n,oc(e)):"object"===t&&"data"===r?sc(e,n):n:sc(e,n):n}function lc(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function cc(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&cc(Pl.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&cc(Pl.parentNode(e),t,r)}function uc(e,t,r,n){let s;if(Al(e)){if(s=e,!Pl.childNodes(s).length)return!1}else{if(null===Pl.parentElement(e))return!1;s=Pl.parentElement(e)}try{if("string"==typeof t){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(cc(s,t,n))return!0;if(r)if(n){if(s.closest(r))return!0}else if(s.matches(r))return!0}catch(e){}return!1}function hc(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,maskAttributeFn:h,dataURLOptions:d={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:g=!1,cssCaptured:y=!1,applyBackgroundColorToBlockedElements:v=!1}=t,w=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:Sl.Document,childNodes:[],compatMode:e.compatMode}:{type:Sl.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Sl.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:i,maskInputOptions:o={},maskInputFn:a,maskAttributeFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:h,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:f,applyBackgroundColorToBlockedElements:m=!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,s),y=function(e){if(e instanceof HTMLFormElement)return"form";const t=Bl(e.tagName);return Ql.test(t)?"div":t}(e);let v={};const w=e.attributes.length;for(let t=0;t<w;t++){const n=e.attributes[t];if(!lc(y,n.name,n.value)){const t=ac(r,y,Bl(n.name),n.value);if(l&&null!==t){const r=l(n.name,t,e);null!==r&&(v[n.name]=r)}else v[n.name]=t}}if("link"===y&&i){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=Nl(t)),n&&(delete v.rel,delete v.href,v._cssText=n)}if("style"===y&&e.sheet){let t=Nl(e.sheet);t&&(e.childNodes.length>1&&(t=Jl(t,e)),v._cssText=t)}if("input"===y||"textarea"===y||"select"===y){const t=e.value,r=e.checked;"radio"!==v.type&&"checkbox"!==v.type&&"submit"!==v.type&&"button"!==v.type&&t?v.value=Dl({element:e,type:Ul(e),tagName:y,value:t,maskInputOptions:o,maskInputFn:a}):r&&(v.checked=r)}"option"===y&&(e.selected&&!o.select?v.selected=!0:delete v.selected);"dialog"===y&&e.open&&(v.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===y&&h)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 s=t.getImageData,i=jl in s?s[jl]:s;if(new Uint32Array(i.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(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(c.type,c.quality)&&(v.rr_dataURL=t)}if("img"===y&&u){Zl||(Zl=r.createElement("canvas"),ec=Zl.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{Zl.width=t.naturalWidth,Zl.height=t.naturalHeight,ec.drawImage(t,0,0),v.rr_dataURL=Zl.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i));console.warn(`Cannot inline img src=${n}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(s?v.crossOrigin=s:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if("audio"===y||"video"===y){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}p||(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`,...m?{rr_background_color:Kl}:{}}}"iframe"!==y||d(v.src)||(e.contentDocument||(v.rr_src=v.src),delete v.src);let b;try{customElements.get(y)&&(b=!0)}catch(e){}return{type:Sl.Element,tagName:y,attributes:v,childNodes:[],isSVG:ic(e)||void 0,needBlock:g,rootId:f,isCustom:b}}(e,{doc:r,blockClass:s,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,maskAttributeFn:h,dataURLOptions:d,inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:g,rootId:w,applyBackgroundColorToBlockedElements:v});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:i}=t,o=Pl.parentNode(e),a=o&&o.tagName;let l="";const c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;u?l="SCRIPT_PLACEHOLDER":i||(l=Pl.textContent(e),c&&l&&(l=Gl(l,oc(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,Pl.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Sl.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:c,rootId:w,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:Sl.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:Sl.Comment,textContent:Pl.textContent(e)||"",rootId:w};default:return!1}}function dc(e){return null==e?"":e.toLowerCase()}function pc(e,t,r){return Array.from(e).map(e=>{const n=t(e);let s=[];if(!r.has(n)){r.add(n);try{s=Array.from(e.cssRules,(t,r)=>({rule:Fl(t,e.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}return{styleId:n,rules:s}})}function fc(e,t){var r,n;const{doc:s,mirror:i,blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:c,skipChild:u=!1,inlineStylesheet:h=!0,maskInputOptions:d={},maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y={},inlineImages:v=!1,recordCanvas:w=!1,onSerialize:b,onAdoptedStyleSheet:S,onIframeLoad:C,iframeLoadTimeout:k=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:O=5e3,keepIframeSrcFn:I=()=>!1,newlyAddedElement:E=!1,cssCaptured:M=!1,applyBackgroundColorToBlockedElements:R=!1}=t,P=t._emittedStyleIds??new Set;let{needsMask:A}=t,{preserveWhiteSpace:T=!0}=t;if(!A){A=uc(e,l,c,void 0===A)}const L=hc(e,{doc:s,mirror:i,blockClass:o,blockSelector:a,needsMask:A,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,dataURLOptions:y,inlineImages:v,recordCanvas:w,keepIframeSrcFn:I,newlyAddedElement:E,cssCaptured:M,applyBackgroundColorToBlockedElements:R});if(!L)return console.warn(e,"not serialized"),null;let N;N=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===Sl.Comment)return!0;if(e.type===Sl.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"===$l(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(dc(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===dc(e.attributes.name)||"icon"===dc(e.attributes.rel)||"apple-touch-icon"===dc(e.attributes.rel)||"shortcut icon"===dc(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&dc(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(dc(e.attributes.property).match(/^(og|twitter|fb):/)||dc(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===dc(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===dc(e.attributes.name)||"googlebot"===dc(e.attributes.name)||"bingbot"===dc(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===dc(e.attributes.name)||"generator"===dc(e.attributes.name)||"framework"===dc(e.attributes.name)||"publisher"===dc(e.attributes.name)||"progid"===dc(e.attributes.name)||dc(e.attributes.property).match(/^article:/)||dc(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===dc(e.attributes.name)||"yandex-verification"===dc(e.attributes.name)||"csrf-token"===dc(e.attributes.name)||"p:domain_verify"===dc(e.attributes.name)||"verify-v1"===dc(e.attributes.name)||"verification"===dc(e.attributes.name)||"shopify-checkout-api-token"===dc(e.attributes.name)))return!0}}return!1}(L,g)||!T&&L.type===Sl.Text&&!L.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Xl();const F=Object.assign(L,{id:N});if(i.add(e,F),-2===N)return null;b&&b(e);let _=!u;if(F.type===Sl.Element){_=_&&!F.needBlock,delete F.needBlock;const t=Pl.shadowRoot(e);t&&Ll(t)&&(F.isShadowHost=!0,S&&(null==(r=t.adoptedStyleSheets)?void 0:r.length)&&(F.adoptedStyleSheets=pc(t.adoptedStyleSheets,S,P)))}if(F.type===Sl.Document&&S){const t=e;(null==(n=t.adoptedStyleSheets)?void 0:n.length)&&(F.adoptedStyleSheets=pc(t.adoptedStyleSheets,S,P))}if((F.type===Sl.Document||F.type===Sl.Element)&&_){g.headWhitespace&&F.type===Sl.Element&&"head"===F.tagName&&(T=!1);const t={doc:s,mirror:i,blockClass:o,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:u,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:v,recordCanvas:w,preserveWhiteSpace:T,onSerialize:b,onAdoptedStyleSheet:S,_emittedStyleIds:P,onIframeLoad:C,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:I,cssCaptured:!1,applyBackgroundColorToBlockedElements:R};if(F.type===Sl.Element&&"textarea"===F.tagName&&void 0!==F.attributes.value);else{F.type===Sl.Element&&void 0!==F.attributes._cssText&&"string"==typeof F.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(Pl.childNodes(e))){const e=fc(r,t);e&&F.childNodes.push(e)}}let r=null;if(Al(e)&&(r=Pl.shadowRoot(e)))for(const e of Array.from(Pl.childNodes(r))){const n=fc(e,t);n&&(Ll(r)&&(n.isShadow=!0),F.childNodes.push(n))}}const D=Pl.parentNode(e);return D&&Tl(D)&&Ll(D)&&(F.isShadow=!0),F.type===Sl.Element&&"iframe"===F.tagName&&function(e,t,r){const n=e.contentWindow;if(!n)return;let s,i=!1;try{s=n.document.readyState}catch(e){return}if("complete"!==s){const n=setTimeout(()=>{i||(t(),i=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(n),i=!0,t()})}const o="about:blank";if(n.location.href!==o||e.src===o||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&C){const r=fc(t,{doc:t,mirror:i,blockClass:o,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:v,recordCanvas:w,preserveWhiteSpace:T,onSerialize:b,onAdoptedStyleSheet:S,_emittedStyleIds:P,onIframeLoad:C,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:I});r&&C(e,r)}},k),F.type===Sl.Element&&"link"===F.tagName&&"string"==typeof F.attributes.rel&&("stylesheet"===F.attributes.rel||"preload"===F.attributes.rel&&"string"==typeof F.attributes.href&&"css"===$l(F.attributes.href))&&function(e,t,r){let n,s=!1;try{n=e.sheet}catch(e){return}if(n)return;const i=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),s=!0,t()})}(e,()=>{if(x){const t=fc(e,{doc:s,mirror:i,blockClass:o,blockSelector:a,needsMask:A,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:v,recordCanvas:w,preserveWhiteSpace:T,onSerialize:b,onIframeLoad:C,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:I});t&&x(e,t)}},O),F}function mc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gc(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 yc,vc={exports:{}};function wc(){if(yc)return vc.exports;yc=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return vc.exports=t(),vc.exports.createColors=t,vc.exports}const bc=gc(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Sc,Cc,kc,xc,Oc,Ic;function Ec(){if(Cc)return Sc;Cc=1;let e=wc(),t=bc;class r extends Error{constructor(e,t,n,s,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),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);let s=e=>e,i=e=>e,o=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);i=e=>r(a(e)),s=e=>n(e),t&&(o=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+s(n)+o(l)+"\n "+c+i("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(n)+o(e)+"\n "+t+i("^")}return" "+s(n)+o(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Sc=r,r.default=r,Sc}function Mc(){if(xc)return kc;xc=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let i=t.parent;if("before"===n){if(!i||"root"===i.type&&i.first===t)return"";if(i&&"document"===i.type)return""}if(!i)return e[n];let o=t.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](o,t):o.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),o.rawCache[n]=s,s}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 kc=t,t.default=t,kc}function Rc(){if(Ic)return Oc;Ic=1;let e=Mc();function t(t,r){new e(r).stringify(t)}return Oc=t,t.default=t,Oc}var Pc,Ac,Tc,Lc,Nc,Fc,_c,Dc,Bc,jc,Uc,$c,zc,Wc,qc,Vc,Gc,Hc,Jc,Kc,Yc,Qc,Xc,Zc,eu,tu,ru,nu,su,iu,ou,au,lu,cu,uu,hu,du,pu,fu,mu,gu,yu,vu,wu,bu,Su,Cu,ku,xu,Ou={};function Iu(){return Pc||(Pc=1,Ou.isClean=Symbol("isClean"),Ou.my=Symbol("my")),Ou}function Eu(){if(Tc)return Ac;Tc=1;let e=Ec(),t=Mc(),r=Rc(),{isClean:n,my:s}=Iu();function i(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 s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>i(e,r)):("object"===o&&null!==s&&(s=i(s)),r[n]=s)}return r}function o(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let i=0;i<e.length;i++){if(n===t.line&&r===t.column){s=i;break}"\n"===e[i]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=i(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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(o(r,this.source.start),o(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=o(n,this.source.start),i=s+e;for(let e=s;e<i;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:o(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:o(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(o(t,this.source.start),o(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:o(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:o(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,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=r){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)}}return Ac=a,a.default=a,Ac}function Mu(){if(Nc)return Lc;Nc=1;let e=Eu();class t extends e{constructor(e){super(e),this.type="comment"}}return Lc=t,t.default=t,Lc}function Ru(){if(_c)return Fc;_c=1;let e=Eu();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return Fc=t,t.default=t,Fc}function Pu(){if(Bc)return Dc;Bc=1;let e,t,r,n,s=Mu(),i=Ru(),o=Eu(),{isClean:a,my:l}=Iu();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends o{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(r,o){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new i(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&o&&void 0!==o.raws.before&&(e.raws.before=o.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},Dc=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,i.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},Dc}function Au(){if(Uc)return jc;Uc=1;let e=Pu();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 jc=t,t.default=t,e.registerAtRule(t),jc}function Tu(){if(zc)return $c;zc=1;let e,t,r=Pu();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},$c=n,n.default=n,$c}function Lu(){if(qc)return Wc;qc=1;return Wc={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},Wc}function Nu(){if(Gc)return Vc;Gc=1;let{existsSync:e,readFileSync:t}=bc,{dirname:r,join:n}=bc,{SourceMapConsumer:s,SourceMapGenerator:i}=bc;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Vc=o,o.default=o,Vc}function Fu(){if(Jc)return Hc;Jc=1;let{nanoid:e}=Lu(),{isAbsolute:t,resolve:r}=bc,{SourceMapConsumer:n,SourceMapGenerator:s}=bc,{fileURLToPath:i,pathToFileURL:o}=bc,a=Ec(),l=Nu(),c=bc,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);i=e.line,s=e.col}else i=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,i,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:s,line:i},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:i,endOffset:l,line:t,offset:c,source:this.css},this.file&&(o&&(u.input.url=o(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?o(u.source):new URL(u.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!i)throw new Error("file: protocol is not available in this PostCSS build");h.file=i(l)}let d=c.sourceContentFor(u.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}}return Hc=f,f.default=f,c&&c.registerInput&&c.registerInput(f),Hc}function _u(){if(Yc)return Kc;Yc=1;let e,t,r=Pu();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},Kc=n,n.default=n,r.registerRoot(n),Kc}function Du(){if(Xc)return Qc;Xc=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return Qc=e,e.default=e,Qc}function Bu(){if(eu)return Zc;eu=1;let e=Pu(),t=Du();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return Zc=r,r.default=r,e.registerRule(r),Zc}function ju(){if(su)return nu;su=1;let{dirname:e,relative:t,resolve:r,sep:n}=bc,{SourceMapConsumer:s,SourceMapGenerator:i}=bc,{pathToFileURL:o}=bc,a=Fu(),l=Boolean(s&&i),c=Boolean(e&&r&&t&&n);return nu=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 r,n=this.toUrl(this.path(t.file)),i=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=i.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new i({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 i({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),t=i.match(/\n/g),t?(r+=t.length,e=i.lastIndexOf("\n"),n=i.length-e):n+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let i=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=e(r(i,this.mapOpts.annotation)));let o=t(i,n);return this.memoizedPaths.set(n,o),o}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(o){let t=o(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},nu}function Uu(){if(lu)return au;lu=1;let e=Au(),t=Mu(),r=Ru(),n=_u(),s=Bu(),i=function(){if(ou)return iu;ou=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),i=" ".charCodeAt(0),o="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return iu=function(k,x={}){let O,I,E,M,R,P,A,T,L,N,F=k.css.valueOf(),_=x.ignoreErrors,D=F.length,B=0,j=[],U=[];function $(e){throw k.error("Unclosed "+e,B)}return{back:function(e){U.push(e)},endOfFile:function(){return 0===U.length&&B>=D},nextToken:function(k){if(U.length)return U.pop();if(B>=D)return;let x=!!k&&k.ignoreUnclosed;switch(O=F.charCodeAt(B),O){case s:case i:case a:case l:case o:M=B;do{M+=1,O=F.charCodeAt(M)}while(O===i||O===s||O===a||O===l||O===o);P=["space",F.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);P=[e,e,B];break}case h:if(N=j.length?j.pop()[1]:"",L=F.charCodeAt(B+1),"url"===N&&L!==e&&L!==t&&L!==i&&L!==s&&L!==a&&L!==o&&L!==l){M=B;do{if(A=!1,M=F.indexOf(")",M+1),-1===M){if(_||x){M=B;break}$("bracket")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",F.slice(B,M+1),B,M],B=M}else M=F.indexOf(")",B+1),I=F.slice(B,M+1),-1===M||S.test(I)?P=["(","(",B]:(P=["brackets",I,B,M],B=M);break;case e:case t:R=O===e?"'":'"',M=B;do{if(A=!1,M=F.indexOf(R,M+1),-1===M){if(_||x){M=B+1;break}$("string")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",F.slice(B,M+1),B,M],B=M;break;case v:w.lastIndex=B+1,w.test(F),M=0===w.lastIndex?F.length-1:w.lastIndex-2,P=["at-word",F.slice(B,M+1),B,M],B=M;break;case r:for(M=B,E=!0;F.charCodeAt(M+1)===r;)M+=1,E=!E;if(O=F.charCodeAt(M+1),E&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(M+=1,C.test(F.charAt(M)))){for(;C.test(F.charAt(M+1));)M+=1;F.charCodeAt(M+1)===i&&(M+=1)}P=["word",F.slice(B,M+1),B,M],B=M;break;default:O===n&&F.charCodeAt(B+1)===g?(M=F.indexOf("*/",B+2)+1,0===M&&(_||x?M=F.length:$("comment")),P=["comment",F.slice(B,M+1),B,M],B=M):(b.lastIndex=B+1,b.test(F),M=0===b.lastIndex?F.length-1:b.lastIndex-2,P=["word",F.slice(B,M+1),B,M],j.push(P),B=M)}return B++,P},position:function(){return B}}}}();const o={empty:!0,space:!0};return au=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,i=new e;i.name=t[1].slice(1),""===i.name&&this.unnamedAtrule(i,t),this.init(i,t[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){i.source.end=this.getPosition(t[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(t=l[l.length-1],i.source.end=this.getPosition(t[3]||t[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(r=o,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,a=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}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 s,i,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],i=s[0],"space"!==i||e!==c-1||n?"comment"===i?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",o[l]||o[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},au}function $u(){if(uu)return cu;uu=1;let e=Pu(),t=Fu(),r=Uu();function n(e,n){let s=new t(e,n),i=new r(s);try{i.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 i.root}return cu=n,n.default=n,e.registerParse(n),cu}function zu(){if(du)return hu;du=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 hu=e,e.default=e,hu}function Wu(){if(fu)return pu;fu=1;let e=zu();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return pu=t,t.default=t,pu}function qu(){if(gu)return mu;gu=1;let e={};return mu=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Vu(){if(vu)return yu;vu=1;let e=Pu(),t=Tu(),r=ju(),n=$u(),s=Wu(),i=_u(),o=Rc(),{isClean:a,my:l}=Iu(),c=qu();const u={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=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let y={};class v{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"}constructor(t,r,i){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof s)o=g(r.root),r.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{let t=n;i.syntax&&(t=i.syntax.parse),i.parser&&(t=i.parser),t.parse&&(t=t.parse);try{o=t(r,i)}catch(e){this.processed=!0,this.error=e}o&&!o[l]&&e.rebuild(o)}else o=g(r);this.result=new s(t,o,i),this.helpers={...y,postcss:y,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,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return 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=o;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return v.registerPostcss=e=>{y=e},yu=v,v.default=v,i.registerLazyResult(v),t.registerLazyResult(v),yu}function Gu(){if(Cu)return Su;Cu=1;let e=Tu(),t=Vu(),r=function(){if(bu)return wu;bu=1;let e=ju(),t=$u();const r=Wu();let n=Rc(),s=qu();class i{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,r=t;try{e=r(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"}constructor(t,s,i){let o;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=i,this._map=void 0;let a=n;this.result=new r(this._processor,o,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return wu=i,i.default=i,wu}(),n=_u();class s{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Su=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),Su}var Hu=function(){if(xu)return ku;xu=1;let e=Au(),t=Mu(),r=Pu(),n=Ec(),s=Ru(),i=Tu(),o=function(){if(ru)return tu;ru=1;let e=Au(),t=Mu(),r=Ru(),n=Fu(),s=Nu(),i=_u(),o=Bu();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new i(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return tu=a,a.default=a,tu}(),a=Fu(),l=Vu(),c=Du(),u=Eu(),h=$u(),d=Gu(),p=Wu(),f=_u(),m=Bu(),g=Rc(),y=zu();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return v.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return v([s(r)]).process(e,t)},s},v.stringify=g,v.parse=h,v.fromJSON=o,v.list=c,v.comment=e=>new t(e),v.atRule=t=>new e(t),v.decl=e=>new s(e),v.rule=e=>new m(e),v.root=e=>new f(e),v.document=e=>new i(e),v.CssSyntaxError=n,v.Declaration=s,v.Container=r,v.Processor=d,v.Document=i,v.Comment=t,v.Warning=y,v.AtRule=e,v.Result=p,v.Input=a,v.Rule=m,v.Root=f,v.Node=u,l.registerPostcss(v),ku=v,v.default=v,ku}();const Ju=mc(Hu);Ju.stringify,Ju.fromJSON,Ju.plugin,Ju.parse,Ju.list,Ju.document,Ju.comment,Ju.atRule,Ju.rule,Ju.decl,Ju.root,Ju.CssSyntaxError,Ju.Declaration,Ju.Container,Ju.Processor,Ju.Document,Ju.Comment,Ju.Warning,Ju.AtRule,Ju.Result,Ju.Input,Ju.Rule,Ju.Root,Ju.Node;var Ku=Object.defineProperty,Yu=(e,t,r)=>((e,t,r)=>t in e?Ku(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Qu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Xu(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 Zu,eh={exports:{}};function th(){if(Zu)return eh.exports;Zu=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,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return eh.exports=t(),eh.exports.createColors=t,eh.exports}const rh=Xu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var nh,sh,ih,oh,ah,lh;function ch(){if(sh)return nh;sh=1;let e=th(),t=rh;class r extends Error{constructor(e,t,n,s,i,o){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),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);let s=e=>e,i=e=>e,o=e=>e;if(r){let{bold:r,gray:n,red:a}=e.createColors(!0);i=e=>r(a(e)),s=e=>n(e),t&&(o=e=>t(e))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map((e,t)=>{let r=l+1+t,n=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=s(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+s(n)+o(l)+"\n "+c+i("^")}let t=s(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(n)+o(e)+"\n "+t+i("^")}return" "+s(n)+o(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return nh=r,r.default=r,nh}function uh(){if(oh)return ih;oh=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 s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,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,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;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 s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,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 s;if(n||(n=r),r&&(s=t.raws[r],void 0!==s))return s;let i=t.parent;if("before"===n){if(!i||"root"===i.type&&i.first===t)return"";if(i&&"document"===i.type)return""}if(!i)return e[n];let o=t.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(t,n);{let e="raw"+((a=n)[0].toUpperCase()+a.slice(1));this[e]?s=this[e](o,t):o.walk(e=>{if(s=e.raws[r],void 0!==s)return!1})}var a;return void 0===s&&(s=e[n]),o.rawCache[n]=s,s}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 ih=t,t.default=t,ih}function hh(){if(lh)return ah;lh=1;let e=uh();function t(t,r){new e(r).stringify(t)}return ah=t,t.default=t,ah}var dh,ph,fh,mh,gh,yh,vh,wh,bh,Sh,Ch,kh,xh,Oh,Ih,Eh,Mh,Rh,Ph,Ah,Th,Lh,Nh,Fh,_h,Dh,Bh,jh,Uh,$h,zh,Wh,qh,Vh,Gh,Hh,Jh,Kh,Yh,Qh,Xh,Zh,ed,td,rd,nd,sd,id,od,ad={};function ld(){return dh||(dh=1,ad.isClean=Symbol("isClean"),ad.my=Symbol("my")),ad}function cd(){if(fh)return ph;fh=1;let e=ch(),t=uh(),r=hh(),{isClean:n,my:s}=ld();function i(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 s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>i(e,r)):("object"===o&&null!==s&&(s=i(s)),r[n]=s)}return r}function o(e,t){if(t&&void 0!==t.offset)return t.offset;let r=1,n=1,s=0;for(let i=0;i<e.length;i++){if(n===t.line&&r===t.column){s=i;break}"\n"===e[i]?(r=1,n+=1):r+=1}return s}class a{get proxyOf(){return this}constructor(e={}){this.raws={},this[n]=!1,this[s]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=i(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(t,r={}){if(this.source){let{end:e,start:n}=this.rangeBy(r);return this.source.input.error(t,{column:n.column,line:n.line},{column:e.column,line:e.line},r)}return new e(t)}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)}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let e=this;for(;e=e.parent;)e[n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e={}){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,n=r.slice(o(r,this.source.start),o(r,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,r=this.source.start.line,n="document"in this.source.input?this.source.input.document:this.source.input.css,s=o(n,this.source.start),i=s+e;for(let e=s;e<i;e++)"\n"===n[e]?(t=1,r+=1):t+=1;return{column:t,line:r,offset:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e={}){let t="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:o(t,this.source.start)},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:"number"==typeof this.source.end.offset?this.source.end.offset:o(t,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(e.word){let s=t.slice(o(t,this.source.start),o(t,this.source.end)).indexOf(e.word);-1!==s&&(r=this.positionInside(s),n=this.positionInside(s+e.word.length))}else e.start?r={column:e.start.column,line:e.start.line,offset:o(t,e.start)}:e.index&&(r=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line,offset:o(t,e.end)}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<r.line||n.line===r.line&&n.column<=r.column)&&(n={column:r.column+1,line:r.line,offset:r.offset+1}),{end:n,start:r}}raw(e,r){return(new t).raw(this,e,r)}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 s=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){if(null==n)continue;let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,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=r){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)}}return ph=a,a.default=a,ph}function ud(){if(gh)return mh;gh=1;let e=cd();class t extends e{constructor(e){super(e),this.type="comment"}}return mh=t,t.default=t,mh}function hd(){if(vh)return yh;vh=1;let e=cd();class t extends e{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}}return yh=t,t.default=t,yh}function dd(){if(bh)return wh;bh=1;let e,t,r,n,s=ud(),i=hd(),o=cd(),{isClean:a,my:l}=ld();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends o{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]}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),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(r,o){if("string"==typeof r)r=c(t(r).nodes);else if(void 0===r)r=[];else if(Array.isArray(r)){r=r.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===r.type&&"document"!==this.type){r=r.nodes.slice(0);for(let e of r)e.parent&&e.parent.removeChild(e,"ignore")}else if(r.type)r=[r];else if(r.prop){if(void 0===r.value)throw new Error("Value field is missed in node creation");"string"!=typeof r.value&&(r.value=String(r.value)),r=[new i(r)]}else if(r.selector||r.selectors)r=[new n(r)];else if(r.name)r=[new e(r)];else{if(!r.text)throw new Error("Unknown node type in node creation");r=[new s(r)]}return r.map(e=>(e[l]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&u(e),e.raws||(e.raws={}),void 0===e.raws.before&&o&&void 0!==o.raws.before&&(e.raws.before=o.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)}))}}return h.registerParse=e=>{t=e},h.registerRule=e=>{n=e},h.registerAtRule=t=>{e=t},h.registerRoot=e=>{r=e},wh=h,h.default=h,h.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,e.prototype):"rule"===t.type?Object.setPrototypeOf(t,n.prototype):"decl"===t.type?Object.setPrototypeOf(t,i.prototype):"comment"===t.type?Object.setPrototypeOf(t,s.prototype):"root"===t.type&&Object.setPrototypeOf(t,r.prototype),t[l]=!0,t.nodes&&t.nodes.forEach(e=>{h.rebuild(e)})},wh}function pd(){if(Ch)return Sh;Ch=1;let e=dd();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 Sh=t,t.default=t,e.registerAtRule(t),Sh}function fd(){if(xh)return kh;xh=1;let e,t,r=dd();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},kh=n,n.default=n,kh}function md(){if(Ih)return Oh;Ih=1;return Oh={nanoid:(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=0|r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},Oh}function gd(){if(Mh)return Eh;Mh=1;let{existsSync:e,readFileSync:t}=rh,{dirname:r,join:n}=rh,{SourceMapConsumer:s,SourceMapGenerator:i}=rh;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,s=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=r(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new s(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let r=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(r)return n=e.substr(r[0].length),Buffer?Buffer.from(n,"base64").toString():window.atob(n);var n;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}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=/g);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(n){if(this.root=r(n),e(n))return this.mapFile=n,t(n,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof s)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=n(r(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Eh=o,o.default=o,Eh}function yd(){if(Ph)return Rh;Ph=1;let{nanoid:e}=md(),{isAbsolute:t,resolve:r}=rh,{SourceMapConsumer:n,SourceMapGenerator:s}=rh,{fileURLToPath:i,pathToFileURL:o}=rh,a=ch(),l=gd(),c=rh,u=Symbol("lineToIndexCache"),h=Boolean(n&&s),d=Boolean(r&&t);function p(e){if(e[u])return e[u];let t=e.css.split("\n"),r=new Array(t.length),n=0;for(let e=0,s=t.length;e<s;e++)r[e]=n,n+=t[e].length+1;return e[u]=r,r}class f{get from(){return this.file||this.id}constructor(n,s={}){if(null==n||"object"==typeof n&&!n.toString)throw new Error(`PostCSS received ${n} instead of CSS string`);if(this.css=n.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,s.document&&(this.document=s.document.toString()),s.from&&(!d||/^\w+:\/\//.test(s.from)||t(s.from)?this.file=s.from:this.file=r(s.from)),d&&h){let e=new l(this.css,s);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 "+e(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,l,c,u;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){c=e.offset;let n=this.fromOffset(c);t=n.line,r=n.col}else t=e.line,r=e.column,c=this.fromLineAndColumn(t,r);if("number"==typeof n.offset){l=n.offset;let e=this.fromOffset(l);i=e.line,s=e.col}else i=n.line,s=n.column,l=this.fromLineAndColumn(n.line,n.column)}else if(r)c=this.fromLineAndColumn(t,r);else{c=t;let e=this.fromOffset(c);t=e.line,r=e.col}let h=this.origin(t,r,i,s);return u=h?new a(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,n.plugin):new a(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:s,line:i},this.css,this.file,n.plugin),u.input={column:r,endColumn:s,endLine:i,endOffset:l,line:t,offset:c,source:this.css},this.file&&(o&&(u.input.url=o(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(e,t){return p(this)[e-1]+t-1}fromOffset(e){let t=p(this),r=0;if(e>=t[t.length-1])r=t.length-1;else{let n,s=t.length-2;for(;r<s;)if(n=r+(s-r>>1),e<t[n])s=n-1;else{if(!(e>=t[n+1])){r=n;break}r=n+1}}return{col:e-t[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,r,n,s){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:r,line:e});if(!u.source)return!1;"number"==typeof n&&(a=c.originalPositionFor({column:s,line:n})),l=t(u.source)?o(u.source):new URL(u.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let h={column:u.column,endColumn:a&&a.column,endLine:a&&a.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!i)throw new Error("file: protocol is not available in this PostCSS build");h.file=i(l)}let d=c.sourceContentFor(u.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}}return Rh=f,f.default=f,c&&c.registerInput&&c.registerInput(f),Rh}function vd(){if(Th)return Ah;Th=1;let e,t,r=dd();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},Ah=n,n.default=n,r.registerRoot(n),Ah}function wd(){if(Nh)return Lh;Nh=1;let e={comma:t=>e.split(t,[","],!0),space:t=>e.split(t,[" ","\n","\t"]),split(e,t,r){let n=[],s="",i=!1,o=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?o+=1:")"===r?o>0&&(o-=1):0===o&&t.includes(r)&&(i=!0),i?(""!==s&&n.push(s.trim()),s="",i=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};return Lh=e,e.default=e,Lh}function bd(){if(_h)return Fh;_h=1;let e=dd(),t=wd();class r extends e{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)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}}return Fh=r,r.default=r,e.registerRule(r),Fh}function Sd(){if(Uh)return jh;Uh=1;let{dirname:e,relative:t,resolve:r,sep:n}=rh,{SourceMapConsumer:s,SourceMapGenerator:i}=rh,{pathToFileURL:o}=rh,a=yd(),l=Boolean(s&&i),c=Boolean(e&&r&&t&&n);return jh=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 r,n=this.toUrl(this.path(t.file)),i=t.root||e(t.file);!1===this.mapOpts.sourcesContent?(r=new s(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,n,this.toUrl(this.path(i)))}}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&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&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=i.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new i({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 i({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),t=i.match(/\n/g),t?(r+=t.length,e=i.lastIndexOf("\n"),n=i.length-e):n+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(n){if(this.mapOpts.absolute)return n;if(60===n.charCodeAt(0))return n;if(/^\w+:\/\//.test(n))return n;let s=this.memoizedPaths.get(n);if(s)return s;let i=this.opts.to?e(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=e(r(i,this.mapOpts.annotation)));let o=t(i,n);return this.memoizedPaths.set(n,o),o}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(o){let t=o(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;"\\"===n&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},jh}function Cd(){if(qh)return Wh;qh=1;let e=pd(),t=ud(),r=hd(),n=vd(),s=bd(),i=function(){if(zh)return $h;zh=1;const e="'".charCodeAt(0),t='"'.charCodeAt(0),r="\\".charCodeAt(0),n="/".charCodeAt(0),s="\n".charCodeAt(0),i=" ".charCodeAt(0),o="\f".charCodeAt(0),a="\t".charCodeAt(0),l="\r".charCodeAt(0),c="[".charCodeAt(0),u="]".charCodeAt(0),h="(".charCodeAt(0),d=")".charCodeAt(0),p="{".charCodeAt(0),f="}".charCodeAt(0),m=";".charCodeAt(0),g="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return $h=function(k,x={}){let O,I,E,M,R,P,A,T,L,N,F=k.css.valueOf(),_=x.ignoreErrors,D=F.length,B=0,j=[],U=[];function $(e){throw k.error("Unclosed "+e,B)}return{back:function(e){U.push(e)},endOfFile:function(){return 0===U.length&&B>=D},nextToken:function(k){if(U.length)return U.pop();if(B>=D)return;let x=!!k&&k.ignoreUnclosed;switch(O=F.charCodeAt(B),O){case s:case i:case a:case l:case o:M=B;do{M+=1,O=F.charCodeAt(M)}while(O===i||O===s||O===a||O===l||O===o);P=["space",F.slice(B,M)],B=M-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);P=[e,e,B];break}case h:if(N=j.length?j.pop()[1]:"",L=F.charCodeAt(B+1),"url"===N&&L!==e&&L!==t&&L!==i&&L!==s&&L!==a&&L!==o&&L!==l){M=B;do{if(A=!1,M=F.indexOf(")",M+1),-1===M){if(_||x){M=B;break}$("bracket")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["brackets",F.slice(B,M+1),B,M],B=M}else M=F.indexOf(")",B+1),I=F.slice(B,M+1),-1===M||S.test(I)?P=["(","(",B]:(P=["brackets",I,B,M],B=M);break;case e:case t:R=O===e?"'":'"',M=B;do{if(A=!1,M=F.indexOf(R,M+1),-1===M){if(_||x){M=B+1;break}$("string")}for(T=M;F.charCodeAt(T-1)===r;)T-=1,A=!A}while(A);P=["string",F.slice(B,M+1),B,M],B=M;break;case v:w.lastIndex=B+1,w.test(F),M=0===w.lastIndex?F.length-1:w.lastIndex-2,P=["at-word",F.slice(B,M+1),B,M],B=M;break;case r:for(M=B,E=!0;F.charCodeAt(M+1)===r;)M+=1,E=!E;if(O=F.charCodeAt(M+1),E&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(M+=1,C.test(F.charAt(M)))){for(;C.test(F.charAt(M+1));)M+=1;F.charCodeAt(M+1)===i&&(M+=1)}P=["word",F.slice(B,M+1),B,M],B=M;break;default:O===n&&F.charCodeAt(B+1)===g?(M=F.indexOf("*/",B+2)+1,0===M&&(_||x?M=F.length:$("comment")),P=["comment",F.slice(B,M+1),B,M],B=M):(b.lastIndex=B+1,b.test(F),M=0===b.lastIndex?F.length-1:b.lastIndex-2,P=["word",F.slice(B,M+1),B,M],j.push(P),B=M)}return B++,P},position:function(){return B}}}}();const o={empty:!0,space:!0};return Wh=class{constructor(e){this.input=e,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(t){let r,n,s,i=new e;i.name=t[1].slice(1),""===i.name&&this.unnamedAtrule(i,t),this.init(i,t[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(r=(t=this.tokenizer.nextToken())[0],"("===r||"["===r?c.push("("===r?")":"]"):"{"===r&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),0===c.length){if(";"===r){i.source.end=this.getPosition(t[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===r){a=!0;break}if("}"===r){if(l.length>0){for(s=l.length-1,n=l[s];n&&"space"===n[0];)n=l[--s];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(t);break}l.push(t)}else l.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(t=l[l.length-1],i.source.end=this.getPosition(t[3]||t[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[i,o]of e.entries()){if(r=o,n=r[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(r)}t=r}return!1}comment(e){let r=new t;this.init(r,e[2]),r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))r.text="",r.raws.left=n,r.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);r.text=e[2],r.raws.left=e[1],r.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let s,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){n.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),n.raws.between+=s[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,a=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(s.trim().startsWith("!")&&"space"!==t)break;s=r.pop()[1]+s}s.trim().startsWith("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new s;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 t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="",t.source.end=this.getPosition(e[2]),t.source.end.offset+=t.raws.ownSemicolon.length)}}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,s=null,i=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),i.push("("===r?")":"]");else if(o&&n&&"{"===r)s||(s=l),i.push("}");else if(0===i.length){if(";"===r){if(n)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}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 s,i,a,l,c=r.length,u="",h=!0;for(let e=0;e<c;e+=1)s=r[e],i=s[0],"space"!==i||e!==c-1||n?"comment"===i?(l=r[e-1]?r[e-1][0]:"empty",a=r[e+1]?r[e+1][0]:"empty",o[l]||o[a]||","===u.slice(-1)?h=!1:u+=s[1]):u+=s[1]:h=!1;if(!h){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:u}}e[t]=u}rule(e){e.pop();let t=new s;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 "+e[0][1],{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})}},Wh}function kd(){if(Gh)return Vh;Gh=1;let e=dd(),t=yd(),r=Cd();function n(e,n){let s=new t(e,n),i=new r(s);try{i.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 i.root}return Vh=n,n.default=n,e.registerParse(n),Vh}function xd(){if(Jh)return Hh;Jh=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 Hh=e,e.default=e,Hh}function Od(){if(Yh)return Kh;Yh=1;let e=xd();class t{get content(){return this.css}constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css="",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)}}return Kh=t,t.default=t,Kh}function Id(){if(Xh)return Qh;Xh=1;let e={};return Qh=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Ed(){if(ed)return Zh;ed=1;let e=dd(),t=fd(),r=Sd(),n=kd(),s=Od(),i=vd(),o=hh(),{isClean:a,my:l}=ld(),c=Id();const u={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=u[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 m(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 g(e){return e[a]=!1,e.nodes&&e.nodes.forEach(e=>g(e)),e}let y={};class v{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"}constructor(t,r,i){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof s)o=g(r.root),r.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=r.map);else{let t=n;i.syntax&&(t=i.syntax.parse),i.parser&&(t=i.parser),t.parse&&(t=t.parse);try{o=t(r,i)}catch(e){this.processed=!0,this.error=e}o&&!o[l]&&e.rebuild(o)}else o=g(r);this.result=new s(t,o,i),this.helpers={...y,postcss:y,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,s=t.split("."),i=n.split(".");(s[0]!==i[0]||parseInt(s[1])>parseInt(i[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 e=this.result.root;for(;!e[a];){e[a]=!0;let t=[m(e)];for(;t.length>0;){let e=this.visitTick(t);if(p(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return 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=o;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new r(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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 e=this.result.root;for(;!e[a];)e[a]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||c("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(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[a])return n[a]=!0,void e.push(m(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[a]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[a]=!0;let t=f(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[a]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}}return v.registerPostcss=e=>{y=e},Zh=v,v.default=v,i.registerLazyResult(v),t.registerLazyResult(v),Zh}function Md(){if(sd)return nd;sd=1;let e=fd(),t=Ed(),r=function(){if(rd)return td;rd=1;let e=Sd(),t=kd();const r=Od();let n=hh(),s=Id();class i{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,r=t;try{e=r(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"}constructor(t,s,i){let o;s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=i,this._map=void 0;let a=n;this.result=new r(this._processor,o,this._opts),this.result.css=s;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,s);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.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||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}warnings(){return[]}}return td=i,i.default=i,td}(),n=vd();class s{constructor(e=[]){this.version="8.5.6",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,e,n):new r(this,e,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return nd=s,s.default=s,n.registerProcessor(s),e.registerProcessor(s),nd}var Rd=function(){if(od)return id;od=1;let e=pd(),t=ud(),r=dd(),n=ch(),s=hd(),i=fd(),o=function(){if(Bh)return Dh;Bh=1;let e=pd(),t=ud(),r=hd(),n=yd(),s=gd(),i=vd(),o=bd();function a(l,c){if(Array.isArray(l))return l.map(e=>a(e));let{inputs:u,...h}=l;if(u){c=[];for(let e of u){let t={...e,__proto__:n.prototype};t.map&&(t.map={...t.map,__proto__:s.prototype}),c.push(t)}}if(h.nodes&&(h.nodes=l.nodes.map(e=>a(e,c))),h.source){let{inputId:e,...t}=h.source;h.source=t,null!=e&&(h.source.input=c[e])}if("root"===h.type)return new i(h);if("decl"===h.type)return new r(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new t(h);if("atrule"===h.type)return new e(h);throw new Error("Unknown node type: "+l.type)}return Dh=a,a.default=a,Dh}(),a=yd(),l=Ed(),c=wd(),u=cd(),h=kd(),d=Md(),p=Od(),f=vd(),m=bd(),g=hh(),y=xd();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new d(e)}return v.plugin=function(e,t){let r,n=!1;function s(...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 s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new d).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return v([s(r)]).process(e,t)},s},v.stringify=g,v.parse=h,v.fromJSON=o,v.list=c,v.comment=e=>new t(e),v.atRule=t=>new e(t),v.decl=e=>new s(e),v.rule=e=>new m(e),v.root=e=>new f(e),v.document=e=>new i(e),v.CssSyntaxError=n,v.Declaration=s,v.Container=r,v.Processor=d,v.Document=i,v.Comment=t,v.Warning=y,v.AtRule=e,v.Result=p,v.Input=a,v.Rule=m,v.Root=f,v.Node=u,l.registerPostcss(v),id=v,v.default=v,id}();const Pd=Qu(Rd);Pd.stringify,Pd.fromJSON,Pd.plugin,Pd.parse,Pd.list,Pd.document,Pd.comment,Pd.atRule,Pd.rule,Pd.decl,Pd.root,Pd.CssSyntaxError,Pd.Declaration,Pd.Container,Pd.Processor,Pd.Document,Pd.Comment,Pd.Warning,Pd.AtRule,Pd.Result,Pd.Input,Pd.Rule,Pd.Root,Pd.Node;class Ad{constructor(...e){Yu(this,"parentElement",null),Yu(this,"parentNode",null),Yu(this,"ownerDocument"),Yu(this,"firstChild",null),Yu(this,"lastChild",null),Yu(this,"previousSibling",null),Yu(this,"nextSibling",null),Yu(this,"ELEMENT_NODE",1),Yu(this,"TEXT_NODE",3),Yu(this,"nodeType"),Yu(this,"nodeName"),Yu(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 Ad))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 Td={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ld={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Nd={};function Fd(e){if(Nd[e])return Nd[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 Td?Td[e]:void 0,s=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]"))})),i=e in Ld?Ld[e]:void 0,o=Boolean(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&o)return Nd[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const i=s[e].prototype;return document.body.removeChild(n),i?Nd[e]=i:r}catch{return r}}const _d={};function Dd(e,t,r){var n;const s=`${e}.${String(r)}`;if(_d[s])return _d[s].call(t);const i=Fd(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(_d[s]=o,o.call(t)):t[r]}const Bd={};function jd(e,t,r){const n=`${e}.${String(r)}`;if(Bd[n])return Bd[n].bind(t);const s=Fd(e)[r];return"function"!=typeof s?t[r]:(Bd[n]=s,s.bind(t))}function Ud(){return Fd("MutationObserver").constructor}const $d={childNodes:function(e){return Dd("Node",e,"childNodes")},parentNode:function(e){return Dd("Node",e,"parentNode")},parentElement:function(e){return Dd("Node",e,"parentElement")},textContent:function(e){return Dd("Node",e,"textContent")},contains:function(e,t){return jd("Node",e,"contains")(t)},getRootNode:function(e){return jd("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Dd("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Dd("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Dd("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Dd("Element",e,"querySelectorAll")(t)},mutationObserver:Ud};function zd(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Wd="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 qd={map:{},getId:()=>(console.error(Wd),-1),getNode:()=>(console.error(Wd),null),removeNodeFromMap(){console.error(Wd)},has:()=>(console.error(Wd),!1),reset(){console.error(Wd)}};function Vd(e,t,r={}){let n=null,s=0;return function(...i){const o=Date.now();s||!1!==r.leading||(s=o);const a=t-(o-s),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),s=o,e.apply(l,i)):n||!1===r.trailing||(n=setTimeout(()=>{s=!1===r.leading?0:Date.now(),n=null,e.apply(l,i)},a))}}function Gd(e,t,r,n,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>Gd(e,t,i||{},!0)}function Hd(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],s=r(n);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(qd=new Proxy(qd,{get:(e,t,r)=>("map"===t&&console.error(Wd),Reflect.get(e,t,r))}));let Jd=Date.now;function Kd(e){var t,r,n,s;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=$d.parentElement(i.body))?void 0:t.scrollLeft)||(null==(r=null==i?void 0:i.body)?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(n=$d.parentElement(i.body))?void 0:n.scrollTop)||(null==(s=null==i?void 0:i.body)?void 0:s.scrollTop)||0}}function Yd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Qd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Xd(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:$d.parentElement(e)}function Zd(e,t,r,n){if(!e)return!1;const s=Xd(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t))return!0;if(n&&null!==s.closest("."+t))return!0}else if(cc(s,t,n))return!0}catch(e){}if(r){if(s.matches(r))return!0;if(n&&null!==s.closest(r))return!0}return!1}function ep(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function tp(e,t){if(Tl(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=$d.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||tp(n,t))}function rp(e){return Boolean(e.changedTouches)}function np(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function sp(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ip(e){return!!e&&(e instanceof Ad&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean($d.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Jd=()=>(new Date).getTime());class op{constructor(){vl(this,"id",1),vl(this,"styleIDMap",new WeakMap),vl(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 ap(e){var t;let r=null;return"getRootNode"in e&&(null==(t=$d.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&$d.host($d.getRootNode(e))&&(r=$d.host($d.getRootNode(e))),r}function lp(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=ap(r);)r=t;return r}(e);return $d.contains(t,r)}function cp(e){const t=e.ownerDocument;return!!t&&($d.contains(t,e)||lp(e))}var up=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(up||{}),hp=(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))(hp||{}),dp=(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))(dp||{}),pp=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(pp||{}),fp=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(fp||{}),mp=(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))(mp||{}),gp=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(gp||{});function yp(e){return"__ln"in e}class vp{constructor(){vl(this,"length",0),vl(this,"head",null),vl(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&&yp(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&&yp(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 wp=(e,t)=>`${e}@${t}`;class bp{constructor(){vl(this,"frozen",!1),vl(this,"locked",!1),vl(this,"texts",[]),vl(this,"attributes",[]),vl(this,"attributeMap",new WeakMap),vl(this,"removes",[]),vl(this,"mapRemoves",[]),vl(this,"movedMap",{}),vl(this,"addedSet",new Set),vl(this,"movedSet",new Set),vl(this,"droppedSet",new Set),vl(this,"removesSubTreeCache",new Set),vl(this,"mutationCb"),vl(this,"blockClass"),vl(this,"blockSelector"),vl(this,"maskTextClass"),vl(this,"maskTextSelector"),vl(this,"inlineStylesheet"),vl(this,"maskInputOptions"),vl(this,"maskTextFn"),vl(this,"maskInputFn"),vl(this,"maskAttributeFn"),vl(this,"keepIframeSrcFn"),vl(this,"recordCanvas"),vl(this,"inlineImages"),vl(this,"slimDOMOptions"),vl(this,"dataURLOptions"),vl(this,"doc"),vl(this,"mirror"),vl(this,"iframeManager"),vl(this,"stylesheetManager"),vl(this,"shadowDomManager"),vl(this,"canvasManager"),vl(this,"processedNodeManager"),vl(this,"captureAdoptedStyleSheets"),vl(this,"unattachedDoc"),vl(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),vl(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new vp,n=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},s=s=>{const i=$d.parentNode(s);if(!i||!cp(s))return;let o=!1;if(s.nodeType===Node.TEXT_NODE){const e=i.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(i)&&(o=!0)}const a=Tl(i)?this.mirror.getId(ap(s)):this.mirror.getId(i),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=fc(s,{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=>{np(e,this.mirror)&&this.iframeManager.addIframe(e),sp(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ip(s)&&this.shadowDomManager.addShadowRoot($d.shadowRoot(s),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},onAdoptedStyleSheet:this.captureAdoptedStyleSheets?e=>this.stylesheetManager.styleMirror.add(e):void 0,_emittedStyleIds:this.captureAdoptedStyleSheets?this.stylesheetManager.getInlinedAdoptedStyleSheetRuleIds():void 0,cssCaptured:o});c&&(e.push({parentId:a,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Cp(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has($d.parentNode(e))||s(e);for(const e of this.addedSet)kp(this.droppedSet,e)||Cp(this.removesSubTreeCache,e,this.mirror)?kp(this.movedSet,e)?s(e):this.droppedSet.add(e):s(e);let i=null;for(;r.length;){let e=null;if(i){const t=this.mirror.getId($d.parentNode(i.value)),r=n(i.value);-1!==t&&-1!==r&&(e=i)}if(!e){let t=r.tail;for(;t;){const r=t;if(t=t.previous,r){const t=this.mirror.getId($d.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=$d.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=$d.host(n);if(-1!==this.mirror.getId(t)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}i=e.previous,r.removeNode(e.value),s(e.value)}const o={texts:this.texts.map(e=>{const t=e.node,r=$d.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};(o.texts.length||o.attributes.length||o.removes.length||o.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(o))}),vl(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($d.childNodes(e),e=>$d.textContent(e)||"").join("");t.attributes.value=Dl({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Ul(e),value:r,maskInputFn:this.maskInputFn})}),vl(this,"processMutation",e=>{if(!ep(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=$d.textContent(e.target);Zd(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:uc(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Xd(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=Ul(t);n=Dl({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(Zd(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let s=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;r="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!lc(t.tagName,r)){if(s.attributes[r]=ac(this.doc,Bl(t.tagName),Bl(r),n),this.maskAttributeFn&&"string"==typeof s.attributes[r]){const e=this.maskAttributeFn(r,s.attributes[r],t);null!==e?s.attributes[r]=e:delete s.attributes[r]}if("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),i=t.style.getPropertyPriority(e);n!==r.style.getPropertyValue(e)||i!==r.style.getPropertyPriority(e)?s.styleDiff[e]=""===i?n:[n,i]:s._unchangedStyles[e]=[n,i]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(s.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal")}break}case"childList":if(Zd(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=Tl(e.target)?this.mirror.getId($d.host(e.target)):this.mirror.getId(e.target);Zd(e.target,this.blockClass,this.blockSelector,!1)||ep(t,this.mirror,this.slimDOMOptions)||(!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Sp(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||tp(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[wp(r,n)]?Sp(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!Tl(e.target)||!Ll(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),$d.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache)))),this.mapRemoves.push(t))})}}),vl(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(ep(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[wp(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Zd(e,this.blockClass,this.blockSelector,!1)||($d.childNodes(e).forEach(e=>this.genAdds(e)),ip(e)&&$d.childNodes($d.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAttributeFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","captureAdoptedStyleSheets"].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 Sp(e,t){e.delete(t),$d.childNodes(t).forEach(t=>Sp(e,t))}function Cp(e,t,r){return 0!==e.size&&function(e,t){const r=$d.parentNode(t);return!!r&&e.has(r)}(e,t)}function kp(e,t){return 0!==e.size&&xp(e,t)}function xp(e,t){const r=$d.parentNode(t);return!!r&&(!!e.has(r)||xp(e,r))}let Op;const Ip=e=>{if(!Op)return e;return(...t)=>{try{return e(...t)}catch(e){if(Op&&!0===Op(e))return;throw e}}};function Ep(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const Mp=[];function Rp(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Pp(e,t){const r=new bp;Mp.push(r),r.init(e);const n=new(Ud())(Ip(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function Ap({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const o=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,a=[];let l=null;return Object.keys(dp).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]).forEach(i=>{let o=Bl(i);const c=(t=>i=>{const o=Rp(i);if(Zd(o,n,s,!0))return;let a=null,c=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=pp.Mouse;break;case"touch":a=pp.Touch;break;case"pen":a=pp.Pen}a===pp.Touch?dp[t]===dp.MouseDown?c="TouchStart":dp[t]===dp.MouseUp&&(c="TouchEnd"):pp.Pen}else rp(i)&&(a=pp.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===pp.Touch||c.startsWith("Mouse")&&a===pp.Mouse)&&(a=null)):dp[t]===dp.Click&&(a=l,l=null);const u=rp(i)?i.changedTouches[0]:i;if(!u)return;const h=r.getId(o),{clientX:d,clientY:p}=u;Ip(e)({type:dp[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}},i)})(i);if(window.PointerEvent)switch(dp[i]){case dp.MouseDown:case dp.MouseUp:o=o.replace("mouse","pointer");break;case dp.TouchStart:case dp.TouchEnd:return}a.push(zd(o,c,t))}),Ip(()=>{a.forEach(e=>e())})}function Tp({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){const o=Ip(Vd(Ip(i=>{const o=Rp(i);if(!o||Zd(o,n,s,!0))return;const a=r.getId(o);if(o===t&&t.defaultView){const r=Kd(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}),i.scroll||100));return zd("scroll",o,t)}const Lp=["INPUT","TEXTAREA","SELECT"],Np=new WeakMap;function Fp(e){return function(e,t){if(jp("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||jp("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||jp("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||jp("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 _p(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Dp({mirror:e,stylesheetManager:t},r){var n,s,i;let o=null;o="#document"===r.nodeName?e.getId(r):e.getId($d.host(r));const a="#document"===r.nodeName?null==(n=r.defaultView)?void 0:n.Document:null==(i=null==(s=r.ownerDocument)?void 0:s.defaultView)?void 0:i.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==o&&-1!==o&&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!==o&&-1!==o)try{t.adoptStyleSheets(e,o)}catch(e){}return n}}),Ip(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Bp(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:i,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,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),s(e[0])},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),o(...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),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(n=Pp(e,e.doc));const s=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const s="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let o,a=[];const l=Vd(Ip(t=>{const r=Date.now()-o;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],o=null}),i),c=Ip(Vd(Ip(e=>{const t=Rp(e),{clientX:r,clientY:s}=rp(e)?e.changedTouches[0]:e;o||(o=Jd()),a.push({x:r,y:s,id:n.getId(t),timeOffset:Jd()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?hp.Drag:e instanceof MouseEvent?hp.MouseMove:hp.TouchMove)}),s,{trailing:!1})),u=[zd("mousemove",c,r),zd("touchmove",c,r),zd("drag",c,r)];return Ip(()=>{u.forEach(e=>e())})}(e),i=Ap(e),o=Tp(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return zd("resize",Ip(Vd(Ip(()=>{const t=Yd(),s=Qd();r===t&&n===s||(e({width:Number(s),height:Number(t)}),r=t,n=s)}),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:i,ignoreSelector:o,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function h(e){let r=Rp(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=$d.parentElement(r)),!r||!h||Lp.indexOf(h)<0||Zd(r,n,s,!0))return;if(r.classList.contains(i)||o&&r.matches(o))return;let p=r.value,f=!1;const m=Ul(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(p=Dl({element:r,maskInputOptions:a,tagName:h,type:m,value:p,maskInputFn:l})),d(r,u?{text:p,isChecked:f,userTriggered:c}:{text:p,isChecked:f});const g=r.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==r){const t=e.value;d(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function d(t,n){const s=Np.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){Np.set(t,n);const s=r.getId(t);Ip(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>zd(e,Ip(h),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[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 m&&m.set&&p.push(...g.map(e=>Gd(e[0],e[1],{set(){Ip(h)({target:this,isTrusted:!1})}},!1,f))),Ip(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:i}){const o=Ip(i=>Vd(Ip(s=>{const o=Rp(s);if(!o||Zd(o,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u,loop:h}=o;e({type:i,id:n.getId(o),currentTime:a,volume:l,muted:c,playbackRate:u,loop:h})}),s.media||500)),a=[zd("play",o(mp.Play),i),zd("pause",o(mp.Pause),i),zd("seeked",o(mp.Seeked),i),zd("volumechange",o(mp.VolumeChange),i),zd("ratechange",o(mp.RateChange),i)];return Ip(()=>{a.forEach(e=>e())})}(e);let u=()=>{},h=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Ip((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=_p(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:a}]}),Ep(()=>n.apply(s,i))()})}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const s=`${e} { ${t} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[s,r])};const i=n.CSSStyleSheet.prototype.deleteRule;let o,a;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Ip((n,s,i)=>{const[o]=i,{id:a,styleId:l}=_p(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:o}]}),Ep(()=>n.apply(s,i))()})}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(o=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:Ip((n,s,i)=>{const[o]=i,{id:a,styleId:l}=_p(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:o}),n.apply(s,i)})})),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Ip((n,s,i)=>{const[o]=i,{id:a,styleId:l}=_p(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:o}),n.apply(s,i)})}));const l={};Up("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Up("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Up("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Up("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(l).forEach(([n,s])=>{c[n]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[n].insertRule,{apply:Ip((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=_p(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:[...Fp(s),a||0]}]}),n.apply(s,i)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:Ip((n,s,i)=>{const[o]=i,{id:a,styleId:l}=_p(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...Fp(s),o]}]}),n.apply(s,i)})})}),Ip(()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=i,o&&(n.CSSStyleSheet.prototype.replace=o),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})})}(e,{win:r}),h=Dp(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Ip((s,o,a)=>{var l;const[c,u,h]=a;if(r.has(c))return i.apply(o,[c,u,h]);const{id:d,styleId:p}=_p(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:c,value:u,priority:h},index:Fp(o.parentRule)}),s.apply(o,a)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:Ip((s,i,a)=>{var l;const[c]=a;if(r.has(c))return o.apply(i,[c]);const{id:u,styleId:h}=_p(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(u&&-1!==u||h&&-1!==h)&&e({id:u,styleId:h,remove:{property:c},index:Fp(i.parentRule)}),s.apply(i,a)})}),Ip(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],s=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,r){const n=new i(e,t,r);return s.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const o=Hd(t.fonts,"add",function(t){return function(r){return setTimeout(Ip(()=>{const t=s.get(r);t&&(e(t),s.delete(r))}),0),t.apply(this,[r])}});return n.push(()=>{r.FontFace=i}),n.push(o),Ip(()=>{n.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:i}=e;let o=!0;const a=Ip(()=>{const e=t.getSelection();if(!e||o&&(null==e?void 0:e.isCollapsed))return;o=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const i=e.getRangeAt(t),{startContainer:o,startOffset:l,endContainer:c,endOffset:u}=i;Zd(o,n,s,!0)||Zd(c,n,s,!0)||a.push({start:r.getId(o),startOffset:l,end:r.getId(c),endOffset:u})}i({ranges:a})});return a(),zd("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?Hd(r.customElements,"define",function(e){return function(r,n,s){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,s])}}):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,r,t.options));return Ip(()=>{Mp.forEach(e=>e.reset()),null==n||n.disconnect(),s(),i(),o(),a(),l(),c(),u(),h(),d(),p(),f(),m(),g.forEach(e=>e())})}function jp(e){return void 0!==window[e]}function Up(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class $p{constructor(e){vl(this,"iframeIdToRemoteIdMap",new WeakMap),vl(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){const s=r||this.getIdToRemoteIdMap(e),i=n||this.getRemoteIdToIdMap(e);let o=s.get(t);return o||(o=this.generateIdFn(),s.set(t,o),i.set(o,t)),o}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 s=n.get(t);return s||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,r))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class zp{constructor(e){vl(this,"iframes",new WeakMap),vl(this,"crossOriginIframeMap",new WeakMap),vl(this,"crossOriginIframeMirror",new $p(Xl)),vl(this,"crossOriginIframeStyleMirror"),vl(this,"crossOriginIframeRootIdMap",new WeakMap),vl(this,"mirror"),vl(this,"mutationCb"),vl(this,"wrappedEmit"),vl(this,"loadListener"),vl(this,"stylesheetManager"),vl(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new $p(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case up.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:up.IncrementalSnapshot,data:{source:hp.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case up.Meta:case up.Load:case up.DomContentLoaded:return!1;case up.Plugin:return t;case up.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case up.IncrementalSnapshot:switch(t.data.source){case hp.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 hp.Drag:case hp.TouchMove:case hp.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case hp.ViewportResize:return!1;case hp.MediaInteraction:case hp.MouseInteraction:case hp.Scroll:case hp.CanvasMutation:case hp.Input:return this.replaceIds(t.data,e,["id"]),t;case hp.StyleSheetRule:case hp.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case hp.Font:return t;case hp.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case hp.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 s of n)(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(r,t[s]):t[s]=e.getId(r,t[s]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===gp.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Wp{constructor(e){vl(this,"shadowDoms",new WeakSet),vl(this,"mutationCb"),vl(this,"scrollCb"),vl(this,"bypassOptions"),vl(this,"mirror"),vl(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(!Ll(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Pp({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Tp({...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($d.host(e))),this.restoreHandlers.push(Dp({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(Hd(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),i=$d.shadowRoot(this);return i&&cp(this)&&r.addShadowRoot(i,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var qp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vp="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Gp=0;Gp<64;Gp++)Vp[qp.charCodeAt(Gp)]=Gp;const Hp=new Map;const Jp=(e,t,r)=>{if(!e||!Qp(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=Hp.get(e);return r||(r=new Map,Hp.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let s=n.indexOf(e);return-1===s&&(s=n.length,n.push(e)),s};function Kp(e,t,r){if(e instanceof Array)return e.map(e=>Kp(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,s="";for(t=0;t<n;t+=3)s+=qp[r[t]>>2],s+=qp[(3&r[t])<<4|r[t+1]>>4],s+=qp[(15&r[t+1])<<2|r[t+2]>>6],s+=qp[63&r[t+2]];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Kp(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:[Kp(e.data,t,r),e.width,e.height]}}if(Qp(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Jp(e,t,r)}}return e}const Yp=(e,t,r)=>e.map(e=>Kp(e,t,r)),Qp=(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 Xp(e,t,r,n){const s=[];try{const i=Hd(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...i){if(!Zd(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(s);if("__context"in this||(this.__context=e),n&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[s,...i])}});s.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(e=>e())}}function Zp(e,t,r,n,s,i){const o=[],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=Hd(e,l,function(e){return function(...o){const a=e.apply(this,o);if(Jp(a,i,this),"tagName"in this.canvas&&!Zd(this.canvas,n,s,!0)){const e=Yp(o,i,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});o.push(a)}catch{const n=Gd(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});o.push(n)}return o}const ef='(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',tf="undefined"!=typeof self&&self.Blob&&new Blob([ef],{type:"text/javascript;charset=utf-8"});function rf(e){let t;try{if(t=tf&&(self.URL||self.webkitURL).createObjectURL(tf),!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(ef),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class nf{constructor(e){vl(this,"pendingCanvasMutations",new Map),vl(this,"rafStamps",{latestId:0,invokeId:null}),vl(this,"mirror"),vl(this,"mutationCb"),vl(this,"resetObservers"),vl(this,"frozen",!1),vl(this,"locked",!1),vl(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:s,recordCanvas:i,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(r,n,s),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,s,{dataURLOptions:o})}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,s){const i=Xp(t,r,n,!0),o=new Map,a=new rf;a.onmessage=e=>{const{id:t}=e.data;if(o.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:s,height:i}=e.data;this.mutationCb({id:t,type:fp["2D"],commands:[{property:"clearRect",args:[0,0,s,i]},{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 c,u=0;const h=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Zd(t,r,n,!0)||e.push(t)}),e})().forEach(async e=>{var t;const r=this.mirror.getId(e);if(o.get(r))return;if(0===e.width||0===e.height)return;if(o.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:s.dataURLOptions},[n])})),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{i(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Xp(e,t,r,!1),s=function(e,t,r,n){const s=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const o of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])continue;const i=Hd(t.CanvasRenderingContext2D.prototype,o,function(s){return function(...i){return Zd(this.canvas,r,n,!0)||setTimeout(()=>{const r=Yp(i,t,this);e(this.canvas,{type:fp["2D"],property:o,args:r})},0),s.apply(this,i)}});s.push(i)}catch{const r=Gd(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:fp["2D"],property:o,args:[t],setter:!0})}});s.push(r)}return()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),i=function(e,t,r,n){const s=[];return s.push(...Zp(t.WebGLRenderingContext.prototype,fp.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...Zp(t.WebGL2RenderingContext.prototype,fp.WebGL2,e,r,n,t)),()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),s(),i()}}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:s}=r[0];this.mutationCb({id:t,type:s,commands:n}),this.pendingCanvasMutations.delete(e)}}class sf{constructor(e){vl(this,"trackedLinkElements",new WeakSet),vl(this,"mutationCb"),vl(this,"adoptedStyleSheetCb"),vl(this,"styleMirror",new op),vl(this,"inlinedAdoptedStyleSheetRuleIds",new Set),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}getInlinedAdoptedStyleSheetRuleIds(){return this.inlinedAdoptedStyleSheetRuleIds}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;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);let r=[];try{r=Array.from(t.cssRules,(e,r)=>({rule:Fl(e,t.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}n.push({styleId:e,rules:r})}r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.inlinedAdoptedStyleSheetRuleIds.clear()}trackStylesheetInLinkElement(e){}}class of{constructor(){vl(this,"nodeMap",new WeakMap),vl(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 af,lf,cf,uf=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ml=e.contentWindow)?void 0:ml.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const hf=new _l;function df(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:i=null,ignoreClass:o="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:m,maskAttributeFn:g,hooks:y,packFn:v,sampling:w={},dataURLOptions:b={},mousemoveWait:S,recordDOM:C=!0,recordCanvas:k=!1,recordCrossOriginIframes:x=!1,recordAfter:O=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:I=!1,collectFonts:E=!1,inlineImages:M=!1,captureAdoptedStyleSheets:R=!1,plugins:P,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:T=new Set([]),errorHandler:L,applyBackgroundColorToBlockedElements:N=!1}=e;Op=L;const F=!x||window.parent===window;let _=!1;if(!F)try{window.parent.document&&(_=!1)}catch(e){_=!0}if(F&&!t)throw new Error("emit function is required");if(!F&&!_)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),hf.reset();const D=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==d?d:{password:!0},B=!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 j;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let U=0;const $=e=>{for(const t of P||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!_&&(e=v(e)),e};af=(e,s)=>{var i;const o=e;if(o.timestamp=Jd(),!(null==(i=Mp[0])?void 0:i.isFrozen())||o.type===up.FullSnapshot||o.type===up.IncrementalSnapshot&&o.data.source===hp.Mutation||Mp.forEach(e=>e.unfreeze()),F)null==t||t($(o),s);else if(_){const e={type:"rrweb",event:$(o),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(o.type===up.FullSnapshot)j=o,U=0;else if(o.type===up.IncrementalSnapshot){if(o.data.source===hp.Mutation&&o.data.isAttachIframe)return;U++;const e=n&&U>=n,t=r&&o.timestamp-j.timestamp>r;(e||t)&&lf(!0)}};const z=e=>{af({type:up.IncrementalSnapshot,data:{source:hp.Mutation,...e}})},W=e=>af({type:up.IncrementalSnapshot,data:{source:hp.Scroll,...e}}),q=e=>af({type:up.IncrementalSnapshot,data:{source:hp.CanvasMutation,...e}}),V=new sf({mutationCb:z,adoptedStyleSheetCb:e=>af({type:up.IncrementalSnapshot,data:{source:hp.AdoptedStyleSheet,...e}})}),G=new zp({mirror:hf,mutationCb:z,stylesheetManager:V,recordCrossOriginIframes:x,wrappedEmit:af});for(const e of P||[])e.getMirror&&e.getMirror({nodeMirror:hf,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const H=new of;cf=new nf({recordCanvas:k,mutationCb:q,win:window,blockClass:s,blockSelector:i,mirror:hf,sampling:w.canvas,dataURLOptions:b});const J=new Wp({mutationCb:z,scrollCb:W,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:b,maskTextFn:m,maskInputFn:f,maskAttributeFn:g,recordCanvas:k,inlineImages:M,sampling:w,slimDOMOptions:B,iframeManager:G,stylesheetManager:V,canvasManager:cf,keepIframeSrcFn:A,processedNodeManager:H,captureAdoptedStyleSheets:R},mirror:hf});lf=(e=!1)=>{if(!C)return;af({type:up.Meta,data:{href:window.location.href,width:Qd(),height:Yd()}},e),V.reset(),J.init(),Mp.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new _l,blockClass:n="rr-block",blockSelector:s=null,maskTextClass:i="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:h,maskInputFn:d,maskAttributeFn:p,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:g,onSerialize:y,onAdoptedStyleSheet:v,_emittedStyleIds:w,onIframeLoad:b,iframeLoadTimeout:S,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:x=()=>!1,applyBackgroundColorToBlockedElements:O=!1}=t||{};return fc(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,maskTextClass:i,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:h,maskInputFn:d,maskAttributeFn:p,slimDOMOptions:!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===f,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===f?{}:f,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:y,onAdoptedStyleSheet:v,_emittedStyleIds:w,onIframeLoad:b,iframeLoadTimeout:S,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:x,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:O})}(document,{mirror:hf,blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:D,maskTextFn:m,maskInputFn:f,maskAttributeFn:g,slimDOM:B,dataURLOptions:b,recordCanvas:k,inlineImages:M,applyBackgroundColorToBlockedElements:N,onSerialize:e=>{np(e,hf)&&G.addIframe(e),sp(e,hf)&&V.trackLinkElement(e),ip(e)&&J.addShadowRoot($d.shadowRoot(e),document)},onAdoptedStyleSheet:R?e=>V.styleMirror.add(e):void 0,_emittedStyleIds:R?V.getInlinedAdoptedStyleSheetRuleIds():void 0,onIframeLoad:(e,t)=>{G.attachIframe(e,t),J.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");af({type:up.FullSnapshot,data:{node:t,initialOffset:Kd(window)}},e),Mp.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,hf.getId(document))};try{const e=[],t=e=>{var t;return Ip(Bp)({mutationCb:z,mousemoveCb:(e,t)=>af({type:up.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>af({type:up.IncrementalSnapshot,data:{source:hp.MouseInteraction,...e}}),scrollCb:W,viewportResizeCb:e=>af({type:up.IncrementalSnapshot,data:{source:hp.ViewportResize,...e}}),inputCb:e=>af({type:up.IncrementalSnapshot,data:{source:hp.Input,...e}}),mediaInteractionCb:e=>af({type:up.IncrementalSnapshot,data:{source:hp.MediaInteraction,...e}}),styleSheetRuleCb:e=>af({type:up.IncrementalSnapshot,data:{source:hp.StyleSheetRule,...e}}),styleDeclarationCb:e=>af({type:up.IncrementalSnapshot,data:{source:hp.StyleDeclaration,...e}}),canvasMutationCb:q,fontCb:e=>af({type:up.IncrementalSnapshot,data:{source:hp.Font,...e}}),selectionCb:e=>{af({type:up.IncrementalSnapshot,data:{source:hp.Selection,...e}})},customElementCb:e=>{af({type:up.IncrementalSnapshot,data:{source:hp.CustomElement,...e}})},blockClass:s,ignoreClass:o,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:u,sampling:w,recordDOM:C,recordCanvas:k,inlineImages:M,userTriggeredOnInput:I,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:m,maskAttributeFn:g,keepIframeSrcFn:A,blockSelector:i,slimDOMOptions:B,dataURLOptions:b,mirror:hf,iframeManager:G,stylesheetManager:V,shadowDomManager:J,processedNodeManager:H,captureAdoptedStyleSheets:R,canvasManager:cf,ignoreCSSAttributes:T,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=>af({type:up.Plugin,data:{plugin:e.name,payload:t}})})))||[]},y)};G.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{lf(),e.push(t(document)),uf=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(zd("DOMContentLoaded",()=>{af({type:up.DomContentLoaded,data:{}}),"DOMContentLoaded"===O&&r()})),e.push(zd("load",()=>{af({type:up.Load,data:{}}),"load"===O&&r()},window))),()=>{e.forEach(e=>e()),H.destroy(),uf=!1,Op=void 0}}catch(e){console.warn(e)}}var pf;df.addCustomEvent=(e,t)=>{if(!uf)throw new Error("please add custom event after start recording");af({type:up.Custom,data:{tag:e,payload:t}})},df.freezePage=()=>{Mp.forEach(e=>e.freeze())},df.takeFullSnapshot=e=>{if(!uf)throw new Error("please take full snapshot after start recording");lf(e)},df.mirror=hf,df.supportsNativeMouseInteraction=!0,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(pf||(pf={}));var ff=Object.freeze({__proto__:null,record:df});const mf=e=>void 0!==e&&("boolean"==typeof e?e:!1!==e.enabled),gf=(e,t,r,n)=>{const{allowlist:s,excludelist:i}=(e=>{var t;return"object"==typeof e&&null!==e?{allowlist:null!==(t=e.allowlist)&&void 0!==t?t:[],excludelist:e.excludelist||e.blocklist||[]}:{allowlist:[],excludelist:[]}})(t),o=((e,t,r)=>{if(0===t.length&&0===r.length)return e;const n=t.length>0?t:["/**"];try{const t=JSON.parse(e);return X(t,n,r),JSON.stringify(t)}catch(t){return e}})(e,s,i);return n(o,r)},yf=["image/","audio/","video/","application/octet-stream","font/"];function vf(e,t){return function(e,t){t<0&&(t=0);const r=e.length;let n=0,s=0;for(;s<r;s++){const i=e.charCodeAt(s);let o=1,a=1;if(i<=127)o=1;else if(i<=2047)o=2;else if(i>=55296&&i<=56319){const t=s+1<r?e.charCodeAt(s+1):NaN;t>=56320&&t<=57343?(o=4,a=2):o=3}else o=3;if(n+o>t)break;n+=o,2===a&&s++}return s>=r?{value:e,truncated:!1}:{value:e.slice(0,s),truncated:!0}}(e,t)}var wf=Object.freeze({__proto__:null,NetworkObservers:class{constructor(){this.fetchObserver=null}start(e,t){this.eventCallback=e,this.networkConfig=t,this.observeFetch()}stop(){var e;null===(e=this.fetchObserver)||void 0===e||e.call(this),this.fetchObserver=null,this.eventCallback=void 0,this.networkConfig=void 0}notifyEvent(e){var t;null===(t=this.eventCallback)||void 0===t||t.call(this,e)}observeFetch(){const e=m();if(!e)return;const t=e.fetch;t&&(e.fetch=(e,r)=>a(this,void 0,void 0,function*(){var n,s;const i=Date.now(),o={timestamp:i,type:"fetch",method:(null==r?void 0:r.method)||"GET",url:e.toString(),requestHeaders:null==r?void 0:r.headers},a=null===(n=this.networkConfig)||void 0===n?void 0:n.body;if(a&&mf(a.request)){const e=function(e){if(null!=e){if("string"==typeof e)return e;if(e instanceof URLSearchParams)return e.toString();if(e instanceof FormData){const t=[];return e.forEach((e,r)=>{t.push(`${r}=${"string"==typeof e?e:"[File]"}`)}),t.join("&")}}}(null==r?void 0:r.body);if(void 0!==e){const t=null!==(s=a.maxBodySizeBytes)&&void 0!==s?s:10240;o.requestBody=gf(e,a.request,t,vf).value}}try{const n=yield t(e,r),s=Date.now();o.status=n.status,o.duration=s-i;const l={};if(n.headers.forEach((e,t)=>{l[t]=e}),o.responseHeaders=l,a&&mf(a.response)){if(function(e){return!!e&&yf.some(t=>e.toLowerCase().startsWith(t))}(l["content-type"]||null))o.responseBodyStatus="skipped_binary",this.notifyEvent(o);else{n.clone().text().then(e=>{var t;const r=null!==(t=a.maxBodySizeBytes)&&void 0!==t?t:10240,{value:n,truncated:s}=gf(e,a.response,r,vf);o.responseBody=n,o.responseBodyStatus=s?"truncated":"captured",this.notifyEvent(o)},()=>{o.responseBodyStatus="error",this.notifyEvent(o)})}}else this.notifyEvent(o);return n}catch(e){const t=Date.now();o.duration=t-i;const r=e;throw o.error={name:r.name||"UnknownError",message:r.message||"An unknown error occurred"},this.notifyEvent(o),e}}),this.fetchObserver=()=>{e.fetch=t})}}});return e.SafeLoggerProvider=Pe,e.evaluateTargetingAndCapture=pn,e.flush=cn,e.getSessionId=an,e.getSessionReplayProperties=ln,e.init=sn,e.setSessionId=on,e.shutdown=dn,e.start=un,e.stop=hn,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
2
2
  //# sourceMappingURL=session-replay-browser-min.js.map