@amplitude/session-replay-browser 1.46.0 → 1.47.0-sr-trc-debug-log.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 (65) hide show
  1. package/lib/cjs/config/joined-config.d.ts +6 -1
  2. package/lib/cjs/config/joined-config.d.ts.map +1 -1
  3. package/lib/cjs/config/joined-config.js +58 -18
  4. package/lib/cjs/config/joined-config.js.map +1 -1
  5. package/lib/cjs/config/local-config.d.ts +5 -1
  6. package/lib/cjs/config/local-config.d.ts.map +1 -1
  7. package/lib/cjs/config/local-config.js +19 -1
  8. package/lib/cjs/config/local-config.js.map +1 -1
  9. package/lib/cjs/config/types.d.ts +19 -1
  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/diagnostics.d.ts +43 -0
  13. package/lib/cjs/diagnostics.d.ts.map +1 -0
  14. package/lib/cjs/diagnostics.js +54 -0
  15. package/lib/cjs/diagnostics.js.map +1 -0
  16. package/lib/cjs/session-replay.d.ts +25 -0
  17. package/lib/cjs/session-replay.d.ts.map +1 -1
  18. package/lib/cjs/session-replay.js +246 -51
  19. package/lib/cjs/session-replay.js.map +1 -1
  20. package/lib/cjs/targeting/targeting-manager.d.ts +4 -1
  21. package/lib/cjs/targeting/targeting-manager.d.ts.map +1 -1
  22. package/lib/cjs/targeting/targeting-manager.js +43 -10
  23. package/lib/cjs/targeting/targeting-manager.js.map +1 -1
  24. package/lib/cjs/version.d.ts +1 -1
  25. package/lib/cjs/version.d.ts.map +1 -1
  26. package/lib/cjs/version.js +1 -1
  27. package/lib/cjs/version.js.map +1 -1
  28. package/lib/esm/config/joined-config.d.ts +6 -1
  29. package/lib/esm/config/joined-config.d.ts.map +1 -1
  30. package/lib/esm/config/joined-config.js +58 -18
  31. package/lib/esm/config/joined-config.js.map +1 -1
  32. package/lib/esm/config/local-config.d.ts +5 -1
  33. package/lib/esm/config/local-config.d.ts.map +1 -1
  34. package/lib/esm/config/local-config.js +20 -2
  35. package/lib/esm/config/local-config.js.map +1 -1
  36. package/lib/esm/config/types.d.ts +19 -1
  37. package/lib/esm/config/types.d.ts.map +1 -1
  38. package/lib/esm/config/types.js.map +1 -1
  39. package/lib/esm/diagnostics.d.ts +43 -0
  40. package/lib/esm/diagnostics.d.ts.map +1 -0
  41. package/lib/esm/diagnostics.js +51 -0
  42. package/lib/esm/diagnostics.js.map +1 -0
  43. package/lib/esm/session-replay.d.ts +25 -0
  44. package/lib/esm/session-replay.d.ts.map +1 -1
  45. package/lib/esm/session-replay.js +246 -51
  46. package/lib/esm/session-replay.js.map +1 -1
  47. package/lib/esm/targeting/targeting-manager.d.ts +4 -1
  48. package/lib/esm/targeting/targeting-manager.d.ts.map +1 -1
  49. package/lib/esm/targeting/targeting-manager.js +43 -10
  50. package/lib/esm/targeting/targeting-manager.js.map +1 -1
  51. package/lib/esm/version.d.ts +1 -1
  52. package/lib/esm/version.d.ts.map +1 -1
  53. package/lib/esm/version.js +1 -1
  54. package/lib/esm/version.js.map +1 -1
  55. package/lib/scripts/index-min.js +1 -1
  56. package/lib/scripts/index-min.js.gz +0 -0
  57. package/lib/scripts/index-min.js.map +1 -1
  58. package/lib/scripts/observers-min.js +1 -1
  59. package/lib/scripts/observers-min.js.gz +0 -0
  60. package/lib/scripts/session-replay-browser-min.js +1 -1
  61. package/lib/scripts/session-replay-browser-min.js.gz +0 -0
  62. package/lib/scripts/session-replay-browser-min.js.map +1 -1
  63. package/lib/scripts/targeting-min.js +1 -1
  64. package/lib/scripts/targeting-min.js.gz +0 -0
  65. package/package.json +2 -2
@@ -1,2 +1,2 @@
1
- var sessionReplay=function(e){"use strict";var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},t(e,r)};var r,n,s=function(){return s=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},s.apply(this,arguments)};function i(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 o(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 a(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 l(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 c(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"}(r||(r={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(n||(n={}));var u,h="$default_instance",d="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"}(u||(u={}));var p,f=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},m=c([],l(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),g=function(e){var t,r=f();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,g)}(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,c([],l(n.entries()),!1).map(function(e){var t=l(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(m[n]):m[n]}).join("")},y=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"}(p||(p={}));var v="Amplitude Logger ",w=function(){function e(){this.logLevel=p.None}return e.prototype.disable=function(){this.logLevel=p.None},e.prototype.enable=function(e){void 0===e&&(e=p.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.Verbose||console.log("".concat(v,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.Warn||console.warn("".concat(v,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.Error||console.error("".concat(v,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.Debug||console.log("".concat(v,"[Debug]: ").concat(e.join(" ")))},e}(),b=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:h,logLevel:p.Warn,loggerProvider:new w,offline:!1,optOut:!1,serverUrl:d,serverZone:"US",useBatch:!1}},S=function(){function e(e){var t,r,n,s;this._optOut=!1;var i=b();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=e.instanceName||i.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=x(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}(),C=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":d},x=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=b().serverZone),void 0===r&&(r=b().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:b().serverZone;return{serverZone:n,serverUrl:C(n,r)}};var k=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<p.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}},O=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:I(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),I=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},E=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),M=function(){return M=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},M.apply(this,arguments)};function R(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 P(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"==typeof SuppressedError&&SuppressedError;var A=function(e,t){var r,n,s=typeof e;if(s!==typeof t)return!1;try{for(var i=R(["string","number","boolean","undefined"]),o=i.next();!o.done;o=i.next()){if(o.value===s)return e===t}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var c=Object.keys(e).sort(),u=Object.keys(t).sort();if(!A(c,u))return!1;var h=!0;return Object.keys(e).forEach(function(r){A(e[r],t[r])||(h=!1)}),h}for(var d=0;d<e.length;d++)if(!A(e[d],t[d]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var T,N=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=M({},this.identity.userProperties),r=M(M({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,s,i,o,a,l=r.userProperties||{};try{for(var c=R(Object.entries(e)),u=c.next();!u.done;u=c.next()){var h=P(u.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(s=void 0,R(Object.entries(p))),m=f.next();!m.done;m=f.next()){var g=P(m.value,2),y=g[0],v=g[1];l[y]=v}}catch(e){s={error:e}}finally{try{m&&!m.done&&(i=f.return)&&i.call(f)}finally{if(s)throw s.error}}break;case"$unset":try{for(var w=(o=void 0,R(Object.keys(p))),b=w.next();!b.done;b=w.next()){delete l[y=b.value]}}catch(e){o={error:e}}finally{try{b&&!b.done&&(a=w.return)&&a.call(w)}finally{if(o)throw o.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return M({},this.identity)},e.prototype.setIdentity=function(e){var t=M({},this.identity);this.identity=M({},e),A(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,_=function(){function e(){this.identityStore=new N,this.eventBridge=new E,this.applicationContextProvider=new O}return e.getInstance=function(t){return L.analyticsConnectorInstances||(L.analyticsConnectorInstances={}),L.analyticsConnectorInstances[t]||(L.analyticsConnectorInstances[t]=new e),L.analyticsConnectorInstances[t]},e}(),D=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},F=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,h,d,p,f,m,g,y,v,w,b,S,C,x;if("object"!=typeof e)return null;var k=e.code||0,O=this.buildStatus(k);switch(O){case u.Success:return{status:O,statusCode:k,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case u.Invalid:return{status:O,statusCode:k,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!==(h=e.exceeded_daily_quota_devices)&&void 0!==h?h:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],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 u.PayloadTooLarge:return{status:O,statusCode:k,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case u.RateLimit:return{status:O,statusCode:k,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!==(x=e.throttled_events)&&void 0!==x?x:[]}};case u.Timeout:default:return{status:O,statusCode:k}}},e.prototype.buildStatus=function(e){return function(e){return e>=200&&e<300}(e)?u.Success:429===e?u.RateLimit:413===e?u.PayloadTooLarge:408===e?u.Timeout:e>=400&&e<500?u.Invalid:e>=500?u.Failed:u.Unknown},e}(),j=function(e){function r(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}(r,e),r.prototype.send=function(e,t){return o(this,void 0,void 0,function(){var r,n,i;return a(this,function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:s({"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:i=o.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}})})},r}(F),U=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),B=401,$=403,z=429,W=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new U(e,t)}return e.prototype.subscribe=function(e,t,r){var n=g(),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 o(this,void 0,void 0,function(){var e,t=this;return a(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 o(this,void 0,void 0,function(){var t,r,n,s=this;return a(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 o(this,void 0,void 0,function(){var r,n;return a(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),o(this,void 0,void 0,function(){var r,n,s,i,o,l,c=this;return a(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},s=function(n){var s,o,l,u,h,d;return a(this,function(a){switch(a.label){case 0:s=!0,o=new AbortController,l=setTimeout(function(){return o.abort()},t),a.label=1;case 1:return a.trys.push([1,7,8,9]),[4,fetch(i.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:o.signal})];case 2:return(u=a.sent()).ok?[3,4]:[4,u.text()];case 3:return h=a.sent(),i.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(u.status,": ").concat(h)),u.status===B||u.status===$?(i.logger.error("Remote config client fetch failed with ".concat(u.status,". Invalid API key; future fetches will be skipped.")),i.isLastFetchInvalidApiKey=!0,s=!1):u.status>=400&&u.status<500&&u.status!==z&&(s=!1),[3,6];case 4:return[4,u.json()];case 5:return[2,{value:{remoteConfig:a.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(d=a.sent())instanceof Error&&"AbortError"===d.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: "),d),[3,9];case 8:return clearTimeout(l),[7];case 9:return s?n<e-1?[4,new Promise(function(e){return setTimeout(e,c.getJitterDelay(r))})]:[3,11]:[2,"break"];case 10:a.sent(),a.label=11;case 11:return[2]}})},i=this,o=0,u.label=1;case 1:return o<e?[5,s(o)]:[3,4];case 2:if("object"==typeof(l=u.sent()))return[2,l.value];if("break"===l)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 t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}();!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(T||(T={}));var q,V="https://app.amplitude.com",G={US:V,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var H="__AMPLITUDE_MESSENGER_INSTANCE__",J="__AMPLITUDE_MESSENGER__",K=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?V:t;this[q]=!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=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.")}(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 o(this,void 0,void 0,function(){var t,r,n;return a(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===V&&(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=f();(null==e?void 0:e[J])===this&&delete e[J]},e}();function Y(e){var t,r=f(),n=null==r?void 0:r[J];if("object"==typeof(t=n)&&null!==t&&H in t&&!0===t[H])return n;var s=new K(e);return r&&(r[J]=s),s}q=H;var Q="__AMPLITUDE_BACKGROUND_CAPTURE__";const X="[Amplitude]",Z=`${X} Session Replay ID`,ee=T.US,te={enabled:!0},re=1e3,ne=`${X} Session Replay Debug`,se="amp-mask",ie="amp-unmask",oe="https://api-sr.amplitude.com/sessions/v2/track",ae="https://api-sr.eu.amplitude.com/sessions/v2/track",le="https://api-sr.stag2.amplitude.com/sessions/v2/track",ce=9e6,ue=/payload.*exceed/i,he=500,de=1e4,pe=1024,fe="amplitude-sr-iframe";var me;!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"}(me||(me={}));class ge{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()}}const ye="medium";function ve(e,t){return t||("STAGING"===e?le:"EU"===e?ae:oe)}const we=(e,t,r)=>{switch(t){case"light":{if("input"!==e)return!1;const t=r?function(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}(r):"";return!!t&&(!!["password","hidden","email","tel"].includes(t)||!!r.autocomplete.startsWith("cc-"))}case"medium":return"input"===e;case"conservative":return!0;default:return we(e,ye,r)}},be=(e,t)=>{var r;if(e&&t.urlMaskLevels)for(const r of t.urlMaskLevels)if(Ie(r.match).test(e))return r.maskLevel;return null!==(r=t.defaultMaskLevel)&&void 0!==r?r:ye},Se=(e,t={defaultMaskLevel:ye},r,n)=>{var s,i;if(r){if(r.closest("."+se))return!0;const e=(null!==(s=t.maskSelector)&&void 0!==s?s:[]).some(e=>r.closest(e));if(e)return!0;if(r.closest("."+ie))return!1;const n=(null!==(i=t.unmaskSelector)&&void 0!==i?i:[]).some(e=>r.closest(e));if(n)return!1}return we(e,be(n,t),r)},Ce=(e,t,r)=>(n,s)=>Se(e,t,s,null==r?void 0:r())?n.replace(/[^\s]/g,"*"):n,xe=(e,t)=>(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;const o=["INPUT","SELECT","TEXTAREA"].includes(s.tagName)?"input":"text";return Se(o,e,s,null==t?void 0:t())?n.replace(/[^\s]/g,"*"):n},ke=()=>{const e=f();return(null==e?void 0:e.location)?e.location.href:""},Oe=new Map,Ie=e=>{const t=Oe.get(e);if(t)return t;const r="\0TRAIL\0",n="\0MID\0",s="\0DS\0",i="\0ST\0",o="\0QU\0";let a=e;a=a.replace(/\/\*\*$/,r),a=a.replace(/\/\*\*\//g,n),a=a.replace(/\*\*/g,s),a=a.replace(/\*/g,i),a=a.replace(/\?/g,o),a=a.replace(/[.+^${}()|[\]\\]/g,"\\$&"),a=a.split(r).join("(/.*)?"),a=a.split(n).join("/(.*\\/)?"),a=a.split(s).join(".*"),a=a.split(i).join(".*"),a=a.split(o).join(".");const l=new RegExp(`^${a}$`);return Oe.set(e,l),l},Ee=(e,t)=>{for(const r of t){const t=Ie(r.selector);if(t.test(e))return e.replace(t,r.replacement)}return e},Me=()=>o(void 0,void 0,void 0,function*(){try{const e=f();if(e){const{usage:t,quota:r,usageDetails:n}=yield e.navigator.storage.estimate(),s=t?Math.round(t/pe):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:""}}),Re=e=>{const t=Object.assign({},e),{apiKey:r}=t;return t.apiKey=`****${r.substring(r.length-4)}`,t},Pe=()=>({flushMaxRetries:2,logLevel:p.Warn,loggerProvider:new w,transportProvider:new j});class Ae extends S{constructor(e,t){var r,n,s,i,o,a,l,c,u,h,d,p,f,m;const g=Pe();super(Object.assign(Object.assign({transportProvider:g.transportProvider,loggerProvider:new ge(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.serverZone=t.serverZone||ee,this.configServerUrl=t.configServerUrl,this.trackServerUrl=t.trackServerUrl,this.shouldInlineStylesheet=t.shouldInlineStylesheet,this.version=t.version,this.performanceConfig=t.performanceConfig||te,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:re,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=De(t.maxPersistedEventsSizeBytes,Ne,Le,"maxPersistedEventsSizeBytes",this.loggerProvider)),void 0!==t.maxSingleEventSizeBytes&&(this.maxSingleEventSizeBytes=De(t.maxSingleEventSizeBytes,Ne,_e,"maxSingleEventSizeBytes",this.loggerProvider)),this.privacyConfig=Object.assign(Object.assign({},null!==(l=t.privacyConfig)&&void 0!==l?l:{}),{unmaskSelector:Array.from(new Set([`.${ie}`,...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<Te?(t.warn(`flushIntervalConfig.minIntervalMs ${e.minIntervalMs} is below floor ${Te}ms; clamping.`),s.minIntervalMs=Te):s.minIntervalMs=e.minIntervalMs);void 0!==e.maxIntervalMs&&(Number.isNaN(e.maxIntervalMs)||e.maxIntervalMs<Te?(t.warn(`flushIntervalConfig.maxIntervalMs ${e.maxIntervalMs} is below floor ${Te}ms; clamping.`),s.maxIntervalMs=Te):s.maxIntervalMs=e.maxIntervalMs);if(void 0!==s.minIntervalMs||void 0!==s.maxIntervalMs){const e=null!==(r=s.minIntervalMs)&&void 0!==r?r:he,i=null!==(n=s.maxIntervalMs)&&void 0!==n?n:de;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}}}const Te=100,Ne=1e3,Le=8e6,_e=1e7;function De(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 Fe=(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))(Fe||{}),je=(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))(je||{}),Ue=(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))(Ue||{});class Be{constructor(e,t){this.localConfig=t,this.remoteConfigClient=e}generateJoinedConfig(){var e,t,r,n,s,i,a;return o(this,void 0,void 0,function*(){const o=Object.assign({},this.localConfig);let l;o.optOut=this.localConfig.optOut,o.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,a=i.sr_sampling_config,c=i.sr_privacy_config,u=i.sr_targeting_config,h=null===(s=o.interactionConfig)||void 0===s?void 0:s.ugcFilterRules;o.interactionConfig=i.sr_interaction_config,o.interactionConfig&&h&&(o.interactionConfig.ugcFilterRules=h),o.loggingConfig=i.sr_logging_config,(a||c||u)&&(l={},a&&(l.sr_sampling_config=a),c&&(l.sr_privacy_config=c),u&&(l.sr_targeting_config=u)),e()})})}catch(e){return this.localConfig.loggerProvider.error("Failed to generate joined config: ",e),o.captureEnabled=!1,{localConfig:this.localConfig,joinedConfig:o,remoteConfig:void 0}}if(!l)return{localConfig:this.localConfig,joinedConfig:o,remoteConfig:l};const{sr_sampling_config:c,sr_privacy_config:u,sr_targeting_config:h}=l;if(c&&Object.keys(c).length>0?(Object.prototype.hasOwnProperty.call(c,"capture_enabled")?o.captureEnabled=c.capture_enabled:o.captureEnabled=!1,Object.prototype.hasOwnProperty.call(c,"sample_rate")&&(o.sampleRate=c.sample_rate),Object.prototype.hasOwnProperty.call(c,"min_session_duration_ms")&&(o.minSessionDurationMs=this.sanitizeMinSessionDurationMs(c.min_session_duration_ms))):(o.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),u){const l=null!==(e=o.privacyConfig)&&void 0!==e?e:{},c={defaultMaskLevel:null!==(r=null!==(t=u.defaultMaskLevel)&&void 0!==t?t:l.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[],maskAttributes:[...new Set([...null!==(n=l.maskAttributes)&&void 0!==n?n:[],...null!==(s=u.maskAttributes)&&void 0!==s?s:[]])],urlMaskLevels:[...null!==(i=u.urlMaskLevels)&&void 0!==i?i:[],...null!==(a=l.urlMaskLevels)&&void 0!==a?a:[]]},h=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({},h(l)),h(u));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);o.privacyConfig=((e,t)=>{const r=document.createDocumentFragment(),n=(e=[])=>{if("string"==typeof e&&(e=[e]),e=e.filter(e=>{try{r.querySelector(e)}catch(r){return t.warn(`[session-replay-browser] omitting selector "${e}" because it is invalid`),!1}return!0}),0!==e.length)return e};return e.blockSelector=n(e.blockSelector),e.maskSelector=n(e.maskSelector),e.unmaskSelector=n(e.unmaskSelector),e})(c,this.localConfig.loggerProvider)}return h&&Object.keys(h).length>0&&(o.targetingConfig=h),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:Re(o)},null,2)),{localConfig:this.localConfig,joinedConfig:o,remoteConfig:l}})}sanitizeMinSessionDurationMs(e){if("number"==typeof e&&Number.isFinite(e)){if(!(e<0))return e>$e?(this.localConfig.loggerProvider.warn(`min_session_duration_ms remote value ${e} exceeds ${$e}ms ceiling; clamping.`),$e):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 $e=6e4;function ze(e){if(e.type!==Fe.IncrementalSnapshot)return!1;const t=e.data;return t.source===je.Mutation&&!t.isAttachIframe}function We(e){const t={};for(const r of e)for(const e of Object.keys(r))t[e]=r[e];return t}function qe(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=We(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 Ve(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:je.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:qe(m)};return Object.assign(Object.assign({},t),{data:g})}function Ge(e){if(e.length<=1)return e;const t=[];let r=0;for(;r<e.length;){if(!ze(e[r])){t.push(e[r]),r++;continue}let n=r+1;for(;n<e.length&&ze(e[n]);)n++;t.push(n>r+1?Ve(e.slice(r,n)):e[r]),r=n}return t}class He{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=new Blob([e]).size;n>(null!==(r=this.config.maxSingleEventSizeBytes)&&void 0!==r?r:ce)?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.eventsManager&&this.deviceId&&this.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:this.deviceId})},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=f();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===Fe.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=Ge(e.slice(n,s).map(e=>e.event));for(const e of i)r.push({event:e,sessionId:t});n=s}return r}}const Je="Session replay event batch rejected due to exceeded retry count",Ke="Failed to store session replay events in IndexedDB",Ye="Session replay event batch dropped: server signalled capture disabled or session out of valid range for this session",Qe="1.46.0";class Xe{constructor({trackServerUrl:e,loggerProvider:t,payloadBatcher:r,workerScript:n,enableTransportCompression:s,sendTimeoutMs:i}){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,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}))}}},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=>new Blob([e]).size;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;const u=new URLSearchParams({device_id:r,session_id:String(t),type:"replay",api_key:n}),h=`${ve(s,this.trackServerUrl)}?${u.toString()}`,d=f();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:Ye}),!1):e.attempts<(e.flushMaxRetries||0)?(e.attempts+=1,!0):(this.completeRequest({context:e,err:Je}),!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 o(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,a,l;if(e.length<=1)return e;const c=new Map;for(const o of e){const e=[o.sessionId,null!==(t=o.deviceId)&&void 0!==t?t:"",null!==(r=o.apiKey)&&void 0!==r?r:"",o.type,null!==(n=o.serverZone)&&void 0!==n?n:"",o.sampleRate,null!==(i=null===(s=o.version)||void 0===s?void 0:s.type)&&void 0!==i?i:"",null!==(l=null===(a=o.version)||void 0===a?void 0:a.version)&&void 0!==l?l:""].join("|"),u=c.get(e);u?u.push(o):c.set(e,[o])}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=s.events.reduce((e,t)=>e+new Blob([t]).size,0);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,a=s.onComplete;t.events=t.events.concat(s.events),r+=e,t.onComplete=()=>o(this,void 0,void 0,function*(){yield Promise.allSettled([i(),a()])})}n()}return u}send(e,t=!0){return o(this,void 0,void 0,function*(){if(this.killedSessions.has(e.sessionId))return this.completeRequest({context:e,err:Ye});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 o(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,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:ke(),sdkVersion:Qe,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}}sendOnMainThread(e,t,r,n,s){var i,a,l,c,u,h,d;return o(this,void 0,void 0,function*(){const p=ke(),m=Qe,g=r.sampleRate,y=new URLSearchParams({device_id:t,session_id:`${r.sessionId}`,type:`${r.type}`}),v=`${null!==(a=null===(i=r.version)||void 0===i?void 0:i.type)&&void 0!==a?a:"standalone"}/${null!==(c=null===(l=r.version)||void 0===l?void 0:l.version)&&void 0!==c?c:m}`;try{const t=JSON.stringify(n),i=f(),a=this.enableTransportCompression&&i&&"CompressionStream"in i?yield function(e,t){return o(this,void 0,void 0,function*(){try{const r=new(0,t.CompressionStream)("gzip"),n=r.writable.getWriter(),s=r.readable.getReader(),i=[],a=(()=>o(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 a;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=a?a.byteLength:new Blob([t]).size,c=new AbortController,w={headers:Object.assign({"Content-Type":"application/json",Accept:"*/*",Authorization:`Bearer ${e}`,"X-Client-Version":m,"X-Client-Library":v,"X-Client-Url":p.substring(0,1e3),"X-Client-Sample-Rate":`${g}`,"X-Sampling-Hash-Alg":"xxhash32"},a?{"Content-Encoding":"gzip"}:{}),body:null!=a?a:t,method:"POST",keepalive:l<=65536,signal:c.signal},b=`${ve(r.serverZone,this.trackServerUrl)}?${y.toString()}`;if(0===n.events.length)return void this.completeRequest({context:r});const S=this.sendTimeoutMs>0?setTimeout(()=>{c.abort()},this.sendTimeoutMs):void 0;let C;try{C=yield fetch(b,w)}finally{S&&clearTimeout(S)}if(null===C)return void this.completeRequest({context:r,err:"Unexpected error occurred"});if(C.status>=200&&C.status<300){const e=null!==(d=null===(h=null===(u=C.headers)||void 0===u?void 0:u.get)||void 0===h?void 0:h.call(u,"X-Session-Replay-Event-Skipped"))&&void 0!==d?d:null;this.applyServerDirective(r.sessionId,e)}if(s){let e="";if(413===C.status)try{e=yield C.text()}catch(e){}yield this.handleReponse(C.status,r,e)}else{let e="";try{e=JSON.stringify(C.body,null,2)}catch(e){}this.completeRequest({context:r,success:`${C.status}: ${e}`})}}catch(e){!!e&&"object"==typeof e&&"AbortError"===e.name&&s?yield this.handleOtherResponse(r):this.completeRequest({context:r,err:e})}})}handleReponse(e,t,r=""){return o(this,void 0,void 0,function*(){switch((new F).buildStatus(e)){case u.Success:this.handleSuccessResponse(t);break;case u.Failed:case u.Timeout:case u.RateLimit:yield this.handleOtherResponse(t);break;case u.PayloadTooLarge:this.handlePayloadTooLargeResponse(t,ue.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)/pe);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(new Blob(e.events).size/pe);this.completeRequest({context:e,success:`Session replay event batch tracked successfully for session id ${e.sessionId}, size of events: ${t} KB`})}handleOtherResponse(e){return o(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:Je}):(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:Ye}):r.push(t);this.queue=r}}const Ze=(e,t)=>t.some(t=>e instanceof t);let et,tt;const rt=new WeakMap,nt=new WeakMap,st=new WeakMap;let it={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return rt.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return ct(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function ot(e){it=e(it)}function at(e){return(tt||(tt=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(ut(this),t),ct(this.request)}:function(...t){return ct(e.apply(ut(this),t))}}function lt(e){return"function"==typeof e?at(e):(e instanceof IDBTransaction&&function(e){if(rt.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)});rt.set(e,t)}(e),Ze(e,et||(et=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,it):e)}function ct(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(ct(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",i)});return st.set(t,e),t}(e);if(nt.has(e))return nt.get(e);const t=lt(e);return t!==e&&(nt.set(e,t),st.set(t,e)),t}const ut=e=>st.get(e);function ht(e,t,{blocked:r,upgrade:n,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=ct(o);return n&&o.addEventListener("upgradeneeded",e=>{n(ct(o.result),e.oldVersion,e.newVersion,ct(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 dt=["get","getKey","getAll","getAllKeys","count"],pt=["put","add","delete","clear"],ft=new Map;function mt(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(ft.get(t))return ft.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=pt.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!dt.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 ft.set(t,i),i}ot(e=>({...e,get:(t,r,n)=>mt(t,r)||e.get(t,r,n),has:(t,r)=>!!mt(t,r)||e.has(t,r)}));const gt=["continue","continuePrimaryKey","advance"],yt={},vt=new WeakMap,wt=new WeakMap,bt={get(e,t){if(!gt.includes(t))return e[t];let r=yt[t];return r||(r=yt[t]=function(...e){vt.set(this,wt.get(this)[t](...e))}),r}};async function*St(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,bt);for(wt.set(r,t),st.set(r,ut(t));t;)yield r,t=await(vt.get(r)||t.continue()),vt.delete(r)}function Ct(e,t){return t===Symbol.asyncIterator&&Ze(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Ze(e,[IDBIndex,IDBObjectStore])}ot(e=>({...e,get:(t,r,n)=>Ct(t,r)?St:e.get(t,r,n),has:(t,r)=>Ct(t,r)||e.has(t,r)}));class xt{get timeAtLastSplit(){return this._timeAtLastSplit}constructor(e){var t,r,n;this.minInterval=he,this.maxInterval=de,this.maxPersistedEventsSize=6e6,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=(e,t)=>{const r=this.getStringSize(t);return this.getEventsArraySize(e)+r>=this.maxPersistedEventsSize||!!(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}getStringSize(e){let t=0;for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);if(n<=127)t++;else if(n<=2047)t+=2;else if(n>=55296&&n<=56319){const n=r+1<e.length?e.charCodeAt(r+1):NaN;n>=56320&&n<=57343?(t+=4,r++):t+=3}else t+=3}return t}getEventsArraySize(e){let t=0;for(const r of e)t+=this.getStringSize(r);return t+(2+Math.max(0,e.length-1)+2*e.length)}}const kt=(e,t,r)=>{var n;"object"==typeof(n=r)&&null!==n&&"AbortError"===n.name?e.debug(t):e.warn(t)};const Ot="sessionCurrentSequence",It="sequencesToSend",Et=5e3;function Mt(e,t,r){const n=setTimeout(r,t);return e.then(()=>clearTimeout(n),()=>clearTimeout(n)),()=>clearTimeout(n)}const Rt=e=>{let t,r;return e.objectStoreNames.contains(Ot)||(r=e.createObjectStore(Ot,{keyPath:"sessionId"})),e.objectStoreNames.contains(It)||(t=e.createObjectStore(It,{keyPath:"sequenceId",autoIncrement:!0}),t.createIndex("sessionId","sessionId")),{sequencesStore:t,currentSequenceStore:r}},Pt=e=>o(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)})})}(ht(e,1,{upgrade:Rt}),2e3,"IDB openDB timed out")});class At extends xt{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=()=>o(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||(kt(this.loggerProvider,`${Ke}: ${r}`,r),this.recordFailure())});const s=Mt(n.done,Et,()=>{e||t||(t=!0,kt(this.loggerProvider,`${Ke}: 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,kt(this.loggerProvider,`${Ke}: ${r}`,r),this.recordFailure())}}),this.storeCurrentSequence=e=>o(this,void 0,void 0,function*(){let t=!1,r=!1;try{const n=this.db.transaction([Ot,It],"readwrite");n.done.catch(e=>{t||r||(kt(this.loggerProvider,`${Ke}: ${e}`,e),this.recordFailure())});const s=Mt(n.done,Et,()=>{t||r||(r=!0,kt(this.loggerProvider,`${Ke}: transaction timed out`),this.recordFailure())}),o=yield n.objectStore(Ot).get(e);if(!o||o.tabId&&o.tabId!==this.tabId)return void s();if(0===o.events.length)return this.maybeLogEmptyFiltered("storeCurrentSequence"),void s();const a=yield n.objectStore(It).put({sessionId:e,events:o.events,tabId:this.tabId});yield n.objectStore(Ot).put({sessionId:e,events:[],tabId:this.tabId}),this.recordSuccess(),s();const{tabId:l}=o,c=i(o,["tabId"]);return Object.assign(Object.assign({},c),{sessionId:e,sequenceId:a})}catch(e){r||(t=!0,kt(this.loggerProvider,`${Ke}: ${e}`,e),this.recordFailure())}}),this.addEventToCurrentSequence=(e,t)=>o(this,void 0,void 0,function*(){let r=!1,n=!1;try{const s=this.db.transaction([Ot,It],"readwrite");s.done.catch(e=>{r||n||(kt(this.loggerProvider,`${Ke}: ${e}`,e),this.recordFailure())});const i=Mt(s.done,Et,()=>{r||n||(n=!0,kt(this.loggerProvider,`${Ke}: transaction timed out`),this.recordFailure())}),o=yield s.objectStore(Ot).get(e);if((null==o?void 0:o.tabId)&&o.tabId!==this.tabId)return o.events.length>0&&(yield s.objectStore(It).put({sessionId:e,events:o.events,tabId:o.tabId})),yield s.objectStore(Ot).put({sessionId:e,events:[t],tabId:this.tabId}),this.recordSuccess(),void i();const a=o;if(!a)return yield s.objectStore(Ot).put({sessionId:e,events:[t],tabId:this.tabId}),this.recordSuccess(),void i();if(!this.shouldSplitEventsList(a.events,t))return yield s.objectStore(Ot).put({sessionId:e,events:a.events.concat(t),tabId:this.tabId}),this.recordSuccess(),void i();const l=a.events;if(0===l.length)return this.maybeLogEmptyFiltered("addEventToCurrentSequence"),yield s.objectStore(Ot).put({sessionId:e,events:[t],tabId:this.tabId}),this.recordSuccess(),void i();yield s.objectStore(Ot).put({sessionId:e,events:[t],tabId:this.tabId});const c=yield s.objectStore(It).put({sessionId:e,events:l,tabId:this.tabId});return this.recordSuccess(),i(),{events:l,sessionId:e,sequenceId:c}}catch(e){n||(r=!0,kt(this.loggerProvider,`${Ke}: ${e}`,e),this.recordFailure())}}),this.storeSendingEvents=(e,t)=>o(this,void 0,void 0,function*(){try{const r=yield this.db.put(It,{sessionId:e,events:t,tabId:this.tabId});return this.recordSuccess(),r}catch(e){kt(this.loggerProvider,`${Ke}: ${e}`,e),this.recordFailure()}}),this.cleanUpSessionEventsStore=(e,t)=>o(this,void 0,void 0,function*(){if(t)try{yield this.db.delete(It,t),this.recordSuccess()}catch(e){kt(this.loggerProvider,`${Ke}: ${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 o(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 Pt(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 At(Object.assign(Object.assign({},t),{db:i,tabId:o}))}catch(e){kt(t.loggerProvider,`${Ke}: ${e}`,e)}})}getCurrentSequenceEvents(e){return o(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[i(t,["tabId"])]}const t=[];for(const e of yield this.db.getAll("sessionCurrentSequence")){if(e.tabId&&e.tabId!==this.tabId)continue;const r=i(e,["tabId"]);t.push(r)}return t})}}class Tt extends xt{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 o(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 o(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 o(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 o(this,void 0,void 0,function*(){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},this.sequenceId++})}cleanUpSessionEventsStore(e,t){return o(this,void 0,void 0,function*(){void 0!==t&&delete this.finalizedSequences[t]})}}const Nt=({config:e,minInterval:t,maxInterval:r,maxPersistedEventsSize:n,type:s,payloadBatcher:i,storeType:a,trackDestinationWorkerScript:l,shouldSend:c})=>o(void 0,void 0,void 0,function*(){var u;const h=null!==(u=e.maxSingleEventSizeBytes)&&void 0!==u?u:ce,d=new Xe(Object.assign(Object.assign({},e),{loggerProvider:e.loggerProvider,payloadBatcher:i,workerScript:l})),p=()=>new Tt({loggerProvider:e.loggerProvider,maxInterval:r,minInterval:t,maxPersistedEventsSize:n});let f,m,g=!1;m="idb"===a?yield o(void 0,void 0,void 0,function*(){const i=yield At.new(s,{loggerProvider:e.loggerProvider,minInterval:t,maxInterval:r,maxPersistedEventsSize:n,apiKey:e.apiKey,onPersistentFailure:()=>{o(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})=>{const a=t.map(e=>({event:e,bytes:new Blob([e]).size})),l=a.filter(e=>e.bytes>h);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.bytes/1024)} KB`).join(", ")}. If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support.`);const c=l.length>0?a.filter(e=>e.bytes<=h).map(e=>e.event):t;0!==c.length?(e.debugMode&&Me().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:c,sessionId:r,flushMaxRetries:e.flushMaxRetries,apiKey:e.apiKey,deviceId:n,sampleRate:e.sampleRate,serverZone:e.serverZone,version:e.version,type:s,onComplete:()=>o(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})=>o(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 o(this,void 0,void 0,function*(){return d.flush(e)})},getBeaconEvents:()=>[...y],dropPendingBeaconEvents:()=>{w(v+y.length)},trackDestination:d}});class Lt{constructor(...e){const t=new Map;e.forEach(e=>{t.set(e.name,e.manager)}),this.managers=t}sendStoredEvents(e){return o(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 o(this,void 0,void 0,function*(){const t=[];this.managers.forEach(r=>{t.push(r.flush(e))}),yield Promise.all(t)})}}let _t,Dt,Ft;function jt(e,t){if(Ft=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};_t=Object.assign(Object.assign({},r),t),Dt=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(_t.root,r);let n=Ut(e,"all",()=>Ut(e,"two",()=>Ut(e,"one",()=>Ut(e,"none"))));if(n){const t=tr(rr(n,e));return t.length>0&&(n=t[0]),$t(n)}throw new Error("Selector was not found.")}function Ut(e,t,r){let n=null,s=[],i=e,o=0;for(;i;){const e=(new Date).getTime()-Ft.getTime();if(void 0!==_t.timeoutMs&&e>_t.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${e}ms`);let a=Xt(qt(i))||Xt(...Vt(i))||Xt(...Gt(i))||Xt(Ht(i))||[Jt()];const l=Kt(i);if("all"==t)l&&(a=a.concat(a.filter(Qt).map(e=>Yt(e,l))));else if("two"==t)a=a.slice(0,1),l&&(a=a.concat(a.filter(Qt).map(e=>Yt(e,l))));else if("one"==t){const[e]=a=a.slice(0,1);l&&Qt(e)&&(a=[Yt(e,l)])}else"none"==t&&(a=[Jt()],l&&(a=[Yt(a[0],l)]));for(let e of a)e.level=o;if(s.push(a),s.length>=_t.seedMinLength&&(n=Bt(s,r),n))break;i=i.parentElement,o++}return n||(n=Bt(s,r)),!n&&r?r():n}function Bt(e,t){const r=tr(er(e));if(r.length>_t.threshold)return t?t():null;for(let e of r)if(Wt(e))return e;return null}function $t(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 zt(e){return e.map(e=>e.penalty).reduce((e,t)=>e+t,0)}function Wt(e){const t=$t(e);switch(Dt.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 qt(e){const t=e.getAttribute("id");return t&&_t.idName(t)?{name:"#"+CSS.escape(t),penalty:0}:null}function Vt(e){const t=Array.from(e.attributes).filter(e=>_t.attr(e.name,e.value));return t.map(e=>({name:`[${CSS.escape(e.name)}="${CSS.escape(e.value)}"]`,penalty:.5}))}function Gt(e){return Array.from(e.classList).filter(_t.className).map(e=>({name:"."+CSS.escape(e),penalty:1}))}function Ht(e){const t=e.tagName.toLowerCase();return _t.tagName(t)?{name:t,penalty:2}:null}function Jt(){return{name:"*",penalty:3}}function Kt(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 Yt(e,t){return{name:e.name+`:nth-child(${t})`,penalty:e.penalty+1}}function Qt(e){return"html"!==e.name&&!e.name.startsWith("#")}function Xt(...e){const t=e.filter(Zt);return t.length>0?t:null}function Zt(e){return null!=e}function*er(e,t=[]){if(e.length>0)for(let r of e[0])yield*er(e.slice(1,e.length),t.concat(r));else yield t}function tr(e){return[...e].sort((e,t)=>zt(e)-zt(t))}function*rr(e,t,r={counter:0,visited:new Map}){if(e.length>2&&e.length>_t.optimizedMinLength)for(let n=1;n<e.length-1;n++){if(r.counter>_t.maxNumberOfTries)return;r.counter+=1;const s=[...e];s.splice(n,1);const i=$t(s);if(r.visited.has(i))return;Wt(s)&&nr(s,t)&&(yield s,r.visited.set(i,!0),yield*rr(s,t,r))}}function nr(e,t){return Dt.querySelector($t(e))===t}const sr=({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}},ir=({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 or{constructor(e,t){this.createHook=({eventsManager:e,sessionId:t,deviceIdFn:r,mirror:n,ugcFilterRules:s,performanceOptions:i})=>o=>{if(o.type!==Ue.Click)return;const a=f();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 m;if(p)try{m=jt(p,i)}catch(e){this.logger.debug("error resolving selector from finder")}const g=Ee(l.href,s),y={x:h+this.scrollWatcher.currentScrollX,y:d+this.scrollWatcher.currentScrollY,selector:m,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=f();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function lr(){const e=f();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}class cr{constructor(e,t){const r=f();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=ve(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}send(e,t){const{sessionId:r,type:n}=this.context,s=new URLSearchParams({device_id:e,session_id:String(r),type:String(n),api_key:this.apiKey}),i=`${this.basePageUrl}?${s.toString()}`;this.sendBeacon(i,t)||this.sendXhr(i,t)}}class ur{static default(e,t){return new ur(new cr(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=f();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:lr(),pageUrl:Ee(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=lr(),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=lr();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 hr{constructor({sessionId:e,deviceId:t}){this.deviceId=t,this.sessionId=e,e&&t&&(this.sessionReplayId=((e,t)=>`${t}/${e}`)(e,t))}}const dr=864e5,pr=e=>`AMP_SR_START_${e.substring(0,10)}_`,fr=(e,t)=>`${pr(e)}${t}`,mr=()=>{try{const e=f();return null==e?void 0:e.localStorage}catch(e){return}};const gr=new class{constructor(){this.dbs={},this.createStore=e=>o(this,void 0,void 0,function*(){return yield ht(e,1,{upgrade:e=>{e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})}),this.openOrCreateDB=e=>o(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})=>o(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){kt(e,`Failed to get targeting match for session id ${r}: ${t}`,t)}}),this.storeTargetingMatchForSession=({loggerProvider:e,apiKey:t,sessionId:r,targetingMatch:n})=>o(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){kt(e,`Failed to store targeting match for session id ${r}: ${t}`,t)}}),this.clearStoreOfOldSessions=({loggerProvider:e,apiKey:t,currentSessionId:r})=>o(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){kt(e,`Failed to clear old targeting matches for sessions: ${t}`,t)}})}},yr=2654435761,vr=2246822519,wr=3266489917,br=374761393;function Sr(e,t){return(e<<t|e>>>32-t)>>>0}function Cr(e,t){return e=Sr(e=e+Math.imul(t,vr)>>>0,13),e=Math.imul(e,yr)>>>0}function xr(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function kr(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+yr+vr>>>0,o=t+vr>>>0,a=t>>>0,l=t-yr>>>0;for(;i<=n-16;)e=Cr(e,xr(r,i)),i+=4,o=Cr(o,xr(r,i)),i+=4,a=Cr(a,xr(r,i)),i+=4,l=Cr(l,xr(r,i)),i+=4;s=Sr(e,1)+Sr(o,7)+Sr(a,12)+Sr(l,18)>>>0}else s=t+br>>>0;for(s=s+n>>>0;i<=n-4;)s=s+Math.imul(xr(r,i),wr)>>>0,s=Math.imul(Sr(s,17),668265263)>>>0,i+=4;for(;i<n;)s=s+Math.imul(r[i],br)>>>0,s=Math.imul(Sr(s,11),yr)>>>0,i++;return s^=s>>>15,s=Math.imul(s,vr)>>>0,s^=s>>>13,s=Math.imul(s,wr)>>>0,s^=s>>>16,s>>>0}const Or="__amplitude_url_tracking_patched__",Ir=new WeakMap;function Er(e,t,r={}){if(!(null==e?void 0:e.location))return()=>{};const{enablePolling:n=!1,pollingInterval:s=re}=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=Ir.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[Or]=!0,t},a=e.history;if(null==a?void 0:a.pushState){const e=Reflect.get(a,"pushState");e[Or]||(a.pushState=o(e))}if(null==a?void 0:a.replaceState){const e=Reflect.get(a,"replaceState");e[Or]||(a.replaceState=o(e))}i={callbacks:r,notify:s,onPopStateOrHashChange:()=>s(),listenersAttached:!1},Ir.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 Mr(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:re,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?Ee(s,l):s,title:i,viewportHeight:e,viewportWidth:t,type:"url-change-event"}})();t(n)}},m=Er(r,()=>f(),c?{enablePolling:!0,pollingInterval:u}:{});return f(),()=>m()},options:e}}class Rr{constructor(){this.pendingLoadListeners=new Map}start(){var e;null===(e=this.mutationObserver)||void 0===e||e.disconnect();f()&&(this.sendToAllIframes({type:fe,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:fe,action:"stop"})}sendToIframeAfterLoad(e){const t=()=>{this.pendingLoadListeners.delete(e),this.sendToIframe(e,{type:fe,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 Pr{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.pendingEmitEvents=[],this.currentPageUrl="",this.recordEventsPendingShouldLogMetadata=null,this.urlChangeCleanup=null,this.crossOriginIframeCoordinator=null,this.crossOriginParentSignalCleanup=null,this.latestUrlChangeTargetingEvaluationId=0,this.teardownEventListeners=e=>{const t=f();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.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,s=!1)=>o(this,void 0,void 0,function*(){var i,a,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=s?this.latestUrlChangeTargetingEvaluationId:void 0;let r=e.event;r&&Object.values(n).includes(r.event_type)&&(r=void 0);const p=null!==(u=null!==(a=null===(i=e.page)||void 0===i?void 0:i.url)&&void 0!==a?a:null===(c=null===(l=f())||void 0===l?void 0:l.location)||void 0===c?void 0:c.href)&&void 0!==u?u:"",m=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})=>o(void 0,void 0,void 0,function*(){if(yield gr.clearStoreOfOldSessions({loggerProvider:r,apiKey:n,currentSessionId:e}),!0===(yield gr.getTargetingMatchForSession({loggerProvider:r,apiKey:n,sessionId:e}))&&!i)return!0;let o=!0;try{const{evaluateTargeting:i}=yield Promise.resolve().then(function(){return In}),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),gr.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:m},urlChange:s});if(s&&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)=>o(this,void 0,void 0,function*(){try{let n;const s=this.config;if(s&&e!==me.METADATA&&(n={config:Re(s),version:Qe},r)){const e=yield Me();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.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 ge(new w)}init(e,t){return y(this._init(e,t))}setupUrlChangeListener(){var e,t;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this);const r=f();if(!(null==r?void 0:r.location))return;const n=!!(null===(t=this.config)||void 0===t?void 0:t.targetingConfig),s=Er(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=f())||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,a,l,c,u,h,d,p,m,g,y;return o(this,void 0,void 0,function*(){null===(r=this.urlChangeCleanup)||void 0===r||r.call(this),this.loggerProvider=new ge(t.loggerProvider||new w),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.currentPageUrl=ke(),this.identifiers=new hr({sessionId:t.sessionId,deviceId:t.deviceId});const v=Date.now();((e,t,r)=>{const n=mr();if(!n)return;const s=pr(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>=dr)&&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=mr();if(!s)return;const i=fr(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<dr)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)=>o(void 0,void 0,void 0,function*(){const r=new Ae(e,t),n=new W(e,r.loggerProvider,r.serverZone,t.configServerUrl);return new Be(n,r)}))(e,t);const{joinedConfig:b,localConfig:S,remoteConfig:C}=yield this.joinedConfigGenerator.generateJoinedConfig();if(this.config=b,this.setMetadata(t.sessionId,b,S,C,null===(s=t.version)||void 0===s?void 0:s.version,Qe,null===(i=t.version)||void 0===i?void 0:i.type),this.pageLeaveFns=[],t.sessionId&&(null===(a=this.config.interactionConfig)||void 0===a?void 0:a.enabled)){const e=ur.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 or(this.loggerProvider,e)}const x=[];let k,O,{storeType:I}=this.config;"idb"!==I||(null===(l=f())||void 0===l?void 0:l.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=f();if(this.config.useWebWorker&&E&&E.Worker){const{compressionScript:e,trackDestinationScript:t}=yield Promise.resolve().then(function(){return Mn});k=e,O=t}let M;try{M=yield Nt({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:I,trackDestinationWorkerScript:O,shouldSend:()=>!this.isBelowMinSessionDuration()}),this.rrwebEventManager=M,x.push({name:"replay",manager:M})}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?ir:sr;try{const t=yield Nt({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:I,trackDestinationWorkerScript:O});x.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 Lt(...x),this.eventCompressor&&this.eventCompressor.terminate();const R=!0===this.config.eagerFullSnapshotSend?()=>this.sendEvents():void 0;if(this.eventCompressor=new He(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)||!M)return;const t=M.getBeaconEvents();if(!t.length)return;const r=this.getDeviceId();r&&(this.isBelowMinSessionDuration()||M.trackDestination.sendBeacon({events:t,sessionId:this.identifiers.sessionId,deviceId:r,apiKey:this.config.apiKey,serverZone:this.config.serverZone}))}],yield this.initializeNetworkObservers(),null===(p=f())||void 0===p?void 0:p.opener){const e=Y();!function(e,t){var r,n=e;if(!0!==n[Q]){n[Q]=!0;var s=null!==(r=null==t?void 0:t.scriptUrl)&&void 0!==r?r:"https://cdn.amplitude.com/libs/background-capture-1.0.1.js.gz",i=null,o=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(){var t,r;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Initializing background capture (external script)");var n=new URL(s,e.endpoint).toString();e.loadScriptOnce(n).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)"),i=null===(n=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===n?void 0:n.call(window,{messenger:e,onBackgroundCapture:o}),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==i?void 0:i.close)||void 0===e||e.call(i),i=null})}}(e),e.setup(Object.assign({logger:this.loggerProvider},this.config.serverZone&&{endpoint:G[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===(m=this.config.privacyConfig)||void 0===m?void 0:m.urlMaskLevels)||void 0===g?void 0:g.length)&&void 0!==y?y:0)>0)&&this.setupUrlChangeListener()})}setSessionId(e,t){return y(this.asyncSetSessionId(e,t))}asyncSetSessionId(e,t,r){var n,s,i;return o(this,void 0,void 0,function*(){this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0;const o=this.identifiers&&this.identifiers.sessionId;o&&this.sendEvents(o);const a=o!==e;a&&(null===(n=this.rrwebEventManager)||void 0===n||n.dropPendingBeaconEvents());const l=t||this.getDeviceId();if(this.identifiers=new hr({sessionId:e,deviceId:l}),a&&(this.sessionStartTime=Date.now(),this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,(null===(s=this.config)||void 0===s?void 0:s.apiKey)&&(((e,t,r,n)=>{const s=mr();if(s)try{s.setItem(fr(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!==o&&((e,t,r)=>{const n=mr();if(n)try{n.removeItem(fr(e,t))}catch(e){null==r||r.debug(`Failed to remove replay start time from storage: ${String(e)}`)}})(this.config.apiKey,o,this.loggerProvider))),this.joinedConfigGenerator&&o){const{joinedConfig:e}=yield this.joinedConfigGenerator.generateJoinedConfig();this.config=e}(null===(i=this.config)||void 0===i?void 0:i.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={[Z]:t.sessionReplayId?t.sessionReplayId:null},e.debugMode&&(n[ne]=JSON.stringify({appHash:D(e.apiKey).toString()}))),this.addCustomRRWebEvent(me.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(me.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 o(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,void 0===n&&(n=h),_.getInstance(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.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,kr(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(me.TARGETING_DECISION,{message:t,sessionId:this.identifiers.sessionId,matched:r,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=e),e}getBlockSelectors(){var e,t,r;const n=null!==(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.blockSelector)&&void 0!==r?r:[];if(0!==n.length)return n}getMaskTextSelectors(){var e,t;const r=null===(e=this.config)||void 0===e?void 0:e.privacyConfig;if("conservative"===(r?be(this.currentPageUrl,r):void 0))return"*";if(null===(t=null==r?void 0:r.urlMaskLevels)||void 0===t?void 0:t.some(e=>"conservative"===e.maskLevel))return"*";const n=null==r?void 0:r.urlMaskLevels;if("conservative"===(null==r?void 0:r.defaultMaskLevel)&&n&&n.length>0)return"*";const s=null==r?void 0:r.maskSelector;return s||void 0}getRecordingPlugins(e){var t,r,n,s,i,a;return o(this,void 0,void 0,function*(){const o=[];try{const e=Mr({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});o.push(e)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(null===(a=null==e?void 0:e.console)||void 0===a?void 0:a.enabled)try{const{getRecordConsolePlugin:t}=yield Promise.resolve().then(function(){return Wa});o.push(t({level:e.console.levels}))}catch(e){this.loggerProvider.warn("Failed to load console plugin:",e)}return o.length>0?o:void 0})}getRecordFunction(){return o(this,void 0,void 0,function*(){if(this.recordFunction)return this.recordFunction;try{const{record:e}=yield Promise.resolve().then(function(){return Bp});return this.recordFunction=e,e}catch(e){return this.loggerProvider.warn("Failed to load rrweb-record module:",e),null}})}recordEvents(e=!0){return o(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}}})}_recordEvents(e=!0){var t,r,n,s,i,a,l,c;return o(this,void 0,void 0,function*(){const o=this.config,u=this.getShouldRecord(),h=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId;if(!u||!h||!o)return;this.stopRecordingEvents();const d=yield this.getRecordFunction();if(!d)return;yield this.initializeNetworkObservers();const p=null===(r=o.loggingConfig)||void 0===r?void 0:r.network,m=ve(o.serverZone,o.trackServerUrl),g=[oe,ae,le,m];null===(n=this.networkObservers)||void 0===n||n.start(e=>{g.some(t=>e.url.startsWith(t))||this.addCustomRRWebEvent(me.FETCH_REQUEST,e)},p);const{interactionConfig:y,loggingConfig:v}=o,w=(null==y?void 0:y.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:d.mirror,ugcFilterRules:null!==(i=y.ugcFilterRules)&&void 0!==i?i:[],performanceOptions:null===(a=o.performanceConfig)||void 0===a?void 0:a.interaction})),scroll:this.scrollHook}:{},b=(null==y?void 0:y.enabled)&&y.ugcFilterRules?y.ugcFilterRules:[];this.loggerProvider.log(`Session Replay capture beginning for ${h}.`);try{const t=!!(null===(l=o.crossOriginIframes)||void 0===l?void 0:l.enabled),r=!1!==(null===(c=o.crossOriginIframes)||void 0===c?void 0:c.coordinateChildren),n=t&&function(){try{const e=f();return!!e&&e.parent!==e}catch(e){return!0}}();if(n&&r)return void(this.crossOriginParentSignalCleanup=function(e){const t=f();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)===fe&&("start"===n.action?e.onStart():"stop"===n.action&&e.onStop())}return t.addEventListener("message",n),()=>t.removeEventListener("message",n)}({onStart:()=>this._recordEventsInChildMode(d,h,o,w),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()}`)}}}));this.recordCancelCallback=d(Object.assign(Object.assign({},this.buildRRWebRecordOptions(o,w,e=>{if(this.shouldOptOut())return this.loggerProvider.log(`Opting session ${h} out of recording due to optOut config.`),this.stopRecordingEvents(),void this.sendEvents();e.type===Fe.Meta&&(e.data.href=Ee(e.data.href,b)),this.eventCompressor?this.eventCompressor.enqueueEvent(e,h):this.pendingEmitEvents.push({event:e,sessionId:h})},"Error while capturing replay: ")),{plugins:yield this.getRecordingPlugins(v),recordCrossOriginIframes:t})),t&&!n&&r&&(this.crossOriginIframeCoordinator||(this.crossOriginIframeCoordinator=new Rr),this.crossOriginIframeCoordinator.start()),this.addCustomRRWebEvent(me.DEBUG_INFO),e&&this.addCustomRRWebEvent(me.METADATA,this.metadata)}catch(e){this.loggerProvider.warn("Failed to initialize session replay:",e)}})}buildRRWebRecordOptions(e,t,r,n){const{privacyConfig:s}=e;return Object.assign(Object.assign({emit:r,inlineStylesheet:e.shouldInlineStylesheet,hooks:t,maskAllInputs:!0,maskTextClass:se,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:e.applyBackgroundColorToBlockedElements,maskInputFn:Ce("input",s,()=>this.currentPageUrl),maskTextFn:Ce("text",s,()=>this.currentPageUrl),maskAttributeFn:xe(s,()=>this.currentPageUrl),maskTextSelector:this.getMaskTextSelectors()},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}flush(e=!1){var t;return o(this,void 0,void 0,function*(){return null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)})}shutdown(){var e,t;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())?D(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 o(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 Wp});this.networkObservers=new e}catch(e){this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",e)}})}}const Ar=e=>()=>{const{config:t}=e,{loggerProvider:r,logLevel:n}=t||Pe();return{logger:r,logLevel:n}};var Tr=(()=>{const e=new Pr;return{init:k(e.init.bind(e),"init",Ar(e)),evaluateTargetingAndCapture:k(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",Ar(e)),setSessionId:k(e.setSessionId.bind(e),"setSessionId",Ar(e)),getSessionId:k(e.getSessionId.bind(e),"getSessionId",Ar(e)),getSessionReplayProperties:k(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",Ar(e)),flush:k(e.flush.bind(e),"flush",Ar(e)),shutdown:k(e.shutdown.bind(e),"shutdown",Ar(e))}})();const{init:Nr,setSessionId:Lr,getSessionId:_r,getSessionReplayProperties:Dr,flush:Fr,shutdown:jr,evaluateTargetingAndCapture:Ur}=Tr;var Br=function(e,t){return Br=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])},Br(e,t)};var $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 zr(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 Wr="is",qr="is not",Vr="contains",Gr="does not contain",Hr="less",Jr="less or equal",Kr="greater",Yr="greater or equal",Qr="version less",Xr="version less or equal",Zr="version greater",en="version greater or equal",tn="set is",rn="set is not",nn="set contains",sn="set does not contain",on="set contains any",an="set does not contain any",ln="regex match",cn="regex does not match",un=-862048943,hn=461845907,dn=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=gn(r,o<<2);i=pn(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,un),c=mn(c,15),i^=c=Math.imul(c,hn);break;case 2:c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,un),c=mn(c,15),i^=c=Math.imul(c,hn);break;case 1:c^=r[l],c=Math.imul(c,un),c=mn(c,15),i^=c=Math.imul(c,hn)}return fn(i^=n)>>>0},pn=function(e,t){var r=e,n=t;return r=Math.imul(r,un),r=mn(r,15),r=Math.imul(r,hn),n=mn(n^=r,13),(n=Math.imul(n,5))+-430675100|0},fn=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},mn=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},gn=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 yn(r)},yn=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=zr(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}},wn="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),bn=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(wn).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}(),Sn=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,s={},i={context:e,result:s};try{for(var o=zr(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=zr(t.segments),o=i.next();!o.done;o=i.next()){var a=o.value;if(s=this.evaluateSegment(e,t,a)){var l=$r($r($r({},t.metadata),a.metadata),s.metadata);s=$r($r({},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=zr(r.conditions),l=a.next();!l.done;l=a.next()){var c,u=l.value,h=!0;try{for(var d=(i=void 0,zr(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 dn(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=zr(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,zr(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 Wr:case Vr:case Hr:case Jr:case Kr:case Yr:case Qr:case Xr:case Zr:case en:case tn:case nn:case on:return r;case qr:case Gr:case sn:case an:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case tn:return this.setEquals(e,r);case rn:return!this.setEquals(e,r);case nn:return this.matchesSetContainsAll(e,r);case sn:return!this.matchesSetContainsAll(e,r);case on:return this.matchesSetContainsAny(e,r);case an:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case Wr:return this.matchesIs(e,r);case qr:return!this.matchesIs(e,r);case Vr:return this.matchesContains(e,r);case Gr:return!this.matchesContains(e,r);case Hr:case Jr:case Kr:case Yr:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case Qr:case Xr:case Zr:case en:return this.matchesComparable(e,t,r,function(e){return bn.parse(e)},this.versionComparator);case ln:return this.matchesRegex(e,r);case cn: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=zr(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 Hr:case Qr:return e<r;case Jr:case Xr:return e<=r;case Kr:case Zr:return e>r;case Yr:case en:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Hr:case Qr:return n<0;case Jr:case Xr:return n<=0;case Kr:case Zr:return n>0;case Yr:case en: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 tn:case rn:case nn:case sn:case on:case an: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=zr(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=zr(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}Br(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var Cn=function(){var e=this;this.dbs={},this.createStore=function(t){return o(e,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,ht(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 o(e,void 0,void 0,function(){var e,r;return a(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.updateEventListForSession=function(t){var r=t.sessionId,n=t.eventType,i=t.eventTime,l=t.loggerProvider,c=t.tx;return o(e,void 0,void 0,function(){var e,t,o,u,h,d,p,f,m;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=String(r),[4,c.store.get(e)];case 1:return t=a.sent(),o=t?t.eventTypes:{},u=o[n]||{},h=s(s({},o),((f={})[n]=s(s({},u),((m={})[i]={event_type:n},m)),f)),d={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,c.store.put(d)];case 2:return a.sent(),[2,h];case 3:return p=a.sent(),l.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 o(e,void 0,void 0,function(){var e,t,i,o,l,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),e=String(r),[4,s.store.getAll()];case 1:t=a.sent(),i=0,a.label=2;case 2:return i<t.length?(o=t[i],l=Date.now()-o.lastUpdated,o.sessionId!==e&&l>1728e5?[4,s.store.delete(o.sessionId)]:[3,4]):[3,5];case 3:a.sent(),a.label=4;case 4:return i++,[3,2];case 5:return[3,7];case 6:return c=a.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,l=t.apiKey;return o(e,void 0,void 0,function(){var e,t,o,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,5,,6]),[4,this.openOrCreateDB(l)];case 1:return e=a.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:s,eventTime:i})]:[2];case 2:return o=a.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return a.sent(),[4,t.done];case 4:return a.sent(),[2,o];case 5:return c=a.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(c)),[3,6];case 6:return[2,void 0]}})})}},xn=new Cn,kn=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,i=t.event,l=t.sessionId,c=t.userProperties,u=t.deviceId,h=t.page,d=t.flag;return o(e,void 0,void 0,function(){var e,t,o,p;return a(this,function(a){switch(a.label){case 0:return i&&i.time?[4,xn.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:l,eventType:i.event_type,eventTime:i.time})]:[3,2];case 1:return t=a.sent(),[3,3];case 2:t=void 0,a.label=3;case 3:return o=(e=t)&&new Set(Object.keys(e)),p={session_id:l,event:i,event_types:o&&Array.from(o),user:s(s({},c),{device_id:u,user_properties:c}),page:h},[2,this.evaluationEngine.evaluate(p,[d])]}})})},this.evaluationEngine=new Sn},On=function(){var e=new kn;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,In=Object.freeze({__proto__:null,evaluateTargeting:On});var En,Mn=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{c(n.next(e))}catch(e){o(e)}}function i(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,i)}c((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(c){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,c])}}}"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;!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 i="Network error occurred, event batch rejected";function c(e,t){return n(this,void 0,void 0,function(){var r,o,a,i,c,u,l,d,p,f,h,v,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(),c=[],u=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];c.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,u];case 3:m.sent(),l=c.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.")}(c),h=f.next();!h.done;h=f.next())v=h.value,d.set(v,p),p+=v.length}catch(e){y={error:e}}finally{try{h&&!h.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 u(e,t){var o,u,l,d,p,f,h,v;return n(this,void 0,void 0,function(){var n,y,b,g,m,S,w,T,E,R,k,x,C,A,I;return s(this,function(s){switch(s.label){case 0:n=null!==(o=t.sendTimeoutMs)&&void 0!==o?o: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 b=s.sent(),[3,4];case 3:b=null,s.label=4;case 4:y=b,g="".concat(null!==(l=null===(u=t.version)||void 0===u?void 0:u.type)&&void 0!==l?l:"standalone","/").concat(null!==(p=null===(d=t.version)||void 0===d?void 0:d.version)&&void 0!==p?p:t.sdkVersion),m=new URLSearchParams({device_id:t.deviceId,session_id:"".concat(t.sessionId),type:t.eventType}),S="".concat((O=t.serverZone,U=t.trackServerUrl,U||("STAGING"===O?"https://api-sr.stag2.amplitude.com/sessions/v2/track":"EU"===O?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")),"?").concat(m.toString()),w=r({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(t.apiKey),"X-Client-Version":t.sdkVersion,"X-Client-Library":g,"X-Client-Url":t.currentUrl.substring(0,1e3),"X-Client-Sample-Rate":"".concat(t.sampleRate),"X-Sampling-Hash-Alg":"xxhash32"},y?{"Content-Encoding":"gzip"}:{}),T=y?y.byteLength:new Blob([e]).size,E=new AbortController,R=n>0?setTimeout(function(){E.abort()},n):void 0,k=void 0,s.label=5;case 5:return s.trys.push([5,,7,8]),[4,fetch(S,{method:"POST",headers:w,body:null!=y?y:e,keepalive:T<=65536,signal:E.signal})];case 6:return k=s.sent(),[3,8];case 7:return R&&clearTimeout(R),[7];case 8:if(null===k)return[2,{shouldRetry:!1,success:!1,message:"Unexpected error occurred"}];if(k.status>=200&&k.status<300)return x=Math.round(new Blob(t.events).size/1024),C=null!==(v=null===(h=null===(f=k.headers)||void 0===f?void 0:f.get)||void 0===h?void 0:h.call(f,"X-Session-Replay-Event-Skipped"))&&void 0!==v?v:null,[2,{shouldRetry:!1,success:!0,message:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(x," KB"),skipCode:C}];if(413!==k.status)return[3,13];A="",s.label=9;case 9:return s.trys.push([9,11,,12]),[4,k.text()];case 10:return A=s.sent(),[3,12];case 11:return s.sent(),[3,12];case 12:return[2,{shouldRetry:!1,success:!1,message:i,payloadTooLarge:!0,isWaf:a.test(A)}];case 13:return k.status>=500||408===k.status||429===k.status||499===k.status?[2,{shouldRetry:!0,success:!1,message:"HTTP ".concat(k.status)}]:[2,{shouldRetry:!1,success:!1,message:i}];case 14:return(I=s.sent())&&"object"==typeof I&&"AbortError"===I.name?[2,{shouldRetry:!0,success:!1,message:"Session replay worker request timed out after ".concat(n,"ms")}]:[2,{shouldRetry:!1,success:!1,message:String(I)}];case 15:return[2]}var O,U})})}function l(e,t,r,o){var a;return n(this,void 0,void 0,function(){var n,i,c;return s(this,function(s){switch(s.label){case 0:n=1,s.label=1;case 1:return[4,u(t,r)];case 2:return(i=s.sent()).success?(postMessage({type:"log",id:e,message:i.message}),postMessage({type:"complete",id:e,skipCode:null!==(a=i.skipCode)&&void 0!==a?a:null}),[2]):i.payloadTooLarge&&o?(postMessage({type:"payload_too_large",id:e,isWaf:!0===i.isWaf}),[2]):o&&i.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":i.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,c;return s(this,function(s){switch(s.label){case 0:return t=e.data,r=t.type,n=t.id,o=t.payload,a=t.context,i=t.useRetry,"send"!==r?[3,2]:(c=JSON.stringify(o),[4,l(n,c,a,i)]);case 1:s.sent(),s.label=2;case 2:return[2]}})})};var d=onmessage;return e.trackDestinationOnMessage=d,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n'}),Rn=Object.defineProperty,Pn=(e,t,r)=>((e,t,r)=>t in e?Rn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),An=Object.defineProperty,Tn=(e,t,r)=>((e,t,r)=>t in e?An(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Nn=Object.defineProperty,Ln=(e,t,r)=>((e,t,r)=>t in e?Nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const _n={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Dn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Fn={};function jn(e){if(Fn[e])return Fn[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 _n?_n[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 Dn?Dn[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 Fn[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?Fn[e]=i:r}catch{return r}}const Un={};function Bn(e,t,r){var n;const s=`${e}.${String(r)}`;if(Un[s])return Un[s].call(t);const i=jn(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(Un[s]=o,o.call(t)):t[r]}const $n={};function zn(e,t,r){const n=`${e}.${String(r)}`;if($n[n])return $n[n].bind(t);const s=jn(e)[r];return"function"!=typeof s?t[r]:($n[n]=s,s.bind(t))}const Wn={childNodes:function(e){return Bn("Node",e,"childNodes")},parentNode:function(e){return Bn("Node",e,"parentNode")},parentElement:function(e){return Bn("Node",e,"parentElement")},textContent:function(e){return Bn("Node",e,"textContent")},contains:function(e,t){return zn("Node",e,"contains")(t)},getRootNode:function(e){return zn("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Bn("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Bn("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Bn("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Bn("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return jn("MutationObserver").constructor}};class qn{constructor(){Ln(this,"idNodeMap",new Map),Ln(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 Vn(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Vn(Wn.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Vn(Wn.parentNode(e),t,r)}function Gn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Hn(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 Jn,Kn={exports:{}};function Yn(){if(Jn)return Kn.exports;Jn=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Kn.exports=t(),Kn.exports.createColors=t,Kn.exports}const Qn=Hn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Xn,Zn;function es(){if(Zn)return Xn;Zn=1;let e=Yn(),t=Qn;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),t&&r&&(n=t(n));let s,i,o=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,o.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),i=e=>r(e)}else s=i=e=>e;return o.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=i(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+i(n)+e+"\n "+t+s("^")}return" "+i(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Xn=r,r.default=r,Xn}var ts,rs,ns,ss,is,os,as,ls,cs,us,hs,ds,ps,fs,ms,gs,ys,vs,ws,bs,Ss,Cs,xs,ks,Os,Is,Es,Ms,Rs,Ps,As,Ts,Ns,Ls,_s,Ds,Fs,js,Us,Bs,$s,zs,Ws,qs,Vs,Gs,Hs,Js,Ks,Ys,Qs,Xs,Zs,ei={};function ti(){return ts||(ts=1,ei.isClean=Symbol("isClean"),ei.my=Symbol("my")),ei}function ri(){if(ns)return rs;ns=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 rs=t,t.default=t,rs}function ni(){if(is)return ss;is=1;let e=ri();function t(t,r){new e(r).stringify(t)}return ss=t,t.default=t,ss}function si(){if(as)return os;as=1;let{isClean:e,my:t}=ti(),r=es(),n=ri(),s=ni();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}class o{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=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(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return os=o,o.default=o,os}function ii(){if(cs)return ls;cs=1;let e=si();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return ls=t,t.default=t,ls}function oi(){if(hs)return us;hs=1;return us={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},us}function ai(){if(ps)return ds;ps=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Qn,{existsSync:r,readFileSync:n}=Qn,{dirname:s,join:i}=Qn;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=i(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return ds=o,o.default=o,ds}function li(){if(ms)return fs;ms=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Qn,{fileURLToPath:r,pathToFileURL:n}=Qn,{isAbsolute:s,resolve:i}=Qn,{nanoid:o}=oi(),a=Qn,l=es(),c=ai(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(i&&s);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=i(t.from)),d&&h){let e=new c(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let i,o,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,a=e.col}else o=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,o,a);return i=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:a,line:o},this.css,this.file,s.plugin),i.input={column:r,endColumn:a,endLine:o,line:t,source:this.css},this.file&&(n&&(i.input.url=n(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[u])r=this[u];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[u]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:i(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,i,o){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof i&&(a=c.originalPositionFor({column:o,line:i})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(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(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(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}get from(){return this.file||this.id}}return fs=p,p.default=p,a&&a.registerInput&&a.registerInput(p),fs}function ci(){if(ys)return gs;ys=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Qn,{dirname:r,relative:n,resolve:s,sep:i}=Qn,{pathToFileURL:o}=Qn,a=li(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&i);return gs=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,s=this.toUrl(this.path(t.file)),i=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,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&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(o.generated.line=n,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=s-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let i=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=r(s(i,this.mapOpts.annotation)));let o=n(i,e);return this.memoizedPaths.set(e,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;"\\"===i&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function ui(){if(ws)return vs;ws=1;let e=si();class t extends e{constructor(e){super(e),this.type="comment"}}return vs=t,t.default=t,vs}function hi(){if(Ss)return bs;Ss=1;let e,t,r,n,{isClean:s,my:i}=ti(),o=ii(),a=ui(),l=si();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new o(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[i]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},bs=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,o.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[i]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},bs}function di(){if(xs)return Cs;xs=1;let e,t,r=hi();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},Cs=n,n.default=n,Cs}function pi(){if(Os)return ks;Os=1;let e={};return ks=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function fi(){if(Es)return Is;Es=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 Is=e,e.default=e,Is}function mi(){if(Rs)return Ms;Rs=1;let e=fi();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return Ms=t,t.default=t,Ms}function gi(){if(Ns)return Ts;Ns=1;let e=hi();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 Ts=t,t.default=t,e.registerAtRule(t),Ts}function yi(){if(_s)return Ls;_s=1;let e,t,r=hi();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},Ls=n,n.default=n,r.registerRoot(n),Ls}function vi(){if(Fs)return Ds;Fs=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 Ds=e,e.default=e,Ds}function wi(){if(Us)return js;Us=1;let e=hi(),t=vi();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return js=r,r.default=r,e.registerRule(r),js}function bi(){if($s)return Bs;$s=1;let e=ii(),t=function(){if(As)return Ps;As=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 Ps=function(x,k={}){let O,I,E,M,R,P,A,T,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,j=0,U=[],B=[];function $(e){throw x.error("Unclosed "+e,j)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&j>=F},nextToken:function(x){if(B.length)return B.pop();if(j>=F)return;let k=!!x&&x.ignoreUnclosed;switch(O=_.charCodeAt(j),O){case s:case i:case a:case l:case o:I=j;do{I+=1,O=_.charCodeAt(I)}while(O===i||O===s||O===a||O===l||O===o);L=["space",_.slice(j,I)],j=I-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);L=[e,e,j];break}case h:if(T=U.length?U.pop()[1]:"",N=_.charCodeAt(j+1),"url"===T&&N!==e&&N!==t&&N!==i&&N!==s&&N!==a&&N!==o&&N!==l){I=j;do{if(P=!1,I=_.indexOf(")",I+1),-1===I){if(D||k){I=j;break}$("bracket")}for(A=I;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["brackets",_.slice(j,I+1),j,I],j=I}else I=_.indexOf(")",j+1),M=_.slice(j,I+1),-1===I||S.test(M)?L=["(","(",j]:(L=["brackets",M,j,I],j=I);break;case e:case t:E=O===e?"'":'"',I=j;do{if(P=!1,I=_.indexOf(E,I+1),-1===I){if(D||k){I=j+1;break}$("string")}for(A=I;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["string",_.slice(j,I+1),j,I],j=I;break;case v:w.lastIndex=j+1,w.test(_),I=0===w.lastIndex?_.length-1:w.lastIndex-2,L=["at-word",_.slice(j,I+1),j,I],j=I;break;case r:for(I=j,R=!0;_.charCodeAt(I+1)===r;)I+=1,R=!R;if(O=_.charCodeAt(I+1),R&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(I+=1,C.test(_.charAt(I)))){for(;C.test(_.charAt(I+1));)I+=1;_.charCodeAt(I+1)===i&&(I+=1)}L=["word",_.slice(j,I+1),j,I],j=I;break;default:O===n&&_.charCodeAt(j+1)===g?(I=_.indexOf("*/",j+2)+1,0===I&&(D||k?I=_.length:$("comment")),L=["comment",_.slice(j,I+1),j,I],j=I):(b.lastIndex=j+1,b.test(_),I=0===b.lastIndex?_.length-1:b.lastIndex-2,L=["word",_.slice(j,I+1),j,I],U.push(L),j=I)}return j++,L},position:function(){return j}}}}(),r=ui(),n=gi(),s=yi(),i=wi();const o={empty:!0,space:!0};return Bs=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,s,i=new n;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);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&&(e=l[l.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),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(t=o,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return i}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,i=t[t.length-1];for(";"===i[0]&&(this.semicolon=!0,t.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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.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(;t.length&&(o=t[0][0],"space"===o||"comment"===o);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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 i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Bs}function Si(){if(Ws)return zs;Ws=1;let e=hi(),t=bi(),r=li();function n(e,n){let s=new r(e,n),i=new t(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 zs=n,n.default=n,e.registerParse(n),zs}function Ci(){if(Vs)return qs;Vs=1;let{isClean:e,my:t}=ti(),r=ci(),n=ni(),s=hi(),i=di(),o=pi(),a=mi(),l=Si(),c=yi();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(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let y={};class v{constructor(e,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof a)i=g(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[t]&&s.rebuild(i)}else i=g(r);this.result=new a(e,i,n),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 t=this.result.root;for(;!t[e];){t[e]=!0;let r=[m(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,i=r.iterator;for(;s=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!s[e])return s[e]=!0,void t.push(m(s));r.iterator=0,delete n.indexes[i]}let i=r.events;for(;r.eventIndex<i.length;){let t=i[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return v.registerPostcss=e=>{y=e},qs=v,v.default=v,c.registerLazyResult(v),i.registerLazyResult(v),qs}function xi(){if(Ks)return Js;Ks=1;let e=function(){if(Hs)return Gs;Hs=1;let e=ci(),t=ni(),r=pi(),n=Si();const s=mi();class i{constructor(r,n,i){let o;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=i,this._map=void 0;let a=t;this.result=new s(this._processor,o,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,n);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||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return Gs=i,i.default=i,Gs}(),t=Ci(),r=di(),n=yi();class s{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Js=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Js}const ki=Gn(function(){if(Zs)return Xs;Zs=1;let e=es(),t=ii(),r=Ci(),n=hi(),s=xi(),i=ni(),o=function(){if(Qs)return Ys;Qs=1;let e=ii(),t=ai(),r=ui(),n=gi(),s=li(),i=yi(),o=wi();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 r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}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 e(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return Ys=a,a.default=a,Ys}(),a=di(),l=fi(),c=ui(),u=gi(),h=mi(),d=li(),p=Si(),f=vi(),m=wi(),g=yi(),y=si();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return v.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new s).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return v([i(r)]).process(e,t)},i},v.stringify=i,v.parse=p,v.fromJSON=o,v.list=f,v.comment=e=>new c(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new m(e),v.root=e=>new g(e),v.document=e=>new a(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=n,v.Processor=s,v.Document=a,v.Comment=c,v.Warning=l,v.AtRule=u,v.Result=h,v.Input=d,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),Xs=v,v.default=v,Xs}());ki.stringify,ki.fromJSON,ki.plugin,ki.parse,ki.list,ki.document,ki.comment,ki.atRule,ki.rule,ki.decl,ki.root,ki.CssSyntaxError,ki.Declaration,ki.Container,ki.Processor,ki.Document,ki.Comment,ki.Warning,ki.AtRule,ki.Result,ki.Input,ki.Rule,ki.Root,ki.Node;var Oi=Object.defineProperty,Ii=(e,t,r)=>((e,t,r)=>t in e?Oi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Ei(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Mi(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 Ri,Pi={exports:{}};function Ai(){if(Ri)return Pi.exports;Ri=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Pi.exports=t(),Pi.exports.createColors=t,Pi.exports}const Ti=Mi(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ni,Li;function _i(){if(Li)return Ni;Li=1;let e=Ai(),t=Ti;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),t&&r&&(n=t(n));let s,i,o=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,o.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),i=e=>r(e)}else s=i=e=>e;return o.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=i(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+i(n)+e+"\n "+t+s("^")}return" "+i(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Ni=r,r.default=r,Ni}var Di,Fi,ji,Ui,Bi,$i,zi,Wi,qi,Vi,Gi,Hi,Ji,Ki,Yi,Qi,Xi,Zi,eo,to,ro,no,so,io,oo,ao,lo,co,uo,ho,po,fo,mo,go,yo,vo,wo,bo,So,Co,xo,ko,Oo,Io,Eo,Mo,Ro,Po,Ao,To,No,Lo,_o,Do={};function Fo(){return Di||(Di=1,Do.isClean=Symbol("isClean"),Do.my=Symbol("my")),Do}function jo(){if(ji)return Fi;ji=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 Uo(){if(Bi)return Ui;Bi=1;let e=jo();function t(t,r){new e(r).stringify(t)}return Ui=t,t.default=t,Ui}function Bo(){if(zi)return $i;zi=1;let{isClean:e,my:t}=Fo(),r=_i(),n=jo(),s=Uo();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}class o{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=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(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return $i=o,o.default=o,$i}function $o(){if(qi)return Wi;qi=1;let e=Bo();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return Wi=t,t.default=t,Wi}function zo(){if(Gi)return Vi;Gi=1;return Vi={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},Vi}function Wo(){if(Ji)return Hi;Ji=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Ti,{existsSync:r,readFileSync:n}=Ti,{dirname:s,join:i}=Ti;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=i(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Hi=o,o.default=o,Hi}function qo(){if(Yi)return Ki;Yi=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Ti,{fileURLToPath:r,pathToFileURL:n}=Ti,{isAbsolute:s,resolve:i}=Ti,{nanoid:o}=zo(),a=Ti,l=_i(),c=Wo(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(i&&s);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=i(t.from)),d&&h){let e=new c(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let i,o,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,a=e.col}else o=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,o,a);return i=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:a,line:o},this.css,this.file,s.plugin),i.input={column:r,endColumn:a,endLine:o,line:t,source:this.css},this.file&&(n&&(i.input.url=n(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[u])r=this[u];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[u]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:i(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,i,o){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof i&&(a=c.originalPositionFor({column:o,line:i})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(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(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(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}get from(){return this.file||this.id}}return Ki=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Ki}function Vo(){if(Xi)return Qi;Xi=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Ti,{dirname:r,relative:n,resolve:s,sep:i}=Ti,{pathToFileURL:o}=Ti,a=qo(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&i);return Qi=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,s=this.toUrl(this.path(t.file)),i=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,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&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(o.generated.line=n,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=s-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let i=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=r(s(i,this.mapOpts.annotation)));let o=n(i,e);return this.memoizedPaths.set(e,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;"\\"===i&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}}}function Go(){if(eo)return Zi;eo=1;let e=Bo();class t extends e{constructor(e){super(e),this.type="comment"}}return Zi=t,t.default=t,Zi}function Ho(){if(ro)return to;ro=1;let e,t,r,n,{isClean:s,my:i}=Fo(),o=$o(),a=Go(),l=Bo();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new o(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[i]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},to=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,o.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[i]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},to}function Jo(){if(so)return no;so=1;let e,t,r=Ho();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},no=n,n.default=n,no}function Ko(){if(oo)return io;oo=1;let e={};return io=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Yo(){if(lo)return ao;lo=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 ao=e,e.default=e,ao}function Qo(){if(uo)return co;uo=1;let e=Yo();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return co=t,t.default=t,co}function Xo(){if(mo)return fo;mo=1;let e=Ho();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 fo=t,t.default=t,e.registerAtRule(t),fo}function Zo(){if(yo)return go;yo=1;let e,t,r=Ho();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},go=n,n.default=n,r.registerRoot(n),go}function ea(){if(wo)return vo;wo=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 vo=e,e.default=e,vo}function ta(){if(So)return bo;So=1;let e=Ho(),t=ea();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return bo=r,r.default=r,e.registerRule(r),bo}function ra(){if(xo)return Co;xo=1;let e=$o(),t=function(){if(po)return ho;po=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 ho=function(x,k={}){let O,I,E,M,R,P,A,T,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,j=0,U=[],B=[];function $(e){throw x.error("Unclosed "+e,j)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&j>=F},nextToken:function(x){if(B.length)return B.pop();if(j>=F)return;let k=!!x&&x.ignoreUnclosed;switch(O=_.charCodeAt(j),O){case s:case i:case a:case l:case o:I=j;do{I+=1,O=_.charCodeAt(I)}while(O===i||O===s||O===a||O===l||O===o);L=["space",_.slice(j,I)],j=I-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);L=[e,e,j];break}case h:if(T=U.length?U.pop()[1]:"",N=_.charCodeAt(j+1),"url"===T&&N!==e&&N!==t&&N!==i&&N!==s&&N!==a&&N!==o&&N!==l){I=j;do{if(P=!1,I=_.indexOf(")",I+1),-1===I){if(D||k){I=j;break}$("bracket")}for(A=I;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["brackets",_.slice(j,I+1),j,I],j=I}else I=_.indexOf(")",j+1),M=_.slice(j,I+1),-1===I||S.test(M)?L=["(","(",j]:(L=["brackets",M,j,I],j=I);break;case e:case t:E=O===e?"'":'"',I=j;do{if(P=!1,I=_.indexOf(E,I+1),-1===I){if(D||k){I=j+1;break}$("string")}for(A=I;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["string",_.slice(j,I+1),j,I],j=I;break;case v:w.lastIndex=j+1,w.test(_),I=0===w.lastIndex?_.length-1:w.lastIndex-2,L=["at-word",_.slice(j,I+1),j,I],j=I;break;case r:for(I=j,R=!0;_.charCodeAt(I+1)===r;)I+=1,R=!R;if(O=_.charCodeAt(I+1),R&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(I+=1,C.test(_.charAt(I)))){for(;C.test(_.charAt(I+1));)I+=1;_.charCodeAt(I+1)===i&&(I+=1)}L=["word",_.slice(j,I+1),j,I],j=I;break;default:O===n&&_.charCodeAt(j+1)===g?(I=_.indexOf("*/",j+2)+1,0===I&&(D||k?I=_.length:$("comment")),L=["comment",_.slice(j,I+1),j,I],j=I):(b.lastIndex=j+1,b.test(_),I=0===b.lastIndex?_.length-1:b.lastIndex-2,L=["word",_.slice(j,I+1),j,I],U.push(L),j=I)}return j++,L},position:function(){return j}}}}(),r=Go(),n=Xo(),s=Zo(),i=ta();const o={empty:!0,space:!0};return Co=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,s,i=new n;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);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&&(e=l[l.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),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(t=o,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return i}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,i=t[t.length-1];for(";"===i[0]&&(this.semicolon=!0,t.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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.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(;t.length&&(o=t[0][0],"space"===o||"comment"===o);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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 i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Co}function na(){if(Oo)return ko;Oo=1;let e=Ho(),t=ra(),r=qo();function n(e,n){let s=new r(e,n),i=new t(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 sa(){if(Eo)return Io;Eo=1;let{isClean:e,my:t}=Fo(),r=Vo(),n=Uo(),s=Ho(),i=Jo(),o=Ko(),a=Qo(),l=na(),c=Zo();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(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let y={};class v{constructor(e,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof a)i=g(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[t]&&s.rebuild(i)}else i=g(r);this.result=new a(e,i,n),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 t=this.result.root;for(;!t[e];){t[e]=!0;let r=[m(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,i=r.iterator;for(;s=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!s[e])return s[e]=!0,void t.push(m(s));r.iterator=0,delete n.indexes[i]}let i=r.events;for(;r.eventIndex<i.length;){let t=i[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return v.registerPostcss=e=>{y=e},Io=v,v.default=v,c.registerLazyResult(v),i.registerLazyResult(v),Io}function ia(){if(Ao)return Po;Ao=1;let e=function(){if(Ro)return Mo;Ro=1;let e=Vo(),t=Uo(),r=Ko(),n=na();const s=Qo();class i{constructor(r,n,i){let o;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=i,this._map=void 0;let a=t;this.result=new s(this._processor,o,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,n);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||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return Mo=i,i.default=i,Mo}(),t=sa(),r=Jo(),n=Zo();class s{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Po=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Po}const oa=Ei(function(){if(_o)return Lo;_o=1;let e=_i(),t=$o(),r=sa(),n=Ho(),s=ia(),i=Uo(),o=function(){if(No)return To;No=1;let e=$o(),t=Wo(),r=Go(),n=Xo(),s=qo(),i=Zo(),o=ta();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 r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}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 e(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return To=a,a.default=a,To}(),a=Jo(),l=Yo(),c=Go(),u=Xo(),h=Qo(),d=qo(),p=na(),f=ea(),m=ta(),g=Zo(),y=Bo();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return v.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new s).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return v([i(r)]).process(e,t)},i},v.stringify=i,v.parse=p,v.fromJSON=o,v.list=f,v.comment=e=>new c(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new m(e),v.root=e=>new g(e),v.document=e=>new a(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=n,v.Processor=s,v.Document=a,v.Comment=c,v.Warning=l,v.AtRule=u,v.Result=h,v.Input=d,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),Lo=v,v.default=v,Lo}());oa.stringify,oa.fromJSON,oa.plugin,oa.parse,oa.list,oa.document,oa.comment,oa.atRule,oa.rule,oa.decl,oa.root,oa.CssSyntaxError,oa.Declaration,oa.Container,oa.Processor,oa.Document,oa.Comment,oa.Warning,oa.AtRule,oa.Result,oa.Input,oa.Rule,oa.Root,oa.Node;class aa{constructor(...e){Ii(this,"parentElement",null),Ii(this,"parentNode",null),Ii(this,"ownerDocument"),Ii(this,"firstChild",null),Ii(this,"lastChild",null),Ii(this,"previousSibling",null),Ii(this,"nextSibling",null),Ii(this,"ELEMENT_NODE",1),Ii(this,"TEXT_NODE",3),Ii(this,"nodeType"),Ii(this,"nodeName"),Ii(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 aa))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 la={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ca={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ua={};function ha(e){if(ua[e])return ua[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 la?la[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 ca?ca[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 ua[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?ua[e]=i:r}catch{return r}}const da={};function pa(e,t,r){var n;const s=`${e}.${String(r)}`;if(da[s])return da[s].call(t);const i=ha(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(da[s]=o,o.call(t)):t[r]}const fa={};function ma(e,t,r){const n=`${e}.${String(r)}`;if(fa[n])return fa[n].bind(t);const s=ha(e)[r];return"function"!=typeof s?t[r]:(fa[n]=s,s.bind(t))}const ga={childNodes:function(e){return pa("Node",e,"childNodes")},parentNode:function(e){return pa("Node",e,"parentNode")},parentElement:function(e){return pa("Node",e,"parentElement")},textContent:function(e){return pa("Node",e,"textContent")},contains:function(e,t){return ma("Node",e,"contains")(t)},getRootNode:function(e){return ma("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?pa("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?pa("Element",e,"shadowRoot"):null},querySelector:function(e,t){return pa("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return pa("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ha("MutationObserver").constructor}};const ya="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(ya),-1),getNode:()=>(console.error(ya),null),removeNodeFromMap(){console.error(ya)},has:()=>(console.error(ya),!1),reset(){console.error(ya)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(va=new Proxy(va,{get:(e,t,r)=>("map"===t&&console.error(ya),Reflect.get(e,t,r))}));let wa=Date.now;function ba(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:ga.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(wa=()=>(new Date).getTime());function Sa(e){var t;let r=null;return"getRootNode"in e&&(null==(t=ga.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ga.host(ga.getRootNode(e))&&(r=ga.host(ga.getRootNode(e))),r}function Ca(e){let t,r=e;for(;t=Sa(r);)r=t;return r}function xa(e){const t=e.ownerDocument;if(!t)return!1;const r=Ca(e);return ga.contains(t,r)}const ka=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Tn(this,"id",1),Tn(this,"styleIDMap",new WeakMap),Tn(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:ba,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:Ca,getShadowHost:Sa,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=ga.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=ga.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 aa&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ga.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&&(ga.contains(t,e)||xa(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&Wn.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Wn.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=ga.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=ba(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(Vn(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 wa},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:xa,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 Oa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ia="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ea=0;Ea<64;Ea++)Ia[Oa.charCodeAt(Ea)]=Ea;"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==(En=e.contentWindow)?void 0:En.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Ma,Ra;new qn,(Ra=Ma||(Ma={}))[Ra.NotStarted=0]="NotStarted",Ra[Ra.Running=1]="Running",Ra[Ra.Stopped=2]="Stopped";class Pa{constructor(e){Pn(this,"fileName"),Pn(this,"functionName"),Pn(this,"lineNumber"),Pn(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 Aa=/(^|@)\S+:\d+/,Ta=/^\s*at .*(\S+:\d+|\(native\))/m,Na=/^(eval@)?(\[native code])?$/,La={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ta)?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(Ta)},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 Pa({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(Na)},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 Pa({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new Pa({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 Pa({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 Pa({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(Aa)&&!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 Pa({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function _a(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 Da(e){return"[object Object]"===Object.prototype.toString.call(e)}function Fa(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Da(e[n])&&Fa(e[n],t-1))return!0;return!1}function ja(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(Da(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Da(e)&&Fa(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]=_a(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 Ua={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 Ba(e,t,r){const n=r?Object.assign({},Ua,r):Ua,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=La.parse(s).map(e=>e.toString()),o=[ja(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=[ja(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[ja("Uncaught (in promise)",n.stringifyOptions),ja(t.reason,n.stringifyOptions)]);const i=La.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]?ka.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=La.parse(new Error).map(e=>e.toString()).splice(1),i=("assert"===r?s.slice(1):s).map(e=>ja(e,n.stringifyOptions));o++,o<n.lengthThreshold?e({level:r,trace:t,payload:i}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[ja("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}const $a="rrweb/console@1";var za,Wa=Object.freeze({__proto__:null,PLUGIN_NAME:$a,getRecordConsolePlugin:e=>({name:$a,observer:Ba,options:e})}),qa=Object.defineProperty,Va=(e,t,r)=>((e,t,r)=>t in e?qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ga=Object.defineProperty,Ha=(e,t,r)=>((e,t,r)=>t in e?Ga(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ja=(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))(Ja||{});const Ka={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ya={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Qa={};function Xa(e){if(Qa[e])return Qa[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 Ka?Ka[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 Ya?Ya[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 Qa[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?Qa[e]=i:r}catch{return r}}const Za={};function el(e,t,r){var n;const s=`${e}.${String(r)}`;if(Za[s])return Za[s].call(t);const i=Xa(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(Za[s]=o,o.call(t)):t[r]}const tl={};function rl(e,t,r){const n=`${e}.${String(r)}`;if(tl[n])return tl[n].bind(t);const s=Xa(e)[r];return"function"!=typeof s?t[r]:(tl[n]=s,s.bind(t))}const nl={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 Xa("MutationObserver").constructor}};function sl(e){return e.nodeType===e.ELEMENT_NODE}function il(e){const t=e&&"host"in e&&"mode"in e&&nl.host(e)||null;return Boolean(t&&"shadowRoot"in t&&nl.shadowRoot(t)===e)}function ol(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function al(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=>ll(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 ll(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=al(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?wl(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?wl(r,t):r}}class cl{constructor(){Ha(this,"idNodeMap",new Map),Ha(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 ul({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:i}){let o=s||"";const a=n&&hl(n);return(t[r.toLowerCase()]||a&&t[a])&&(o=i?i(o,e):"*".repeat(o.length)),o}function hl(e){return e.toLowerCase()}const dl="__rrweb_original__";function pl(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?hl(t):null}function fl(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 ml=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,gl=/^(?:[a-z+]+:)?\/\//i,yl=/^www\..*/i,vl=/^(data:)([^,]*),(.*)/i;function wl(e,t){return(e||"").replace(ml,(e,r,n,s,i,o)=>{const a=n||i||o,l=r||s||"";if(!a)return e;if(gl.test(a)||yl.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 bl(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Sl(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=bl(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=bl(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=bl(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=bl(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 Cl="lightgrey";let xl=1;const kl=new RegExp("[^a-z0-9-_:]");function Ol(){return xl++}let Il,El;const Ml=/^[^ \t\n\r\u000c]+/,Rl=/^[, \t\n\r\u000c]+/;const Pl=new WeakMap;function Al(e,t){return t&&""!==t.trim()?Nl(e,t):t}function Tl(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Nl(e,t){let r=Pl.get(e);if(r||(r=e.createElement("a"),Pl.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Ll(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Al(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(Rl),!(r>=t.length);){let i=n(Ml);if(","===i.slice(-1))i=Al(e,i.substring(0,i.length-1)),s.push(i);else{let n="";i=Al(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?wl(n,Nl(e)):"object"===t&&"data"===r?Al(e,n):n:Al(e,n):n}function _l(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Dl(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Dl(nl.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Dl(nl.parentNode(e),t,r)}function Fl(e,t,r,n){let s;if(sl(e)){if(s=e,!nl.childNodes(s).length)return!1}else{if(null===nl.parentElement(e))return!1;s=nl.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(Dl(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 jl(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:Ja.Document,childNodes:[],compatMode:e.compatMode}:{type:Ja.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ja.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=hl(e.tagName);return kl.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(!_l(y,n.name,n.value)){const t=Ll(r,y,hl(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=al(t)),n&&(delete v.rel,delete v.href,v._cssText=n)}if("style"===y&&e.sheet){let t=al(e.sheet);t&&(e.childNodes.length>1&&(t=Sl(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=ul({element:e,type:pl(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=dl in s?s[dl]: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){Il||(Il=r.createElement("canvas"),El=Il.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{Il.width=t.naturalWidth,Il.height=t.naturalHeight,El.drawImage(t,0,0),v.rr_dataURL=Il.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:Cl}:{}}}"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:Ja.Element,tagName:y,attributes:v,childNodes:[],isSVG:Tl(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=nl.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=nl.textContent(e),c&&l&&(l=wl(l,Nl(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,nl.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Ja.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:c,rootId:w,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:Ja.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:Ja.Comment,textContent:nl.textContent(e)||"",rootId:w};default:return!1}}function Ul(e){return null==e?"":e.toLowerCase()}function Bl(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:ll(t,e.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}return{styleId:n,rules:s}})}function $l(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:x=5e3,onStylesheetLoad:k,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=Fl(e,l,c,void 0===A)}const N=jl(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(!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===Ja.Comment)return!0;if(e.type===Ja.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"===fl(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ul(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ul(e.attributes.name)||"icon"===Ul(e.attributes.rel)||"apple-touch-icon"===Ul(e.attributes.rel)||"shortcut icon"===Ul(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ul(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ul(e.attributes.property).match(/^(og|twitter|fb):/)||Ul(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ul(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Ul(e.attributes.name)||"googlebot"===Ul(e.attributes.name)||"bingbot"===Ul(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Ul(e.attributes.name)||"generator"===Ul(e.attributes.name)||"framework"===Ul(e.attributes.name)||"publisher"===Ul(e.attributes.name)||"progid"===Ul(e.attributes.name)||Ul(e.attributes.property).match(/^article:/)||Ul(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Ul(e.attributes.name)||"yandex-verification"===Ul(e.attributes.name)||"csrf-token"===Ul(e.attributes.name)||"p:domain_verify"===Ul(e.attributes.name)||"verify-v1"===Ul(e.attributes.name)||"verification"===Ul(e.attributes.name)||"shopify-checkout-api-token"===Ul(e.attributes.name)))return!0}}return!1}(N,g)||!T&&N.type===Ja.Text&&!N.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Ol();const _=Object.assign(N,{id:L});if(i.add(e,_),-2===L)return null;b&&b(e);let D=!u;if(_.type===Ja.Element){D=D&&!_.needBlock,delete _.needBlock;const t=nl.shadowRoot(e);t&&ol(t)&&(_.isShadowHost=!0,S&&(null==(r=t.adoptedStyleSheets)?void 0:r.length)&&(_.adoptedStyleSheets=Bl(t.adoptedStyleSheets,S,P)))}if(_.type===Ja.Document&&S){const t=e;(null==(n=t.adoptedStyleSheets)?void 0:n.length)&&(_.adoptedStyleSheets=Bl(t.adoptedStyleSheets,S,P))}if((_.type===Ja.Document||_.type===Ja.Element)&&D){g.headWhitespace&&_.type===Ja.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:y,inlineImages:v,recordCanvas:w,preserveWhiteSpace:T,onSerialize:b,onAdoptedStyleSheet:S,_emittedStyleIds:P,onIframeLoad:C,iframeLoadTimeout:x,onStylesheetLoad:k,stylesheetLoadTimeout:O,keepIframeSrcFn:I,cssCaptured:!1,applyBackgroundColorToBlockedElements:R};if(_.type===Ja.Element&&"textarea"===_.tagName&&void 0!==_.attributes.value);else{_.type===Ja.Element&&void 0!==_.attributes._cssText&&"string"==typeof _.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(nl.childNodes(e))){const e=$l(r,t);e&&_.childNodes.push(e)}}let r=null;if(sl(e)&&(r=nl.shadowRoot(e)))for(const e of Array.from(nl.childNodes(r))){const n=$l(e,t);n&&(ol(r)&&(n.isShadow=!0),_.childNodes.push(n))}}const F=nl.parentNode(e);return F&&il(F)&&ol(F)&&(_.isShadow=!0),_.type===Ja.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=$l(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,onIframeLoad:C,iframeLoadTimeout:x,onStylesheetLoad:k,stylesheetLoadTimeout:O,keepIframeSrcFn:I});r&&C(e,r)}},x),_.type===Ja.Element&&"link"===_.tagName&&"string"==typeof _.attributes.rel&&("stylesheet"===_.attributes.rel||"preload"===_.attributes.rel&&"string"==typeof _.attributes.href&&"css"===fl(_.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(k){const t=$l(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:x,onStylesheetLoad:k,stylesheetLoadTimeout:O,keepIframeSrcFn:I});t&&k(e,t)}},O),_}function zl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Wl(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 ql,Vl={exports:{}};function Gl(){if(ql)return Vl.exports;ql=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Vl.exports=t(),Vl.exports.createColors=t,Vl.exports}const Hl=Wl(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Jl,Kl;function Yl(){if(Kl)return Jl;Kl=1;let e=Gl(),t=Hl;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),t&&r&&(n=t(n));let s,i,o=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,o.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),i=e=>r(e)}else s=i=e=>e;return o.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=i(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+i(n)+e+"\n "+t+s("^")}return" "+i(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Jl=r,r.default=r,Jl}var Ql,Xl,Zl,ec,tc,rc,nc,sc,ic,oc,ac,lc,cc,uc,hc,dc,pc,fc,mc,gc,yc,vc,wc,bc,Sc,Cc,xc,kc,Oc,Ic,Ec,Mc,Rc,Pc,Ac,Tc,Nc,Lc,_c,Dc,Fc,jc,Uc,Bc,$c,zc,Wc,qc,Vc,Gc,Hc,Jc,Kc,Yc={};function Qc(){return Ql||(Ql=1,Yc.isClean=Symbol("isClean"),Yc.my=Symbol("my")),Yc}function Xc(){if(Zl)return Xl;Zl=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 Xl=t,t.default=t,Xl}function Zc(){if(tc)return ec;tc=1;let e=Xc();function t(t,r){new e(r).stringify(t)}return ec=t,t.default=t,ec}function eu(){if(nc)return rc;nc=1;let{isClean:e,my:t}=Qc(),r=Yl(),n=Xc(),s=Zc();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}class o{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=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(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return rc=o,o.default=o,rc}function tu(){if(ic)return sc;ic=1;let e=eu();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return sc=t,t.default=t,sc}function ru(){if(ac)return oc;ac=1;return oc={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},oc}function nu(){if(cc)return lc;cc=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Hl,{existsSync:r,readFileSync:n}=Hl,{dirname:s,join:i}=Hl;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=i(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return lc=o,o.default=o,lc}function su(){if(hc)return uc;hc=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Hl,{fileURLToPath:r,pathToFileURL:n}=Hl,{isAbsolute:s,resolve:i}=Hl,{nanoid:o}=ru(),a=Hl,l=Yl(),c=nu(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(i&&s);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=i(t.from)),d&&h){let e=new c(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let i,o,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,a=e.col}else o=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,o,a);return i=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:a,line:o},this.css,this.file,s.plugin),i.input={column:r,endColumn:a,endLine:o,line:t,source:this.css},this.file&&(n&&(i.input.url=n(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[u])r=this[u];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[u]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:i(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,i,o){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof i&&(a=c.originalPositionFor({column:o,line:i})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(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(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(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}get from(){return this.file||this.id}}return uc=p,p.default=p,a&&a.registerInput&&a.registerInput(p),uc}function iu(){if(pc)return dc;pc=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Hl,{dirname:r,relative:n,resolve:s,sep:i}=Hl,{pathToFileURL:o}=Hl,a=su(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&i);return dc=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,s=this.toUrl(this.path(t.file)),i=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,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&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(o.generated.line=n,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=s-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let i=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=r(s(i,this.mapOpts.annotation)));let o=n(i,e);return this.memoizedPaths.set(e,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;"\\"===i&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},dc}function ou(){if(mc)return fc;mc=1;let e=eu();class t extends e{constructor(e){super(e),this.type="comment"}}return fc=t,t.default=t,fc}function au(){if(yc)return gc;yc=1;let e,t,r,n,{isClean:s,my:i}=Qc(),o=tu(),a=ou(),l=eu();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new o(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[i]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},gc=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,o.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[i]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},gc}function lu(){if(wc)return vc;wc=1;let e,t,r=au();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},vc=n,n.default=n,vc}function cu(){if(Sc)return bc;Sc=1;let e={};return bc=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function uu(){if(xc)return Cc;xc=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 Cc=e,e.default=e,Cc}function hu(){if(Oc)return kc;Oc=1;let e=uu();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return kc=t,t.default=t,kc}function du(){if(Rc)return Mc;Rc=1;let e=au();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 Mc=t,t.default=t,e.registerAtRule(t),Mc}function pu(){if(Ac)return Pc;Ac=1;let e,t,r=au();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},Pc=n,n.default=n,r.registerRoot(n),Pc}function fu(){if(Nc)return Tc;Nc=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 Tc=e,e.default=e,Tc}function mu(){if(_c)return Lc;_c=1;let e=au(),t=fu();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return Lc=r,r.default=r,e.registerRule(r),Lc}function gu(){if(Fc)return Dc;Fc=1;let e=tu(),t=function(){if(Ec)return Ic;Ec=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 Ic=function(x,k={}){let O,I,E,M,R,P,A,T,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,j=0,U=[],B=[];function $(e){throw x.error("Unclosed "+e,j)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&j>=F},nextToken:function(x){if(B.length)return B.pop();if(j>=F)return;let k=!!x&&x.ignoreUnclosed;switch(O=_.charCodeAt(j),O){case s:case i:case a:case l:case o:I=j;do{I+=1,O=_.charCodeAt(I)}while(O===i||O===s||O===a||O===l||O===o);L=["space",_.slice(j,I)],j=I-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);L=[e,e,j];break}case h:if(T=U.length?U.pop()[1]:"",N=_.charCodeAt(j+1),"url"===T&&N!==e&&N!==t&&N!==i&&N!==s&&N!==a&&N!==o&&N!==l){I=j;do{if(P=!1,I=_.indexOf(")",I+1),-1===I){if(D||k){I=j;break}$("bracket")}for(A=I;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["brackets",_.slice(j,I+1),j,I],j=I}else I=_.indexOf(")",j+1),M=_.slice(j,I+1),-1===I||S.test(M)?L=["(","(",j]:(L=["brackets",M,j,I],j=I);break;case e:case t:E=O===e?"'":'"',I=j;do{if(P=!1,I=_.indexOf(E,I+1),-1===I){if(D||k){I=j+1;break}$("string")}for(A=I;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["string",_.slice(j,I+1),j,I],j=I;break;case v:w.lastIndex=j+1,w.test(_),I=0===w.lastIndex?_.length-1:w.lastIndex-2,L=["at-word",_.slice(j,I+1),j,I],j=I;break;case r:for(I=j,R=!0;_.charCodeAt(I+1)===r;)I+=1,R=!R;if(O=_.charCodeAt(I+1),R&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(I+=1,C.test(_.charAt(I)))){for(;C.test(_.charAt(I+1));)I+=1;_.charCodeAt(I+1)===i&&(I+=1)}L=["word",_.slice(j,I+1),j,I],j=I;break;default:O===n&&_.charCodeAt(j+1)===g?(I=_.indexOf("*/",j+2)+1,0===I&&(D||k?I=_.length:$("comment")),L=["comment",_.slice(j,I+1),j,I],j=I):(b.lastIndex=j+1,b.test(_),I=0===b.lastIndex?_.length-1:b.lastIndex-2,L=["word",_.slice(j,I+1),j,I],U.push(L),j=I)}return j++,L},position:function(){return j}}}}(),r=ou(),n=du(),s=pu(),i=mu();const o={empty:!0,space:!0};return Dc=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,s,i=new n;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);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&&(e=l[l.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),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(t=o,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return i}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,i=t[t.length-1];for(";"===i[0]&&(this.semicolon=!0,t.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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.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(;t.length&&(o=t[0][0],"space"===o||"comment"===o);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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 i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Dc}function yu(){if(Uc)return jc;Uc=1;let e=au(),t=gu(),r=su();function n(e,n){let s=new r(e,n),i=new t(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 jc=n,n.default=n,e.registerParse(n),jc}function vu(){if($c)return Bc;$c=1;let{isClean:e,my:t}=Qc(),r=iu(),n=Zc(),s=au(),i=lu(),o=cu(),a=hu(),l=yu(),c=pu();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(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let y={};class v{constructor(e,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof a)i=g(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[t]&&s.rebuild(i)}else i=g(r);this.result=new a(e,i,n),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 t=this.result.root;for(;!t[e];){t[e]=!0;let r=[m(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,i=r.iterator;for(;s=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!s[e])return s[e]=!0,void t.push(m(s));r.iterator=0,delete n.indexes[i]}let i=r.events;for(;r.eventIndex<i.length;){let t=i[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return v.registerPostcss=e=>{y=e},Bc=v,v.default=v,c.registerLazyResult(v),i.registerLazyResult(v),Bc}function wu(){if(Vc)return qc;Vc=1;let e=function(){if(Wc)return zc;Wc=1;let e=iu(),t=Zc(),r=cu(),n=yu();const s=hu();class i{constructor(r,n,i){let o;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=i,this._map=void 0;let a=t;this.result=new s(this._processor,o,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,n);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||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return zc=i,i.default=i,zc}(),t=vu(),r=lu(),n=pu();class s{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return qc=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),qc}var bu=function(){if(Kc)return Jc;Kc=1;let e=Yl(),t=tu(),r=vu(),n=au(),s=wu(),i=Zc(),o=function(){if(Hc)return Gc;Hc=1;let e=tu(),t=nu(),r=ou(),n=du(),s=su(),i=pu(),o=mu();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 r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}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 e(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return Gc=a,a.default=a,Gc}(),a=lu(),l=uu(),c=ou(),u=du(),h=hu(),d=su(),p=yu(),f=fu(),m=mu(),g=pu(),y=eu();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return v.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new s).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return v([i(r)]).process(e,t)},i},v.stringify=i,v.parse=p,v.fromJSON=o,v.list=f,v.comment=e=>new c(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new m(e),v.root=e=>new g(e),v.document=e=>new a(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=n,v.Processor=s,v.Document=a,v.Comment=c,v.Warning=l,v.AtRule=u,v.Result=h,v.Input=d,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),Jc=v,v.default=v,Jc}();const Su=zl(bu);Su.stringify,Su.fromJSON,Su.plugin,Su.parse,Su.list,Su.document,Su.comment,Su.atRule,Su.rule,Su.decl,Su.root,Su.CssSyntaxError,Su.Declaration,Su.Container,Su.Processor,Su.Document,Su.Comment,Su.Warning,Su.AtRule,Su.Result,Su.Input,Su.Rule,Su.Root,Su.Node;var Cu=Object.defineProperty,xu=(e,t,r)=>((e,t,r)=>t in e?Cu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function ku(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ou(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 Iu,Eu={exports:{}};function Mu(){if(Iu)return Eu.exports;Iu=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Eu.exports=t(),Eu.exports.createColors=t,Eu.exports}const Ru=Ou(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Pu,Au;function Tu(){if(Au)return Pu;Au=1;let e=Mu(),t=Ru;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),t&&r&&(n=t(n));let s,i,o=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,o.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),i=e=>r(e)}else s=i=e=>e;return o.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=i(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+i(n)+e+"\n "+t+s("^")}return" "+i(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Pu=r,r.default=r,Pu}var Nu,Lu,_u,Du,Fu,ju,Uu,Bu,$u,zu,Wu,qu,Vu,Gu,Hu,Ju,Ku,Yu,Qu,Xu,Zu,eh,th,rh,nh,sh,ih,oh,ah,lh,ch,uh,hh,dh,ph,fh,mh,gh,yh,vh,wh,bh,Sh,Ch,xh,kh,Oh,Ih,Eh,Mh,Rh,Ph,Ah,Th={};function Nh(){return Nu||(Nu=1,Th.isClean=Symbol("isClean"),Th.my=Symbol("my")),Th}function Lh(){if(_u)return Lu;_u=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 Lu=t,t.default=t,Lu}function _h(){if(Fu)return Du;Fu=1;let e=Lh();function t(t,r){new e(r).stringify(t)}return Du=t,t.default=t,Du}function Dh(){if(Uu)return ju;Uu=1;let{isClean:e,my:t}=Nh(),r=Tu(),n=Lh(),s=_h();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}class o{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=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(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return ju=o,o.default=o,ju}function Fh(){if($u)return Bu;$u=1;let e=Dh();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return Bu=t,t.default=t,Bu}function jh(){if(Wu)return zu;Wu=1;return zu={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},zu}function Uh(){if(Vu)return qu;Vu=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Ru,{existsSync:r,readFileSync:n}=Ru,{dirname:s,join:i}=Ru;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=i(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return qu=o,o.default=o,qu}function Bh(){if(Hu)return Gu;Hu=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Ru,{fileURLToPath:r,pathToFileURL:n}=Ru,{isAbsolute:s,resolve:i}=Ru,{nanoid:o}=jh(),a=Ru,l=Tu(),c=Uh(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(i&&s);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=i(t.from)),d&&h){let e=new c(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let i,o,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,a=e.col}else o=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,o,a);return i=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:a,line:o},this.css,this.file,s.plugin),i.input={column:r,endColumn:a,endLine:o,line:t,source:this.css},this.file&&(n&&(i.input.url=n(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[u])r=this[u];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[u]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:i(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,i,o){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof i&&(a=c.originalPositionFor({column:o,line:i})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(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(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(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}get from(){return this.file||this.id}}return Gu=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Gu}function $h(){if(Ku)return Ju;Ku=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Ru,{dirname:r,relative:n,resolve:s,sep:i}=Ru,{pathToFileURL:o}=Ru,a=Bh(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&i);return Ju=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,s=this.toUrl(this.path(t.file)),i=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,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&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(o.generated.line=n,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=s-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let i=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=r(s(i,this.mapOpts.annotation)));let o=n(i,e);return this.memoizedPaths.set(e,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;"\\"===i&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Ju}function zh(){if(Qu)return Yu;Qu=1;let e=Dh();class t extends e{constructor(e){super(e),this.type="comment"}}return Yu=t,t.default=t,Yu}function Wh(){if(Zu)return Xu;Zu=1;let e,t,r,n,{isClean:s,my:i}=Nh(),o=Fh(),a=zh(),l=Dh();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new o(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[i]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},Xu=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,o.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[i]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},Xu}function qh(){if(th)return eh;th=1;let e,t,r=Wh();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},eh=n,n.default=n,eh}function Vh(){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 Gh(){if(ih)return sh;ih=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 sh=e,e.default=e,sh}function Hh(){if(ah)return oh;ah=1;let e=Gh();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return oh=t,t.default=t,oh}function Jh(){if(hh)return uh;hh=1;let e=Wh();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 uh=t,t.default=t,e.registerAtRule(t),uh}function Kh(){if(ph)return dh;ph=1;let e,t,r=Wh();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},dh=n,n.default=n,r.registerRoot(n),dh}function Yh(){if(mh)return fh;mh=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 fh=e,e.default=e,fh}function Qh(){if(yh)return gh;yh=1;let e=Wh(),t=Yh();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return gh=r,r.default=r,e.registerRule(r),gh}function Xh(){if(wh)return vh;wh=1;let e=Fh(),t=function(){if(ch)return lh;ch=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 lh=function(x,k={}){let O,I,E,M,R,P,A,T,N,L,_=x.css.valueOf(),D=k.ignoreErrors,F=_.length,j=0,U=[],B=[];function $(e){throw x.error("Unclosed "+e,j)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&j>=F},nextToken:function(x){if(B.length)return B.pop();if(j>=F)return;let k=!!x&&x.ignoreUnclosed;switch(O=_.charCodeAt(j),O){case s:case i:case a:case l:case o:I=j;do{I+=1,O=_.charCodeAt(I)}while(O===i||O===s||O===a||O===l||O===o);L=["space",_.slice(j,I)],j=I-1;break;case c:case u:case p:case f:case y:case m:case d:{let e=String.fromCharCode(O);L=[e,e,j];break}case h:if(T=U.length?U.pop()[1]:"",N=_.charCodeAt(j+1),"url"===T&&N!==e&&N!==t&&N!==i&&N!==s&&N!==a&&N!==o&&N!==l){I=j;do{if(P=!1,I=_.indexOf(")",I+1),-1===I){if(D||k){I=j;break}$("bracket")}for(A=I;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["brackets",_.slice(j,I+1),j,I],j=I}else I=_.indexOf(")",j+1),M=_.slice(j,I+1),-1===I||S.test(M)?L=["(","(",j]:(L=["brackets",M,j,I],j=I);break;case e:case t:E=O===e?"'":'"',I=j;do{if(P=!1,I=_.indexOf(E,I+1),-1===I){if(D||k){I=j+1;break}$("string")}for(A=I;_.charCodeAt(A-1)===r;)A-=1,P=!P}while(P);L=["string",_.slice(j,I+1),j,I],j=I;break;case v:w.lastIndex=j+1,w.test(_),I=0===w.lastIndex?_.length-1:w.lastIndex-2,L=["at-word",_.slice(j,I+1),j,I],j=I;break;case r:for(I=j,R=!0;_.charCodeAt(I+1)===r;)I+=1,R=!R;if(O=_.charCodeAt(I+1),R&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(I+=1,C.test(_.charAt(I)))){for(;C.test(_.charAt(I+1));)I+=1;_.charCodeAt(I+1)===i&&(I+=1)}L=["word",_.slice(j,I+1),j,I],j=I;break;default:O===n&&_.charCodeAt(j+1)===g?(I=_.indexOf("*/",j+2)+1,0===I&&(D||k?I=_.length:$("comment")),L=["comment",_.slice(j,I+1),j,I],j=I):(b.lastIndex=j+1,b.test(_),I=0===b.lastIndex?_.length-1:b.lastIndex-2,L=["word",_.slice(j,I+1),j,I],U.push(L),j=I)}return j++,L},position:function(){return j}}}}(),r=zh(),n=Jh(),s=Kh(),i=Qh();const o={empty:!0,space:!0};return vh=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,s,i=new n;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);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&&(e=l[l.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),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(t=o,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return i}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,i=t[t.length-1];for(";"===i[0]&&(this.semicolon=!0,t.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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.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(;t.length&&(o=t[0][0],"space"===o||"comment"===o);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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 i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},vh}function Zh(){if(Sh)return bh;Sh=1;let e=Wh(),t=Xh(),r=Bh();function n(e,n){let s=new r(e,n),i=new t(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 bh=n,n.default=n,e.registerParse(n),bh}function ed(){if(xh)return Ch;xh=1;let{isClean:e,my:t}=Nh(),r=$h(),n=_h(),s=Wh(),i=qh(),o=Vh(),a=Hh(),l=Zh(),c=Kh();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(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let y={};class v{constructor(e,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof v||r instanceof a)i=g(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[t]&&s.rebuild(i)}else i=g(r);this.result=new a(e,i,n),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 t=this.result.root;for(;!t[e];){t[e]=!0;let r=[m(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,i=r.iterator;for(;s=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!s[e])return s[e]=!0,void t.push(m(s));r.iterator=0,delete n.indexes[i]}let i=r.events;for(;r.eventIndex<i.length;){let t=i[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return v.registerPostcss=e=>{y=e},Ch=v,v.default=v,c.registerLazyResult(v),i.registerLazyResult(v),Ch}function td(){if(Eh)return Ih;Eh=1;let e=function(){if(Oh)return kh;Oh=1;let e=$h(),t=_h(),r=Vh(),n=Zh();const s=Hh();class i{constructor(r,n,i){let o;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=i,this._map=void 0;let a=t;this.result=new s(this._processor,o,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,n);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||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return kh=i,i.default=i,kh}(),t=ed(),r=qh(),n=Kh();class s{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Ih=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Ih}var rd=function(){if(Ah)return Ph;Ah=1;let e=Tu(),t=Fh(),r=ed(),n=Wh(),s=td(),i=_h(),o=function(){if(Rh)return Mh;Rh=1;let e=Fh(),t=Uh(),r=zh(),n=Jh(),s=Bh(),i=Kh(),o=Qh();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 r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}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 e(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return Mh=a,a.default=a,Mh}(),a=qh(),l=Gh(),c=zh(),u=Jh(),h=Hh(),d=Bh(),p=Zh(),f=Yh(),m=Qh(),g=Kh(),y=Dh();function v(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return v.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new s).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return v([i(r)]).process(e,t)},i},v.stringify=i,v.parse=p,v.fromJSON=o,v.list=f,v.comment=e=>new c(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new m(e),v.root=e=>new g(e),v.document=e=>new a(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=n,v.Processor=s,v.Document=a,v.Comment=c,v.Warning=l,v.AtRule=u,v.Result=h,v.Input=d,v.Rule=m,v.Root=g,v.Node=y,r.registerPostcss(v),Ph=v,v.default=v,Ph}();const nd=ku(rd);nd.stringify,nd.fromJSON,nd.plugin,nd.parse,nd.list,nd.document,nd.comment,nd.atRule,nd.rule,nd.decl,nd.root,nd.CssSyntaxError,nd.Declaration,nd.Container,nd.Processor,nd.Document,nd.Comment,nd.Warning,nd.AtRule,nd.Result,nd.Input,nd.Rule,nd.Root,nd.Node;class sd{constructor(...e){xu(this,"parentElement",null),xu(this,"parentNode",null),xu(this,"ownerDocument"),xu(this,"firstChild",null),xu(this,"lastChild",null),xu(this,"previousSibling",null),xu(this,"nextSibling",null),xu(this,"ELEMENT_NODE",1),xu(this,"TEXT_NODE",3),xu(this,"nodeType"),xu(this,"nodeName"),xu(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 sd))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 id={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},od={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ad={};function ld(e){if(ad[e])return ad[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 id?id[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 od?od[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 ad[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?ad[e]=i:r}catch{return r}}const cd={};function ud(e,t,r){var n;const s=`${e}.${String(r)}`;if(cd[s])return cd[s].call(t);const i=ld(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(cd[s]=o,o.call(t)):t[r]}const hd={};function dd(e,t,r){const n=`${e}.${String(r)}`;if(hd[n])return hd[n].bind(t);const s=ld(e)[r];return"function"!=typeof s?t[r]:(hd[n]=s,s.bind(t))}function pd(){return ld("MutationObserver").constructor}const fd={childNodes:function(e){return ud("Node",e,"childNodes")},parentNode:function(e){return ud("Node",e,"parentNode")},parentElement:function(e){return ud("Node",e,"parentElement")},textContent:function(e){return ud("Node",e,"textContent")},contains:function(e,t){return dd("Node",e,"contains")(t)},getRootNode:function(e){return dd("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ud("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ud("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ud("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ud("Element",e,"querySelectorAll")(t)},mutationObserver:pd};function md(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const gd="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 yd={map:{},getId:()=>(console.error(gd),-1),getNode:()=>(console.error(gd),null),removeNodeFromMap(){console.error(gd)},has:()=>(console.error(gd),!1),reset(){console.error(gd)}};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 wd(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)}}),()=>wd(e,t,i||{},!0)}function bd(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&&(yd=new Proxy(yd,{get:(e,t,r)=>("map"===t&&console.error(gd),Reflect.get(e,t,r))}));let Sd=Date.now;function Cd(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=fd.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=fd.parentElement(i.body))?void 0:n.scrollTop)||(null==(s=null==i?void 0:i.body)?void 0:s.scrollTop)||0}}function xd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function kd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Od(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:fd.parentElement(e)}function Id(e,t,r,n){if(!e)return!1;const s=Od(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(Dl(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 Ed(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function Md(e,t){if(il(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=fd.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Md(n,t))}function Rd(e){return Boolean(e.changedTouches)}function Pd(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ad(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Td(e){return!!e&&(e instanceof sd&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(fd.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Sd=()=>(new Date).getTime());class Nd{constructor(){Va(this,"id",1),Va(this,"styleIDMap",new WeakMap),Va(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 Ld(e){var t;let r=null;return"getRootNode"in e&&(null==(t=fd.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&fd.host(fd.getRootNode(e))&&(r=fd.host(fd.getRootNode(e))),r}function _d(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=Ld(r);)r=t;return r}(e);return fd.contains(t,r)}function Dd(e){const t=e.ownerDocument;return!!t&&(fd.contains(t,e)||_d(e))}var Fd=(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))(Fd||{}),jd=(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))(jd||{}),Ud=(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))(Ud||{}),Bd=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Bd||{}),$d=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))($d||{}),zd=(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))(zd||{}),Wd=(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))(Wd||{});function qd(e){return"__ln"in e}class Vd{constructor(){Va(this,"length",0),Va(this,"head",null),Va(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&&qd(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&&qd(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 Gd=(e,t)=>`${e}@${t}`;class Hd{constructor(){Va(this,"frozen",!1),Va(this,"locked",!1),Va(this,"texts",[]),Va(this,"attributes",[]),Va(this,"attributeMap",new WeakMap),Va(this,"removes",[]),Va(this,"mapRemoves",[]),Va(this,"movedMap",{}),Va(this,"addedSet",new Set),Va(this,"movedSet",new Set),Va(this,"droppedSet",new Set),Va(this,"removesSubTreeCache",new Set),Va(this,"mutationCb"),Va(this,"blockClass"),Va(this,"blockSelector"),Va(this,"maskTextClass"),Va(this,"maskTextSelector"),Va(this,"inlineStylesheet"),Va(this,"maskInputOptions"),Va(this,"maskTextFn"),Va(this,"maskInputFn"),Va(this,"maskAttributeFn"),Va(this,"keepIframeSrcFn"),Va(this,"recordCanvas"),Va(this,"inlineImages"),Va(this,"slimDOMOptions"),Va(this,"dataURLOptions"),Va(this,"doc"),Va(this,"mirror"),Va(this,"iframeManager"),Va(this,"stylesheetManager"),Va(this,"shadowDomManager"),Va(this,"canvasManager"),Va(this,"processedNodeManager"),Va(this,"unattachedDoc"),Va(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Va(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Vd,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=fd.parentNode(s);if(!i||!Dd(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=il(i)?this.mirror.getId(Ld(s)):this.mirror.getId(i),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=$l(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=>{Pd(e,this.mirror)&&this.iframeManager.addIframe(e),Ad(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Td(s)&&this.shadowDomManager.addShadowRoot(fd.shadowRoot(s),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},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)Kd(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(fd.parentNode(e))||s(e);for(const e of this.addedSet)Yd(this.droppedSet,e)||Kd(this.removesSubTreeCache,e,this.mirror)?Yd(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(fd.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(fd.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=fd.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=fd.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=fd.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))}),Va(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(fd.childNodes(e),e=>fd.textContent(e)||"").join("");t.attributes.value=ul({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:pl(e),value:r,maskInputFn:this.maskInputFn})}),Va(this,"processMutation",e=>{if(!Ed(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=fd.textContent(e.target);Id(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Fl(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Od(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=pl(t);n=ul({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(Id(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"),!_l(t.tagName,r)){if(s.attributes[r]=Ll(this.doc,hl(t.tagName),hl(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(Id(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=il(e.target)?this.mirror.getId(fd.host(e.target)):this.mirror.getId(e.target);Id(e.target,this.blockClass,this.blockSelector,!1)||Ed(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Jd(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Md(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Gd(r,n)]?Jd(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!il(e.target)||!ol(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),fd.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Va(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Ed(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[Gd(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Id(e,this.blockClass,this.blockSelector,!1)||(fd.childNodes(e).forEach(e=>this.genAdds(e)),Td(e)&&fd.childNodes(fd.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"].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 Jd(e,t){e.delete(t),fd.childNodes(t).forEach(t=>Jd(e,t))}function Kd(e,t,r){return 0!==e.size&&function(e,t){const r=fd.parentNode(t);return!!r&&e.has(r)}(e,t)}function Yd(e,t){return 0!==e.size&&Qd(e,t)}function Qd(e,t){const r=fd.parentNode(t);return!!r&&(!!e.has(r)||Qd(e,r))}let Xd;const Zd=e=>{if(!Xd)return e;return(...t)=>{try{return e(...t)}catch(e){if(Xd&&!0===Xd(e))return;throw e}}};function ep(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const tp=[];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 np(e,t){const r=new Hd;tp.push(r),r.init(e);const n=new(pd())(Zd(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function sp({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(Ud).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]).forEach(i=>{let o=hl(i);const c=(t=>i=>{const o=rp(i);if(Id(o,n,s,!0))return;let a=null,c=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=Bd.Mouse;break;case"touch":a=Bd.Touch;break;case"pen":a=Bd.Pen}a===Bd.Touch?Ud[t]===Ud.MouseDown?c="TouchStart":Ud[t]===Ud.MouseUp&&(c="TouchEnd"):Bd.Pen}else Rd(i)&&(a=Bd.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Bd.Touch||c.startsWith("Mouse")&&a===Bd.Mouse)&&(a=null)):Ud[t]===Ud.Click&&(a=l,l=null);const u=Rd(i)?i.changedTouches[0]:i;if(!u)return;const h=r.getId(o),{clientX:d,clientY:p}=u;Zd(e)({type:Ud[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(i);if(window.PointerEvent)switch(Ud[i]){case Ud.MouseDown:case Ud.MouseUp:o=o.replace("mouse","pointer");break;case Ud.TouchStart:case Ud.TouchEnd:return}a.push(md(o,c,t))}),Zd(()=>{a.forEach(e=>e())})}function ip({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){const o=Zd(vd(Zd(i=>{const o=rp(i);if(!o||Id(o,n,s,!0))return;const a=r.getId(o);if(o===t&&t.defaultView){const r=Cd(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 md("scroll",o,t)}const op=["INPUT","TEXTAREA","SELECT"],ap=new WeakMap;function lp(e){return function(e,t){if(dp("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||dp("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||dp("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||dp("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 cp(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function up({mirror:e,stylesheetManager:t},r){var n,s,i;let o=null;o="#document"===r.nodeName?e.getId(r):e.getId(fd.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}}),Zd(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function hp(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)},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=np(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(Zd(t=>{const r=Date.now()-o;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],o=null}),i),c=Zd(vd(Zd(e=>{const t=rp(e),{clientX:r,clientY:s}=Rd(e)?e.changedTouches[0]:e;o||(o=Sd()),a.push({x:r,y:s,id:n.getId(t),timeOffset:Sd()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?jd.Drag:e instanceof MouseEvent?jd.MouseMove:jd.TouchMove)}),s,{trailing:!1})),u=[md("mousemove",c,r),md("touchmove",c,r),md("drag",c,r)];return Zd(()=>{u.forEach(e=>e())})}(e),i=sp(e),o=ip(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return md("resize",Zd(vd(Zd(()=>{const t=xd(),s=kd();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=fd.parentElement(r)),!r||!h||op.indexOf(h)<0||Id(r,n,s,!0))return;if(r.classList.contains(i)||o&&r.matches(o))return;let p=r.value,f=!1;const m=pl(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[h.toLowerCase()]||a[m])&&(p=ul({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=ap.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){ap.set(t,n);const s=r.getId(t);Zd(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>md(e,Zd(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=>wd(e[0],e[1],{set(){Zd(h)({target:this,isTrusted:!1})}},!1,f))),Zd(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:i}){const o=Zd(i=>vd(Zd(s=>{const o=rp(s);if(!o||Id(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=[md("play",o(zd.Play),i),md("pause",o(zd.Pause),i),md("seeked",o(zd.Seeked),i),md("volumechange",o(zd.VolumeChange),i),md("ratechange",o(zd.RateChange),i)];return Zd(()=>{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:Zd((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=cp(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:Zd((n,s,i)=>{const[o]=i,{id:a,styleId:l}=cp(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:Zd((n,s,i)=>{const[o]=i,{id:a,styleId:l}=cp(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:Zd((n,s,i)=>{const[o]=i,{id:a,styleId:l}=cp(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:o}),n.apply(s,i)})}));const l={};pp("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(pp("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),pp("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),pp("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:Zd((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=cp(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:[...lp(s),a||0]}]}),n.apply(s,i)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:Zd((n,s,i)=>{const[o]=i,{id:a,styleId:l}=cp(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...lp(s),o]}]}),n.apply(s,i)})})}),Zd(()=>{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=up(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:Zd((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}=cp(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:lp(o.parentRule)}),s.apply(o,a)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:Zd((s,i,a)=>{var l;const[c]=a;if(r.has(c))return o.apply(i,[c]);const{id:u,styleId:h}=cp(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:lp(i.parentRule)}),s.apply(i,a)})}),Zd(()=>{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=bd(t.fonts,"add",function(t){return function(r){return setTimeout(Zd(()=>{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),Zd(()=>{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=Zd(()=>{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;Id(o,n,s,!0)||Id(c,n,s,!0)||a.push({start:r.getId(o),startOffset:l,end:r.getId(c),endOffset:u})}i({ranges:a})});return a(),md("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?bd(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 Zd(()=>{tp.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 dp(e){return void 0!==window[e]}function pp(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class fp{constructor(e){Va(this,"iframeIdToRemoteIdMap",new WeakMap),Va(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 mp{constructor(e){Va(this,"iframes",new WeakMap),Va(this,"crossOriginIframeMap",new WeakMap),Va(this,"crossOriginIframeMirror",new fp(Ol)),Va(this,"crossOriginIframeStyleMirror"),Va(this,"crossOriginIframeRootIdMap",new WeakMap),Va(this,"mirror"),Va(this,"mutationCb"),Va(this,"wrappedEmit"),Va(this,"loadListener"),Va(this,"stylesheetManager"),Va(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new fp(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 Fd.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:Fd.IncrementalSnapshot,data:{source:jd.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Fd.Meta:case Fd.Load:case Fd.DomContentLoaded:return!1;case Fd.Plugin:return t;case Fd.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Fd.IncrementalSnapshot:switch(t.data.source){case jd.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 jd.Drag:case jd.TouchMove:case jd.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case jd.ViewportResize:return!1;case jd.MediaInteraction:case jd.MouseInteraction:case jd.Scroll:case jd.CanvasMutation:case jd.Input:return this.replaceIds(t.data,e,["id"]),t;case jd.StyleSheetRule:case jd.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case jd.Font:return t;case jd.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case jd.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===Wd.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class gp{constructor(e){Va(this,"shadowDoms",new WeakSet),Va(this,"mutationCb"),Va(this,"scrollCb"),Va(this,"bypassOptions"),Va(this,"mirror"),Va(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(!ol(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=np({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(ip({...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(fd.host(e))),this.restoreHandlers.push(up({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(bd(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),i=fd.shadowRoot(this);return i&&Dd(this)&&r.addShadowRoot(i,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var yp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vp="undefined"==typeof Uint8Array?[]:new Uint8Array(256),wp=0;wp<64;wp++)vp[yp.charCodeAt(wp)]=wp;const bp=new Map;const Sp=(e,t,r)=>{if(!e||!kp(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=bp.get(e);return r||(r=new Map,bp.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let s=n.indexOf(e);return-1===s&&(s=n.length,n.push(e)),s};function Cp(e,t,r){if(e instanceof Array)return e.map(e=>Cp(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+=yp[r[t]>>2],s+=yp[(3&r[t])<<4|r[t+1]>>4],s+=yp[(15&r[t+1])<<2|r[t+2]>>6],s+=yp[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:[Cp(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:[Cp(e.data,t,r),e.width,e.height]}}if(kp(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Sp(e,t,r)}}return e}const xp=(e,t,r)=>e.map(e=>Cp(e,t,r)),kp=(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 Op(e,t,r,n){const s=[];try{const i=bd(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...i){if(!Id(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 Ip(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=bd(e,l,function(e){return function(...o){const a=e.apply(this,o);if(Sp(a,i,this),"tagName"in this.canvas&&!Id(this.canvas,n,s,!0)){const e=xp(o,i,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});o.push(a)}catch{const n=wd(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});o.push(n)}return o}const Ep='(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',Mp="undefined"!=typeof self&&self.Blob&&new Blob([Ep],{type:"text/javascript;charset=utf-8"});function Rp(e){let t;try{if(t=Mp&&(self.URL||self.webkitURL).createObjectURL(Mp),!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(Ep),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Pp{constructor(e){Va(this,"pendingCanvasMutations",new Map),Va(this,"rafStamps",{latestId:0,invokeId:null}),Va(this,"mirror"),Va(this,"mutationCb"),Va(this,"resetObservers"),Va(this,"frozen",!1),Va(this,"locked",!1),Va(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=Op(t,r,n,!0),o=new Map,a=new Rp;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:$d["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=>{Id(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=Op(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=bd(t.CanvasRenderingContext2D.prototype,o,function(s){return function(...i){return Id(this.canvas,r,n,!0)||setTimeout(()=>{const r=xp(i,t,this);e(this.canvas,{type:$d["2D"],property:o,args:r})},0),s.apply(this,i)}});s.push(i)}catch{const r=wd(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:$d["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(...Ip(t.WebGLRenderingContext.prototype,$d.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...Ip(t.WebGL2RenderingContext.prototype,$d.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 Ap{constructor(e){Va(this,"trackedLinkElements",new WeakSet),Va(this,"mutationCb"),Va(this,"adoptedStyleSheetCb"),Va(this,"styleMirror",new Nd),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},n=[];for(const t of e){let e;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:ll(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}trackStylesheetInLinkElement(e){}}class Tp{constructor(){Va(this,"nodeMap",new WeakMap),Va(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 Np,Lp,_p,Dp=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(za=e.contentWindow)?void 0:za.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Fp=new cl;function jp(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:x=!1,recordCrossOriginIframes:k=!1,recordAfter:O=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:I=!1,collectFonts:E=!1,inlineImages:M=!1,captureAdoptedStyleSheets:R=!0,plugins:P,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:T=new Set([]),errorHandler:N,applyBackgroundColorToBlockedElements:L=!1}=e;Xd=N;const _=!k||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===w.mousemove&&(w.mousemove=S),Fp.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},j=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let U;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let B=0;const $=e=>{for(const t of P||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!D&&(e=v(e)),e};Np=(e,s)=>{var i;const o=e;if(o.timestamp=Sd(),!(null==(i=tp[0])?void 0:i.isFrozen())||o.type===Fd.FullSnapshot||o.type===Fd.IncrementalSnapshot&&o.data.source===jd.Mutation||tp.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===Fd.FullSnapshot)U=o,B=0;else if(o.type===Fd.IncrementalSnapshot){if(o.data.source===jd.Mutation&&o.data.isAttachIframe)return;B++;const e=n&&B>=n,t=r&&o.timestamp-U.timestamp>r;(e||t)&&Lp(!0)}};const z=e=>{Np({type:Fd.IncrementalSnapshot,data:{source:jd.Mutation,...e}})},W=e=>Np({type:Fd.IncrementalSnapshot,data:{source:jd.Scroll,...e}}),q=e=>Np({type:Fd.IncrementalSnapshot,data:{source:jd.CanvasMutation,...e}}),V=new Ap({mutationCb:z,adoptedStyleSheetCb:e=>Np({type:Fd.IncrementalSnapshot,data:{source:jd.AdoptedStyleSheet,...e}})}),G=new mp({mirror:Fp,mutationCb:z,stylesheetManager:V,recordCrossOriginIframes:k,wrappedEmit:Np});for(const e of P||[])e.getMirror&&e.getMirror({nodeMirror:Fp,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const H=new Tp;_p=new Pp({recordCanvas:x,mutationCb:q,win:window,blockClass:s,blockSelector:i,mirror:Fp,sampling:w.canvas,dataURLOptions:b});const J=new gp({mutationCb:z,scrollCb:W,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:F,dataURLOptions:b,maskTextFn:m,maskInputFn:f,maskAttributeFn:g,recordCanvas:x,inlineImages:M,sampling:w,slimDOMOptions:j,iframeManager:G,stylesheetManager:V,canvasManager:_p,keepIframeSrcFn:A,processedNodeManager:H},mirror:Fp});Lp=(e=!1)=>{if(!C)return;Np({type:Fd.Meta,data:{href:window.location.href,width:kd(),height:xd()}},e),V.reset(),J.init(),tp.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new cl,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,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:x=()=>!1,applyBackgroundColorToBlockedElements:k=!1}=t||{};return $l(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,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:x,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:k})}(document,{mirror:Fp,blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:F,maskTextFn:m,maskInputFn:f,maskAttributeFn:g,slimDOM:j,dataURLOptions:b,recordCanvas:x,inlineImages:M,applyBackgroundColorToBlockedElements:L,onSerialize:e=>{Pd(e,Fp)&&G.addIframe(e),Ad(e,Fp)&&V.trackLinkElement(e),Td(e)&&J.addShadowRoot(fd.shadowRoot(e),document)},onAdoptedStyleSheet:R?e=>V.styleMirror.add(e):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");Np({type:Fd.FullSnapshot,data:{node:t,initialOffset:Cd(window)}},e),tp.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,Fp.getId(document))};try{const e=[],t=e=>{var t;return Zd(hp)({mutationCb:z,mousemoveCb:(e,t)=>Np({type:Fd.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Np({type:Fd.IncrementalSnapshot,data:{source:jd.MouseInteraction,...e}}),scrollCb:W,viewportResizeCb:e=>Np({type:Fd.IncrementalSnapshot,data:{source:jd.ViewportResize,...e}}),inputCb:e=>Np({type:Fd.IncrementalSnapshot,data:{source:jd.Input,...e}}),mediaInteractionCb:e=>Np({type:Fd.IncrementalSnapshot,data:{source:jd.MediaInteraction,...e}}),styleSheetRuleCb:e=>Np({type:Fd.IncrementalSnapshot,data:{source:jd.StyleSheetRule,...e}}),styleDeclarationCb:e=>Np({type:Fd.IncrementalSnapshot,data:{source:jd.StyleDeclaration,...e}}),canvasMutationCb:q,fontCb:e=>Np({type:Fd.IncrementalSnapshot,data:{source:jd.Font,...e}}),selectionCb:e=>{Np({type:Fd.IncrementalSnapshot,data:{source:jd.Selection,...e}})},customElementCb:e=>{Np({type:Fd.IncrementalSnapshot,data:{source:jd.CustomElement,...e}})},blockClass:s,ignoreClass:o,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:F,inlineStylesheet:u,sampling:w,recordDOM:C,recordCanvas:x,inlineImages:M,userTriggeredOnInput:I,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:m,maskAttributeFn:g,keepIframeSrcFn:A,blockSelector:i,slimDOMOptions:j,dataURLOptions:b,mirror:Fp,iframeManager:G,stylesheetManager:V,shadowDomManager:J,processedNodeManager:H,canvasManager:_p,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=>Np({type:Fd.Plugin,data:{plugin:e.name,payload:t}})})))||[]},y)};G.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{Lp(),e.push(t(document)),Dp=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(md("DOMContentLoaded",()=>{Np({type:Fd.DomContentLoaded,data:{}}),"DOMContentLoaded"===O&&r()})),e.push(md("load",()=>{Np({type:Fd.Load,data:{}}),"load"===O&&r()},window))),()=>{e.forEach(e=>e()),H.destroy(),Dp=!1,Xd=void 0}}catch(e){console.warn(e)}}var Up;jp.addCustomEvent=(e,t)=>{if(!Dp)throw new Error("please add custom event after start recording");Np({type:Fd.Custom,data:{tag:e,payload:t}})},jp.freezePage=()=>{tp.forEach(e=>e.freeze())},jp.takeFullSnapshot=e=>{if(!Dp)throw new Error("please take full snapshot after start recording");Lp(e)},jp.mirror=Fp,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Up||(Up={}));var Bp=Object.freeze({__proto__:null,record:jp});const $p=["image/","audio/","video/","application/octet-stream","font/"];function zp(e,t){if(new Blob([e]).size<=t)return{value:e,truncated:!1};let r=0,n=Math.min(e.length,t);for(;r<n;){const s=Math.ceil((r+n)/2);new Blob([e.slice(0,s)]).size<=t?r=s:n=s-1}return r>0&&e.charCodeAt(r-1)>=55296&&e.charCodeAt(r-1)<=56319&&(r-=1),{value:e.slice(0,r),truncated:!0}}var Wp=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=f();if(!e)return;const t=e.fetch;t&&(e.fetch=(e,r)=>o(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(null==a?void 0: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=zp(e,t).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,null==a?void 0:a.response){if(function(e){return!!e&&$p.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}=zp(e,r);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=ge,e.evaluateTargetingAndCapture=Ur,e.flush=Fr,e.getSessionId=_r,e.getSessionReplayProperties=Dr,e.init=Nr,e.setSessionId=Lr,e.shutdown=jr,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
1
+ var sessionReplay=function(e){"use strict";var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},t(e,r)};var r,n,s=function(){return s=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},s.apply(this,arguments)};function i(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 o(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 a(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 l(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(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 u(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"}(r||(r={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(n||(n={}));var h,d="$default_instance",p="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"}(h||(h={}));var f,g=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},m=u([],c(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),v=function(e){var t,r=g();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,u([],c(n.entries()),!1).map(function(e){var t=c(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(m[n]):m[n]}).join("")},y=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"}(f||(f={}));var w="Amplitude Logger ",b=function(){function e(){this.logLevel=f.None}return e.prototype.disable=function(){this.logLevel=f.None},e.prototype.enable=function(e){void 0===e&&(e=f.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Verbose||console.log("".concat(w,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Warn||console.warn("".concat(w,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Error||console.error("".concat(w,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Debug||console.log("".concat(w,"[Debug]: ").concat(e.join(" ")))},e}(),S=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:d,logLevel:f.Warn,loggerProvider:new b,offline:!1,optOut:!1,serverUrl:p,serverZone:"US",useBatch:!1}},C=function(){function e(e){var t,r,n,s;this._optOut=!1;var i=S();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=e.instanceName||i.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=x(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}(),k=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":p},x=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=S().serverZone),void 0===r&&(r=S().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:S().serverZone;return{serverZone:n,serverUrl:k(n,r)}};var O=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<f.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}},I=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:E(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),E=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},M=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),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 P(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 T(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"==typeof SuppressedError&&SuppressedError;var A=function(e,t){var r,n,s=typeof e;if(s!==typeof t)return!1;try{for(var i=P(["string","number","boolean","undefined"]),o=i.next();!o.done;o=i.next()){if(o.value===s)return e===t}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var c=Object.keys(e).sort(),u=Object.keys(t).sort();if(!A(c,u))return!1;var h=!0;return Object.keys(e).forEach(function(r){A(e[r],t[r])||(h=!1)}),h}for(var d=0;d<e.length;d++)if(!A(e[d],t[d]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var D,N=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=R({},this.identity.userProperties),r=R(R({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,s,i,o,a,l=r.userProperties||{};try{for(var c=P(Object.entries(e)),u=c.next();!u.done;u=c.next()){var h=T(u.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(s=void 0,P(Object.entries(p))),g=f.next();!g.done;g=f.next()){var m=T(g.value,2),v=m[0],y=m[1];l[v]=y}}catch(e){s={error:e}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(s)throw s.error}}break;case"$unset":try{for(var w=(o=void 0,P(Object.keys(p))),b=w.next();!b.done;b=w.next()){delete l[v=b.value]}}catch(e){o={error:e}}finally{try{b&&!b.done&&(a=w.return)&&a.call(w)}finally{if(o)throw o.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return R({},this.identity)},e.prototype.setIdentity=function(e){var t=R({},this.identity);this.identity=R({},e),A(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,_=function(){function e(){this.identityStore=new N,this.eventBridge=new M,this.applicationContextProvider=new I}return e.getInstance=function(t){return L.analyticsConnectorInstances||(L.analyticsConnectorInstances={}),L.analyticsConnectorInstances[t]||(L.analyticsConnectorInstances[t]=new e),L.analyticsConnectorInstances[t]},e}(),F=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},j=function(e,t){var r=F(e.toString());return 31*Math.abs(r)%1e5/1e5<t},U="tags",B="counters",$="histograms",z="events",W="internal",q="last_flush_timestamp",V=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return void 0!==(null===(e=g())||void 0===e?void 0:e.indexedDB)},e.prototype.getDB=function(){return o(this,void 0,void 0,function(){return a(this,function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var e=this;return new Promise(function(t,r){var n=indexedDB.open(e.dbName,1);n.onerror=function(){e.dbPromise=null,r(new Error("Failed to open IndexedDB"))},n.onsuccess=function(){var r=n.result;r.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},r.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),r.close()},t(r)},n.onupgradeneeded=function(t){var r=t.target.result;e.createTables(r)}})},e.prototype.createTables=function(e){(e.objectStoreNames.contains(U)||e.createObjectStore(U,{keyPath:"key"}),e.objectStoreNames.contains(B)||e.createObjectStore(B,{keyPath:"key"}),e.objectStoreNames.contains($)||e.createObjectStore($,{keyPath:"key"}),e.objectStoreNames.contains(z))||e.createObjectStore(z,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1});e.objectStoreNames.contains(W)||e.createObjectStore(W,{keyPath:"key"})},e.prototype.setTags=function(e){return o(this,void 0,void 0,function(){var t,r,n,s,i=this;return a(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([U],"readwrite"),n=r.objectStore(U),[2,new Promise(function(t){var s=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tags",e),t()},s.forEach(function(e){var t=c(e,2),r=t[0],s=t[1];n.put({key:r,value:s}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tag",r,s,e)}})})];case 2:return s=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",s),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return o(this,void 0,void 0,function(){var t,r,n,s,i=this;return a(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([B],"readwrite"),n=r.objectStore(B),[2,new Promise(function(t){var s=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to increment counters",e),t()},s.forEach(function(e){var t=c(e,2),r=t[0],s=t[1],o=n.get(r);o.onsuccess=function(){var e=o.result,t=e?e.value:0;n.put({key:r,value:t+s}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to update counter",r,e)}},o.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing counter",r,e)}})})];case 2:return s=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",s),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return o(this,void 0,void 0,function(){var t,r,n,s,i=this;return a(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([$],"readwrite"),n=r.objectStore($),[2,new Promise(function(t){var s=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),t()},s.forEach(function(e){var t=c(e,2),r=t[0],s=t[1],o=n.get(r);o.onsuccess=function(){var e,t=o.result;e=t?{key:r,count:t.count+s.count,min:Math.min(t.min,s.min),max:Math.max(t.max,s.max),sum:t.sum+s.sum}:{key:r,count:s.count,min:s.min,max:s.max,sum:s.sum},n.put(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r,e)}},o.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",r,e)}})})];case 2:return s=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",s),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return o(this,void 0,void 0,function(){var t,r,n,s,i=this;return a(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),0===e.length?[2]:[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([z],"readwrite"),n=r.objectStore(z),[2,new Promise(function(t){r.oncomplete=function(){t()},r.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event records",e),t()};var s=n.count();s.onsuccess=function(){var t=s.result,r=Math.max(0,10-t);r<e.length&&i.logger.debug("DiagnosticsStorage: Only added ".concat(r," of ").concat(e.length," events due to storage limit")),e.slice(0,r).forEach(function(e){n.add(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},s.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return s=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",s),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return o(this,void 0,void 0,function(){var r,n,s,i;return a(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=o.sent(),n=r.transaction([W],"readwrite"),s=n.objectStore(W),[2,new Promise(function(r,i){n.onabort=function(){return i(new Error("Failed to set internal value"))};var o=s.put({key:e,value:t});o.onsuccess=function(){return r()},o.onerror=function(){return i(new Error("Failed to set internal value"))}})];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",i),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(e){return o(this,void 0,void 0,function(){var t,r,n,s;return a(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getDB()];case 1:return t=i.sent(),r=t.transaction([W],"readonly"),n=r.objectStore(W),[2,new Promise(function(t,s){r.onabort=function(){return s(new Error("Failed to get internal value"))};var i=n.get(e);i.onsuccess=function(){return t(i.result)},i.onerror=function(){return s(new Error("Failed to get internal value"))}})];case 2:return s=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",s),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return o(this,void 0,void 0,function(){var e,t;return a(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getInternal(q)];case 1:return[2,(e=r.sent())?parseInt(e.value,10):void 0];case 2:return t=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(e){return o(this,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.setInternal(q,e.toString())];case 1:return r.sent(),[3,3];case 2:return t=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(e,t){return new Promise(function(r,n){var s=e.objectStore(t).clear();s.onsuccess=function(){return r()},s.onerror=function(){return n(new Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return o(this,void 0,void 0,function(){var e,t,r,n,s,i,o,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=a.sent(),t=e.transaction([U,B,$,z],"readwrite"),[4,Promise.all([this.getAllFromStore(t,U),this.getAllFromStore(t,B),this.getAllFromStore(t,$),this.getAllFromStore(t,z)])];case 2:return r=c.apply(void 0,[a.sent(),4]),n=r[0],s=r[1],i=r[2],o=r[3],[4,Promise.all([this.clearTable(t,B),this.clearTable(t,$),this.clearTable(t,z)])];case 3:return a.sent(),[2,{tags:n,counters:s,histogramStats:i,events:o}];case 4:return l=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",l),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(e,t){return new Promise(function(r,n){var s=e.objectStore(t).getAll();s.onsuccess=function(){return r(s.result)},s.onerror=function(){return n(new Error("Failed to get all from ".concat(t)))}})},e}(),H=function(e){var t,r,n=function(){var e=g();if(!e)return[];var t=e.__AMPLITUDE_SCRIPT_URL__;return Array.isArray(t)?t:"string"==typeof t?[t]:[]}();if(0!==n.length)try{for(var s=l(n),i=s.next();!i.done;i=s.next()){var o=i.value;if(e.filename&&e.filename.includes(o))return"filename";if(e.stack&&e.stack.includes(o))return"stack"}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}},G=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},J=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},K=3e5,Y=1e4,X=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===r?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(n,null,2)),this.config=s({enabled:!0,sampleRate:0},n),this.startTimestamp=Date.now(),this.shouldTrack=j(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,V.isSupported()?this.storage=new V(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),function(e){var t=g();if(t&&"function"==typeof t.addEventListener){var r=function(t){e.recordEvent("sdk.error.uncaught",s({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",function(e){var t=e.error instanceof Error?e.error:void 0,n=null==t?void 0:t.stack,s=H({filename:e.filename,stack:n});s&&r({type:"error",message:e.message,stack:n,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:s}})},!0),t.addEventListener("unhandledrejection",function(e){var t,n=e.reason instanceof Error?e.reason:void 0,s=null==n?void 0:n.stack,i=G(s),o=H({filename:i,stack:s});o&&r({type:"unhandledrejection",message:null!==(t=null==n?void 0:n.message)&&void 0!==t?t:J(e.reason),stack:s,filename:i,errorName:null==n?void 0:n.name,metadata:{isTrusted:e.isTrusted,matchReason:o}})},!0)}}(this))}return e.prototype.isStorageAndTrackEnabled=function(){return Boolean(this.storage)&&Boolean(this.shouldTrack)},e.prototype.setTag=function(e,t){this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryTags).length>=Y?this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit"):(this.inMemoryTags[e]=t,this.startTimersIfNeeded()))},e.prototype.increment=function(e,t){void 0===t&&(t=1),this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryCounters).length>=Y?this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit"):(this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()))},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled())if(Object.keys(this.inMemoryHistograms).length>=Y)this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");else{var r=this.inMemoryHistograms[e];r?(r.count+=1,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){this.isStorageAndTrackEnabled()&&(this.inMemoryEvents.length>=10?this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit"):(this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()))},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)}).finally(function(){e.saveTimer=null})},1e3)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)}).finally(function(){e.flushTimer=null})},K))},e.prototype.saveAllDataToStorage=function(){return o(this,void 0,void 0,function(){var e,t,r,n;return a(this,function(i){switch(i.label){case 0:return this.storage?(e=s({},this.inMemoryTags),t=s({},this.inMemoryCounters),r=s({},this.inMemoryHistograms),n=u([],c(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(r),this.storage.addEventRecords(n)])]):[2];case 1:return i.sent(),[2]}})})},e.prototype._flush=function(){return o(this,void 0,void 0,function(){var e,t,r,n,s,i,o,l,c,u;return a(this,function(a){switch(a.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return a.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return e=a.sent(),t=e.tags,r=e.counters,n=e.histogramStats,s=e.events,this.storage.setLastFlushTimestamp(Date.now()),i={},t.forEach(function(e){i[e.key]=e.value}),o={},r.forEach(function(e){o[e.key]=e.value}),l={},n.forEach(function(e){l[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),c=s.map(function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}}),0===Object.keys(o).length&&0===Object.keys(l).length&&0===c.length?[2]:(u={tags:i,histogram:l,counters:o,events:c},this.fetch(u),[2])}})})},e.prototype.fetch=function(e){return o(this,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!g())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:return r.sent().ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return t=r.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return o(this,void 0,void 0,function(){var e,t,r;return a(this,function(n){switch(n.label){case 0:return this.storage?(e=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return-1===(t=n.sent()||-1)?(this.storage.setLastFlushTimestamp(e),this._setFlushTimer(K),[2]):(r=e-t)>=K?(this._flush(),[2]):(this._setFlushTimer(K-r),[2])}})})},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout(function(){t._flush().catch(function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)}).finally(function(){t.flushTimer=null})},e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=j(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),Q=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,d,p,f,g,m,v,y,w,b,S,C,k;if("object"!=typeof e)return null;var x=e.code||0,O=this.buildStatus(x);switch(O){case h.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 h.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!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(g=e.throttled_events)&&void 0!==g?g:[]}};case h.PayloadTooLarge:return{status:O,statusCode:x,body:{error:null!==(m=e.error)&&void 0!==m?m:""}};case h.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!==(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 h.Timeout:default:return{status:O,statusCode:x}}},e.prototype.buildStatus=function(e){return function(e){return e>=200&&e<300}(e)?h.Success:429===e?h.RateLimit:413===e?h.PayloadTooLarge:408===e?h.Timeout:e>=400&&e<500?h.Invalid:e>=500?h.Failed:h.Unknown},e}(),Z=function(e){function r(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}(r,e),r.prototype.send=function(e,t){return o(this,void 0,void 0,function(){var r,n,i;return a(this,function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:s({"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:i=o.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}})})},r}(Q),ee=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),te=401,re=403,ne=429,se=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new ee(e,t)}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 o(this,void 0,void 0,function(){var e,t=this;return a(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 o(this,void 0,void 0,function(){var t,r,n,s=this;return a(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 o(this,void 0,void 0,function(){var r,n;return a(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),o(this,void 0,void 0,function(){var r,n,s,i,o,l,c=this;return a(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},s=function(n){var s,o,l,u,h,d;return a(this,function(a){switch(a.label){case 0:s=!0,o=new AbortController,l=setTimeout(function(){return o.abort()},t),a.label=1;case 1:return a.trys.push([1,7,8,9]),[4,fetch(i.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:o.signal})];case 2:return(u=a.sent()).ok?[3,4]:[4,u.text()];case 3:return h=a.sent(),i.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(u.status,": ").concat(h)),u.status===te||u.status===re?(i.logger.error("Remote config client fetch failed with ".concat(u.status,". Invalid API key; future fetches will be skipped.")),i.isLastFetchInvalidApiKey=!0,s=!1):u.status>=400&&u.status<500&&u.status!==ne&&(s=!1),[3,6];case 4:return[4,u.json()];case 5:return[2,{value:{remoteConfig:a.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(d=a.sent())instanceof Error&&"AbortError"===d.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: "),d),[3,9];case 8:return clearTimeout(l),[7];case 9:return s?n<e-1?[4,new Promise(function(e){return setTimeout(e,c.getJitterDelay(r))})]:[3,11]:[2,"break"];case 10:a.sent(),a.label=11;case 11:return[2]}})},i=this,o=0,u.label=1;case 1:return o<e?[5,s(o)]:[3,4];case 2:if("object"==typeof(l=u.sent()))return[2,l.value];if("break"===l)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 t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}();!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(D||(D={}));var ie,oe="https://app.amplitude.com",ae={US:oe,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var le="__AMPLITUDE_MESSENGER_INSTANCE__",ce="__AMPLITUDE_MESSENGER__",ue=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?oe:t;this[ie]=!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=l(o),c=a.next();!c.done;c=a.next()){t(c.value)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return o(this,void 0,void 0,function(){var t,r,n;return a(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===oe&&(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=g();(null==e?void 0:e[ce])===this&&delete e[ce]},e}();function he(e){var t,r=g(),n=null==r?void 0:r[ce];if("object"==typeof(t=n)&&null!==t&&le in t&&!0===t[le])return n;var s=new ue(e);return r&&(r[ce]=s),s}ie=le;var de="__AMPLITUDE_BACKGROUND_CAPTURE__";const pe="[Amplitude]",fe=`${pe} Session Replay ID`,ge=D.US,me={enabled:!0},ve=1e3,ye=`${pe} Session Replay Debug`,we="amp-mask",be="amp-unmask",Se="https://api-sr.amplitude.com/sessions/v2/track",Ce="https://api-sr.eu.amplitude.com/sessions/v2/track",ke="https://api-sr.stag2.amplitude.com/sessions/v2/track",xe=9e6,Oe=/payload.*exceed/i,Ie=500,Ee=1e4,Me=1024,Re="amplitude-sr-iframe";var Pe;!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"}(Pe||(Pe={}));class Te{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()}}const Ae="medium";function De(e,t){return t||("STAGING"===e?ke:"EU"===e?Ce:Se)}const Ne=(e,t,r)=>{switch(t){case"light":{if("input"!==e)return!1;const t=r?function(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}(r):"";return!!t&&(!!["password","hidden","email","tel"].includes(t)||!!r.autocomplete.startsWith("cc-"))}case"medium":return"input"===e;case"conservative":return!0;default:return Ne(e,Ae,r)}},Le=(e,t)=>{var r;if(e&&t.urlMaskLevels)for(const r of t.urlMaskLevels)if($e(r.match).test(e))return r.maskLevel;return null!==(r=t.defaultMaskLevel)&&void 0!==r?r:Ae},_e=(e,t={defaultMaskLevel:Ae},r,n)=>{var s,i;if(r){if(r.closest("."+we))return!0;const e=(null!==(s=t.maskSelector)&&void 0!==s?s:[]).some(e=>r.closest(e));if(e)return!0;if(r.closest("."+be))return!1;const n=(null!==(i=t.unmaskSelector)&&void 0!==i?i:[]).some(e=>r.closest(e));if(n)return!1}return Ne(e,Le(n,t),r)},Fe=(e,t,r)=>(n,s)=>_e(e,t,s,null==r?void 0:r())?n.replace(/[^\s]/g,"*"):n,je=(e,t)=>(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;const o=["INPUT","SELECT","TEXTAREA"].includes(s.tagName)?"input":"text";return _e(o,e,s,null==t?void 0:t())?n.replace(/[^\s]/g,"*"):n},Ue=()=>{const e=g();return(null==e?void 0:e.location)?e.location.href:""},Be=new Map,$e=e=>{const t=Be.get(e);if(t)return t;const r="\0TRAIL\0",n="\0MID\0",s="\0DS\0",i="\0ST\0",o="\0QU\0";let a=e;a=a.replace(/\/\*\*$/,r),a=a.replace(/\/\*\*\//g,n),a=a.replace(/\*\*/g,s),a=a.replace(/\*/g,i),a=a.replace(/\?/g,o),a=a.replace(/[.+^${}()|[\]\\]/g,"\\$&"),a=a.split(r).join("(/.*)?"),a=a.split(n).join("/(.*\\/)?"),a=a.split(s).join(".*"),a=a.split(i).join(".*"),a=a.split(o).join(".");const l=new RegExp(`^${a}$`);return Be.set(e,l),l},ze=(e,t)=>{for(const r of t){const t=$e(r.selector);if(t.test(e))return e.replace(t,r.replacement)}return e},We=()=>o(void 0,void 0,void 0,function*(){try{const e=g();if(e){const{usage:t,quota:r,usageDetails:n}=yield e.navigator.storage.estimate(),s=t?Math.round(t/Me):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:""}}),qe=e=>{const t=Object.assign({},e),{apiKey:r}=t;return t.apiKey=`****${r.substring(r.length-4)}`,t},Ve=()=>({flushMaxRetries:2,logLevel:f.Warn,loggerProvider:new b,transportProvider:new Z});class He extends C{constructor(e,t){var r,n,s,i,o,a,l,c,u,h,d,p,f,g,m;const v=Ve();super(Object.assign(Object.assign({transportProvider:v.transportProvider,loggerProvider:new Te(t.loggerProvider||v.loggerProvider)},t),{apiKey:e})),this.flushMaxRetries=void 0!==t.flushMaxRetries&&t.flushMaxRetries<=v.flushMaxRetries?t.flushMaxRetries:v.flushMaxRetries,this.apiKey=e,this.sampleRate=t.sampleRate||0,this.serverZone=t.serverZone||ge,this.configServerUrl=t.configServerUrl,this.trackServerUrl=t.trackServerUrl,this.shouldInlineStylesheet=t.shouldInlineStylesheet,this.version=t.version,this.performanceConfig=t.performanceConfig||me,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=Xe(t.maxPersistedEventsSizeBytes,Je,Ke,"maxPersistedEventsSizeBytes",this.loggerProvider)),void 0!==t.maxSingleEventSizeBytes&&(this.maxSingleEventSizeBytes=Xe(t.maxSingleEventSizeBytes,Je,Ye,"maxSingleEventSizeBytes",this.loggerProvider)),this.privacyConfig=Object.assign(Object.assign({},null!==(l=t.privacyConfig)&&void 0!==l?l:{}),{unmaskSelector:Array.from(new Set([`.${be}`,...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===(g=t.captureAdoptedStyleSheets)||void 0===g||g,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<Ge?(t.warn(`flushIntervalConfig.minIntervalMs ${e.minIntervalMs} is below floor ${Ge}ms; clamping.`),s.minIntervalMs=Ge):s.minIntervalMs=e.minIntervalMs);void 0!==e.maxIntervalMs&&(Number.isNaN(e.maxIntervalMs)||e.maxIntervalMs<Ge?(t.warn(`flushIntervalConfig.maxIntervalMs ${e.maxIntervalMs} is below floor ${Ge}ms; clamping.`),s.maxIntervalMs=Ge):s.maxIntervalMs=e.maxIntervalMs);if(void 0!==s.minIntervalMs||void 0!==s.maxIntervalMs){const e=null!==(r=s.minIntervalMs)&&void 0!==r?r:Ie,i=null!==(n=s.maxIntervalMs)&&void 0!==n?n:Ee;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.diagnosticsEnabled=t.diagnosticsEnabled,this.diagnosticsSampleRate=t.diagnosticsSampleRate,this.diagnosticsClient=null!==(m=t.diagnosticsClient)&&void 0!==m?m:this.createStandaloneDiagnosticsClient(e,t)}createStandaloneDiagnosticsClient(e,t){const{diagnosticsEnabled:r,diagnosticsSampleRate:n}=t;if(!0===r||"number"==typeof n&&n>0)return new X(e,this.loggerProvider,this.serverZone,{enabled:null==r||r,sampleRate:null!=n?n:0})}}const Ge=100,Je=1e3,Ke=8e6,Ye=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 Qe=(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))(Qe||{}),Ze=(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))(Ze||{}),et=(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))(et||{});const tt="sr.trc",rt={init:`${tt}.init`,configSource:e=>`${tt}.config.source.${e}`,configHasTargeting:`${tt}.config.has_targeting`,configNoTargeting:`${tt}.config.no_targeting`,configFetchFailed:`${tt}.config.fetch_failed`,configReceived:`${tt}.config.received`,evalTrigger:e=>`${tt}.eval.${e}`,evalNoConfig:`${tt}.eval.no_config`,evalMissingPrereq:`${tt}.eval.missing_prereq`,evalMatch:`${tt}.eval.match`,evalNoMatch:`${tt}.eval.no_match`,evalError:`${tt}.eval.error`,evalStaleDiscarded:`${tt}.eval.stale_discarded`,evalSkippedAlreadyMatched:`${tt}.eval.skipped_already_matched`,evalDurationMs:`${tt}.eval.duration_ms`,evalEvent:`${tt}.eval`,evalResult:`${tt}.eval.result`,recordStarted:`${tt}.record.started`,recordNoRecordFn:`${tt}.record.no_record_fn`,sendSuppressedMinDuration:`${tt}.send.suppressed_min_duration`,gateNoIdentifiers:`${tt}.gate.no_identifiers`,gateCaptureDisabled:`${tt}.gate.capture_disabled`,gateOptOut:`${tt}.gate.optout`,gateTrcMatch:`${tt}.gate.trc_match`,gateTrcNoMatch:`${tt}.gate.trc_no_match`,gateSampleIn:`${tt}.gate.sample_in`,gateSampleOut:`${tt}.gate.sample_out`,decision:`${tt}.decision`,urlChange:`${tt}.url_change`,urlChangeEvent:`${tt}.url_change`};class nt{constructor(e,t,r){this.localConfig=t,this.remoteConfigClient=e,this.sessionId=null==r?void 0:r.sessionId,this.deviceId=null==r?void 0:r.deviceId}generateJoinedConfig(){var e,t,r,n,s,i,a,l;return o(this,void 0,void 0,function*(){const o=Object.assign({},this.localConfig);let c;o.optOut=this.localConfig.optOut,o.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,a=i.sr_sampling_config,l=i.sr_privacy_config,u=i.sr_targeting_config,h=a,d=null==u?void 0:u.segments,p=null===(s=o.interactionConfig)||void 0===s?void 0:s.ugcFilterRules;o.interactionConfig=i.sr_interaction_config,o.interactionConfig&&p&&(o.interactionConfig.ugcFilterRules=p),o.loggingConfig=i.sr_logging_config;try{const e=this.localConfig.diagnosticsClient;null==e||e.increment(rt.configSource(String(n))),null==e||e.increment(u?rt.configHasTargeting:rt.configNoTargeting),null==e||e.recordEvent(rt.configReceived,{sessionId:this.sessionId,deviceId:this.deviceId,srId:null!=this.deviceId&&null!=this.sessionId?`${this.deviceId}/${this.sessionId}`:void 0,source:String(n),hasSampling:!!a,captureEnabled:null==h?void 0:h.capture_enabled,sampleRate:null==h?void 0:h.sample_rate,hasTargeting:!!u,targetingSegmentCount:Array.isArray(d)?d.length:void 0,hasPrivacy:!!l})}catch(e){}(a||l||u)&&(c={},a&&(c.sr_sampling_config=a),l&&(c.sr_privacy_config=l),u&&(c.sr_targeting_config=u)),e()})})}catch(t){this.localConfig.loggerProvider.error("Failed to generate joined config: ",t);try{null===(e=this.localConfig.diagnosticsClient)||void 0===e||e.increment(rt.configFetchFailed)}catch(e){}return o.captureEnabled=!1,{localConfig:this.localConfig,joinedConfig:o,remoteConfig:void 0}}if(!c)return{localConfig:this.localConfig,joinedConfig:o,remoteConfig:c};const{sr_sampling_config:u,sr_privacy_config:h,sr_targeting_config:d}=c;if(u&&Object.keys(u).length>0?(Object.prototype.hasOwnProperty.call(u,"capture_enabled")?o.captureEnabled=u.capture_enabled:o.captureEnabled=!1,Object.prototype.hasOwnProperty.call(u,"sample_rate")&&(o.sampleRate=u.sample_rate),Object.prototype.hasOwnProperty.call(u,"min_session_duration_ms")&&(o.minSessionDurationMs=this.sanitizeMinSessionDurationMs(u.min_session_duration_ms))):(o.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=o.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!==(a=h.urlMaskLevels)&&void 0!==a?a:[],...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);o.privacyConfig=((e,t)=>{const r=document.createDocumentFragment(),n=(e=[])=>{if("string"==typeof e&&(e=[e]),e=e.filter(e=>{try{r.querySelector(e)}catch(r){return t.warn(`[session-replay-browser] omitting selector "${e}" because it is invalid`),!1}return!0}),0!==e.length)return e};return e.blockSelector=n(e.blockSelector),e.maskSelector=n(e.maskSelector),e.unmaskSelector=n(e.unmaskSelector),e})(c,this.localConfig.loggerProvider)}return d&&Object.keys(d).length>0&&(o.targetingConfig=d),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:qe(o)},null,2)),{localConfig:this.localConfig,joinedConfig:o,remoteConfig:c}})}sanitizeMinSessionDurationMs(e){if("number"==typeof e&&Number.isFinite(e)){if(!(e<0))return e>st?(this.localConfig.loggerProvider.warn(`min_session_duration_ms remote value ${e} exceeds ${st}ms ceiling; clamping.`),st):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 st=6e4;function it(e){if(e.type!==Qe.IncrementalSnapshot)return!1;const t=e.data;return t.source===Ze.Mutation&&!t.isAttachIframe}function ot(e){const t={};for(const r of e)for(const e of Object.keys(r))t[e]=r[e];return t}function at(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=ot(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 lt(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),g=u?f.filter(e=>!a.has(e.id)&&!l.has(e.id)&&!c.has(e.id)):f,m={source:Ze.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:at(g)};return Object.assign(Object.assign({},t),{data:m})}function ct(e){if(e.length<=1)return e;const t=[];let r=0;for(;r<e.length;){if(!it(e[r])){t.push(e[r]),r++;continue}let n=r+1;for(;n<e.length&&it(e[n]);)n++;t.push(n>r+1?lt(e.slice(r,n)):e[r]),r=n}return t}class ut{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=new Blob([e]).size;n>(null!==(r=this.config.maxSingleEventSizeBytes)&&void 0!==r?r:xe)?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.eventsManager&&this.deviceId&&this.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:this.deviceId})},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=g();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===Qe.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=ct(e.slice(n,s).map(e=>e.event));for(const e of i)r.push({event:e,sessionId:t});n=s}return r}}const ht="Session replay event batch rejected due to exceeded retry count",dt="Failed to store session replay events in IndexedDB",pt="Session replay event batch dropped: server signalled capture disabled or session out of valid range for this session",ft="1.47.0-sr-trc-debug-log.0";class gt{constructor({trackServerUrl:e,loggerProvider:t,payloadBatcher:r,workerScript:n,enableTransportCompression:s,sendTimeoutMs:i}){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,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}))}}},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=>new Blob([e]).size;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;const u=new URLSearchParams({device_id:r,session_id:String(t),type:"replay",api_key:n}),h=`${De(s,this.trackServerUrl)}?${u.toString()}`,d=g();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:pt}),!1):e.attempts<(e.flushMaxRetries||0)?(e.attempts+=1,!0):(this.completeRequest({context:e,err:ht}),!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 o(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,a,l;if(e.length<=1)return e;const c=new Map;for(const o of e){const e=[o.sessionId,null!==(t=o.deviceId)&&void 0!==t?t:"",null!==(r=o.apiKey)&&void 0!==r?r:"",o.type,null!==(n=o.serverZone)&&void 0!==n?n:"",o.sampleRate,null!==(i=null===(s=o.version)||void 0===s?void 0:s.type)&&void 0!==i?i:"",null!==(l=null===(a=o.version)||void 0===a?void 0:a.version)&&void 0!==l?l:""].join("|"),u=c.get(e);u?u.push(o):c.set(e,[o])}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=s.events.reduce((e,t)=>e+new Blob([t]).size,0);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,a=s.onComplete;t.events=t.events.concat(s.events),r+=e,t.onComplete=()=>o(this,void 0,void 0,function*(){yield Promise.allSettled([i(),a()])})}n()}return u}send(e,t=!0){return o(this,void 0,void 0,function*(){if(this.killedSessions.has(e.sessionId))return this.completeRequest({context:e,err:pt});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 o(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,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:Ue(),sdkVersion:ft,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}}sendOnMainThread(e,t,r,n,s){var i,a,l,c,u,h,d;return o(this,void 0,void 0,function*(){const p=Ue(),f=ft,m=r.sampleRate,v=new URLSearchParams({device_id:t,session_id:`${r.sessionId}`,type:`${r.type}`}),y=`${null!==(a=null===(i=r.version)||void 0===i?void 0:i.type)&&void 0!==a?a:"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=g(),a=this.enableTransportCompression&&i&&"CompressionStream"in i?yield function(e,t){return o(this,void 0,void 0,function*(){try{const r=new(0,t.CompressionStream)("gzip"),n=r.writable.getWriter(),s=r.readable.getReader(),i=[],a=(()=>o(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 a;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=a?a.byteLength:new Blob([t]).size,c=new AbortController,w={headers: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":`${m}`,"X-Sampling-Hash-Alg":"xxhash32"},a?{"Content-Encoding":"gzip"}:{}),body:null!=a?a:t,method:"POST",keepalive:l<=65536,signal:c.signal},b=`${De(r.serverZone,this.trackServerUrl)}?${v.toString()}`;if(0===n.events.length)return void this.completeRequest({context:r});const S=this.sendTimeoutMs>0?setTimeout(()=>{c.abort()},this.sendTimeoutMs):void 0;let C;try{C=yield fetch(b,w)}finally{S&&clearTimeout(S)}if(null===C)return void this.completeRequest({context:r,err:"Unexpected error occurred"});if(C.status>=200&&C.status<300){const e=null!==(d=null===(h=null===(u=C.headers)||void 0===u?void 0:u.get)||void 0===h?void 0:h.call(u,"X-Session-Replay-Event-Skipped"))&&void 0!==d?d:null;this.applyServerDirective(r.sessionId,e)}if(s){let e="";if(413===C.status)try{e=yield C.text()}catch(e){}yield this.handleReponse(C.status,r,e)}else{let e="";try{e=JSON.stringify(C.body,null,2)}catch(e){}this.completeRequest({context:r,success:`${C.status}: ${e}`})}}catch(e){!!e&&"object"==typeof e&&"AbortError"===e.name&&s?yield this.handleOtherResponse(r):this.completeRequest({context:r,err:e})}})}handleReponse(e,t,r=""){return o(this,void 0,void 0,function*(){switch((new Q).buildStatus(e)){case h.Success:this.handleSuccessResponse(t);break;case h.Failed:case h.Timeout:case h.RateLimit:yield this.handleOtherResponse(t);break;case h.PayloadTooLarge:this.handlePayloadTooLargeResponse(t,Oe.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)/Me);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(new Blob(e.events).size/Me);this.completeRequest({context:e,success:`Session replay event batch tracked successfully for session id ${e.sessionId}, size of events: ${t} KB`})}handleOtherResponse(e){return o(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:ht}):(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:pt}):r.push(t);this.queue=r}}const mt=(e,t)=>t.some(t=>e instanceof t);let vt,yt;const wt=new WeakMap,bt=new WeakMap,St=new WeakMap;let Ct={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return wt.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return It(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function kt(e){Ct=e(Ct)}function xt(e){return(yt||(yt=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(Et(this),t),It(this.request)}:function(...t){return It(e.apply(Et(this),t))}}function Ot(e){return"function"==typeof e?xt(e):(e instanceof IDBTransaction&&function(e){if(wt.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)});wt.set(e,t)}(e),mt(e,vt||(vt=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Ct):e)}function It(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(It(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",i)});return St.set(t,e),t}(e);if(bt.has(e))return bt.get(e);const t=Ot(e);return t!==e&&(bt.set(e,t),St.set(t,e)),t}const Et=e=>St.get(e);function Mt(e,t,{blocked:r,upgrade:n,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=It(o);return n&&o.addEventListener("upgradeneeded",e=>{n(It(o.result),e.oldVersion,e.newVersion,It(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 Rt=["get","getKey","getAll","getAllKeys","count"],Pt=["put","add","delete","clear"],Tt=new Map;function At(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Tt.get(t))return Tt.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=Pt.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!Rt.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 Tt.set(t,i),i}kt(e=>({...e,get:(t,r,n)=>At(t,r)||e.get(t,r,n),has:(t,r)=>!!At(t,r)||e.has(t,r)}));const Dt=["continue","continuePrimaryKey","advance"],Nt={},Lt=new WeakMap,_t=new WeakMap,Ft={get(e,t){if(!Dt.includes(t))return e[t];let r=Nt[t];return r||(r=Nt[t]=function(...e){Lt.set(this,_t.get(this)[t](...e))}),r}};async function*jt(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,Ft);for(_t.set(r,t),St.set(r,Et(t));t;)yield r,t=await(Lt.get(r)||t.continue()),Lt.delete(r)}function Ut(e,t){return t===Symbol.asyncIterator&&mt(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&mt(e,[IDBIndex,IDBObjectStore])}kt(e=>({...e,get:(t,r,n)=>Ut(t,r)?jt:e.get(t,r,n),has:(t,r)=>Ut(t,r)||e.has(t,r)}));class Bt{get timeAtLastSplit(){return this._timeAtLastSplit}constructor(e){var t,r,n;this.minInterval=Ie,this.maxInterval=Ee,this.maxPersistedEventsSize=6e6,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=(e,t)=>{const r=this.getStringSize(t);return this.getEventsArraySize(e)+r>=this.maxPersistedEventsSize||!!(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}getStringSize(e){let t=0;for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);if(n<=127)t++;else if(n<=2047)t+=2;else if(n>=55296&&n<=56319){const n=r+1<e.length?e.charCodeAt(r+1):NaN;n>=56320&&n<=57343?(t+=4,r++):t+=3}else t+=3}return t}getEventsArraySize(e){let t=0;for(const r of e)t+=this.getStringSize(r);return t+(2+Math.max(0,e.length-1)+2*e.length)}}const $t=(e,t,r)=>{var n;"object"==typeof(n=r)&&null!==n&&"AbortError"===n.name?e.debug(t):e.warn(t)};const zt="sessionCurrentSequence",Wt="sequencesToSend",qt=5e3;function Vt(e,t,r){const n=setTimeout(r,t);return e.then(()=>clearTimeout(n),()=>clearTimeout(n)),()=>clearTimeout(n)}const Ht=e=>{let t,r;return e.objectStoreNames.contains(zt)||(r=e.createObjectStore(zt,{keyPath:"sessionId"})),e.objectStoreNames.contains(Wt)||(t=e.createObjectStore(Wt,{keyPath:"sequenceId",autoIncrement:!0}),t.createIndex("sessionId","sessionId")),{sequencesStore:t,currentSequenceStore:r}},Gt=e=>o(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)})})}(Mt(e,1,{upgrade:Ht}),2e3,"IDB openDB timed out")});class Jt extends Bt{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=()=>o(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||($t(this.loggerProvider,`${dt}: ${r}`,r),this.recordFailure())});const s=Vt(n.done,qt,()=>{e||t||(t=!0,$t(this.loggerProvider,`${dt}: 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,$t(this.loggerProvider,`${dt}: ${r}`,r),this.recordFailure())}}),this.storeCurrentSequence=e=>o(this,void 0,void 0,function*(){let t=!1,r=!1;try{const n=this.db.transaction([zt,Wt],"readwrite");n.done.catch(e=>{t||r||($t(this.loggerProvider,`${dt}: ${e}`,e),this.recordFailure())});const s=Vt(n.done,qt,()=>{t||r||(r=!0,$t(this.loggerProvider,`${dt}: transaction timed out`),this.recordFailure())}),o=yield n.objectStore(zt).get(e);if(!o||o.tabId&&o.tabId!==this.tabId)return void s();if(0===o.events.length)return this.maybeLogEmptyFiltered("storeCurrentSequence"),void s();const a=yield n.objectStore(Wt).put({sessionId:e,events:o.events,tabId:this.tabId});yield n.objectStore(zt).put({sessionId:e,events:[],tabId:this.tabId}),this.recordSuccess(),s();const{tabId:l}=o,c=i(o,["tabId"]);return Object.assign(Object.assign({},c),{sessionId:e,sequenceId:a})}catch(e){r||(t=!0,$t(this.loggerProvider,`${dt}: ${e}`,e),this.recordFailure())}}),this.addEventToCurrentSequence=(e,t)=>o(this,void 0,void 0,function*(){let r=!1,n=!1;try{const s=this.db.transaction([zt,Wt],"readwrite");s.done.catch(e=>{r||n||($t(this.loggerProvider,`${dt}: ${e}`,e),this.recordFailure())});const i=Vt(s.done,qt,()=>{r||n||(n=!0,$t(this.loggerProvider,`${dt}: transaction timed out`),this.recordFailure())}),o=yield s.objectStore(zt).get(e);if((null==o?void 0:o.tabId)&&o.tabId!==this.tabId)return o.events.length>0&&(yield s.objectStore(Wt).put({sessionId:e,events:o.events,tabId:o.tabId})),yield s.objectStore(zt).put({sessionId:e,events:[t],tabId:this.tabId}),this.recordSuccess(),void i();const a=o;if(!a)return yield s.objectStore(zt).put({sessionId:e,events:[t],tabId:this.tabId}),this.recordSuccess(),void i();if(!this.shouldSplitEventsList(a.events,t))return yield s.objectStore(zt).put({sessionId:e,events:a.events.concat(t),tabId:this.tabId}),this.recordSuccess(),void i();const l=a.events;if(0===l.length)return this.maybeLogEmptyFiltered("addEventToCurrentSequence"),yield s.objectStore(zt).put({sessionId:e,events:[t],tabId:this.tabId}),this.recordSuccess(),void i();yield s.objectStore(zt).put({sessionId:e,events:[t],tabId:this.tabId});const c=yield s.objectStore(Wt).put({sessionId:e,events:l,tabId:this.tabId});return this.recordSuccess(),i(),{events:l,sessionId:e,sequenceId:c}}catch(e){n||(r=!0,$t(this.loggerProvider,`${dt}: ${e}`,e),this.recordFailure())}}),this.storeSendingEvents=(e,t)=>o(this,void 0,void 0,function*(){try{const r=yield this.db.put(Wt,{sessionId:e,events:t,tabId:this.tabId});return this.recordSuccess(),r}catch(e){$t(this.loggerProvider,`${dt}: ${e}`,e),this.recordFailure()}}),this.cleanUpSessionEventsStore=(e,t)=>o(this,void 0,void 0,function*(){if(t)try{yield this.db.delete(Wt,t),this.recordSuccess()}catch(e){$t(this.loggerProvider,`${dt}: ${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 o(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 Gt(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 Jt(Object.assign(Object.assign({},t),{db:i,tabId:o}))}catch(e){$t(t.loggerProvider,`${dt}: ${e}`,e)}})}getCurrentSequenceEvents(e){return o(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[i(t,["tabId"])]}const t=[];for(const e of yield this.db.getAll("sessionCurrentSequence")){if(e.tabId&&e.tabId!==this.tabId)continue;const r=i(e,["tabId"]);t.push(r)}return t})}}class Kt extends Bt{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 o(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 o(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 o(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 o(this,void 0,void 0,function*(){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},this.sequenceId++})}cleanUpSessionEventsStore(e,t){return o(this,void 0,void 0,function*(){void 0!==t&&delete this.finalizedSequences[t]})}}const Yt=({config:e,minInterval:t,maxInterval:r,maxPersistedEventsSize:n,type:s,payloadBatcher:i,storeType:a,trackDestinationWorkerScript:l,shouldSend:c})=>o(void 0,void 0,void 0,function*(){var u;const h=null!==(u=e.maxSingleEventSizeBytes)&&void 0!==u?u:xe,d=new gt(Object.assign(Object.assign({},e),{loggerProvider:e.loggerProvider,payloadBatcher:i,workerScript:l})),p=()=>new Kt({loggerProvider:e.loggerProvider,maxInterval:r,minInterval:t,maxPersistedEventsSize:n});let f,g,m=!1;g="idb"===a?yield o(void 0,void 0,void 0,function*(){const i=yield Jt.new(s,{loggerProvider:e.loggerProvider,minInterval:t,maxInterval:r,maxPersistedEventsSize:n,apiKey:e.apiKey,onPersistentFailure:()=>{o(void 0,void 0,void 0,function*(){if(!m)return;m=!1,e.loggerProvider.warn("IDB store is experiencing repeated failures; falling back to in-memory event store.");const t=f?yield g.getSequencesToSend():void 0;if(g=p(),t&&f){const e=f;t.forEach(t=>{b({sequenceId:t.sequenceId,events:t.events,sessionId:t.sessionId,deviceId:e})})}})}});return i?(m=!0,i):(e.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),p())}):p();const v=[];let y=0;const w=e=>{if(e<=y)return;const t=Math.min(e-y,v.length);t>0&&(v.splice(0,t),y=e)},b=({events:t,sessionId:r,deviceId:n,sequenceId:i})=>{const a=t.map(e=>({event:e,bytes:new Blob([e]).size})),l=a.filter(e=>e.bytes>h);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.bytes/1024)} KB`).join(", ")}. If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support.`);const c=l.length>0?a.filter(e=>e.bytes<=h).map(e=>e.event):t;0!==c.length?(e.debugMode&&We().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:c,sessionId:r,flushMaxRetries:e.flushMaxRetries,apiKey:e.apiKey,deviceId:n,sampleRate:e.sampleRate,serverZone:e.serverZone,version:e.version,type:s,onComplete:()=>o(void 0,void 0,void 0,function*(){yield g.cleanUpSessionEventsStore(r,i)})})):g.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;g.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=y+v.length;v.push(t.data),g.addEventToCurrentSequence(r,t.data).then(t=>{if(t){if(!s)return g.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})=>o(void 0,void 0,void 0,function*(){f=t;const r=yield g.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 o(this,void 0,void 0,function*(){return d.flush(e)})},getBeaconEvents:()=>[...v],dropPendingBeaconEvents:()=>{w(y+v.length)},trackDestination:d}});class Xt{constructor(...e){const t=new Map;e.forEach(e=>{t.set(e.name,e.manager)}),this.managers=t}sendStoredEvents(e){return o(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 o(this,void 0,void 0,function*(){const t=[];this.managers.forEach(r=>{t.push(r.flush(e))}),yield Promise.all(t)})}}let Qt,Zt,er;function tr(e,t){if(er=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};Qt=Object.assign(Object.assign({},r),t),Zt=function(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return e;if(e===t.root)return e.ownerDocument;return e}(Qt.root,r);let n=rr(e,"all",()=>rr(e,"two",()=>rr(e,"one",()=>rr(e,"none"))));if(n){const t=yr(wr(n,e));return t.length>0&&(n=t[0]),sr(n)}throw new Error("Selector was not found.")}function rr(e,t,r){let n=null,s=[],i=e,o=0;for(;i;){const e=(new Date).getTime()-er.getTime();if(void 0!==Qt.timeoutMs&&e>Qt.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${e}ms`);let a=gr(ar(i))||gr(...lr(i))||gr(...cr(i))||gr(ur(i))||[hr()];const l=dr(i);if("all"==t)l&&(a=a.concat(a.filter(fr).map(e=>pr(e,l))));else if("two"==t)a=a.slice(0,1),l&&(a=a.concat(a.filter(fr).map(e=>pr(e,l))));else if("one"==t){const[e]=a=a.slice(0,1);l&&fr(e)&&(a=[pr(e,l)])}else"none"==t&&(a=[hr()],l&&(a=[pr(a[0],l)]));for(let e of a)e.level=o;if(s.push(a),s.length>=Qt.seedMinLength&&(n=nr(s,r),n))break;i=i.parentElement,o++}return n||(n=nr(s,r)),!n&&r?r():n}function nr(e,t){const r=yr(vr(e));if(r.length>Qt.threshold)return t?t():null;for(let e of r)if(or(e))return e;return null}function sr(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 ir(e){return e.map(e=>e.penalty).reduce((e,t)=>e+t,0)}function or(e){const t=sr(e);switch(Zt.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 ar(e){const t=e.getAttribute("id");return t&&Qt.idName(t)?{name:"#"+CSS.escape(t),penalty:0}:null}function lr(e){const t=Array.from(e.attributes).filter(e=>Qt.attr(e.name,e.value));return t.map(e=>({name:`[${CSS.escape(e.name)}="${CSS.escape(e.value)}"]`,penalty:.5}))}function cr(e){return Array.from(e.classList).filter(Qt.className).map(e=>({name:"."+CSS.escape(e),penalty:1}))}function ur(e){const t=e.tagName.toLowerCase();return Qt.tagName(t)?{name:t,penalty:2}:null}function hr(){return{name:"*",penalty:3}}function dr(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 pr(e,t){return{name:e.name+`:nth-child(${t})`,penalty:e.penalty+1}}function fr(e){return"html"!==e.name&&!e.name.startsWith("#")}function gr(...e){const t=e.filter(mr);return t.length>0?t:null}function mr(e){return null!=e}function*vr(e,t=[]){if(e.length>0)for(let r of e[0])yield*vr(e.slice(1,e.length),t.concat(r));else yield t}function yr(e){return[...e].sort((e,t)=>ir(e)-ir(t))}function*wr(e,t,r={counter:0,visited:new Map}){if(e.length>2&&e.length>Qt.optimizedMinLength)for(let n=1;n<e.length-1;n++){if(r.counter>Qt.maxNumberOfTries)return;r.counter+=1;const s=[...e];s.splice(n,1);const i=sr(s);if(r.visited.has(i))return;or(s)&&br(s,t)&&(yield s,r.visited.set(i,!0),yield*wr(s,t,r))}}function br(e,t){return Zt.querySelector(sr(e))===t}const Sr=({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}},Cr=({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 kr{constructor(e,t){this.createHook=({eventsManager:e,sessionId:t,deviceIdFn:r,mirror:n,ugcFilterRules:s,performanceOptions:i})=>o=>{if(o.type!==et.Click)return;const a=g();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=tr(p,i)}catch(e){this.logger.debug("error resolving selector from finder")}const m=ze(l.href,s),v={x:h+this.scrollWatcher.currentScrollX,y:d+this.scrollWatcher.currentScrollY,selector:f,viewportHeight:c,viewportWidth:u,pageUrl:m,timestamp:Date.now(),type:"click"},y=r();y&&e.addEvent({sessionId:t,event:{type:"interaction",data:JSON.stringify(v)},deviceId:y})},this.logger=e,this.scrollWatcher=t}}function xr(){const e=g();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function Or(){const e=g();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}class Ir{constructor(e,t){const r=g();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=De(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}send(e,t){const{sessionId:r,type:n}=this.context,s=new URLSearchParams({device_id:e,session_id:String(r),type:String(n),api_key:this.apiKey}),i=`${this.basePageUrl}?${s.toString()}`;this.sendBeacon(i,t)||this.sendXhr(i,t)}}class Er{static default(e,t){return new Er(new Ir(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=g();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:xr(),viewportWidth:Or(),pageUrl:ze(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=Or(),this._maxScrollHeight=xr(),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=Or();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=xr();this._maxScrollY=e.y;const n=e.y+r;n>this._maxScrollHeight&&(this._maxScrollHeight=n),this.timestamp=t}}}class Mr{constructor({sessionId:e,deviceId:t}){this.deviceId=t,this.sessionId=e,e&&t&&(this.sessionReplayId=((e,t)=>`${t}/${e}`)(e,t))}}const Rr=864e5,Pr=e=>`AMP_SR_START_${e.substring(0,10)}_`,Tr=(e,t)=>`${Pr(e)}${t}`,Ar=()=>{try{const e=g();return null==e?void 0:e.localStorage}catch(e){return}};const Dr=new class{constructor(){this.dbs={},this.createStore=e=>o(this,void 0,void 0,function*(){return yield Mt(e,1,{upgrade:e=>{e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})}),this.openOrCreateDB=e=>o(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})=>o(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){$t(e,`Failed to get targeting match for session id ${r}: ${t}`,t)}}),this.storeTargetingMatchForSession=({loggerProvider:e,apiKey:t,sessionId:r,targetingMatch:n})=>o(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){$t(e,`Failed to store targeting match for session id ${r}: ${t}`,t)}}),this.clearStoreOfOldSessions=({loggerProvider:e,apiKey:t,currentSessionId:r})=>o(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){$t(e,`Failed to clear old targeting matches for sessions: ${t}`,t)}})}},Nr=2654435761,Lr=2246822519,_r=3266489917,Fr=374761393;function jr(e,t){return(e<<t|e>>>32-t)>>>0}function Ur(e,t){return e=jr(e=e+Math.imul(t,Lr)>>>0,13),e=Math.imul(e,Nr)>>>0}function Br(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function $r(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+Nr+Lr>>>0,o=t+Lr>>>0,a=t>>>0,l=t-Nr>>>0;for(;i<=n-16;)e=Ur(e,Br(r,i)),i+=4,o=Ur(o,Br(r,i)),i+=4,a=Ur(a,Br(r,i)),i+=4,l=Ur(l,Br(r,i)),i+=4;s=jr(e,1)+jr(o,7)+jr(a,12)+jr(l,18)>>>0}else s=t+Fr>>>0;for(s=s+n>>>0;i<=n-4;)s=s+Math.imul(Br(r,i),_r)>>>0,s=Math.imul(jr(s,17),668265263)>>>0,i+=4;for(;i<n;)s=s+Math.imul(r[i],Fr)>>>0,s=Math.imul(jr(s,11),Nr)>>>0,i++;return s^=s>>>15,s=Math.imul(s,Lr)>>>0,s^=s>>>13,s=Math.imul(s,_r)>>>0,s^=s>>>16,s>>>0}const zr="__amplitude_url_tracking_patched__",Wr=new WeakMap;function qr(e,t,r={}){if(!(null==e?void 0:e.location))return()=>{};const{enablePolling:n=!1,pollingInterval:s=ve}=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=Wr.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[zr]=!0,t},a=e.history;if(null==a?void 0:a.pushState){const e=Reflect.get(a,"pushState");e[zr]||(a.pushState=o(e))}if(null==a?void 0:a.replaceState){const e=Reflect.get(a,"replaceState");e[zr]||(a.replaceState=o(e))}i={callbacks:r,notify:s,onPopStateOrHashChange:()=>s(),listenersAttached:!1},Wr.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 Vr(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?ze(s,l):s,title:i,viewportHeight:e,viewportWidth:t,type:"url-change-event"}})();t(n)}},g=qr(r,()=>f(),c?{enablePolling:!0,pollingInterval:u}:{});return f(),()=>g()},options:e}}class Hr{constructor(){this.pendingLoadListeners=new Map}start(){var e;null===(e=this.mutationObserver)||void 0===e||e.disconnect();g()&&(this.sendToAllIframes({type:Re,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:Re,action:"stop"})}sendToIframeAfterLoad(e){const t=()=>{this.pendingLoadListeners.delete(e),this.sendToIframe(e,{type:Re,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 Gr{constructor(){this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.trcDiagnosticSessionId=void 0,this.pageLeaveFns=[],this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,this.recordFunction=null,this.recordEventsInFlight=!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=g();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.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,s=!1)=>o(this,void 0,void 0,function*(){var i,a,l,c,u,h,d;if(this.incrementDiagnostic(rt.evalTrigger(t?"init":s?"urlchange":"event")),!this.identifiers||!this.identifiers.sessionId||!this.config)return this.incrementDiagnostic(rt.evalMissingPrereq),this.recordDiagnosticEvent(rt.evalMissingPrereq,{hasIdentifiers:!!this.identifiers,hasSessionId:!!(null===(i=this.identifiers)||void 0===i?void 0:i.sessionId),hasConfig:!!this.config,hasDeviceId:!!this.getDeviceId()}),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(this.incrementDiagnostic(rt.evalNoConfig),!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 p=this.config.targetingConfig;if(p&&!this.sessionTargetingMatch){const r=s?this.latestUrlChangeTargetingEvaluationId:void 0;let i=e.event;i&&Object.values(n).includes(i.event_type)&&(i=void 0);const f=null!==(h=null!==(l=null===(a=e.page)||void 0===a?void 0:a.url)&&void 0!==l?l:null===(u=null===(c=g())||void 0===c?void 0:c.location)||void 0===u?void 0:u.href)&&void 0!==h?h:"",m=null!==(d=e.page)&&void 0!==d?d:""!==f?{url:f}:void 0,v=Date.now(),y=yield(({sessionId:e,targetingConfig:t,loggerProvider:r,apiKey:n,targetingParams:s,urlChange:i=!1,diagnosticsClient:a,deviceId:l})=>o(void 0,void 0,void 0,function*(){var o,c,u,h;if(yield Dr.clearStoreOfOldSessions({loggerProvider:r,apiKey:n,currentSessionId:e}),!0===(yield Dr.getTargetingMatchForSession({loggerProvider:r,apiKey:n,sessionId:e}))&&!i)return!0;let d=!0;try{const{evaluateTargeting:i}=yield Promise.resolve().then(function(){return Wn}),h=Object.assign(Object.assign({},s),{flag:t,sessionId:"string"==typeof e?parseInt(e,10):e,apiKey:n,loggerProvider:r}),p=yield i(h);p&&p.sr_targeting_config&&(d="on"===p.sr_targeting_config.key);try{null==a||a.recordEvent(rt.evalResult,{sessionId:e,deviceId:l,srId:null!=l&&null!=e?`${l}/${e}`:void 0,pageUrl:null===(o=null==s?void 0:s.page)||void 0===o?void 0:o.url,variantKey:null!==(u=null===(c=null==p?void 0:p.sr_targeting_config)||void 0===c?void 0:c.key)&&void 0!==u?u:null,matched:d})}catch(e){}Dr.storeTargetingMatchForSession({loggerProvider:r,apiKey:n,sessionId:e,targetingMatch:d})}catch(t){const n=t;try{null==a||a.increment(rt.evalError),null==a||a.recordEvent(rt.evalError,{sessionId:e,deviceId:l,srId:null!=l&&null!=e?`${l}/${e}`:void 0,pageUrl:null===(h=null==s?void 0:s.page)||void 0===h?void 0:h.url,message:n.message})}catch(e){}r.warn(n.message)}return d}))({sessionId:this.identifiers.sessionId,targetingConfig:p,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:e.userProperties,event:i,page:m},urlChange:s,diagnosticsClient:this.config.diagnosticsClient,deviceId:this.getDeviceId()}),w=Date.now()-v,b=t?"init":s?"urlchange":"event";if(this.recordDiagnosticHistogram(rt.evalDurationMs,w),s&&void 0!==r&&r!==this.latestUrlChangeTargetingEvaluationId)return this.incrementDiagnostic(rt.evalStaleDiscarded),this.recordDiagnosticEvent(rt.evalStaleDiscarded,{sessionId:this.identifiers.sessionId,pageUrl:null==m?void 0:m.url,evaluationId:r,latestEvaluationId:this.latestUrlChangeTargetingEvaluationId,evalDurationMs:w}),void this.loggerProvider.debug(`Ignoring stale URL-change targeting result #${r}; latest is #${this.latestUrlChangeTargetingEvaluationId}.`);this.incrementDiagnostic(y?rt.evalMatch:rt.evalNoMatch),this.sessionTargetingMatch=this.sessionTargetingMatch||y,this.recordDiagnosticEvent(rt.evalEvent,{trigger:b,matched:y,sessionTargetingMatch:this.sessionTargetingMatch,pageUrl:null==m?void 0:m.url,hasDeviceId:!!this.getDeviceId(),hasEvent:!!i,eventType:null==i?void 0:i.event_type,userPropertyKeys:e.userProperties?Object.keys(e.userProperties):[],evalDurationMs:w}),this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:i,targetingParams:e},null,2))}else p&&this.sessionTargetingMatch&&this.incrementDiagnostic(rt.evalSkippedAlreadyMatched);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)=>o(this,void 0,void 0,function*(){try{let n;const s=this.config;if(s&&e!==Pe.METADATA&&(n={config:qe(s),version:ft},r)){const e=yield We();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.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 Te(new b)}init(e,t){return y(this._init(e,t))}setupUrlChangeListener(){var e,t;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this);const r=g();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,this.incrementDiagnostic(rt.urlChange),this.recordDiagnosticEvent(rt.urlChangeEvent,{href:e,hasTargeting:n,alreadyMatched:this.sessionTargetingMatch}),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=g())||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,a,l,c,u,h,d,p,f,m,v,y;return o(this,void 0,void 0,function*(){null===(r=this.urlChangeCleanup)||void 0===r||r.call(this),this.loggerProvider=new Te(t.loggerProvider||new b),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.currentPageUrl=Ue(),this.identifiers=new Mr({sessionId:t.sessionId,deviceId:t.deviceId});const w=Date.now();((e,t,r)=>{const n=Ar();if(!n)return;const s=Pr(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>=Rr)&&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,w,this.loggerProvider),this.sessionStartTime=void 0!==t.sessionId&&null!==(n=((e,t,r,n)=>{const s=Ar();if(!s)return;const i=Tr(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<Rr)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,w,this.loggerProvider))&&void 0!==n?n:w,this.joinedConfigGenerator=yield((e,t)=>o(void 0,void 0,void 0,function*(){const r=new He(e,t),n=new se(e,r.loggerProvider,r.serverZone,t.configServerUrl);return new nt(n,r,{sessionId:t.sessionId,deviceId:t.deviceId})}))(e,t);const{joinedConfig:S,localConfig:C,remoteConfig:k}=yield this.joinedConfigGenerator.generateJoinedConfig();if(this.config=S,this.setMetadata(t.sessionId,S,C,k,null===(s=t.version)||void 0===s?void 0:s.version,ft,null===(i=t.version)||void 0===i?void 0:i.type),this.pageLeaveFns=[],t.sessionId&&(null===(a=this.config.interactionConfig)||void 0===a?void 0:a.enabled)){const e=Er.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 kr(this.loggerProvider,e)}const x=[];let O,I,{storeType:E}=this.config;"idb"!==E||(null===(l=g())||void 0===l?void 0:l.indexedDB)||(E="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log(`Using ${E} for event storage.`);const M=g();if(this.config.useWebWorker&&M&&M.Worker){const{compressionScript:e,trackDestinationScript:t}=yield Promise.resolve().then(function(){return Vn});O=e,I=t}let R;try{R=yield Yt({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:E,trackDestinationWorkerScript:I,shouldSend:()=>!this.isBelowMinSessionDuration()}),this.rrwebEventManager=R,x.push({name:"replay",manager:R})}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?Cr:Sr;try{const t=yield Yt({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:E,trackDestinationWorkerScript:I});x.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 Xt(...x),this.eventCompressor&&this.eventCompressor.terminate();const P=!0===this.config.eagerFullSnapshotSend?()=>this.sendEvents():void 0;if(this.eventCompressor=new ut(this.eventsManager,this.config,this.getDeviceId(),O,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===(p=g())||void 0===p?void 0:p.opener){const e=he();!function(e,t){var r,n=e;if(!0!==n[de]){n[de]=!0;var s=null!==(r=null==t?void 0:t.scriptUrl)&&void 0!==r?r:"https://cdn.amplitude.com/libs/background-capture-1.0.1.js.gz",i=null,o=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(){var t,r;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Initializing background capture (external script)");var n=new URL(s,e.endpoint).toString();e.loadScriptOnce(n).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)"),i=null===(n=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===n?void 0:n.call(window,{messenger:e,onBackgroundCapture:o}),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==i?void 0:i.close)||void 0===e||e.call(i),i=null})}}(e),e.setup(Object.assign({logger:this.loggerProvider},this.config.serverZone&&{endpoint:ae[this.config.serverZone]}))}this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),this.incrementDiagnostic(rt.init),this.recordDiagnosticEvent(rt.init,{hasDeviceId:!!this.getDeviceId(),captureEnabled:this.config.captureEnabled,hasTargetingConfig:!!this.config.targetingConfig,sampleRate:this.config.sampleRate,optOut:this.shouldOptOut(),currentUrl:null===(f=this.getCurrentPageForTargeting())||void 0===f?void 0:f.url}),yield this.evaluateTargetingAndCapture({userProperties:t.userProperties,page:this.getCurrentPageForTargeting()},!0);(this.config.targetingConfig||(null!==(y=null===(v=null===(m=this.config.privacyConfig)||void 0===m?void 0:m.urlMaskLevels)||void 0===v?void 0:v.length)&&void 0!==y?y:0)>0)&&this.setupUrlChangeListener()})}setSessionId(e,t){return y(this.asyncSetSessionId(e,t))}asyncSetSessionId(e,t,r){var n,s,i,a;return o(this,void 0,void 0,function*(){const o=null===(n=this.identifiers)||void 0===n?void 0:n.sessionId,l=this.getDeviceId();if(!(void 0===o||o!==e||void 0!==t&&t!==l||void 0!==(null==r?void 0:r.userProperties)&&0!==Object.keys(r.userProperties).length))return;this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,o&&this.sendEvents(o);const c=o!==e;c&&(null===(s=this.rrwebEventManager)||void 0===s||s.dropPendingBeaconEvents());const u=t||this.getDeviceId();if(this.identifiers=new Mr({sessionId:e,deviceId:u}),c&&(this.sessionStartTime=Date.now(),this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,(null===(i=this.config)||void 0===i?void 0:i.apiKey)&&(((e,t,r,n)=>{const s=Ar();if(s)try{s.setItem(Tr(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!==o&&((e,t,r)=>{const n=Ar();if(n)try{n.removeItem(Tr(e,t))}catch(e){null==r||r.debug(`Failed to remove replay start time from storage: ${String(e)}`)}})(this.config.apiKey,o,this.loggerProvider))),this.joinedConfigGenerator&&o){const{joinedConfig:e}=yield this.joinedConfigGenerator.generateJoinedConfig();this.config=e}(null===(a=this.config)||void 0===a?void 0:a.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:F(e.apiKey).toString()}))),this.addCustomRRWebEvent(Pe.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.`),this.suppressedSendCount++,void this.incrementDiagnostic(rt.sendSuppressedMinDuration)}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(Pe.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 o(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,void 0===n&&(n=d),_.getInstance(n)).identityStore.getIdentity().optOut}var n;return void 0!==r?r:null===(t=this.config)||void 0===t?void 0:t.optOut}incrementDiagnostic(e){var t,r;try{null===(r=null===(t=this.config)||void 0===t?void 0:t.diagnosticsClient)||void 0===r||r.increment(e)}catch(e){}}recordDiagnosticHistogram(e,t){var r,n;try{null===(n=null===(r=this.config)||void 0===r?void 0:r.diagnosticsClient)||void 0===n||n.recordHistogram(e,t)}catch(e){}}recordDiagnosticEvent(e,t){var r,n,s;try{const i=null===(r=this.identifiers)||void 0===r?void 0:r.sessionId,o=this.getDeviceId();null===(s=null===(n=this.config)||void 0===n?void 0:n.diagnosticsClient)||void 0===s||s.recordEvent(e,Object.assign({sessionId:i,deviceId:o,srId:null!=o&&null!=i?`${o}/${i}`:void 0},t))}catch(e){}}recordTrcDecisionDiagnostic(e){var t,r;const n=this.config;if(!n)return;const s=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId;n.diagnosticsClient&&void 0!==s&&s!==this.trcDiagnosticSessionId&&(this.trcDiagnosticSessionId=s,this.recordDiagnosticEvent(rt.decision,{shouldRecord:e,captureEnabled:n.captureEnabled,hasTargetingConfig:!!n.targetingConfig,sessionTargetingMatch:this.sessionTargetingMatch,sampleRate:n.sampleRate,pageUrl:null===(r=this.getCurrentPageForTargeting())||void 0===r?void 0:r.url,sdkVersion:ft}))}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."),this.incrementDiagnostic(rt.gateNoIdentifiers),!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.`),this.incrementDiagnostic(rt.gateCaptureDisabled),this.recordTrcDecisionDiagnostic(!1),!1;if(this.shouldOptOut())return this.loggerProvider.log(`Opting session ${this.identifiers.sessionId} out of recording due to optOut config.`),this.incrementDiagnostic(rt.gateOptOut),this.recordTrcDecisionDiagnostic(!1),!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,this.incrementDiagnostic(rt.gateTrcMatch)):(t=`Not capturing replays for session ${this.identifiers.sessionId} due to not matching targeting conditions.`,this.loggerProvider.log(t),e=!1,r=!1,this.incrementDiagnostic(rt.gateTrcNoMatch));else{(n=this.identifiers.sessionId,s=this.config.sampleRate,$r(n.toString())%1e6/1e6<s)?(e=!0,r=!0,this.incrementDiagnostic(rt.gateSampleIn)):(t=`Opting session ${this.identifiers.sessionId} out of recording due to sample rate.`,this.loggerProvider.log(t),e=!1,r=!1,this.incrementDiagnostic(rt.gateSampleOut))}var n,s;return this.lastShouldRecordDecision!==e&&this.config.targetingConfig&&(this.addCustomRRWebEvent(Pe.TARGETING_DECISION,{message:t,sessionId:this.identifiers.sessionId,matched:r,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=e),this.recordTrcDecisionDiagnostic(e),e}getBlockSelectors(){var e,t,r;const n=null!==(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.blockSelector)&&void 0!==r?r:[];if(0!==n.length)return n}getMaskTextSelectors(){var e,t;const r=null===(e=this.config)||void 0===e?void 0:e.privacyConfig;if("conservative"===(r?Le(this.currentPageUrl,r):void 0))return"*";if(null===(t=null==r?void 0:r.urlMaskLevels)||void 0===t?void 0:t.some(e=>"conservative"===e.maskLevel))return"*";const n=null==r?void 0:r.urlMaskLevels;if("conservative"===(null==r?void 0:r.defaultMaskLevel)&&n&&n.length>0)return"*";const s=null==r?void 0:r.maskSelector;return s||void 0}getRecordingPlugins(e){var t,r,n,s,i,a;return o(this,void 0,void 0,function*(){const o=[];try{const e=Vr({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});o.push(e)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(null===(a=null==e?void 0:e.console)||void 0===a?void 0:a.enabled)try{const{getRecordConsolePlugin:t}=yield Promise.resolve().then(function(){return ol});o.push(t({level:e.console.levels}))}catch(e){this.loggerProvider.warn("Failed to load console plugin:",e)}return o.length>0?o:void 0})}getRecordFunction(){return o(this,void 0,void 0,function*(){if(this.recordFunction)return this.recordFunction;try{const{record:e}=yield Promise.resolve().then(function(){return nf});return this.recordFunction=e,e}catch(e){return this.loggerProvider.warn("Failed to load rrweb-record module:",e),null}})}recordEvents(e=!0){return o(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}}})}_recordEvents(e=!0){var t,r,n,s,i,a,l,c;return o(this,void 0,void 0,function*(){const o=this.config,u=this.getShouldRecord(),h=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId;if(!u||!h||!o)return;this.stopRecordingEvents();const d=yield this.getRecordFunction();if(!d)return this.incrementDiagnostic(rt.recordNoRecordFn),void this.recordDiagnosticEvent(rt.recordNoRecordFn,{});yield this.initializeNetworkObservers();const p=null===(r=o.loggingConfig)||void 0===r?void 0:r.network,f=De(o.serverZone,o.trackServerUrl),m=[Se,Ce,ke,f];null===(n=this.networkObservers)||void 0===n||n.start(e=>{m.some(t=>e.url.startsWith(t))||this.addCustomRRWebEvent(Pe.FETCH_REQUEST,e)},p);const{interactionConfig:v,loggingConfig:y}=o,w=(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:d.mirror,ugcFilterRules:null!==(i=v.ugcFilterRules)&&void 0!==i?i:[],performanceOptions:null===(a=o.performanceConfig)||void 0===a?void 0:a.interaction})),scroll:this.scrollHook}:{},b=(null==v?void 0:v.enabled)&&v.ugcFilterRules?v.ugcFilterRules:[];this.loggerProvider.log(`Session Replay capture beginning for ${h}.`),this.incrementDiagnostic(rt.recordStarted),this.recordDiagnosticEvent(rt.recordStarted,{});try{const t=!!(null===(l=o.crossOriginIframes)||void 0===l?void 0:l.enabled),r=!1!==(null===(c=o.crossOriginIframes)||void 0===c?void 0:c.coordinateChildren),n=t&&function(){try{const e=g();return!!e&&e.parent!==e}catch(e){return!0}}();if(n&&r)return void(this.crossOriginParentSignalCleanup=function(e){const t=g();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)===Re&&("start"===n.action?e.onStart():"stop"===n.action&&e.onStop())}return t.addEventListener("message",n),()=>t.removeEventListener("message",n)}({onStart:()=>this._recordEventsInChildMode(d,h,o,w),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()}`)}}}));this.recordCancelCallback=d(Object.assign(Object.assign({},this.buildRRWebRecordOptions(o,w,e=>{if(this.shouldOptOut())return this.loggerProvider.log(`Opting session ${h} out of recording due to optOut config.`),this.stopRecordingEvents(),void this.sendEvents();e.type===Qe.Meta&&(e.data.href=ze(e.data.href,b)),this.eventCompressor?this.eventCompressor.enqueueEvent(e,h):this.pendingEmitEvents.push({event:e,sessionId:h})},"Error while capturing replay: ")),{plugins:yield this.getRecordingPlugins(y),recordCrossOriginIframes:t})),t&&!n&&r&&(this.crossOriginIframeCoordinator||(this.crossOriginIframeCoordinator=new Hr),this.crossOriginIframeCoordinator.start()),this.addCustomRRWebEvent(Pe.DEBUG_INFO),e&&this.addCustomRRWebEvent(Pe.METADATA,this.metadata)}catch(e){this.loggerProvider.warn("Failed to initialize session replay:",e)}})}buildRRWebRecordOptions(e,t,r,n){const{privacyConfig:s}=e;return Object.assign(Object.assign({emit:r,inlineStylesheet:e.shouldInlineStylesheet,hooks:t,maskAllInputs:!0,maskTextClass:we,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:e.applyBackgroundColorToBlockedElements,maskInputFn:Fe("input",s,()=>this.currentPageUrl),maskTextFn:Fe("text",s,()=>this.currentPageUrl),maskAttributeFn:je(s,()=>this.currentPageUrl),maskTextSelector:this.getMaskTextSelectors()},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}flush(e=!1){var t;return o(this,void 0,void 0,function*(){return null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)})}shutdown(){var e,t;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())?F(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 o(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 af});this.networkObservers=new e}catch(e){this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",e)}})}}const Jr=e=>()=>{const{config:t}=e,{loggerProvider:r,logLevel:n}=t||Ve();return{logger:r,logLevel:n}};var Kr=(()=>{const e=new Gr;return{init:O(e.init.bind(e),"init",Jr(e)),evaluateTargetingAndCapture:O(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",Jr(e)),setSessionId:O(e.setSessionId.bind(e),"setSessionId",Jr(e)),getSessionId:O(e.getSessionId.bind(e),"getSessionId",Jr(e)),getSessionReplayProperties:O(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",Jr(e)),flush:O(e.flush.bind(e),"flush",Jr(e)),shutdown:O(e.shutdown.bind(e),"shutdown",Jr(e))}})();const{init:Yr,setSessionId:Xr,getSessionId:Qr,getSessionReplayProperties:Zr,flush:en,shutdown:tn,evaluateTargetingAndCapture:rn}=Kr;var nn=function(e,t){return nn=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])},nn(e,t)};var sn=function(){return sn=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},sn.apply(this,arguments)};function on(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 an="is",ln="is not",cn="contains",un="does not contain",hn="less",dn="less or equal",pn="greater",fn="greater or equal",gn="version less",mn="version less or equal",vn="version greater",yn="version greater or equal",wn="set is",bn="set is not",Sn="set contains",Cn="set does not contain",kn="set contains any",xn="set does not contain any",On="regex match",In="regex does not match",En=-862048943,Mn=461845907,Rn=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=Dn(r,o<<2);i=Pn(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,En),c=An(c,15),i^=c=Math.imul(c,Mn);break;case 2:c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,En),c=An(c,15),i^=c=Math.imul(c,Mn);break;case 1:c^=r[l],c=Math.imul(c,En),c=An(c,15),i^=c=Math.imul(c,Mn)}return Tn(i^=n)>>>0},Pn=function(e,t){var r=e,n=t;return r=Math.imul(r,En),r=An(r,15),r=Math.imul(r,Mn),n=An(n^=r,13),(n=Math.imul(n,5))+-430675100|0},Tn=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},An=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},Dn=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 Nn(r)},Nn=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Ln=function(e,t){var r,n;if(t&&0!==t.length){try{for(var s=on(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}},_n="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),Fn=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(_n).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=on(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=on(t.segments),o=i.next();!o.done;o=i.next()){var a=o.value;if(s=this.evaluateSegment(e,t,a)){var l=sn(sn(sn({},t.metadata),a.metadata),s.metadata);s=sn(sn({},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=on(r.conditions),l=a.next();!l.done;l=a.next()){var c,u=l.value,h=!0;try{for(var d=(i=void 0,on(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=Ln(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 Rn(e)},e.prototype.bucket=function(e,t){var r,n,s,i;if(!t.bucket)return t.variant;var o=this.coerceString(Ln(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=on(t.bucket.allocations),d=h.next();!d.done;d=h.next()){var p=d.value,f=p.range[0],g=p.range[1];if(c>=f&&c<g)try{for(var m=(s=void 0,on(p.distributions)),v=m.next();!v.done;v=m.next()){var y=v.value,w=y.range[0],b=y.range[1];if(u>=w&&u<b)return y.variant}}catch(e){s={error:e}}finally{try{v&&!v.done&&(i=m.return)&&i.call(m)}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 an:case cn:case hn:case dn:case pn:case fn:case gn:case mn:case vn:case yn:case wn:case Sn:case kn:return r;case ln:case un:case Cn:case xn:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case wn:return this.setEquals(e,r);case bn:return!this.setEquals(e,r);case Sn:return this.matchesSetContainsAll(e,r);case Cn:return!this.matchesSetContainsAll(e,r);case kn:return this.matchesSetContainsAny(e,r);case xn:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case an:return this.matchesIs(e,r);case ln:return!this.matchesIs(e,r);case cn:return this.matchesContains(e,r);case un:return!this.matchesContains(e,r);case hn:case dn:case pn:case fn:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case gn:case mn:case vn:case yn:return this.matchesComparable(e,t,r,function(e){return Fn.parse(e)},this.versionComparator);case On:return this.matchesRegex(e,r);case In: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=on(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 hn:case gn:return e<r;case dn:case mn:return e<=r;case pn:case vn:return e>r;case fn:case yn:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case hn:case gn:return n<0;case dn:case mn:return n<=0;case pn:case vn:return n>0;case fn:case yn: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 wn:case bn:case Sn:case Cn:case kn:case xn: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=on(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=on(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}nn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(t,e)}(Error);var Un=function(){var e=this;this.dbs={},this.createStore=function(t){return o(e,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,Mt(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 o(e,void 0,void 0,function(){var e,r;return a(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.updateEventListForSession=function(t){var r=t.sessionId,n=t.eventType,i=t.eventTime,l=t.loggerProvider,c=t.tx;return o(e,void 0,void 0,function(){var e,t,o,u,h,d,p,f,g;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=String(r),[4,c.store.get(e)];case 1:return t=a.sent(),o=t?t.eventTypes:{},u=o[n]||{},h=s(s({},o),((f={})[n]=s(s({},u),((g={})[i]={event_type:n},g)),f)),d={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,c.store.put(d)];case 2:return a.sent(),[2,h];case 3:return p=a.sent(),l.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 o(e,void 0,void 0,function(){var e,t,i,o,l,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),e=String(r),[4,s.store.getAll()];case 1:t=a.sent(),i=0,a.label=2;case 2:return i<t.length?(o=t[i],l=Date.now()-o.lastUpdated,o.sessionId!==e&&l>1728e5?[4,s.store.delete(o.sessionId)]:[3,4]):[3,5];case 3:a.sent(),a.label=4;case 4:return i++,[3,2];case 5:return[3,7];case 6:return c=a.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,l=t.apiKey;return o(e,void 0,void 0,function(){var e,t,o,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,5,,6]),[4,this.openOrCreateDB(l)];case 1:return e=a.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:s,eventTime:i})]:[2];case 2:return o=a.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return a.sent(),[4,t.done];case 4:return a.sent(),[2,o];case 5:return c=a.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(c)),[3,6];case 6:return[2,void 0]}})})}},Bn=new Un,$n=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,i=t.event,l=t.sessionId,c=t.userProperties,u=t.deviceId,h=t.page,d=t.flag;return o(e,void 0,void 0,function(){var e,t,o,p;return a(this,function(a){switch(a.label){case 0:return i&&i.time?[4,Bn.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:l,eventType:i.event_type,eventTime:i.time})]:[3,2];case 1:return t=a.sent(),[3,3];case 2:t=void 0,a.label=3;case 3:return o=(e=t)&&new Set(Object.keys(e)),p={session_id:l,event:i,event_types:o&&Array.from(o),user:s(s({},c),{device_id:u,user_properties:c}),page:h},[2,this.evaluationEngine.evaluate(p,[d])]}})})},this.evaluationEngine=new jn},zn=function(){var e=new $n;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,Wn=Object.freeze({__proto__:null,evaluateTargeting:zn});var qn,Vn=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{c(n.next(e))}catch(e){o(e)}}function i(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,i)}c((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(c){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,c])}}}"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;!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 i="Network error occurred, event batch rejected";function c(e,t){return n(this,void 0,void 0,function(){var r,o,a,i,c,u,l,d,p,f,h,v,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(),c=[],u=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];c.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,u];case 3:m.sent(),l=c.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.")}(c),h=f.next();!h.done;h=f.next())v=h.value,d.set(v,p),p+=v.length}catch(e){y={error:e}}finally{try{h&&!h.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 u(e,t){var o,u,l,d,p,f,h,v;return n(this,void 0,void 0,function(){var n,y,b,g,m,S,w,T,E,R,k,x,C,A,I;return s(this,function(s){switch(s.label){case 0:n=null!==(o=t.sendTimeoutMs)&&void 0!==o?o: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 b=s.sent(),[3,4];case 3:b=null,s.label=4;case 4:y=b,g="".concat(null!==(l=null===(u=t.version)||void 0===u?void 0:u.type)&&void 0!==l?l:"standalone","/").concat(null!==(p=null===(d=t.version)||void 0===d?void 0:d.version)&&void 0!==p?p:t.sdkVersion),m=new URLSearchParams({device_id:t.deviceId,session_id:"".concat(t.sessionId),type:t.eventType}),S="".concat((O=t.serverZone,U=t.trackServerUrl,U||("STAGING"===O?"https://api-sr.stag2.amplitude.com/sessions/v2/track":"EU"===O?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")),"?").concat(m.toString()),w=r({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(t.apiKey),"X-Client-Version":t.sdkVersion,"X-Client-Library":g,"X-Client-Url":t.currentUrl.substring(0,1e3),"X-Client-Sample-Rate":"".concat(t.sampleRate),"X-Sampling-Hash-Alg":"xxhash32"},y?{"Content-Encoding":"gzip"}:{}),T=y?y.byteLength:new Blob([e]).size,E=new AbortController,R=n>0?setTimeout(function(){E.abort()},n):void 0,k=void 0,s.label=5;case 5:return s.trys.push([5,,7,8]),[4,fetch(S,{method:"POST",headers:w,body:null!=y?y:e,keepalive:T<=65536,signal:E.signal})];case 6:return k=s.sent(),[3,8];case 7:return R&&clearTimeout(R),[7];case 8:if(null===k)return[2,{shouldRetry:!1,success:!1,message:"Unexpected error occurred"}];if(k.status>=200&&k.status<300)return x=Math.round(new Blob(t.events).size/1024),C=null!==(v=null===(h=null===(f=k.headers)||void 0===f?void 0:f.get)||void 0===h?void 0:h.call(f,"X-Session-Replay-Event-Skipped"))&&void 0!==v?v:null,[2,{shouldRetry:!1,success:!0,message:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(x," KB"),skipCode:C}];if(413!==k.status)return[3,13];A="",s.label=9;case 9:return s.trys.push([9,11,,12]),[4,k.text()];case 10:return A=s.sent(),[3,12];case 11:return s.sent(),[3,12];case 12:return[2,{shouldRetry:!1,success:!1,message:i,payloadTooLarge:!0,isWaf:a.test(A)}];case 13:return k.status>=500||408===k.status||429===k.status||499===k.status?[2,{shouldRetry:!0,success:!1,message:"HTTP ".concat(k.status)}]:[2,{shouldRetry:!1,success:!1,message:i}];case 14:return(I=s.sent())&&"object"==typeof I&&"AbortError"===I.name?[2,{shouldRetry:!0,success:!1,message:"Session replay worker request timed out after ".concat(n,"ms")}]:[2,{shouldRetry:!1,success:!1,message:String(I)}];case 15:return[2]}var O,U})})}function l(e,t,r,o){var a;return n(this,void 0,void 0,function(){var n,i,c;return s(this,function(s){switch(s.label){case 0:n=1,s.label=1;case 1:return[4,u(t,r)];case 2:return(i=s.sent()).success?(postMessage({type:"log",id:e,message:i.message}),postMessage({type:"complete",id:e,skipCode:null!==(a=i.skipCode)&&void 0!==a?a:null}),[2]):i.payloadTooLarge&&o?(postMessage({type:"payload_too_large",id:e,isWaf:!0===i.isWaf}),[2]):o&&i.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":i.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,c;return s(this,function(s){switch(s.label){case 0:return t=e.data,r=t.type,n=t.id,o=t.payload,a=t.context,i=t.useRetry,"send"!==r?[3,2]:(c=JSON.stringify(o),[4,l(n,c,a,i)]);case 1:s.sent(),s.label=2;case 2:return[2]}})})};var d=onmessage;return e.trackDestinationOnMessage=d,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n'}),Hn=Object.defineProperty,Gn=(e,t,r)=>((e,t,r)=>t in e?Hn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Jn=Object.defineProperty,Kn=(e,t,r)=>((e,t,r)=>t in e?Jn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Yn=Object.defineProperty,Xn=(e,t,r)=>((e,t,r)=>t in e?Yn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const Qn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Zn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},es={};function ts(e){if(es[e])return es[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 Qn?Qn[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 Zn?Zn[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 es[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?es[e]=i:r}catch{return r}}const rs={};function ns(e,t,r){var n;const s=`${e}.${String(r)}`;if(rs[s])return rs[s].call(t);const i=ts(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(rs[s]=o,o.call(t)):t[r]}const ss={};function is(e,t,r){const n=`${e}.${String(r)}`;if(ss[n])return ss[n].bind(t);const s=ts(e)[r];return"function"!=typeof s?t[r]:(ss[n]=s,s.bind(t))}const os={childNodes:function(e){return ns("Node",e,"childNodes")},parentNode:function(e){return ns("Node",e,"parentNode")},parentElement:function(e){return ns("Node",e,"parentElement")},textContent:function(e){return ns("Node",e,"textContent")},contains:function(e,t){return is("Node",e,"contains")(t)},getRootNode:function(e){return is("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ns("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ns("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ns("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ns("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ts("MutationObserver").constructor}};class as{constructor(){Xn(this,"idNodeMap",new Map),Xn(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 ls(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ls(os.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&ls(os.parentNode(e),t,r)}function cs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function us(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 hs,ds={exports:{}};function ps(){if(hs)return ds.exports;hs=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return ds.exports=t(),ds.exports.createColors=t,ds.exports}const fs=us(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var gs,ms;function vs(){if(ms)return gs;ms=1;let e=ps(),t=fs;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),t&&r&&(n=t(n));let s,i,o=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,o.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),i=e=>r(e)}else s=i=e=>e;return o.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=i(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+i(n)+e+"\n "+t+s("^")}return" "+i(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return gs=r,r.default=r,gs}var ys,ws,bs,Ss,Cs,ks,xs,Os,Is,Es,Ms,Rs,Ps,Ts,As,Ds,Ns,Ls,_s,Fs,js,Us,Bs,$s,zs,Ws,qs,Vs,Hs,Gs,Js,Ks,Ys,Xs,Qs,Zs,ei,ti,ri,ni,si,ii,oi,ai,li,ci,ui,hi,di,pi,fi,gi,mi,vi={};function yi(){return ys||(ys=1,vi.isClean=Symbol("isClean"),vi.my=Symbol("my")),vi}function wi(){if(bs)return ws;bs=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 ws=t,t.default=t,ws}function bi(){if(Cs)return Ss;Cs=1;let e=wi();function t(t,r){new e(r).stringify(t)}return Ss=t,t.default=t,Ss}function Si(){if(xs)return ks;xs=1;let{isClean:e,my:t}=yi(),r=vs(),n=wi(),s=bi();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}class o{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=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(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return ks=o,o.default=o,ks}function Ci(){if(Is)return Os;Is=1;let e=Si();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return Os=t,t.default=t,Os}function ki(){if(Ms)return Es;Ms=1;return Es={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},Es}function xi(){if(Ps)return Rs;Ps=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=fs,{existsSync:r,readFileSync:n}=fs,{dirname:s,join:i}=fs;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=i(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Rs=o,o.default=o,Rs}function Oi(){if(As)return Ts;As=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=fs,{fileURLToPath:r,pathToFileURL:n}=fs,{isAbsolute:s,resolve:i}=fs,{nanoid:o}=ki(),a=fs,l=vs(),c=xi(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(i&&s);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=i(t.from)),d&&h){let e=new c(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let i,o,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,a=e.col}else o=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,o,a);return i=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:a,line:o},this.css,this.file,s.plugin),i.input={column:r,endColumn:a,endLine:o,line:t,source:this.css},this.file&&(n&&(i.input.url=n(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[u])r=this[u];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[u]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:i(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,i,o){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof i&&(a=c.originalPositionFor({column:o,line:i})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(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(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(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}get from(){return this.file||this.id}}return Ts=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Ts}function Ii(){if(Ns)return Ds;Ns=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=fs,{dirname:r,relative:n,resolve:s,sep:i}=fs,{pathToFileURL:o}=fs,a=Oi(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&i);return Ds=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,s=this.toUrl(this.path(t.file)),i=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,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&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(o.generated.line=n,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=s-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let i=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=r(s(i,this.mapOpts.annotation)));let o=n(i,e);return this.memoizedPaths.set(e,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;"\\"===i&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Ds}function Ei(){if(_s)return Ls;_s=1;let e=Si();class t extends e{constructor(e){super(e),this.type="comment"}}return Ls=t,t.default=t,Ls}function Mi(){if(js)return Fs;js=1;let e,t,r,n,{isClean:s,my:i}=yi(),o=Ci(),a=Ei(),l=Si();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new o(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[i]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},Fs=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,o.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[i]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},Fs}function Ri(){if(Bs)return Us;Bs=1;let e,t,r=Mi();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},Us=n,n.default=n,Us}function Pi(){if(zs)return $s;zs=1;let e={};return $s=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Ti(){if(qs)return Ws;qs=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 Ws=e,e.default=e,Ws}function Ai(){if(Hs)return Vs;Hs=1;let e=Ti();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return Vs=t,t.default=t,Vs}function Di(){if(Ys)return Ks;Ys=1;let e=Mi();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 Ks=t,t.default=t,e.registerAtRule(t),Ks}function Ni(){if(Qs)return Xs;Qs=1;let e,t,r=Mi();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},Xs=n,n.default=n,r.registerRoot(n),Xs}function Li(){if(ei)return Zs;ei=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 Zs=e,e.default=e,Zs}function _i(){if(ri)return ti;ri=1;let e=Mi(),t=Li();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return ti=r,r.default=r,e.registerRule(r),ti}function Fi(){if(si)return ni;si=1;let e=Ci(),t=function(){if(Js)return Gs;Js=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),g=";".charCodeAt(0),m="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Gs=function(k,x={}){let O,I,E,M,R,P,T,A,D,N,L=k.css.valueOf(),_=x.ignoreErrors,F=L.length,j=0,U=[],B=[];function $(e){throw k.error("Unclosed "+e,j)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&j>=F},nextToken:function(k){if(B.length)return B.pop();if(j>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=L.charCodeAt(j),O){case s:case i:case a:case l:case o:I=j;do{I+=1,O=L.charCodeAt(I)}while(O===i||O===s||O===a||O===l||O===o);N=["space",L.slice(j,I)],j=I-1;break;case c:case u:case p:case f:case v:case g:case d:{let e=String.fromCharCode(O);N=[e,e,j];break}case h:if(A=U.length?U.pop()[1]:"",D=L.charCodeAt(j+1),"url"===A&&D!==e&&D!==t&&D!==i&&D!==s&&D!==a&&D!==o&&D!==l){I=j;do{if(P=!1,I=L.indexOf(")",I+1),-1===I){if(_||x){I=j;break}$("bracket")}for(T=I;L.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);N=["brackets",L.slice(j,I+1),j,I],j=I}else I=L.indexOf(")",j+1),M=L.slice(j,I+1),-1===I||S.test(M)?N=["(","(",j]:(N=["brackets",M,j,I],j=I);break;case e:case t:E=O===e?"'":'"',I=j;do{if(P=!1,I=L.indexOf(E,I+1),-1===I){if(_||x){I=j+1;break}$("string")}for(T=I;L.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);N=["string",L.slice(j,I+1),j,I],j=I;break;case y:w.lastIndex=j+1,w.test(L),I=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["at-word",L.slice(j,I+1),j,I],j=I;break;case r:for(I=j,R=!0;L.charCodeAt(I+1)===r;)I+=1,R=!R;if(O=L.charCodeAt(I+1),R&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(I+=1,C.test(L.charAt(I)))){for(;C.test(L.charAt(I+1));)I+=1;L.charCodeAt(I+1)===i&&(I+=1)}N=["word",L.slice(j,I+1),j,I],j=I;break;default:O===n&&L.charCodeAt(j+1)===m?(I=L.indexOf("*/",j+2)+1,0===I&&(_||x?I=L.length:$("comment")),N=["comment",L.slice(j,I+1),j,I],j=I):(b.lastIndex=j+1,b.test(L),I=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["word",L.slice(j,I+1),j,I],U.push(N),j=I)}return j++,N},position:function(){return j}}}}(),r=Ei(),n=Di(),s=Ni(),i=_i();const o={empty:!0,space:!0};return ni=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,s,i=new n;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);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&&(e=l[l.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),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(t=o,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return i}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,i=t[t.length-1];for(";"===i[0]&&(this.semicolon=!0,t.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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.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(;t.length&&(o=t[0][0],"space"===o||"comment"===o);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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 i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},ni}function ji(){if(oi)return ii;oi=1;let e=Mi(),t=Fi(),r=Oi();function n(e,n){let s=new r(e,n),i=new t(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 ii=n,n.default=n,e.registerParse(n),ii}function Ui(){if(li)return ai;li=1;let{isClean:e,my:t}=yi(),r=Ii(),n=bi(),s=Mi(),i=Ri(),o=Pi(),a=Ai(),l=ji(),c=Ni();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 g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>m(e)),t}let v={};class y{constructor(e,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)i=m(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[t]&&s.rebuild(i)}else i=m(r);this.result=new a(e,i,n),this.helpers={...v,postcss:v,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,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 t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,i=r.iterator;for(;s=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!s[e])return s[e]=!0,void t.push(g(s));r.iterator=0,delete n.indexes[i]}let i=r.events;for(;r.eventIndex<i.length;){let t=i[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return y.registerPostcss=e=>{v=e},ai=y,y.default=y,c.registerLazyResult(y),i.registerLazyResult(y),ai}function Bi(){if(di)return hi;di=1;let e=function(){if(ui)return ci;ui=1;let e=Ii(),t=bi(),r=Pi(),n=ji();const s=Ai();class i{constructor(r,n,i){let o;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=i,this._map=void 0;let a=t;this.result=new s(this._processor,o,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,n);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||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return ci=i,i.default=i,ci}(),t=Ui(),r=Ri(),n=Ni();class s{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return hi=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),hi}const $i=cs(function(){if(mi)return gi;mi=1;let e=vs(),t=Ci(),r=Ui(),n=Mi(),s=Bi(),i=bi(),o=function(){if(fi)return pi;fi=1;let e=Ci(),t=xi(),r=Ei(),n=Di(),s=Oi(),i=Ni(),o=_i();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 r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}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 e(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return pi=a,a.default=a,pi}(),a=Ri(),l=Ti(),c=Ei(),u=Di(),h=Ai(),d=Oi(),p=ji(),f=Li(),g=_i(),m=Ni(),v=Si();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return y.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new s).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return y([i(r)]).process(e,t)},i},y.stringify=i,y.parse=p,y.fromJSON=o,y.list=f,y.comment=e=>new c(e),y.atRule=e=>new u(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new m(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=s,y.Document=a,y.Comment=c,y.Warning=l,y.AtRule=u,y.Result=h,y.Input=d,y.Rule=g,y.Root=m,y.Node=v,r.registerPostcss(y),gi=y,y.default=y,gi}());$i.stringify,$i.fromJSON,$i.plugin,$i.parse,$i.list,$i.document,$i.comment,$i.atRule,$i.rule,$i.decl,$i.root,$i.CssSyntaxError,$i.Declaration,$i.Container,$i.Processor,$i.Document,$i.Comment,$i.Warning,$i.AtRule,$i.Result,$i.Input,$i.Rule,$i.Root,$i.Node;var zi=Object.defineProperty,Wi=(e,t,r)=>((e,t,r)=>t in e?zi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function qi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vi(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 Hi,Gi={exports:{}};function Ji(){if(Hi)return Gi.exports;Hi=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Gi.exports=t(),Gi.exports.createColors=t,Gi.exports}const Ki=Vi(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Yi,Xi;function Qi(){if(Xi)return Yi;Xi=1;let e=Ji(),t=Ki;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),t&&r&&(n=t(n));let s,i,o=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,o.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),i=e=>r(e)}else s=i=e=>e;return o.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=i(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+i(n)+e+"\n "+t+s("^")}return" "+i(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Yi=r,r.default=r,Yi}var Zi,eo,to,ro,no,so,io,oo,ao,lo,co,uo,ho,po,fo,go,mo,vo,yo,wo,bo,So,Co,ko,xo,Oo,Io,Eo,Mo,Ro,Po,To,Ao,Do,No,Lo,_o,Fo,jo,Uo,Bo,$o,zo,Wo,qo,Vo,Ho,Go,Jo,Ko,Yo,Xo,Qo,Zo={};function ea(){return Zi||(Zi=1,Zo.isClean=Symbol("isClean"),Zo.my=Symbol("my")),Zo}function ta(){if(to)return eo;to=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 eo=t,t.default=t,eo}function ra(){if(no)return ro;no=1;let e=ta();function t(t,r){new e(r).stringify(t)}return ro=t,t.default=t,ro}function na(){if(io)return so;io=1;let{isClean:e,my:t}=ea(),r=Qi(),n=ta(),s=ra();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}class o{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=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(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return so=o,o.default=o,so}function sa(){if(ao)return oo;ao=1;let e=na();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return oo=t,t.default=t,oo}function ia(){if(co)return lo;co=1;return lo={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},lo}function oa(){if(ho)return uo;ho=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Ki,{existsSync:r,readFileSync:n}=Ki,{dirname:s,join:i}=Ki;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=i(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return uo=o,o.default=o,uo}function aa(){if(fo)return po;fo=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Ki,{fileURLToPath:r,pathToFileURL:n}=Ki,{isAbsolute:s,resolve:i}=Ki,{nanoid:o}=ia(),a=Ki,l=Qi(),c=oa(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(i&&s);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=i(t.from)),d&&h){let e=new c(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let i,o,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,a=e.col}else o=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,o,a);return i=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:a,line:o},this.css,this.file,s.plugin),i.input={column:r,endColumn:a,endLine:o,line:t,source:this.css},this.file&&(n&&(i.input.url=n(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[u])r=this[u];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[u]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:i(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,i,o){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof i&&(a=c.originalPositionFor({column:o,line:i})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(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(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(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}get from(){return this.file||this.id}}return po=p,p.default=p,a&&a.registerInput&&a.registerInput(p),po}function la(){if(mo)return go;mo=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Ki,{dirname:r,relative:n,resolve:s,sep:i}=Ki,{pathToFileURL:o}=Ki,a=aa(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&i);return go=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,s=this.toUrl(this.path(t.file)),i=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,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&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(o.generated.line=n,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=s-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let i=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=r(s(i,this.mapOpts.annotation)));let o=n(i,e);return this.memoizedPaths.set(e,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;"\\"===i&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},go}function ca(){if(yo)return vo;yo=1;let e=na();class t extends e{constructor(e){super(e),this.type="comment"}}return vo=t,t.default=t,vo}function ua(){if(bo)return wo;bo=1;let e,t,r,n,{isClean:s,my:i}=ea(),o=sa(),a=ca(),l=na();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new o(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[i]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},wo=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,o.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[i]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},wo}function ha(){if(Co)return So;Co=1;let e,t,r=ua();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},So=n,n.default=n,So}function da(){if(xo)return ko;xo=1;let e={};return ko=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function pa(){if(Io)return Oo;Io=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 Oo=e,e.default=e,Oo}function fa(){if(Mo)return Eo;Mo=1;let e=pa();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return Eo=t,t.default=t,Eo}function ga(){if(Ao)return To;Ao=1;let e=ua();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 To=t,t.default=t,e.registerAtRule(t),To}function ma(){if(No)return Do;No=1;let e,t,r=ua();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},Do=n,n.default=n,r.registerRoot(n),Do}function va(){if(_o)return Lo;_o=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 Lo=e,e.default=e,Lo}function ya(){if(jo)return Fo;jo=1;let e=ua(),t=va();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return Fo=r,r.default=r,e.registerRule(r),Fo}function wa(){if(Bo)return Uo;Bo=1;let e=sa(),t=function(){if(Po)return Ro;Po=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),g=";".charCodeAt(0),m="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Ro=function(k,x={}){let O,I,E,M,R,P,T,A,D,N,L=k.css.valueOf(),_=x.ignoreErrors,F=L.length,j=0,U=[],B=[];function $(e){throw k.error("Unclosed "+e,j)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&j>=F},nextToken:function(k){if(B.length)return B.pop();if(j>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=L.charCodeAt(j),O){case s:case i:case a:case l:case o:I=j;do{I+=1,O=L.charCodeAt(I)}while(O===i||O===s||O===a||O===l||O===o);N=["space",L.slice(j,I)],j=I-1;break;case c:case u:case p:case f:case v:case g:case d:{let e=String.fromCharCode(O);N=[e,e,j];break}case h:if(A=U.length?U.pop()[1]:"",D=L.charCodeAt(j+1),"url"===A&&D!==e&&D!==t&&D!==i&&D!==s&&D!==a&&D!==o&&D!==l){I=j;do{if(P=!1,I=L.indexOf(")",I+1),-1===I){if(_||x){I=j;break}$("bracket")}for(T=I;L.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);N=["brackets",L.slice(j,I+1),j,I],j=I}else I=L.indexOf(")",j+1),M=L.slice(j,I+1),-1===I||S.test(M)?N=["(","(",j]:(N=["brackets",M,j,I],j=I);break;case e:case t:E=O===e?"'":'"',I=j;do{if(P=!1,I=L.indexOf(E,I+1),-1===I){if(_||x){I=j+1;break}$("string")}for(T=I;L.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);N=["string",L.slice(j,I+1),j,I],j=I;break;case y:w.lastIndex=j+1,w.test(L),I=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["at-word",L.slice(j,I+1),j,I],j=I;break;case r:for(I=j,R=!0;L.charCodeAt(I+1)===r;)I+=1,R=!R;if(O=L.charCodeAt(I+1),R&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(I+=1,C.test(L.charAt(I)))){for(;C.test(L.charAt(I+1));)I+=1;L.charCodeAt(I+1)===i&&(I+=1)}N=["word",L.slice(j,I+1),j,I],j=I;break;default:O===n&&L.charCodeAt(j+1)===m?(I=L.indexOf("*/",j+2)+1,0===I&&(_||x?I=L.length:$("comment")),N=["comment",L.slice(j,I+1),j,I],j=I):(b.lastIndex=j+1,b.test(L),I=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["word",L.slice(j,I+1),j,I],U.push(N),j=I)}return j++,N},position:function(){return j}}}}(),r=ca(),n=ga(),s=ma(),i=ya();const o={empty:!0,space:!0};return Uo=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,s,i=new n;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);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&&(e=l[l.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),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(t=o,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return i}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,i=t[t.length-1];for(";"===i[0]&&(this.semicolon=!0,t.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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.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(;t.length&&(o=t[0][0],"space"===o||"comment"===o);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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 i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Uo}function ba(){if(zo)return $o;zo=1;let e=ua(),t=wa(),r=aa();function n(e,n){let s=new r(e,n),i=new t(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 $o=n,n.default=n,e.registerParse(n),$o}function Sa(){if(qo)return Wo;qo=1;let{isClean:e,my:t}=ea(),r=la(),n=ra(),s=ua(),i=ha(),o=da(),a=fa(),l=ba(),c=ma();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 g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>m(e)),t}let v={};class y{constructor(e,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)i=m(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[t]&&s.rebuild(i)}else i=m(r);this.result=new a(e,i,n),this.helpers={...v,postcss:v,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,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 t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,i=r.iterator;for(;s=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!s[e])return s[e]=!0,void t.push(g(s));r.iterator=0,delete n.indexes[i]}let i=r.events;for(;r.eventIndex<i.length;){let t=i[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return y.registerPostcss=e=>{v=e},Wo=y,y.default=y,c.registerLazyResult(y),i.registerLazyResult(y),Wo}function Ca(){if(Jo)return Go;Jo=1;let e=function(){if(Ho)return Vo;Ho=1;let e=la(),t=ra(),r=da(),n=ba();const s=fa();class i{constructor(r,n,i){let o;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=i,this._map=void 0;let a=t;this.result=new s(this._processor,o,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,n);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||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return Vo=i,i.default=i,Vo}(),t=Sa(),r=ha(),n=ma();class s{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Go=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Go}const ka=qi(function(){if(Qo)return Xo;Qo=1;let e=Qi(),t=sa(),r=Sa(),n=ua(),s=Ca(),i=ra(),o=function(){if(Yo)return Ko;Yo=1;let e=sa(),t=oa(),r=ca(),n=ga(),s=aa(),i=ma(),o=ya();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 r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}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 e(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return Ko=a,a.default=a,Ko}(),a=ha(),l=pa(),c=ca(),u=ga(),h=fa(),d=aa(),p=ba(),f=va(),g=ya(),m=ma(),v=na();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return y.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new s).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return y([i(r)]).process(e,t)},i},y.stringify=i,y.parse=p,y.fromJSON=o,y.list=f,y.comment=e=>new c(e),y.atRule=e=>new u(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new m(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=s,y.Document=a,y.Comment=c,y.Warning=l,y.AtRule=u,y.Result=h,y.Input=d,y.Rule=g,y.Root=m,y.Node=v,r.registerPostcss(y),Xo=y,y.default=y,Xo}());ka.stringify,ka.fromJSON,ka.plugin,ka.parse,ka.list,ka.document,ka.comment,ka.atRule,ka.rule,ka.decl,ka.root,ka.CssSyntaxError,ka.Declaration,ka.Container,ka.Processor,ka.Document,ka.Comment,ka.Warning,ka.AtRule,ka.Result,ka.Input,ka.Rule,ka.Root,ka.Node;class xa{constructor(...e){Wi(this,"parentElement",null),Wi(this,"parentNode",null),Wi(this,"ownerDocument"),Wi(this,"firstChild",null),Wi(this,"lastChild",null),Wi(this,"previousSibling",null),Wi(this,"nextSibling",null),Wi(this,"ELEMENT_NODE",1),Wi(this,"TEXT_NODE",3),Wi(this,"nodeType"),Wi(this,"nodeName"),Wi(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 xa))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 Oa={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ia={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ea={};function Ma(e){if(Ea[e])return Ea[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 Oa?Oa[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 Ia?Ia[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 Ea[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?Ea[e]=i:r}catch{return r}}const Ra={};function Pa(e,t,r){var n;const s=`${e}.${String(r)}`;if(Ra[s])return Ra[s].call(t);const i=Ma(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(Ra[s]=o,o.call(t)):t[r]}const Ta={};function Aa(e,t,r){const n=`${e}.${String(r)}`;if(Ta[n])return Ta[n].bind(t);const s=Ma(e)[r];return"function"!=typeof s?t[r]:(Ta[n]=s,s.bind(t))}const Da={childNodes:function(e){return Pa("Node",e,"childNodes")},parentNode:function(e){return Pa("Node",e,"parentNode")},parentElement:function(e){return Pa("Node",e,"parentElement")},textContent:function(e){return Pa("Node",e,"textContent")},contains:function(e,t){return Aa("Node",e,"contains")(t)},getRootNode:function(e){return Aa("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Pa("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Pa("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Pa("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Pa("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ma("MutationObserver").constructor}};const Na="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 La={map:{},getId:()=>(console.error(Na),-1),getNode:()=>(console.error(Na),null),removeNodeFromMap(){console.error(Na)},has:()=>(console.error(Na),!1),reset(){console.error(Na)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(La=new Proxy(La,{get:(e,t,r)=>("map"===t&&console.error(Na),Reflect.get(e,t,r))}));let _a=Date.now;function Fa(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Da.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(_a=()=>(new Date).getTime());function ja(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Da.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Da.host(Da.getRootNode(e))&&(r=Da.host(Da.getRootNode(e))),r}function Ua(e){let t,r=e;for(;t=ja(r);)r=t;return r}function Ba(e){const t=e.ownerDocument;if(!t)return!1;const r=Ua(e);return Da.contains(t,r)}const $a=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Kn(this,"id",1),Kn(this,"styleIDMap",new WeakMap),Kn(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 La},closestElementOfNode:Fa,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:Ua,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=Da.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=Da.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 xa&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Da.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&&(Da.contains(t,e)||Ba(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&os.host(e)||null;return Boolean(t&&"shadowRoot"in t&&os.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=Da.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=Fa(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(ls(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 _a},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:Ba,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 za="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wa="undefined"==typeof Uint8Array?[]:new Uint8Array(256),qa=0;qa<64;qa++)Wa[za.charCodeAt(qa)]=qa;"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==(qn=e.contentWindow)?void 0:qn.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Va,Ha;new as,(Ha=Va||(Va={}))[Ha.NotStarted=0]="NotStarted",Ha[Ha.Running=1]="Running",Ha[Ha.Stopped=2]="Stopped";class Ga{constructor(e){Gn(this,"fileName"),Gn(this,"functionName"),Gn(this,"lineNumber"),Gn(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 Ja=/(^|@)\S+:\d+/,Ka=/^\s*at .*(\S+:\d+|\(native\))/m,Ya=/^(eval@)?(\[native code])?$/,Xa={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ka)?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(Ka)},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 Ga({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(Ya)},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 Ga({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new Ga({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 Ga({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 Ga({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(Ja)&&!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 Ga({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Qa(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 Za(e){return"[object Object]"===Object.prototype.toString.call(e)}function el(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Za(e[n])&&el(e[n],t-1))return!0;return!1}function tl(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(Za(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Za(e)&&el(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]=Qa(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 rl={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 nl(e,t,r){const n=r?Object.assign({},rl,r):rl,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=Xa.parse(s).map(e=>e.toString()),o=[tl(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=[tl(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[tl("Uncaught (in promise)",n.stringifyOptions),tl(t.reason,n.stringifyOptions)]);const i=Xa.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]?$a.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=Xa.parse(new Error).map(e=>e.toString()).splice(1),i=("assert"===r?s.slice(1):s).map(e=>tl(e,n.stringifyOptions));o++,o<n.lengthThreshold?e({level:r,trace:t,payload:i}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[tl("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}const sl="rrweb/console@1";var il,ol=Object.freeze({__proto__:null,PLUGIN_NAME:sl,getRecordConsolePlugin:e=>({name:sl,observer:nl,options:e})}),al=Object.defineProperty,ll=(e,t,r)=>((e,t,r)=>t in e?al(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),cl=Object.defineProperty,ul=(e,t,r)=>((e,t,r)=>t in e?cl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),hl=(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))(hl||{});const dl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},pl={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},fl={};function gl(e){if(fl[e])return fl[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 dl?dl[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 pl?pl[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 fl[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?fl[e]=i:r}catch{return r}}const ml={};function vl(e,t,r){var n;const s=`${e}.${String(r)}`;if(ml[s])return ml[s].call(t);const i=gl(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(ml[s]=o,o.call(t)):t[r]}const yl={};function wl(e,t,r){const n=`${e}.${String(r)}`;if(yl[n])return yl[n].bind(t);const s=gl(e)[r];return"function"!=typeof s?t[r]:(yl[n]=s,s.bind(t))}const bl={childNodes:function(e){return vl("Node",e,"childNodes")},parentNode:function(e){return vl("Node",e,"parentNode")},parentElement:function(e){return vl("Node",e,"parentElement")},textContent:function(e){return vl("Node",e,"textContent")},contains:function(e,t){return wl("Node",e,"contains")(t)},getRootNode:function(e){return wl("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?vl("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?vl("Element",e,"shadowRoot"):null},querySelector:function(e,t){return vl("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return vl("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return gl("MutationObserver").constructor}};function Sl(e){return e.nodeType===e.ELEMENT_NODE}function Cl(e){const t=e&&"host"in e&&"mode"in e&&bl.host(e)||null;return Boolean(t&&"shadowRoot"in t&&bl.shadowRoot(t)===e)}function kl(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function xl(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=>Ol(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 Ol(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=xl(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?_l(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?_l(r,t):r}}class Il{constructor(){ul(this,"idNodeMap",new Map),ul(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 El({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:i}){let o=s||"";const a=n&&Ml(n);return(t[r.toLowerCase()]||a&&t[a])&&(o=i?i(o,e):"*".repeat(o.length)),o}function Ml(e){return e.toLowerCase()}const Rl="__rrweb_original__";function Pl(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ml(t):null}function Tl(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 Al=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Dl=/^(?:[a-z+]+:)?\/\//i,Nl=/^www\..*/i,Ll=/^(data:)([^,]*),(.*)/i;function _l(e,t){return(e||"").replace(Al,(e,r,n,s,i,o)=>{const a=n||i||o,l=r||s||"";if(!a)return e;if(Dl.test(a)||Nl.test(a))return`url(${l}${a}${l})`;if(Ll.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 Fl(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=Fl(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=Fl(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=Fl(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=Fl(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 Ul="lightgrey";let Bl=1;const $l=new RegExp("[^a-z0-9-_:]");function zl(){return Bl++}let Wl,ql;const Vl=/^[^ \t\n\r\u000c]+/,Hl=/^[, \t\n\r\u000c]+/;const Gl=new WeakMap;function Jl(e,t){return t&&""!==t.trim()?Yl(e,t):t}function Kl(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Yl(e,t){let r=Gl.get(e);if(r||(r=e.createElement("a"),Gl.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Xl(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?Jl(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(Hl),!(r>=t.length);){let i=n(Vl);if(","===i.slice(-1))i=Jl(e,i.substring(0,i.length-1)),s.push(i);else{let n="";i=Jl(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?_l(n,Yl(e)):"object"===t&&"data"===r?Jl(e,n):n:Jl(e,n):n}function Ql(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Zl(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Zl(bl.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Zl(bl.parentNode(e),t,r)}function ec(e,t,r,n){let s;if(Sl(e)){if(s=e,!bl.childNodes(s).length)return!1}else{if(null===bl.parentElement(e))return!1;s=bl.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(Zl(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 tc(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:g,newlyAddedElement:m=!1,cssCaptured:v=!1,applyBackgroundColorToBlockedElements:y=!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:hl.Document,childNodes:[],compatMode:e.compatMode}:{type:hl.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:hl.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:g=!1}=t,m=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=Ml(e.tagName);return $l.test(t)?"div":t}(e);let y={};const w=e.attributes.length;for(let t=0;t<w;t++){const n=e.attributes[t];if(!Ql(v,n.name,n.value)){const t=Xl(r,v,Ml(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=xl(t)),n&&(delete y.rel,delete y.href,y._cssText=n)}if("style"===v&&e.sheet){let t=xl(e.sheet);t&&(e.childNodes.length>1&&(t=jl(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=El({element:e,type:Pl(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=Rl in s?s[Rl]: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){Wl||(Wl=r.createElement("canvas"),ql=Wl.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{Wl.width=t.naturalWidth,Wl.height=t.naturalHeight,ql.drawImage(t,0,0),y.rr_dataURL=Wl.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(m){const{width:t,height:r}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${r}px`,...g?{rr_background_color:Ul}:{}}}"iframe"!==v||d(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let b;try{customElements.get(v)&&(b=!0)}catch(e){}return{type:hl.Element,tagName:v,attributes:y,childNodes:[],isSVG:Kl(e)||void 0,needBlock:m,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:g,newlyAddedElement:m,rootId:w,applyBackgroundColorToBlockedElements:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:i}=t,o=bl.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=bl.textContent(e),c&&l&&(l=_l(l,Yl(t.doc))));!c&&!u&&l&&r&&(l=n?n(l,bl.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:hl.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:c,rootId:w,cssCaptured:v});case e.CDATA_SECTION_NODE:return{type:hl.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:hl.Comment,textContent:bl.textContent(e)||"",rootId:w};default:return!1}}function rc(e){return null==e?"":e.toLowerCase()}function nc(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:Ol(t,e.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}return{styleId:n,rules:s}})}function sc(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:g,slimDOMOptions:m,dataURLOptions:v={},inlineImages:y=!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:T}=t,{preserveWhiteSpace:A=!0}=t;if(!T){T=ec(e,l,c,void 0===T)}const D=tc(e,{doc:s,mirror:i,blockClass:o,blockSelector:a,needsMask:T,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:g,dataURLOptions:v,inlineImages:y,recordCanvas:w,keepIframeSrcFn:I,newlyAddedElement:E,cssCaptured:M,applyBackgroundColorToBlockedElements:R});if(!D)return console.warn(e,"not serialized"),null;let N;N=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===hl.Comment)return!0;if(e.type===hl.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"===Tl(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(rc(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===rc(e.attributes.name)||"icon"===rc(e.attributes.rel)||"apple-touch-icon"===rc(e.attributes.rel)||"shortcut icon"===rc(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&rc(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(rc(e.attributes.property).match(/^(og|twitter|fb):/)||rc(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===rc(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===rc(e.attributes.name)||"googlebot"===rc(e.attributes.name)||"bingbot"===rc(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===rc(e.attributes.name)||"generator"===rc(e.attributes.name)||"framework"===rc(e.attributes.name)||"publisher"===rc(e.attributes.name)||"progid"===rc(e.attributes.name)||rc(e.attributes.property).match(/^article:/)||rc(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===rc(e.attributes.name)||"yandex-verification"===rc(e.attributes.name)||"csrf-token"===rc(e.attributes.name)||"p:domain_verify"===rc(e.attributes.name)||"verify-v1"===rc(e.attributes.name)||"verification"===rc(e.attributes.name)||"shopify-checkout-api-token"===rc(e.attributes.name)))return!0}}return!1}(D,m)||!A&&D.type===hl.Text&&!D.textContent.replace(/^\s+|\s+$/gm,"").length?-2:zl();const L=Object.assign(D,{id:N});if(i.add(e,L),-2===N)return null;b&&b(e);let _=!u;if(L.type===hl.Element){_=_&&!L.needBlock,delete L.needBlock;const t=bl.shadowRoot(e);t&&kl(t)&&(L.isShadowHost=!0,S&&(null==(r=t.adoptedStyleSheets)?void 0:r.length)&&(L.adoptedStyleSheets=nc(t.adoptedStyleSheets,S,P)))}if(L.type===hl.Document&&S){const t=e;(null==(n=t.adoptedStyleSheets)?void 0:n.length)&&(L.adoptedStyleSheets=nc(t.adoptedStyleSheets,S,P))}if((L.type===hl.Document||L.type===hl.Element)&&_){m.headWhitespace&&L.type===hl.Element&&"head"===L.tagName&&(A=!1);const t={doc:s,mirror:i,blockClass:o,blockSelector:a,needsMask:T,maskTextClass:l,maskTextSelector:c,skipChild:u,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:g,slimDOMOptions:m,dataURLOptions:v,inlineImages:y,recordCanvas:w,preserveWhiteSpace:A,onSerialize:b,onAdoptedStyleSheet:S,_emittedStyleIds:P,onIframeLoad:C,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:I,cssCaptured:!1,applyBackgroundColorToBlockedElements:R};if(L.type===hl.Element&&"textarea"===L.tagName&&void 0!==L.attributes.value);else{L.type===hl.Element&&void 0!==L.attributes._cssText&&"string"==typeof L.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(bl.childNodes(e))){const e=sc(r,t);e&&L.childNodes.push(e)}}let r=null;if(Sl(e)&&(r=bl.shadowRoot(e)))for(const e of Array.from(bl.childNodes(r))){const n=sc(e,t);n&&(kl(r)&&(n.isShadow=!0),L.childNodes.push(n))}}const F=bl.parentNode(e);return F&&Cl(F)&&kl(F)&&(L.isShadow=!0),L.type===hl.Element&&"iframe"===L.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=sc(t,{doc:t,mirror:i,blockClass:o,blockSelector:a,needsMask:T,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:g,slimDOMOptions:m,dataURLOptions:v,inlineImages:y,recordCanvas:w,preserveWhiteSpace:A,onSerialize:b,onAdoptedStyleSheet:S,onIframeLoad:C,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:I});r&&C(e,r)}},k),L.type===hl.Element&&"link"===L.tagName&&"string"==typeof L.attributes.rel&&("stylesheet"===L.attributes.rel||"preload"===L.attributes.rel&&"string"==typeof L.attributes.href&&"css"===Tl(L.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=sc(e,{doc:s,mirror:i,blockClass:o,blockSelector:a,needsMask:T,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:d,maskTextFn:p,maskInputFn:f,maskAttributeFn:g,slimDOMOptions:m,dataURLOptions:v,inlineImages:y,recordCanvas:w,preserveWhiteSpace:A,onSerialize:b,onIframeLoad:C,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:I});t&&x(e,t)}},O),L}function ic(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function oc(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 ac,lc={exports:{}};function cc(){if(ac)return lc.exports;ac=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return lc.exports=t(),lc.exports.createColors=t,lc.exports}const uc=oc(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var hc,dc;function pc(){if(dc)return hc;dc=1;let e=cc(),t=uc;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),t&&r&&(n=t(n));let s,i,o=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,o.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),i=e=>r(e)}else s=i=e=>e;return o.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=i(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+i(n)+e+"\n "+t+s("^")}return" "+i(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return hc=r,r.default=r,hc}var fc,gc,mc,vc,yc,wc,bc,Sc,Cc,kc,xc,Oc,Ic,Ec,Mc,Rc,Pc,Tc,Ac,Dc,Nc,Lc,_c,Fc,jc,Uc,Bc,$c,zc,Wc,qc,Vc,Hc,Gc,Jc,Kc,Yc,Xc,Qc,Zc,eu,tu,ru,nu,su,iu,ou,au,lu,cu,uu,hu,du,pu={};function fu(){return fc||(fc=1,pu.isClean=Symbol("isClean"),pu.my=Symbol("my")),pu}function gu(){if(mc)return gc;mc=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 gc=t,t.default=t,gc}function mu(){if(yc)return vc;yc=1;let e=gu();function t(t,r){new e(r).stringify(t)}return vc=t,t.default=t,vc}function vu(){if(bc)return wc;bc=1;let{isClean:e,my:t}=fu(),r=pc(),n=gu(),s=mu();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}class o{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=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(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return wc=o,o.default=o,wc}function yu(){if(Cc)return Sc;Cc=1;let e=vu();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return Sc=t,t.default=t,Sc}function wu(){if(xc)return kc;xc=1;return kc={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},kc}function bu(){if(Ic)return Oc;Ic=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=uc,{existsSync:r,readFileSync:n}=uc,{dirname:s,join:i}=uc;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=i(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Oc=o,o.default=o,Oc}function Su(){if(Mc)return Ec;Mc=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=uc,{fileURLToPath:r,pathToFileURL:n}=uc,{isAbsolute:s,resolve:i}=uc,{nanoid:o}=wu(),a=uc,l=pc(),c=bu(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(i&&s);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=i(t.from)),d&&h){let e=new c(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let i,o,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,a=e.col}else o=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,o,a);return i=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:a,line:o},this.css,this.file,s.plugin),i.input={column:r,endColumn:a,endLine:o,line:t,source:this.css},this.file&&(n&&(i.input.url=n(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[u])r=this[u];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[u]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:i(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,i,o){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof i&&(a=c.originalPositionFor({column:o,line:i})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(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(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(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}get from(){return this.file||this.id}}return Ec=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Ec}function Cu(){if(Pc)return Rc;Pc=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=uc,{dirname:r,relative:n,resolve:s,sep:i}=uc,{pathToFileURL:o}=uc,a=Su(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&i);return Rc=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,s=this.toUrl(this.path(t.file)),i=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,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&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(o.generated.line=n,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=s-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let i=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=r(s(i,this.mapOpts.annotation)));let o=n(i,e);return this.memoizedPaths.set(e,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;"\\"===i&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Rc}function ku(){if(Ac)return Tc;Ac=1;let e=vu();class t extends e{constructor(e){super(e),this.type="comment"}}return Tc=t,t.default=t,Tc}function xu(){if(Nc)return Dc;Nc=1;let e,t,r,n,{isClean:s,my:i}=fu(),o=yu(),a=ku(),l=vu();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new o(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[i]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},Dc=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,o.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[i]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},Dc}function Ou(){if(_c)return Lc;_c=1;let e,t,r=xu();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},Lc=n,n.default=n,Lc}function Iu(){if(jc)return Fc;jc=1;let e={};return Fc=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Eu(){if(Bc)return Uc;Bc=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 Uc=e,e.default=e,Uc}function Mu(){if(zc)return $c;zc=1;let e=Eu();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return $c=t,t.default=t,$c}function Ru(){if(Hc)return Vc;Hc=1;let e=xu();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 Vc=t,t.default=t,e.registerAtRule(t),Vc}function Pu(){if(Jc)return Gc;Jc=1;let e,t,r=xu();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},Gc=n,n.default=n,r.registerRoot(n),Gc}function Tu(){if(Yc)return Kc;Yc=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 Kc=e,e.default=e,Kc}function Au(){if(Qc)return Xc;Qc=1;let e=xu(),t=Tu();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return Xc=r,r.default=r,e.registerRule(r),Xc}function Du(){if(eu)return Zc;eu=1;let e=yu(),t=function(){if(qc)return Wc;qc=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),g=";".charCodeAt(0),m="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Wc=function(k,x={}){let O,I,E,M,R,P,T,A,D,N,L=k.css.valueOf(),_=x.ignoreErrors,F=L.length,j=0,U=[],B=[];function $(e){throw k.error("Unclosed "+e,j)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&j>=F},nextToken:function(k){if(B.length)return B.pop();if(j>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=L.charCodeAt(j),O){case s:case i:case a:case l:case o:I=j;do{I+=1,O=L.charCodeAt(I)}while(O===i||O===s||O===a||O===l||O===o);N=["space",L.slice(j,I)],j=I-1;break;case c:case u:case p:case f:case v:case g:case d:{let e=String.fromCharCode(O);N=[e,e,j];break}case h:if(A=U.length?U.pop()[1]:"",D=L.charCodeAt(j+1),"url"===A&&D!==e&&D!==t&&D!==i&&D!==s&&D!==a&&D!==o&&D!==l){I=j;do{if(P=!1,I=L.indexOf(")",I+1),-1===I){if(_||x){I=j;break}$("bracket")}for(T=I;L.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);N=["brackets",L.slice(j,I+1),j,I],j=I}else I=L.indexOf(")",j+1),M=L.slice(j,I+1),-1===I||S.test(M)?N=["(","(",j]:(N=["brackets",M,j,I],j=I);break;case e:case t:E=O===e?"'":'"',I=j;do{if(P=!1,I=L.indexOf(E,I+1),-1===I){if(_||x){I=j+1;break}$("string")}for(T=I;L.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);N=["string",L.slice(j,I+1),j,I],j=I;break;case y:w.lastIndex=j+1,w.test(L),I=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["at-word",L.slice(j,I+1),j,I],j=I;break;case r:for(I=j,R=!0;L.charCodeAt(I+1)===r;)I+=1,R=!R;if(O=L.charCodeAt(I+1),R&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(I+=1,C.test(L.charAt(I)))){for(;C.test(L.charAt(I+1));)I+=1;L.charCodeAt(I+1)===i&&(I+=1)}N=["word",L.slice(j,I+1),j,I],j=I;break;default:O===n&&L.charCodeAt(j+1)===m?(I=L.indexOf("*/",j+2)+1,0===I&&(_||x?I=L.length:$("comment")),N=["comment",L.slice(j,I+1),j,I],j=I):(b.lastIndex=j+1,b.test(L),I=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["word",L.slice(j,I+1),j,I],U.push(N),j=I)}return j++,N},position:function(){return j}}}}(),r=ku(),n=Ru(),s=Pu(),i=Au();const o={empty:!0,space:!0};return Zc=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,s,i=new n;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);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&&(e=l[l.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),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(t=o,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return i}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,i=t[t.length-1];for(";"===i[0]&&(this.semicolon=!0,t.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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.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(;t.length&&(o=t[0][0],"space"===o||"comment"===o);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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 i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Zc}function Nu(){if(ru)return tu;ru=1;let e=xu(),t=Du(),r=Su();function n(e,n){let s=new r(e,n),i=new t(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 tu=n,n.default=n,e.registerParse(n),tu}function Lu(){if(su)return nu;su=1;let{isClean:e,my:t}=fu(),r=Cu(),n=mu(),s=xu(),i=Ou(),o=Iu(),a=Mu(),l=Nu(),c=Pu();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 g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>m(e)),t}let v={};class y{constructor(e,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)i=m(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[t]&&s.rebuild(i)}else i=m(r);this.result=new a(e,i,n),this.helpers={...v,postcss:v,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,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 t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,i=r.iterator;for(;s=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!s[e])return s[e]=!0,void t.push(g(s));r.iterator=0,delete n.indexes[i]}let i=r.events;for(;r.eventIndex<i.length;){let t=i[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return y.registerPostcss=e=>{v=e},nu=y,y.default=y,c.registerLazyResult(y),i.registerLazyResult(y),nu}function _u(){if(lu)return au;lu=1;let e=function(){if(ou)return iu;ou=1;let e=Cu(),t=mu(),r=Iu(),n=Nu();const s=Mu();class i{constructor(r,n,i){let o;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=i,this._map=void 0;let a=t;this.result=new s(this._processor,o,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,n);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||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return iu=i,i.default=i,iu}(),t=Lu(),r=Ou(),n=Pu();class s{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return au=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),au}var Fu=function(){if(du)return hu;du=1;let e=pc(),t=yu(),r=Lu(),n=xu(),s=_u(),i=mu(),o=function(){if(uu)return cu;uu=1;let e=yu(),t=bu(),r=ku(),n=Ru(),s=Su(),i=Pu(),o=Au();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 r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}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 e(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return cu=a,a.default=a,cu}(),a=Ou(),l=Eu(),c=ku(),u=Ru(),h=Mu(),d=Su(),p=Nu(),f=Tu(),g=Au(),m=Pu(),v=vu();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return y.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new s).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return y([i(r)]).process(e,t)},i},y.stringify=i,y.parse=p,y.fromJSON=o,y.list=f,y.comment=e=>new c(e),y.atRule=e=>new u(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new m(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=s,y.Document=a,y.Comment=c,y.Warning=l,y.AtRule=u,y.Result=h,y.Input=d,y.Rule=g,y.Root=m,y.Node=v,r.registerPostcss(y),hu=y,y.default=y,hu}();const ju=ic(Fu);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 Uu=Object.defineProperty,Bu=(e,t,r)=>((e,t,r)=>t in e?Uu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function $u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zu(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 Wu,qu={exports:{}};function Vu(){if(Wu)return qu.exports;Wu=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return qu.exports=t(),qu.exports.createColors=t,qu.exports}const Hu=zu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Gu,Ju;function Ku(){if(Ju)return Gu;Ju=1;let e=Vu(),t=Hu;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),t&&r&&(n=t(n));let s,i,o=n.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,o.length),c=String(l).length;if(r){let{bold:t,gray:r,red:n}=e.createColors(!0);s=e=>t(n(e)),i=e=>r(e)}else s=i=e=>e;return o.slice(a,l).map((e,t)=>{let r=a+1+t,n=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=i(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+i(n)+e+"\n "+t+s("^")}return" "+i(n)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}return Gu=r,r.default=r,Gu}var Yu,Xu,Qu,Zu,eh,th,rh,nh,sh,ih,oh,ah,lh,ch,uh,hh,dh,ph,fh,gh,mh,vh,yh,wh,bh,Sh,Ch,kh,xh,Oh,Ih,Eh,Mh,Rh,Ph,Th,Ah,Dh,Nh,Lh,_h,Fh,jh,Uh,Bh,$h,zh,Wh,qh,Vh,Hh,Gh,Jh,Kh={};function Yh(){return Yu||(Yu=1,Kh.isClean=Symbol("isClean"),Kh.my=Symbol("my")),Kh}function Xh(){if(Qu)return Xu;Qu=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 Xu=t,t.default=t,Xu}function Qh(){if(eh)return Zu;eh=1;let e=Xh();function t(t,r){new e(r).stringify(t)}return Zu=t,t.default=t,Zu}function Zh(){if(rh)return th;rh=1;let{isClean:e,my:t}=Yh(),r=Ku(),n=Xh(),s=Qh();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}class o{constructor(r={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in r)if("nodes"===e){this.nodes=[];for(let t of r[e])"function"==typeof t.clone?this.append(t.clone()):this.append(t)}else this[e]=r[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=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(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new n).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let 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){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=s){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}}return th=o,o.default=o,th}function ed(){if(sh)return nh;sh=1;let e=Zh();class t extends e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}return nh=t,t.default=t,nh}function td(){if(oh)return ih;oh=1;return ih={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(r=t)=>{let n="",s=r;for(;s--;)n+=e[Math.random()*e.length|0];return n}},ih}function rd(){if(lh)return ah;lh=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Hu,{existsSync:r,readFileSync:n}=Hu,{dirname:s,join:i}=Hu;class o{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=s(e),r(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}loadMap(r,n){if(!1===n)return!1;if(n){if("string"==typeof n)return n;if("function"!=typeof n){if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}{let e=n(r);if(e){let t=this.loadFile(e);if(!t)throw new Error("Unable to load previous source map: "+e.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return r&&(e=i(s(r),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return ah=o,o.default=o,ah}function nd(){if(uh)return ch;uh=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Hu,{fileURLToPath:r,pathToFileURL:n}=Hu,{isAbsolute:s,resolve:i}=Hu,{nanoid:o}=td(),a=Hu,l=Ku(),c=rd(),u=Symbol("fromOffsetCache"),h=Boolean(e&&t),d=Boolean(i&&s);class p{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!d||/^\w+:\/\//.test(t.from)||s(t.from)?this.file=t.from:this.file=i(t.from)),d&&h){let e=new c(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let i,o,a;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,a=e.col}else o=n.line,a=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let c=this.origin(t,r,o,a);return i=c?new l(e,void 0===c.endLine?c.line:{column:c.column,line:c.line},void 0===c.endLine?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,s.plugin):new l(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:a,line:o},this.css,this.file,s.plugin),i.input={column:r,endColumn:a,endLine:o,line:t,source:this.css},this.file&&(n&&(i.input.url=n(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,r;if(this[u])r=this[u];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[u]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:i(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,i,o){if(!this.map)return!1;let a,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof i&&(a=c.originalPositionFor({column:o,line:i})),l=s(u.source)?n(u.source):new URL(u.source,this.map.consumer().sourceRoot||n(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(!r)throw new Error("file: protocol is not available in this PostCSS build");h.file=r(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}get from(){return this.file||this.id}}return ch=p,p.default=p,a&&a.registerInput&&a.registerInput(p),ch}function sd(){if(dh)return hh;dh=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Hu,{dirname:r,relative:n,resolve:s,sep:i}=Hu,{pathToFileURL:o}=Hu,a=nd(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&i);return hh=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let t of this.previous()){let n,s=this.toUrl(this.path(t.file)),i=t.root||r(t.file);!1===this.mapOpts.sourcesContent?(n=new e(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,s,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&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),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=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e,r,n=1,s=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(t,a,l)=>{if(this.css+=t,a&&"end"!==l&&(o.generated.line=n,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=t.match(/\n/g),e?(n+=e.length,r=t.lastIndexOf("\n"),s=t.length-r):s+=t.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=s-2,this.map.addMapping(o)):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let i=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=r(s(i,this.mapOpts.annotation)));let o=n(i,e);return this.memoizedPaths.set(e,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;"\\"===i&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},hh}function id(){if(fh)return ph;fh=1;let e=Zh();class t extends e{constructor(e){super(e),this.type="comment"}}return ph=t,t.default=t,ph}function od(){if(mh)return gh;mh=1;let e,t,r,n,{isClean:s,my:i}=Yh(),o=ed(),a=id(),l=Zh();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[s]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)u(t)}class h extends l{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),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(n,l){if("string"==typeof n)n=c(e(n).nodes);else if(void 0===n)n=[];else if(Array.isArray(n)){n=n.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===n.type&&"document"!==this.type){n=n.nodes.slice(0);for(let e of n)e.parent&&e.parent.removeChild(e,"ignore")}else if(n.type)n=[n];else if(n.prop){if(void 0===n.value)throw new Error("Value field is missed in node creation");"string"!=typeof n.value&&(n.value=String(n.value)),n=[new o(n)]}else if(n.selector)n=[new t(n)];else if(n.name)n=[new r(n)];else{if(!n.text)throw new Error("Unknown node type in node creation");n=[new a(n)]}return n.map(e=>(e[i]||h.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&u(e),void 0===e.raws.before&&l&&void 0!==l.raws.before&&(e.raws.before=l.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return h.registerParse=t=>{e=t},h.registerRule=e=>{t=e},h.registerAtRule=e=>{r=e},h.registerRoot=e=>{n=e},gh=h,h.default=h,h.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,t.prototype):"decl"===e.type?Object.setPrototypeOf(e,o.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,n.prototype),e[i]=!0,e.nodes&&e.nodes.forEach(e=>{h.rebuild(e)})},gh}function ad(){if(yh)return vh;yh=1;let e,t,r=od();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},vh=n,n.default=n,vh}function ld(){if(bh)return wh;bh=1;let e={};return wh=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function cd(){if(Ch)return Sh;Ch=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 Sh=e,e.default=e,Sh}function ud(){if(xh)return kh;xh=1;let e=cd();class t{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let n=new e(t,r);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}}return kh=t,t.default=t,kh}function hd(){if(Mh)return Eh;Mh=1;let e=od();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 Eh=t,t.default=t,e.registerAtRule(t),Eh}function dd(){if(Ph)return Rh;Ph=1;let e,t,r=od();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},Rh=n,n.default=n,r.registerRoot(n),Rh}function pd(){if(Ah)return Th;Ah=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 Th=e,e.default=e,Th}function fd(){if(Nh)return Dh;Nh=1;let e=od(),t=pd();class r extends e{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}}return Dh=r,r.default=r,e.registerRule(r),Dh}function gd(){if(_h)return Lh;_h=1;let e=ed(),t=function(){if(Ih)return Oh;Ih=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),g=";".charCodeAt(0),m="*".charCodeAt(0),v=":".charCodeAt(0),y="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,b=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,C=/[\da-f]/i;return Oh=function(k,x={}){let O,I,E,M,R,P,T,A,D,N,L=k.css.valueOf(),_=x.ignoreErrors,F=L.length,j=0,U=[],B=[];function $(e){throw k.error("Unclosed "+e,j)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&j>=F},nextToken:function(k){if(B.length)return B.pop();if(j>=F)return;let x=!!k&&k.ignoreUnclosed;switch(O=L.charCodeAt(j),O){case s:case i:case a:case l:case o:I=j;do{I+=1,O=L.charCodeAt(I)}while(O===i||O===s||O===a||O===l||O===o);N=["space",L.slice(j,I)],j=I-1;break;case c:case u:case p:case f:case v:case g:case d:{let e=String.fromCharCode(O);N=[e,e,j];break}case h:if(A=U.length?U.pop()[1]:"",D=L.charCodeAt(j+1),"url"===A&&D!==e&&D!==t&&D!==i&&D!==s&&D!==a&&D!==o&&D!==l){I=j;do{if(P=!1,I=L.indexOf(")",I+1),-1===I){if(_||x){I=j;break}$("bracket")}for(T=I;L.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);N=["brackets",L.slice(j,I+1),j,I],j=I}else I=L.indexOf(")",j+1),M=L.slice(j,I+1),-1===I||S.test(M)?N=["(","(",j]:(N=["brackets",M,j,I],j=I);break;case e:case t:E=O===e?"'":'"',I=j;do{if(P=!1,I=L.indexOf(E,I+1),-1===I){if(_||x){I=j+1;break}$("string")}for(T=I;L.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);N=["string",L.slice(j,I+1),j,I],j=I;break;case y:w.lastIndex=j+1,w.test(L),I=0===w.lastIndex?L.length-1:w.lastIndex-2,N=["at-word",L.slice(j,I+1),j,I],j=I;break;case r:for(I=j,R=!0;L.charCodeAt(I+1)===r;)I+=1,R=!R;if(O=L.charCodeAt(I+1),R&&O!==n&&O!==i&&O!==s&&O!==a&&O!==l&&O!==o&&(I+=1,C.test(L.charAt(I)))){for(;C.test(L.charAt(I+1));)I+=1;L.charCodeAt(I+1)===i&&(I+=1)}N=["word",L.slice(j,I+1),j,I],j=I;break;default:O===n&&L.charCodeAt(j+1)===m?(I=L.indexOf("*/",j+2)+1,0===I&&(_||x?I=L.length:$("comment")),N=["comment",L.slice(j,I+1),j,I],j=I):(b.lastIndex=j+1,b.test(L),I=0===b.lastIndex?L.length-1:b.lastIndex-2,N=["word",L.slice(j,I+1),j,I],U.push(N),j=I)}return j++,N},position:function(){return j}}}}(),r=id(),n=hd(),s=dd(),i=fd();const o={empty:!0,space:!0};return Lh=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,s,i=new n;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(s=l.length-1,r=l[s];r&&"space"===r[0];)r=l[--s];r&&(i.source.end=this.getPosition(r[3]||r[2]),i.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);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&&(e=l[l.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),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(t=o,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return i}this.doubleColon(t)}n=t}return!1}comment(e){let t=new r;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,r){let n=new e;this.init(n,t[0][2]);let s,i=t[t.length-1];for(";"===i[0]&&(this.semicolon=!0,t.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}}(t)),n.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),n.raws.before+=t.shift()[1];for(n.source.start=this.getPosition(t[0][2]),n.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;n.prop+=t.shift()[1]}for(n.raws.between="";t.length;){if(s=t.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(;t.length&&(o=t[0][0],"space"===o||"comment"===o);)a.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){n.important=!0;let r=this.stringFrom(t,e);r=this.spacesFromEnd(t)+r," !important"!==r&&(n.raws.important=r);break}if("important"===s[1].toLowerCase()){let r=t.slice(0),s="";for(let t=e;t>0;t--){let e=r[t][0];if(0===s.trim().indexOf("!")&&"space"!==e)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,t=r)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(n,"value",a.concat(t),r),n.value.includes(":")&&!r&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,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 i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Lh}function md(){if(jh)return Fh;jh=1;let e=od(),t=gd(),r=nd();function n(e,n){let s=new r(e,n),i=new t(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 Fh=n,n.default=n,e.registerParse(n),Fh}function vd(){if(Bh)return Uh;Bh=1;let{isClean:e,my:t}=Yh(),r=sd(),n=Qh(),s=od(),i=ad(),o=ld(),a=ud(),l=md(),c=dd();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 g(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:f(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function m(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>m(e)),t}let v={};class y{constructor(e,r,n){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof y||r instanceof a)i=m(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=l;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{i=e(r,n)}catch(e){this.processed=!0,this.error=e}i&&!i[t]&&s.rebuild(i)}else i=m(r);this.result=new a(e,i,n),this.helpers={...v,postcss:v,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,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 t=this.result.root;for(;!t[e];){t[e]=!0;let r=[g(t)];for(;r.length>0;){let e=this.visitTick(r);if(p(e))try{await e}catch(e){let t=r[r.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,r]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(e=>r(e,this.helpers));await Promise.all(e)}else await r(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=n;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new r(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(p(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let r=t[t.length-1],{node:n,visitors:s}=r;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void t.pop();if(s.length>0&&r.visitorIndex<s.length){let[e,t]=s[r.visitorIndex];r.visitorIndex+=1,r.visitorIndex===s.length&&(r.visitors=[],r.visitorIndex=0),this.result.lastPlugin=e;try{return t(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==r.iterator){let s,i=r.iterator;for(;s=n.nodes[n.indexes[i]];)if(n.indexes[i]+=1,!s[e])return s[e]=!0,void t.push(g(s));r.iterator=0,delete n.indexes[i]}let i=r.events;for(;r.eventIndex<i.length;){let t=i[r.eventIndex];if(r.eventIndex+=1,0===t)return void(n.nodes&&n.nodes.length&&(n[e]=!0,r.iterator=n.getIterator()));if(this.listeners[t])return void(r.visitors=this.listeners[t])}t.pop()}walkSync(t){t[e]=!0;let r=f(t);for(let n of r)if(0===n)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[n];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return y.registerPostcss=e=>{v=e},Uh=y,y.default=y,c.registerLazyResult(y),i.registerLazyResult(y),Uh}function yd(){if(qh)return Wh;qh=1;let e=function(){if(zh)return $h;zh=1;let e=sd(),t=Qh(),r=ld(),n=md();const s=ud();class i{constructor(r,n,i){let o;n=n.toString(),this.stringified=!1,this._processor=r,this._css=n,this._opts=i,this._map=void 0;let a=t;this.result=new s(this._processor,o,this._opts),this.result.css=n;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new e(a,o,this._opts,n);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||r("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}return $h=i,i.default=i,$h}(),t=vd(),r=ad(),n=dd();class s{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(r,n={}){return this.plugins.length||n.parser||n.stringifier||n.syntax?new t(this,r,n):new e(this,r,n)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Wh=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Wh}var wd=function(){if(Jh)return Gh;Jh=1;let e=Ku(),t=ed(),r=vd(),n=od(),s=yd(),i=Qh(),o=function(){if(Hh)return Vh;Hh=1;let e=ed(),t=rd(),r=id(),n=hd(),s=nd(),i=dd(),o=fd();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 r={...e,__proto__:s.prototype};r.map&&(r.map={...r.map,__proto__:t.prototype}),c.push(r)}}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 e(h);if("rule"===h.type)return new o(h);if("comment"===h.type)return new r(h);if("atrule"===h.type)return new n(h);throw new Error("Unknown node type: "+l.type)}return Vh=a,a.default=a,Vh}(),a=ad(),l=cd(),c=id(),u=hd(),h=ud(),d=nd(),p=md(),f=pd(),g=fd(),m=dd(),v=Zh();function y(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new s(e)}return y.plugin=function(e,t){let r,n=!1;function i(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...r);return i.postcssPlugin=e,i.postcssVersion=(new s).version,i}return Object.defineProperty(i,"postcss",{get:()=>(r||(r=i()),r)}),i.process=function(e,t,r){return y([i(r)]).process(e,t)},i},y.stringify=i,y.parse=p,y.fromJSON=o,y.list=f,y.comment=e=>new c(e),y.atRule=e=>new u(e),y.decl=e=>new t(e),y.rule=e=>new g(e),y.root=e=>new m(e),y.document=e=>new a(e),y.CssSyntaxError=e,y.Declaration=t,y.Container=n,y.Processor=s,y.Document=a,y.Comment=c,y.Warning=l,y.AtRule=u,y.Result=h,y.Input=d,y.Rule=g,y.Root=m,y.Node=v,r.registerPostcss(y),Gh=y,y.default=y,Gh}();const bd=$u(wd);bd.stringify,bd.fromJSON,bd.plugin,bd.parse,bd.list,bd.document,bd.comment,bd.atRule,bd.rule,bd.decl,bd.root,bd.CssSyntaxError,bd.Declaration,bd.Container,bd.Processor,bd.Document,bd.Comment,bd.Warning,bd.AtRule,bd.Result,bd.Input,bd.Rule,bd.Root,bd.Node;class Sd{constructor(...e){Bu(this,"parentElement",null),Bu(this,"parentNode",null),Bu(this,"ownerDocument"),Bu(this,"firstChild",null),Bu(this,"lastChild",null),Bu(this,"previousSibling",null),Bu(this,"nextSibling",null),Bu(this,"ELEMENT_NODE",1),Bu(this,"TEXT_NODE",3),Bu(this,"nodeType"),Bu(this,"nodeName"),Bu(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 Sd))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 Cd={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},kd={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},xd={};function Od(e){if(xd[e])return xd[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 Cd?Cd[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 kd?kd[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 xd[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?xd[e]=i:r}catch{return r}}const Id={};function Ed(e,t,r){var n;const s=`${e}.${String(r)}`;if(Id[s])return Id[s].call(t);const i=Od(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(Id[s]=o,o.call(t)):t[r]}const Md={};function Rd(e,t,r){const n=`${e}.${String(r)}`;if(Md[n])return Md[n].bind(t);const s=Od(e)[r];return"function"!=typeof s?t[r]:(Md[n]=s,s.bind(t))}function Pd(){return Od("MutationObserver").constructor}const Td={childNodes:function(e){return Ed("Node",e,"childNodes")},parentNode:function(e){return Ed("Node",e,"parentNode")},parentElement:function(e){return Ed("Node",e,"parentElement")},textContent:function(e){return Ed("Node",e,"textContent")},contains:function(e,t){return Rd("Node",e,"contains")(t)},getRootNode:function(e){return Rd("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ed("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ed("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ed("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ed("Element",e,"querySelectorAll")(t)},mutationObserver:Pd};function Ad(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Dd="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 Nd={map:{},getId:()=>(console.error(Dd),-1),getNode:()=>(console.error(Dd),null),removeNodeFromMap(){console.error(Dd)},has:()=>(console.error(Dd),!1),reset(){console.error(Dd)}};function Ld(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 _d(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)}}),()=>_d(e,t,i||{},!0)}function Fd(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&&(Nd=new Proxy(Nd,{get:(e,t,r)=>("map"===t&&console.error(Dd),Reflect.get(e,t,r))}));let jd=Date.now;function Ud(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=Td.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=Td.parentElement(i.body))?void 0:n.scrollTop)||(null==(s=null==i?void 0:i.body)?void 0:s.scrollTop)||0}}function Bd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function $d(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function zd(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Td.parentElement(e)}function Wd(e,t,r,n){if(!e)return!1;const s=zd(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(Zl(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 qd(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function Vd(e,t){if(Cl(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Td.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Vd(n,t))}function Hd(e){return Boolean(e.changedTouches)}function Gd(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Jd(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Kd(e){return!!e&&(e instanceof Sd&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Td.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(jd=()=>(new Date).getTime());class Yd{constructor(){ll(this,"id",1),ll(this,"styleIDMap",new WeakMap),ll(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 Xd(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Td.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Td.host(Td.getRootNode(e))&&(r=Td.host(Td.getRootNode(e))),r}function Qd(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=Xd(r);)r=t;return r}(e);return Td.contains(t,r)}function Zd(e){const t=e.ownerDocument;return!!t&&(Td.contains(t,e)||Qd(e))}var ep=(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))(ep||{}),tp=(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))(tp||{}),rp=(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))(rp||{}),np=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(np||{}),sp=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(sp||{}),ip=(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))(ip||{}),op=(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))(op||{});function ap(e){return"__ln"in e}class lp{constructor(){ll(this,"length",0),ll(this,"head",null),ll(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&&ap(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&&ap(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 cp=(e,t)=>`${e}@${t}`;class up{constructor(){ll(this,"frozen",!1),ll(this,"locked",!1),ll(this,"texts",[]),ll(this,"attributes",[]),ll(this,"attributeMap",new WeakMap),ll(this,"removes",[]),ll(this,"mapRemoves",[]),ll(this,"movedMap",{}),ll(this,"addedSet",new Set),ll(this,"movedSet",new Set),ll(this,"droppedSet",new Set),ll(this,"removesSubTreeCache",new Set),ll(this,"mutationCb"),ll(this,"blockClass"),ll(this,"blockSelector"),ll(this,"maskTextClass"),ll(this,"maskTextSelector"),ll(this,"inlineStylesheet"),ll(this,"maskInputOptions"),ll(this,"maskTextFn"),ll(this,"maskInputFn"),ll(this,"maskAttributeFn"),ll(this,"keepIframeSrcFn"),ll(this,"recordCanvas"),ll(this,"inlineImages"),ll(this,"slimDOMOptions"),ll(this,"dataURLOptions"),ll(this,"doc"),ll(this,"mirror"),ll(this,"iframeManager"),ll(this,"stylesheetManager"),ll(this,"shadowDomManager"),ll(this,"canvasManager"),ll(this,"processedNodeManager"),ll(this,"unattachedDoc"),ll(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),ll(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new lp,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=Td.parentNode(s);if(!i||!Zd(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=Cl(i)?this.mirror.getId(Xd(s)):this.mirror.getId(i),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=sc(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=>{Gd(e,this.mirror)&&this.iframeManager.addIframe(e),Jd(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Kd(s)&&this.shadowDomManager.addShadowRoot(Td.shadowRoot(s),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},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)dp(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Td.parentNode(e))||s(e);for(const e of this.addedSet)pp(this.droppedSet,e)||dp(this.removesSubTreeCache,e,this.mirror)?pp(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(Td.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(Td.parentNode(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Td.parentNode(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Td.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=Td.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))}),ll(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(Td.childNodes(e),e=>Td.textContent(e)||"").join("");t.attributes.value=El({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Pl(e),value:r,maskInputFn:this.maskInputFn})}),ll(this,"processMutation",e=>{if(!qd(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Td.textContent(e.target);Wd(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ec(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,zd(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=Pl(t);n=El({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(Wd(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"),!Ql(t.tagName,r)){if(s.attributes[r]=Xl(this.doc,Ml(t.tagName),Ml(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(Wd(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=Cl(e.target)?this.mirror.getId(Td.host(e.target)):this.mirror.getId(e.target);Wd(e.target,this.blockClass,this.blockSelector,!1)||qd(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(hp(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Vd(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[cp(r,n)]?hp(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!Cl(e.target)||!kl(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Td.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),ll(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(qd(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[cp(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Wd(e,this.blockClass,this.blockSelector,!1)||(Td.childNodes(e).forEach(e=>this.genAdds(e)),Kd(e)&&Td.childNodes(Td.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"].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 hp(e,t){e.delete(t),Td.childNodes(t).forEach(t=>hp(e,t))}function dp(e,t,r){return 0!==e.size&&function(e,t){const r=Td.parentNode(t);return!!r&&e.has(r)}(e,t)}function pp(e,t){return 0!==e.size&&fp(e,t)}function fp(e,t){const r=Td.parentNode(t);return!!r&&(!!e.has(r)||fp(e,r))}let gp;const mp=e=>{if(!gp)return e;return(...t)=>{try{return e(...t)}catch(e){if(gp&&!0===gp(e))return;throw e}}};function vp(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const yp=[];function wp(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 bp(e,t){const r=new up;yp.push(r),r.init(e);const n=new(Pd())(mp(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function Sp({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(rp).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]).forEach(i=>{let o=Ml(i);const c=(t=>i=>{const o=wp(i);if(Wd(o,n,s,!0))return;let a=null,c=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=np.Mouse;break;case"touch":a=np.Touch;break;case"pen":a=np.Pen}a===np.Touch?rp[t]===rp.MouseDown?c="TouchStart":rp[t]===rp.MouseUp&&(c="TouchEnd"):np.Pen}else Hd(i)&&(a=np.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===np.Touch||c.startsWith("Mouse")&&a===np.Mouse)&&(a=null)):rp[t]===rp.Click&&(a=l,l=null);const u=Hd(i)?i.changedTouches[0]:i;if(!u)return;const h=r.getId(o),{clientX:d,clientY:p}=u;mp(e)({type:rp[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(i);if(window.PointerEvent)switch(rp[i]){case rp.MouseDown:case rp.MouseUp:o=o.replace("mouse","pointer");break;case rp.TouchStart:case rp.TouchEnd:return}a.push(Ad(o,c,t))}),mp(()=>{a.forEach(e=>e())})}function Cp({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){const o=mp(Ld(mp(i=>{const o=wp(i);if(!o||Wd(o,n,s,!0))return;const a=r.getId(o);if(o===t&&t.defaultView){const r=Ud(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 Ad("scroll",o,t)}const kp=["INPUT","TEXTAREA","SELECT"],xp=new WeakMap;function Op(e){return function(e,t){if(Rp("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Rp("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Rp("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Rp("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Ip(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Ep({mirror:e,stylesheetManager:t},r){var n,s,i;let o=null;o="#document"===r.nodeName?e.getId(r):e.getId(Td.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}}),mp(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Mp(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb: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)},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=bp(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=Ld(mp(t=>{const r=Date.now()-o;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],o=null}),i),c=mp(Ld(mp(e=>{const t=wp(e),{clientX:r,clientY:s}=Hd(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?tp.Drag:e instanceof MouseEvent?tp.MouseMove:tp.TouchMove)}),s,{trailing:!1})),u=[Ad("mousemove",c,r),Ad("touchmove",c,r),Ad("drag",c,r)];return mp(()=>{u.forEach(e=>e())})}(e),i=Sp(e),o=Cp(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Ad("resize",mp(Ld(mp(()=>{const t=Bd(),s=$d();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=wp(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=Td.parentElement(r)),!r||!h||kp.indexOf(h)<0||Wd(r,n,s,!0))return;if(r.classList.contains(i)||o&&r.matches(o))return;let p=r.value,f=!1;const g=Pl(r)||"";"radio"===g||"checkbox"===g?f=r.checked:(a[h.toLowerCase()]||a[g])&&(p=El({element:r,maskInputOptions:a,tagName:h,type:g,value:p,maskInputFn:l})),d(r,u?{text:p,isChecked:f,userTriggered:c}:{text:p,isChecked:f});const m=r.name;"radio"===g&&m&&f&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach(e=>{if(e!==r){const t=e.value;d(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function d(t,n){const s=xp.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){xp.set(t,n);const s=r.getId(t);mp(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>Ad(e,mp(h),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push(...m.map(e=>_d(e[0],e[1],{set(){mp(h)({target:this,isTrusted:!1})}},!1,f))),mp(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:i}){const o=mp(i=>Ld(mp(s=>{const o=wp(s);if(!o||Wd(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=[Ad("play",o(ip.Play),i),Ad("pause",o(ip.Pause),i),Ad("seeked",o(ip.Seeked),i),Ad("volumechange",o(ip.VolumeChange),i),Ad("ratechange",o(ip.RateChange),i)];return mp(()=>{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:mp((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=Ip(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:a}]}),vp(()=>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:mp((n,s,i)=>{const[o]=i,{id:a,styleId:l}=Ip(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:o}]}),vp(()=>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:mp((n,s,i)=>{const[o]=i,{id:a,styleId:l}=Ip(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:mp((n,s,i)=>{const[o]=i,{id:a,styleId:l}=Ip(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:o}),n.apply(s,i)})}));const l={};Pp("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Pp("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Pp("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Pp("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:mp((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=Ip(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:[...Op(s),a||0]}]}),n.apply(s,i)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:mp((n,s,i)=>{const[o]=i,{id:a,styleId:l}=Ip(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...Op(s),o]}]}),n.apply(s,i)})})}),mp(()=>{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=Ep(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:mp((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}=Ip(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:Op(o.parentRule)}),s.apply(o,a)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:mp((s,i,a)=>{var l;const[c]=a;if(r.has(c))return o.apply(i,[c]);const{id:u,styleId:h}=Ip(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:Op(i.parentRule)}),s.apply(i,a)})}),mp(()=>{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=Fd(t.fonts,"add",function(t){return function(r){return setTimeout(mp(()=>{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),mp(()=>{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=mp(()=>{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;Wd(o,n,s,!0)||Wd(c,n,s,!0)||a.push({start:r.getId(o),startOffset:l,end:r.getId(c),endOffset:u})}i({ranges:a})});return a(),Ad("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?Fd(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),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,r,t.options));return mp(()=>{yp.forEach(e=>e.reset()),null==n||n.disconnect(),s(),i(),o(),a(),l(),c(),u(),h(),d(),p(),f(),g(),m.forEach(e=>e())})}function Rp(e){return void 0!==window[e]}function Pp(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Tp{constructor(e){ll(this,"iframeIdToRemoteIdMap",new WeakMap),ll(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 Ap{constructor(e){ll(this,"iframes",new WeakMap),ll(this,"crossOriginIframeMap",new WeakMap),ll(this,"crossOriginIframeMirror",new Tp(zl)),ll(this,"crossOriginIframeStyleMirror"),ll(this,"crossOriginIframeRootIdMap",new WeakMap),ll(this,"mirror"),ll(this,"mutationCb"),ll(this,"wrappedEmit"),ll(this,"loadListener"),ll(this,"stylesheetManager"),ll(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Tp(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 ep.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:ep.IncrementalSnapshot,data:{source:tp.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ep.Meta:case ep.Load:case ep.DomContentLoaded:return!1;case ep.Plugin:return t;case ep.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ep.IncrementalSnapshot:switch(t.data.source){case tp.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 tp.Drag:case tp.TouchMove:case tp.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case tp.ViewportResize:return!1;case tp.MediaInteraction:case tp.MouseInteraction:case tp.Scroll:case tp.CanvasMutation:case tp.Input:return this.replaceIds(t.data,e,["id"]),t;case tp.StyleSheetRule:case tp.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case tp.Font:return t;case tp.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case tp.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===op.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Dp{constructor(e){ll(this,"shadowDoms",new WeakSet),ll(this,"mutationCb"),ll(this,"scrollCb"),ll(this,"bypassOptions"),ll(this,"mirror"),ll(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(!kl(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=bp({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Cp({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(Td.host(e))),this.restoreHandlers.push(Ep({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(Fd(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),i=Td.shadowRoot(this);return i&&Zd(this)&&r.addShadowRoot(i,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Np="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Lp="undefined"==typeof Uint8Array?[]:new Uint8Array(256),_p=0;_p<64;_p++)Lp[Np.charCodeAt(_p)]=_p;const Fp=new Map;const jp=(e,t,r)=>{if(!e||!$p(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=Fp.get(e);return r||(r=new Map,Fp.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 Up(e,t,r){if(e instanceof Array)return e.map(e=>Up(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+=Np[r[t]>>2],s+=Np[(3&r[t])<<4|r[t+1]>>4],s+=Np[(15&r[t+1])<<2|r[t+2]>>6],s+=Np[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:[Up(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:[Up(e.data,t,r),e.width,e.height]}}if($p(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:jp(e,t,r)}}return e}const Bp=(e,t,r)=>e.map(e=>Up(e,t,r)),$p=(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 zp(e,t,r,n){const s=[];try{const i=Fd(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...i){if(!Wd(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 Wp(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=Fd(e,l,function(e){return function(...o){const a=e.apply(this,o);if(jp(a,i,this),"tagName"in this.canvas&&!Wd(this.canvas,n,s,!0)){const e=Bp(o,i,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});o.push(a)}catch{const n=_d(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});o.push(n)}return o}const qp='(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',Vp="undefined"!=typeof self&&self.Blob&&new Blob([qp],{type:"text/javascript;charset=utf-8"});function Hp(e){let t;try{if(t=Vp&&(self.URL||self.webkitURL).createObjectURL(Vp),!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(qp),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Gp{constructor(e){ll(this,"pendingCanvasMutations",new Map),ll(this,"rafStamps",{latestId:0,invokeId:null}),ll(this,"mirror"),ll(this,"mutationCb"),ll(this,"resetObservers"),ll(this,"frozen",!1),ll(this,"locked",!1),ll(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=zp(t,r,n,!0),o=new Map,a=new Hp;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:sp["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=>{Wd(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=zp(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=Fd(t.CanvasRenderingContext2D.prototype,o,function(s){return function(...i){return Wd(this.canvas,r,n,!0)||setTimeout(()=>{const r=Bp(i,t,this);e(this.canvas,{type:sp["2D"],property:o,args:r})},0),s.apply(this,i)}});s.push(i)}catch{const r=_d(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:sp["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(...Wp(t.WebGLRenderingContext.prototype,sp.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...Wp(t.WebGL2RenderingContext.prototype,sp.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 Jp{constructor(e){ll(this,"trackedLinkElements",new WeakSet),ll(this,"mutationCb"),ll(this,"adoptedStyleSheetCb"),ll(this,"styleMirror",new Yd),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},n=[];for(const t of e){let e;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:Ol(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}trackStylesheetInLinkElement(e){}}class Kp{constructor(){ll(this,"nodeMap",new WeakMap),ll(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 Yp,Xp,Qp,Zp=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(il=e.contentWindow)?void 0:il.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const ef=new Il;function tf(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:g,maskAttributeFn:m,hooks:v,packFn:y,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=!0,plugins:P,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:D,applyBackgroundColorToBlockedElements:N=!1}=e;gp=D;const L=!x||window.parent===window;let _=!1;if(!L)try{window.parent.document&&(_=!1)}catch(e){_=!0}if(L&&!t)throw new Error("emit function is required");if(!L&&!_)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),ef.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},j=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let U;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let B=0;const $=e=>{for(const t of P||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!_&&(e=y(e)),e};Yp=(e,s)=>{var i;const o=e;if(o.timestamp=jd(),!(null==(i=yp[0])?void 0:i.isFrozen())||o.type===ep.FullSnapshot||o.type===ep.IncrementalSnapshot&&o.data.source===tp.Mutation||yp.forEach(e=>e.unfreeze()),L)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===ep.FullSnapshot)U=o,B=0;else if(o.type===ep.IncrementalSnapshot){if(o.data.source===tp.Mutation&&o.data.isAttachIframe)return;B++;const e=n&&B>=n,t=r&&o.timestamp-U.timestamp>r;(e||t)&&Xp(!0)}};const z=e=>{Yp({type:ep.IncrementalSnapshot,data:{source:tp.Mutation,...e}})},W=e=>Yp({type:ep.IncrementalSnapshot,data:{source:tp.Scroll,...e}}),q=e=>Yp({type:ep.IncrementalSnapshot,data:{source:tp.CanvasMutation,...e}}),V=new Jp({mutationCb:z,adoptedStyleSheetCb:e=>Yp({type:ep.IncrementalSnapshot,data:{source:tp.AdoptedStyleSheet,...e}})}),H=new Ap({mirror:ef,mutationCb:z,stylesheetManager:V,recordCrossOriginIframes:x,wrappedEmit:Yp});for(const e of P||[])e.getMirror&&e.getMirror({nodeMirror:ef,crossOriginIframeMirror:H.crossOriginIframeMirror,crossOriginIframeStyleMirror:H.crossOriginIframeStyleMirror});const G=new Kp;Qp=new Gp({recordCanvas:k,mutationCb:q,win:window,blockClass:s,blockSelector:i,mirror:ef,sampling:w.canvas,dataURLOptions:b});const J=new Dp({mutationCb:z,scrollCb:W,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:F,dataURLOptions:b,maskTextFn:g,maskInputFn:f,maskAttributeFn:m,recordCanvas:k,inlineImages:M,sampling:w,slimDOMOptions:j,iframeManager:H,stylesheetManager:V,canvasManager:Qp,keepIframeSrcFn:T,processedNodeManager:G},mirror:ef});Xp=(e=!1)=>{if(!C)return;Yp({type:ep.Meta,data:{href:window.location.href,width:$d(),height:Bd()}},e),V.reset(),J.init(),yp.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new Il,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:g,preserveWhiteSpace:m,onSerialize:v,onAdoptedStyleSheet:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:k=()=>!1,applyBackgroundColorToBlockedElements:x=!1}=t||{};return sc(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:g,inlineImages:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:v,onAdoptedStyleSheet:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:k,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:x})}(document,{mirror:ef,blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:F,maskTextFn:g,maskInputFn:f,maskAttributeFn:m,slimDOM:j,dataURLOptions:b,recordCanvas:k,inlineImages:M,applyBackgroundColorToBlockedElements:N,onSerialize:e=>{Gd(e,ef)&&H.addIframe(e),Jd(e,ef)&&V.trackLinkElement(e),Kd(e)&&J.addShadowRoot(Td.shadowRoot(e),document)},onAdoptedStyleSheet:R?e=>V.styleMirror.add(e):void 0,onIframeLoad:(e,t)=>{H.attachIframe(e,t),J.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!t)return console.warn("Failed to snapshot the document");Yp({type:ep.FullSnapshot,data:{node:t,initialOffset:Ud(window)}},e),yp.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,ef.getId(document))};try{const e=[],t=e=>{var t;return mp(Mp)({mutationCb:z,mousemoveCb:(e,t)=>Yp({type:ep.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Yp({type:ep.IncrementalSnapshot,data:{source:tp.MouseInteraction,...e}}),scrollCb:W,viewportResizeCb:e=>Yp({type:ep.IncrementalSnapshot,data:{source:tp.ViewportResize,...e}}),inputCb:e=>Yp({type:ep.IncrementalSnapshot,data:{source:tp.Input,...e}}),mediaInteractionCb:e=>Yp({type:ep.IncrementalSnapshot,data:{source:tp.MediaInteraction,...e}}),styleSheetRuleCb:e=>Yp({type:ep.IncrementalSnapshot,data:{source:tp.StyleSheetRule,...e}}),styleDeclarationCb:e=>Yp({type:ep.IncrementalSnapshot,data:{source:tp.StyleDeclaration,...e}}),canvasMutationCb:q,fontCb:e=>Yp({type:ep.IncrementalSnapshot,data:{source:tp.Font,...e}}),selectionCb:e=>{Yp({type:ep.IncrementalSnapshot,data:{source:tp.Selection,...e}})},customElementCb:e=>{Yp({type:ep.IncrementalSnapshot,data:{source:tp.CustomElement,...e}})},blockClass:s,ignoreClass:o,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:F,inlineStylesheet:u,sampling:w,recordDOM:C,recordCanvas:k,inlineImages:M,userTriggeredOnInput:I,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:g,maskAttributeFn:m,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:j,dataURLOptions:b,mirror:ef,iframeManager:H,stylesheetManager:V,shadowDomManager:J,processedNodeManager:G,canvasManager:Qp,ignoreCSSAttributes:A,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=>Yp({type:ep.Plugin,data:{plugin:e.name,payload:t}})})))||[]},v)};H.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{Xp(),e.push(t(document)),Zp=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Ad("DOMContentLoaded",()=>{Yp({type:ep.DomContentLoaded,data:{}}),"DOMContentLoaded"===O&&r()})),e.push(Ad("load",()=>{Yp({type:ep.Load,data:{}}),"load"===O&&r()},window))),()=>{e.forEach(e=>e()),G.destroy(),Zp=!1,gp=void 0}}catch(e){console.warn(e)}}var rf;tf.addCustomEvent=(e,t)=>{if(!Zp)throw new Error("please add custom event after start recording");Yp({type:ep.Custom,data:{tag:e,payload:t}})},tf.freezePage=()=>{yp.forEach(e=>e.freeze())},tf.takeFullSnapshot=e=>{if(!Zp)throw new Error("please take full snapshot after start recording");Xp(e)},tf.mirror=ef,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(rf||(rf={}));var nf=Object.freeze({__proto__:null,record:tf});const sf=["image/","audio/","video/","application/octet-stream","font/"];function of(e,t){if(new Blob([e]).size<=t)return{value:e,truncated:!1};let r=0,n=Math.min(e.length,t);for(;r<n;){const s=Math.ceil((r+n)/2);new Blob([e.slice(0,s)]).size<=t?r=s:n=s-1}return r>0&&e.charCodeAt(r-1)>=55296&&e.charCodeAt(r-1)<=56319&&(r-=1),{value:e.slice(0,r),truncated:!0}}var af=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=g();if(!e)return;const t=e.fetch;t&&(e.fetch=(e,r)=>o(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(null==a?void 0: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=of(e,t).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,null==a?void 0:a.response){if(function(e){return!!e&&sf.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}=of(e,r);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=Te,e.evaluateTargetingAndCapture=rn,e.flush=en,e.getSessionId=Qr,e.getSessionReplayProperties=Zr,e.init=Yr,e.setSessionId=Xr,e.shutdown=tn,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
2
2
  //# sourceMappingURL=session-replay-browser-min.js.map