!function(){"use strict";!function(e,t){var r=e.amplitudeGTM||{_q:[],_iq:{}};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}},s=function(e,t,r){return function(n){e._q.push({name:t,args:Array.prototype.slice.call(r,0),resolve:n})}},i=function(e,t,r){e[t]=function(){if(r)return{promise:new Promise(s(e,t,Array.prototype.slice.call(arguments)))};!function(e,t,r){e._q.push({name:t,args:Array.prototype.slice.call(r,0)})}(e,t,Array.prototype.slice.call(arguments))}},o=function(e){for(var t=0;t0&&s[s.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]0&&s[s.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]0?2===l.length?typeof l[1]==s?this[l[0]]=l[1].call(this,u):this[l[0]]=l[1]:3===l.length?typeof l[1]!==s||l[1].exec&&l[1].test?this[l[0]]=u?u.replace(l[1],l[2]):n:this[l[0]]=u?l[1].call(this,u,l[2]):n:4===l.length&&(this[l[0]]=u?l[3].call(this,u.replace(l[1],l[2])):n):this[l]=u||n;h+=2}},$=function(e,t){for(var r in t)if(typeof t[r]===o&&t[r].length>0){for(var s=0;s350?q(e,350):e,this},this.setUA(s),this};H.VERSION="0.7.33",H.BROWSER=j([c,d,"major"]),H.CPU=j([p]),H.DEVICE=j([l,h,u,f,g,v,m,y,w]),H.ENGINE=H.OS=j([c,d]),e.exports&&(t=e.exports=H),t.UAParser=H;var J=typeof r!==i&&(r.jQuery||r.Zepto);if(J&&!J.ua){var K=new H;J.ua=K.getResult(),J.ua.get=function(){return K.getUA()},J.ua.set=function(e){K.setUA(e);var t=K.getResult();for(var r in t)J.ua[r]=t[r]}}}("object"==typeof window?window:s)}(i,i.exports);var o=i.exports,a=function(e){var s=this;void 0===e&&(e={});var i,a=e.osName,l=void 0===a||a,c=e.osVersion,u=void 0===c||c,h=e.deviceManufacturer,d=void 0===h||h,p=e.deviceModel,f=void 0===p||p;return{name:"@amplitude/plugin-user-agent-enrichment-browser",type:"enrichment",setup:function(e){return r(this,void 0,void 0,function(){var t;return n(this,function(r){return"undefined"!=typeof navigator&&(t=navigator.userAgent),i=new o(t).getResult(),e.loggerProvider.log("Installing @amplitude/plugin-user-agent-enrichment-browser."),[2]})})},execute:function(e){return r(s,void 0,void 0,function(){var r,s,o,a;return n(this,function(n){return r=i.browser.name,s=i.browser.version,o=i.device.model||i.os.name,a=i.device.vendor,[2,t(t(t(t(t({},e),l&&{os_name:r}),u&&{os_version:s}),d&&{device_manufacturer:a}),f&&{device_model:o})]})})}}};return e.plugin=a,e.userAgentEnrichmentPlugin=a,Object.defineProperty(e,"__esModule",{value:!0}),e}({}),r=function(e){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},t(e,r)};function r(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n,s,i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&s[s.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function h(e,t,r){if(r||2===arguments.length)for(var n,s=0,i=t.length;s>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,y)}(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,h([],u(n.entries()),!1).map(function(e){var t=u(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(v[n]):v[n]}).join("")},w=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"}(g||(g={}));var b="Amplitude Logger ",S=function(){function e(){this.logLevel=g.None}return e.prototype.disable=function(){this.logLevel=g.None},e.prototype.enable=function(e){void 0===e&&(e=g.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),P=function(){return P=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=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 A(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 _=function(e,t){var r,n,s=typeof e;if(s!==typeof t)return!1;try{for(var i=T(["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(!_(c,u))return!1;var h=!0;return Object.keys(e).forEach(function(r){_(e[r],t[r])||(h=!1)}),h}for(var d=0;d=200&&e<300}(e)?d.Success:429===e?d.RateLimit:413===e?d.PayloadTooLarge:408===e?d.Timeout:e>=400&&e<500?d.Invalid:e>=500?d.Failed:d.Unknown},e}(),B=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return r(t,e),t.prototype.send=function(e,t){return a(this,void 0,void 0,function(){var r,n,s;return l(this,function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:i({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=o.sent()).text()];case 2:s=o.sent();try{return[2,this.buildResponse(JSON.parse(s))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}})})},t}(j),z=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}(),q=function(){function e(e,t,r,n,s){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 z(e,t),this.customFetch=s}return e.prototype.subscribe=function(e,t,r){var n=y(),s={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(s),"all"===t?this.subscribeAll(s):this.subscribeWaitForRemote(s,t.timeout),n},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return a(this,void 0,void 0,function(){var e,t=this;return l(this,function(r){switch(r.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise?this.fetchPromise:this.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null}),this.fetchPromise):(this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null}),this.fetchPromise)},e.prototype.subscribeAll=function(e){return a(this,void 0,void 0,function(){var t,r,n,s=this;return l(this,function(i){switch(i.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){s.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),s.sendCallback(e,t,"remote"),s.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=i.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return i.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return a(this,void 0,void 0,function(){var r,n;return l(this,function(s){switch(s.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),s.label=1;case 1:return s.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=s.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[3,5];case 3:return s.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(n=s.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),a(this,void 0,void 0,function(){var r,n,s,i,o,a,c=this;return l(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},s=function(n){var s,o,a,u,h,d,p,f,g;return l(this,function(l){switch(l.label){case 0:s=!0,o=new AbortController,a=setTimeout(function(){return o.abort()},t),l.label=1;case 1:return l.trys.push([1,10,11,12]),u=i.getUrlParams(),h={Accept:"*/*"},i.customFetch?[4,(m=i.customFetch({url:u,method:"GET",headers:h,signal:o.signal}),v=o.signal,new Promise(function(e,t){var r=function(){var e=new Error("Remote config custom fetch aborted by timeout");e.name="AbortError",t(e)};v.addEventListener("abort",r,{once:!0}),m.then(function(t){v.removeEventListener("abort",r),e(t)},function(e){v.removeEventListener("abort",r),t(e)})}))]:[3,3];case 2:return p=l.sent(),[3,5];case 3:return[4,fetch(u,{method:"GET",headers:h,signal:o.signal})];case 4:p=l.sent(),l.label=5;case 5:return(d=p).ok||d.status>=200&&d.status<300?[3,7]:[4,d.text()];case 6:return f=l.sent(),i.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(d.status,": ").concat(f)),401===d.status||403===d.status?(i.logger.error("Remote config client fetch failed with ".concat(d.status,". Invalid API key; future fetches will be skipped.")),i.isLastFetchInvalidApiKey=!0,s=!1):d.status>=400&&d.status<500&&429!==d.status&&(s=!1),[3,9];case 7:return[4,d.json()];case 8:return[2,{value:{remoteConfig:l.sent(),lastFetch:new Date}}];case 9:return[3,12];case 10:return(g=l.sent())instanceof Error&&"AbortError"===g.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: "),g),[3,12];case 11:return clearTimeout(a),[7];case 12:return s?n0&&setTimeout(function(){o(new Error("".concat(e," timed out (id: ").concat(s,")"))),delete n.requestCallbacks[s]},r.timeout)})},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.registerActionHandler=function(e,t){var r,n,s,i;this.actionHandlers.has(e)&&(null===(i=null===(s=this.logger)||void 0===s?void 0:s.warn)||void 0===i||i.call(s,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var o=this.pendingMessages.get(e);if(o){this.pendingMessages.delete(e);try{for(var a=c(o),l=a.next();!l.done;l=a.next())t(l.value)}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return a(this,void 0,void 0,function(){var t,r,n;return l(this,function(s){switch(s.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,r){var n;try{var s=document.createElement("script");s.type="text/javascript",s.async=!0,s.src=e,s.addEventListener("load",function(){t({status:!0})},{once:!0}),s.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),null===(n=document.head)||void 0===n||n.appendChild(s)}catch(e){r(e)}})}(e).then(function(){}),this.scriptLoadPromises.set(e,r),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,r];case 2:return s.sent(),[3,4];case 3:throw n=s.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}})})},e.prototype.setup=function(e){var t,r,n=this,s=void 0===e?{}:e,i=s.logger,o=s.endpoint;i&&(this.logger=i),o&&this.endpoint===$&&(this.endpoint=o),this.isSetup||(this.isSetup=!0,null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,r,s,i,o;if(null===(r=null===(t=n.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message received: ",JSON.stringify(e)),n.endpoint===e.origin){var a=e.data,l=null==a?void 0:a.action;if(l)if("id"in a&&a.id)null===(i=null===(s=n.logger)||void 0===s?void 0:s.debug)||void 0===i||i.call(s,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(a);else{if("ping"===l)return void n.notify({action:"pong"});var c=n.actionHandlers.get(l);if(c)c(a.data);else{var u=null!==(o=n.pendingMessages.get(l))&&void 0!==o?o:[];u.push(a.data),n.pendingMessages.set(l,u)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=m();(null==e?void 0:e[H])===this&&delete e[H]},e}();function K(e){var t,r=m(),n=null==r?void 0:r[H];if("object"==typeof(t=n)&&null!==t&&G in t&&!0===t[G])return n;var s=new J(e);return r&&(r[H]=s),s}W=G;var Y,Z="__AMPLITUDE_BACKGROUND_CAPTURE__",Q="[Amplitude]",X="".concat(Q," Session Replay ID"),ee=L.US,te={enabled:!0},re=1e3,ne="".concat(Q," 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=1e4,de=1024,pe="X-Session-Replay-Event-Skipped",fe="amplitude-sr-iframe";!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"}(Y||(Y={}));var ge=function(){function e(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return e.prototype.getSafeMethod=function(e){var t;if(!this.logger)return function(){};var r=this.logger[e];return"function"==typeof r?(null!==(t=r.__rrweb_original__)&&void 0!==t?t:r).bind(this.logger):function(){}},e.prototype.enable=function(e){this.logger.enable(e)},e.prototype.disable=function(){this.logger.disable()},e}(),me="medium";function ve(e,t){return t||("STAGING"===e?le:"EU"===e?ae:oe)}var ye=function(e,t,r){switch(t){case"light":if("input"!==e)return!1;var n=r?function(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}(r):"";return!(!n||!["password","hidden","email","tel"].includes(n)&&!r.autocomplete.startsWith("cc-"));case"medium":return"input"===e;case"conservative":return!0;default:return ye(e,me,r)}},we=function(e,t){var r,n,s;if(e&&t.urlMaskLevels)try{for(var i=c(t.urlMaskLevels),o=i.next();!o.done;o=i.next()){var a=o.value;if(Ie(a.match).test(e))return a.maskLevel}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return null!==(s=t.defaultMaskLevel)&&void 0!==s?s:me},be=function(e,t,r,n){var s,i;if(void 0===t&&(t={defaultMaskLevel:me}),r){if(r.closest("."+se))return!0;var o=(null!==(s=t.maskSelector)&&void 0!==s?s:[]).some(function(e){return r.closest(e)});if(o)return!0;if(r.closest("."+ie))return!1;var a=(null!==(i=t.unmaskSelector)&&void 0!==i?i:[]).some(function(e){return r.closest(e)});if(a)return!1}return ye(e,we(n,t),r)},Se=function(e,t,r){return function(n,s){return be(e,t,s,null==r?void 0:r())?n.replace(/[^\s]/g,"*"):n}},xe=function(e,t){return function(r,n,s){var i;if("style"===r)return n;if(!(null!==(i=null==e?void 0:e.maskAttributes)&&void 0!==i?i:[]).includes(r))return n;var o=["INPUT","SELECT","TEXTAREA"].includes(s.tagName)?"input":"text";return be(o,e,s,null==t?void 0:t())?n.replace(/[^\s]/g,"*"):n}},Ce=function(){var e=m();return(null==e?void 0:e.location)?e.location.href:""},ke=new Map,Ie=function(e){var t=ke.get(e);if(t)return t;var r="\0TRAIL\0",n="\0MID\0",s="\0DS\0",i="\0ST\0",o="\0QU\0",a=e;a=(a=(a=(a=(a=(a=(a=(a=(a=(a=(a=a.replace(/\/\*\*$/,r)).replace(/\/\*\*\//g,n)).replace(/\*\*/g,s)).replace(/\*/g,i)).replace(/\?/g,o)).replace(/[.+^${}()|[\]\\]/g,"\\$&")).split(r).join("(/.*)?")).split(n).join("/(.*\\/)?")).split(s).join(".*")).split(i).join(".*")).split(o).join(".");var l=new RegExp("^".concat(a,"$"));return ke.set(e,l),l},Oe=function(e,t){var r,n;try{for(var s=c(t),i=s.next();!i.done;i=s.next()){var o=i.value,a=Ie(o.selector);if(a.test(e))return e.replace(a,o.replacement)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e},Ee=function(){return a(void 0,void 0,void 0,function(){var e,t,r,n,s,i,o;return l(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),(e=m())?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=a.sent(),r=t.usage,n=t.quota,s=t.usageDetails,i=r?Math.round(r/de):0,o=r&&n?Math.round(1e3*(r/n+Number.EPSILON))/1e3:0,[2,{totalStorageSize:i,percentOfQuota:o,usageDetails:JSON.stringify(s)}];case 2:return[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},Me=function(e){var t=i({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},Re=function(){return{flushMaxRetries:2,logLevel:g.Warn,loggerProvider:new S,transportProvider:new B}},Pe=function(e){function t(t,r){var n,s,o,a,l,c,d,p,f,g,m,v,y,w,b=this,S=Re();(b=e.call(this,i(i({transportProvider:S.transportProvider,loggerProvider:new ge(r.loggerProvider||S.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=S.flushMaxRetries?r.flushMaxRetries:S.flushMaxRetries,b.apiKey=t,b.sampleRate=r.sampleRate||0,b.serverZone=r.serverZone||ee,b.configServerUrl=r.configServerUrl,b.trackServerUrl=r.trackServerUrl,b.shouldInlineStylesheet=r.shouldInlineStylesheet,b.version=r.version,b.performanceConfig=r.performanceConfig||te,b.storeType=null!==(n=r.storeType)&&void 0!==n?n:"memory",b.applyBackgroundColorToBlockedElements=null!==(s=r.applyBackgroundColorToBlockedElements)&&void 0!==s&&s,b.enableUrlChangePolling=null!==(o=r.enableUrlChangePolling)&&void 0!==o&&o,b.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:re,b.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,void 0!==r.fullSnapshotIntervalMs&&(b.fullSnapshotIntervalMs=r.fullSnapshotIntervalMs),void 0!==r.eagerFullSnapshotSend&&(b.eagerFullSnapshotSend=r.eagerFullSnapshotSend),b.captureFullSnapshotOnFocus=null!==(c=r.captureFullSnapshotOnFocus)&&void 0!==c&&c,void 0!==r.maxPersistedEventsSizeBytes&&(b.maxPersistedEventsSizeBytes=Ne(r.maxPersistedEventsSizeBytes,Ae,_e,"maxPersistedEventsSizeBytes",b.loggerProvider)),void 0!==r.maxSingleEventSizeBytes&&(b.maxSingleEventSizeBytes=Ne(r.maxSingleEventSizeBytes,Ae,Le,"maxSingleEventSizeBytes",b.loggerProvider)),b.privacyConfig=i(i({},null!==(d=r.privacyConfig)&&void 0!==d?d:{}),{unmaskSelector:Array.from(new Set(h([".".concat(ie)],u(null!==(f=null===(p=r.privacyConfig)||void 0===p?void 0:p.unmaskSelector)&&void 0!==f?f:[]),!1)))}),r.interactionConfig&&(b.interactionConfig=r.interactionConfig,b.interactionConfig.ugcFilterRules&&function(e){if(!e.every(function(e){return"string"==typeof e.selector&&"string"==typeof e.replacement}))throw new Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every(function(e){return"string"==typeof(t=e.selector)&&""!==t.trim()&&!!/^\/|^https?:\/\/[^\s]+$/.test(t);var t}))throw new Error("ugcFilterRules must be an array of objects with valid globs")}(b.interactionConfig.ugcFilterRules)),r.debugMode&&(b.debugMode=r.debugMode);var x=r;return b.useWebWorker=null===(v=null!==(g=r.useWebWorker)&&void 0!==g?g:null===(m=x.experimental)||void 0===m?void 0:m.useWebWorker)||void 0===v||v,b.enableTransportCompression=null===(y=r.enableTransportCompression)||void 0===y||y,b.sendTimeoutMs=r.sendTimeoutMs,b.captureAdoptedStyleSheets=null===(w=r.captureAdoptedStyleSheets)||void 0===w||w,r.crossOriginIframes&&(b.crossOriginIframes=r.crossOriginIframes),r.flushIntervalConfig?b.flushIntervalConfig=function(e,t){var r,n,s={};if(void 0!==e.minIntervalMs&&(!Number.isFinite(e.minIntervalMs)||e.minIntervalMsr?(s.warn("".concat(n," ").concat(e," exceeds ceiling ").concat(r,"; clamping.")),r):e;s.warn("".concat(n," value is not a finite number (got ").concat(String(e),"); ignoring."))}var De=(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))(De||{}),Fe=(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))(Fe||{}),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||{}),je=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,r,n,s,o,d;return a(this,void 0,void 0,function(){var a,p,f,g,m,v,y,w,b,S,x,C,k,I,O,E,M,R=this;return l(this,function(l){switch(l.label){case 0:(a=i({},this.localConfig)).optOut=this.localConfig.optOut,a.captureEnabled=!0,l.label=1;case 1:return l.trys.push([1,3,,4]),[4,new Promise(function(e,t){R.remoteConfigClient.subscribe("configs.sessionReplay",{timeout:1500},function(r,n){var s;if(R.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(n,":"),JSON.stringify(r,null,2)),r){var i=r,o=i.sr_sampling_config,l=i.sr_privacy_config,c=i.sr_targeting_config,u=null===(s=a.interactionConfig)||void 0===s?void 0:s.ugcFilterRules;a.interactionConfig=i.sr_interaction_config,a.interactionConfig&&u&&(a.interactionConfig.ugcFilterRules=u),a.loggingConfig=i.sr_logging_config,(o||l||c)&&(p={},o&&(p.sr_sampling_config=o),l&&(p.sr_privacy_config=l),c&&(p.sr_targeting_config=c)),e()}else t(new Error("No remote config received"))})})];case 2:return l.sent(),[3,4];case 3:return f=l.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",f),a.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:a,remoteConfig:void 0}];case 4:if(!p)return[2,{localConfig:this.localConfig,joinedConfig:a,remoteConfig:p}];if(g=p.sr_sampling_config,m=p.sr_privacy_config,v=p.sr_targeting_config,g&&Object.keys(g).length>0?(Object.prototype.hasOwnProperty.call(g,"capture_enabled")?a.captureEnabled=g.capture_enabled:a.captureEnabled=!1,Object.prototype.hasOwnProperty.call(g,"sample_rate")&&(a.sampleRate=g.sample_rate),Object.prototype.hasOwnProperty.call(g,"min_session_duration_ms")&&(a.minSessionDurationMs=this.sanitizeMinSessionDurationMs(g.min_session_duration_ms))):(a.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),m){y=null!==(e=a.privacyConfig)&&void 0!==e?e:{},w={defaultMaskLevel:null!==(r=null!==(t=m.defaultMaskLevel)&&void 0!==t?t:y.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[],maskAttributes:h([],u(new Set(h(h([],u(null!==(n=y.maskAttributes)&&void 0!==n?n:[]),!1),u(null!==(s=m.maskAttributes)&&void 0!==s?s:[]),!1))),!1),urlMaskLevels:h(h([],u(null!==(o=m.urlMaskLevels)&&void 0!==o?o:[]),!1),u(null!==(d=y.urlMaskLevels)&&void 0!==d?d:[]),!1)},b=function(e){var t,r,n,s,i,o,a,l,u,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=c(null!==(a=e.blockSelector)&&void 0!==a?a:[]),p=d.next();!p.done;p=d.next())h[p.value]="block"}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}try{for(var f=c(null!==(l=e.maskSelector)&&void 0!==l?l:[]),g=f.next();!g.done;g=f.next())h[g.value]="mask"}catch(e){n={error:e}}finally{try{g&&!g.done&&(s=f.return)&&s.call(f)}finally{if(n)throw n.error}}try{for(var m=c(null!==(u=e.unmaskSelector)&&void 0!==u?u:[]),v=m.next();!v.done;v=m.next())h[v.value]="unmask"}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}return h},S=i(i({},b(y)),b(m));try{for(x=c(Object.entries(S)),C=x.next();!C.done;C=x.next())k=u(C.value,2),I=k[0],"mask"===(O=k[1])?w.maskSelector.push(I):"block"===O?w.blockSelector.push(I):"unmask"===O&&w.unmaskSelector.push(I)}catch(e){E={error:e}}finally{try{C&&!C.done&&(M=x.return)&&M.call(x)}finally{if(E)throw E.error}}a.privacyConfig=(P=w,T=this.localConfig.loggerProvider,A=document.createDocumentFragment(),_=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),0!==(e=e.filter(function(e){try{A.querySelector(e)}catch(t){return T.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0})).length)return e},P.blockSelector=_(P.blockSelector),P.maskSelector=_(P.maskSelector),P.unmaskSelector=_(P.unmaskSelector),P)}return v&&Object.keys(v).length>0&&(a.targetingConfig=v),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:Me(a)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:a,remoteConfig:p}]}var P,T,A,_})})},e.prototype.sanitizeMinSessionDurationMs=function(e){if("number"==typeof e&&Number.isFinite(e)){if(!(e<0))return e>Be?(this.localConfig.loggerProvider.warn("min_session_duration_ms remote value ".concat(e," exceeds ").concat(Be,"ms ceiling; clamping.")),Be):e;this.localConfig.loggerProvider.warn("min_session_duration_ms remote value is negative (".concat(e,"); ignoring."))}else this.localConfig.loggerProvider.warn("min_session_duration_ms remote value is not a finite number (got ".concat(String(e),"); ignoring."))},e}(),Be=6e4,ze=function(e,t){return a(void 0,void 0,void 0,function(){var r,n;return l(this,function(s){return r=new Pe(e,t),n=new q(e,r.loggerProvider,r.serverZone,t.configServerUrl,t.handleFetchConfig),[2,new je(n,r)]})})};function qe(e){if(e.type!==De.IncrementalSnapshot)return!1;var t=e.data;return t.source===Fe.Mutation&&!t.isAttachIframe}function We(e){var t,r,n=new Map;if(e.forEach(function(e,t){if(e.attributes&&"style"in e.attributes){var r=n.get(e.id);r?r.push(t):n.set(e.id,[t])}}),0===n.size)return e;var s=function(t){return e[t].attributes.style},o=new Set,a=new Map,l=function(e){if(1===e.length)return"continue";var t=-1;e.forEach(function(e,r){var n;("object"!=typeof(n=s(e))||null===n)&&(t=r)});var r=[];if(e.forEach(function(e,n){n!==t&&(o.add(e),n>t&&r.push(e))}),r.length>0){var n=r[r.length-1],i=function(e){var t,r,n,s,i={};try{for(var o=c(e),a=o.next();!a.done;a=o.next()){var l=a.value;try{for(var u=(n=void 0,c(Object.keys(l))),h=u.next();!h.done;h=u.next()){var d=h.value;i[d]=l[d]}}catch(e){n={error:e}}finally{try{h&&!h.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i}(r.map(function(e){return s(e)}));o.delete(n),a.set(n,i)}};try{for(var u=c(n.values()),h=u.next();!h.done;h=u.next())l(h.value)}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}if(0===o.size&&0===a.size)return e;var d=[];return e.forEach(function(e,t){var r=a.get(t);if(void 0===r)if(o.has(t)){var n=i({},e.attributes);delete n.style,Object.keys(n).length>0&&d.push(i(i({},e),{attributes:n}))}else d.push(e);else d.push(i(i({},e),{attributes:i(i({},e.attributes),{style:r})}))}),d}function $e(e){var t,r,n,s,o=e[0],a=new Map,l=new Map,h=new Map,d=new Map,p=new Map;e.forEach(function(e,t){var r,n,s,i,o=e.data;try{for(var u=c(o.adds),f=u.next();!f.done;f=u.next()){var g=f.value;a.has(g.node.id)||a.set(g.node.id,t),l.set(g.node.id,t),p.set(g.node.id,g.parentId)}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}try{for(var m=c(o.removes),v=m.next();!v.done;v=m.next()){var y=v.value;h.has(y.id)||h.set(y.id,t),d.set(y.id,t)}}catch(e){s={error:e}}finally{try{v&&!v.done&&(i=m.return)&&i.call(m)}finally{if(s)throw s.error}}});var f=new Set,g=new Set;try{for(var m=c(a),v=m.next();!v.done;v=m.next()){var y=u(v.value,2),w=y[0],b=y[1],S=h.get(w);void 0!==S&&(l.get(w)>=d.get(w)||(b0||g.size>0)for(var C=!0;C;){C=!1;try{for(var k=(n=void 0,c(p)),I=k.next();!I.done;I=k.next()){var O=u(I.value,2),E=O[0],M=O[1];if(!f.has(E)&&!g.has(E)&&!x.has(E)&&(f.has(M)||g.has(M)||x.has(M))){var R=h.get(E),P=a.get(E);void 0!==R&&void 0!==P&&R0||g.size>0||x.size>0,A=[];e.forEach(function(e,t){var r,n;try{for(var s=c(e.data.removes),i=s.next();!i.done;i=s.next()){var o=i.value;f.has(o.id)||g.has(o.id)&&t>=a.get(o.id)||x.has(o.id)&&(f.has(o.parentId)||g.has(o.parentId)||x.has(o.parentId))||A.push(o)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}});var _=e.flatMap(function(e){return e.data.adds}),L=e.flatMap(function(e){return e.data.texts}),N=e.flatMap(function(e){return e.data.attributes}),D=T?N.filter(function(e){return!f.has(e.id)&&!g.has(e.id)&&!x.has(e.id)}):N,F={source:Fe.Mutation,removes:A,adds:T?_.filter(function(e){return!f.has(e.node.id)&&!g.has(e.node.id)&&!x.has(e.node.id)}):_,texts:T?L.filter(function(e){return!f.has(e.id)&&!g.has(e.id)&&!x.has(e.id)}):L,attributes:We(D)};return i(i({},o),{data:F})}function Ve(e){if(e.length<=1)return e;for(var t=[],r=0;rr+1?$e(e.slice(r,n)):e[r]),r=n}else t.push(e[r]),r++;return t}var Ge=function(){function e(e,t,r,n,s){var i,o=this;this.taskQueue=[],this.pendingQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=e,r=t.type,n=t.timestamp,s=t.delay,i=t.data;return null!=s?JSON.stringify({type:r,timestamp:n,delay:s,data:i}):JSON.stringify({type:r,timestamp:n,data:i})},this.addCompressedEventToManager=function(e,t){var r,n=new Blob([e]).size;n>(null!==(r=o.config.maxSingleEventSizeBytes)&&void 0!==r?r:ce)?o.config.loggerProvider.warn("Session replay event dropped: serialized size ".concat(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.")):o.eventsManager&&o.deviceId&&o.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:o.deviceId})},this.addCompressedEvent=function(e,t){if(o.worker)try{o.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?o.worker.postMessage(JSON.stringify({event:e,sessionId:t})):o.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{var r=o.compressEvent(e);o.addCompressedEventToManager(r,t)}},this.flushQueue=function(){var e;for(o.pendingQueue.length>0&&(e=o.taskQueue).push.apply(e,h([],u(o.mergeMutationTasks(o.pendingQueue.splice(0))),!1));o.taskQueue.length>0;){var t=o.taskQueue.shift();if(t){var r=t.event,n=t.sessionId,s=o.compressEvent(r);o.addCompressedEventToManager(s,n)}}o.isProcessing=!1},this.terminate=function(){var e;null===(e=o.worker)||void 0===e||e.terminate()};var a=m();if(this.canUseIdleCallback=a&&"requestIdleCallback"in a,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{var l=new Blob([n],{type:"application/javascript"}),c=URL.createObjectURL(l),d=new Worker(c);d.onerror=function(e){e.preventDefault(),t.loggerProvider.error("Worker failed, falling back to non-worker compression: ".concat(e.message," (").concat(e.filename,":").concat(e.lineno,")")),d.terminate(),o.worker=void 0},d.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;o.addCompressedEventToManager(r,n)},this.worker=d}catch(e){t.loggerProvider.error("Failed to create worker, falling back to non-worker compression:",e)}}}return e.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(t){e.processQueue(t)},{timeout:this.timeout}))},e.prototype.enqueueEvent=function(e,t){var r,n,s,i;if(e.type===De.FullSnapshot){if(this.config.loggerProvider.debug("Processing full snapshot immediately."),this.taskQueue.length>0||this.pendingQueue.length>0){var o=h(h([],u(this.taskQueue.splice(0)),!1),u(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1);try{for(var a=c(o),l=a.next();!l.done;l=a.next()){var d=l.value,p=this.compressEvent(d.event);this.addCompressedEventToManager(p,d.sessionId)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}this.isProcessing=!1}var f=this.compressEvent(e);return this.addCompressedEventToManager(f,t),void(null===(s=this.onFullSnapshotProcessed)||void 0===s||s.call(this))}this.canUseIdleCallback&&(null===(i=this.config.performanceConfig)||void 0===i?void 0:i.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))},e.prototype.processQueue=function(e){var t,r=this;for(this.pendingQueue.length>0&&(t=this.taskQueue).push.apply(t,h([],u(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1));this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var n=this.taskQueue.shift();if(n){var s=n.event,i=n.sessionId;this.addCompressedEvent(s,i)}}this.taskQueue.length>0||this.pendingQueue.length>0?requestIdleCallback(function(e){r.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e.prototype.mergeMutationTasks=function(e){var t,r,n;if(!1===(null===(n=this.config.performanceConfig)||void 0===n?void 0:n.mergeMutations))return e;if(e.length<=1)return e;for(var s=[],i=0;i65536){for(var d=0,p=u.length;de?r:e;r>0&&(this.mergeOnNextFlush=!0),this.scheduled=setTimeout(function(){t.flush(!0).then(function(){t.queue.length>0&&t.schedule(e)})},n)}},e.prototype.flush=function(e){return void 0===e&&(e=!1),a(this,void 0,void 0,function(){var t,r,n,s,i,o,a;return l(this,function(l){switch(l.label){case 0: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)),l.label=1;case 1:l.trys.push([1,6,7,8]),r=c(t),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(s=n.value,[4,this.send(s,e)]);case 3:l.sent(),l.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return i=l.sent(),o={error:i},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}return[7];case 8:return[2]}})})},e.prototype.mergeQueueAfterThrottle=function(e){var t=this.coalesceByIdentity(e);return t.length4e6)return o(),n=i(i({},e),{events:h([],u(e.events),!1),attempts:0}),s=t,"continue";var r=n.onComplete,c=e.onComplete;n.events=n.events.concat(e.events),s+=t,n.onComplete=function(){return a(y,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,Promise.allSettled([r(),c()])];case 1:return e.sent(),[2]}})})}};try{for(var p=(t=void 0,c(e)),f=p.next();!f.done;f=p.next())d(f.value)}catch(e){t={error:e}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}o()};try{for(var E=c(w.values()),M=E.next();!M.done;M=E.next())O(M.value)}catch(e){n={error:e}}finally{try{M&&!M.done&&(s=E.return)&&s.call(E)}finally{if(n)throw n.error}}return I},e.prototype.send=function(e,t){return void 0===t&&(t=!0),a(this,void 0,void 0,function(){var r,n,s,i;return l(this,function(o){return this.killedSessions.has(e.sessionId)?[2,this.completeRequest({context:e,err:Ke})]:(r=e.apiKey)?(n=e.deviceId)?0===(s=this.payloadBatcher({version:1,events:e.events})).events.length?(this.completeRequest({context:e}),[2]):(i=this.worker)?[2,this.sendViaWorker(i,e,s,t)]:[2,this.sendOnMainThread(r,n,e,s,t)]:[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})]:[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})]})})},e.prototype.sendViaWorker=function(e,t,r,n){return a(this,void 0,void 0,function(){var s,i=this;return l(this,function(o){return s="".concat(++this.sendIdCounter),[2,new Promise(function(o){var a,l=i.sendTimeoutMs>0?setTimeout(function(){var e=i.pendingWorkerRequests.get(s);e&&(i.pendingWorkerRequests.delete(s),i.rememberTimedOutRequest(s,e.context),i.loggerProvider.warn("Session replay worker send timed out after ".concat(i.sendTimeoutMs,"ms; leaving events for retry")),e.resolve())},i.sendTimeoutMs):void 0;i.pendingWorkerRequests.set(s,{context:t,resolve:o,timeout:l}),e.postMessage({type:"send",id:s,payload:r,useRetry:n,useCustomTransport:!!i.handleSendEvents,context:{apiKey:t.apiKey,deviceId:t.deviceId,sessionId:t.sessionId,events:t.events,eventType:t.type,flushMaxRetries:null!==(a=t.flushMaxRetries)&&void 0!==a?a:0,sampleRate:t.sampleRate,serverZone:t.serverZone,trackServerUrl:i.trackServerUrl,version:t.version,currentUrl:Ce(),sdkVersion:Ye,enableTransportCompression:i.enableTransportCompression,sendTimeoutMs:i.sendTimeoutMs}})})]})})},e.prototype.rememberTimedOutRequest=function(e,t){var r,n;if(this.timedOutWorkerRequests.set(e,t),this.timedOutWorkerRequests.size>256)try{for(var s=c(this.timedOutWorkerRequests.keys()),i=s.next();!i.done;i=s.next()){var o=i.value;this.timedOutWorkerRequests.delete(o);break}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}},e.prototype.handleDelegatedFetch=function(e,t){var r,n,s;return a(this,void 0,void 0,function(){var i,o,a,c,u,h,d,p,f,g,m;return l(this,function(l){switch(l.label){case 0:i=t.requestId,o=t.url,a=t.method,c=t.headers,u=t.body,h=t.keepalive,l.label=1;case 1:return l.trys.push([1,10,,11]),d=void 0,this.handleSendEvents?[4,this.handleSendEvents({url:o,method:a,headers:c,body:u,keepalive:h})]:[3,3];case 2:return d=l.sent(),[3,5];case 3:return this.loggerProvider.warn("Delegated session replay fetch received without a custom transport configured; falling back to built-in fetch."),[4,fetch(o,{method:a,headers:c,body:u,keepalive:h})];case 4:d=l.sent(),l.label=5;case 5:if(p=d.status,f=null,g="",p>=200&&p<300&&(f=null!==(s=null===(n=null===(r=d.headers)||void 0===r?void 0:r.get)||void 0===n?void 0:n.call(r,pe))&&void 0!==s?s:null),413!==p)return[3,9];l.label=6;case 6:return l.trys.push([6,8,,9]),[4,d.text()];case 7:return g=l.sent(),[3,9];case 8:return l.sent(),[3,9];case 9:return this.loggerProvider.debug("Delegated session replay fetch (request ".concat(i,") returned status ").concat(p,".")),e.postMessage({type:"fetch-response",requestId:i,status:p,skipHeader:f,body:g}),[3,11];case 10:return m=l.sent(),this.loggerProvider.debug("Delegated session replay fetch (request ".concat(i,") failed:"),m),e.postMessage({type:"fetch-response",requestId:i,status:0,skipHeader:null,body:String(m),error:!0}),[3,11];case 11:return[2]}})})},e.prototype.sendOnMainThread=function(e,t,r,n,s){var o,c,u,h,d,p,f;return a(this,void 0,void 0,function(){var a,g,v,y,w,b,S,x,C,k,I,O,E,M,R,P,T,A,_,L,N,D;return l(this,function(l){switch(l.label){case 0:a=Ce(),g=Ye,v=r.sampleRate,y=new URLSearchParams({device_id:t,session_id:"".concat(r.sessionId),type:"".concat(r.type)}),w="".concat(null!==(c=null===(o=r.version)||void 0===o?void 0:o.type)&&void 0!==c?c:"standalone","/").concat(null!==(h=null===(u=r.version)||void 0===u?void 0:u.version)&&void 0!==h?h:g),l.label=1;case 1:return l.trys.push([1,19,,23]),b=JSON.stringify(n),S=m(),this.enableTransportCompression&&S&&"CompressionStream"in S?[4,Ze(b,S)]:[3,3];case 2:return C=l.sent(),[3,4];case 3:C=null,l.label=4;case 4:if(k=(x=C)?x.byteLength:new Blob([b]).size,I=new AbortController,O=i({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(e),"X-Client-Version":g,"X-Client-Library":w,"X-Client-Url":a.substring(0,1e3),"X-Client-Sample-Rate":"".concat(v),"X-Sampling-Hash-Alg":"xxhash32"},x?{"Content-Encoding":"gzip"}:{}),R={headers:O,body:E=null!=x?x:b,method:"POST",keepalive:M=k<=65536,signal:I.signal},P="".concat(ve(r.serverZone,this.trackServerUrl),"?").concat(y.toString()),0===n.events.length)return this.completeRequest({context:r}),[2];T=this.sendTimeoutMs>0?setTimeout(function(){I.abort()},this.sendTimeoutMs):void 0,A=void 0,l.label=5;case 5:return l.trys.push([5,,10,11]),this.handleSendEvents?[4,(F=this.handleSendEvents({url:P,method:"POST",headers:O,body:E,keepalive:M}),U=I.signal,new Promise(function(e,t){var r=function(){var e=new Error("Custom session replay transport aborted by send timeout");e.name="AbortError",t(e)};U.addEventListener("abort",r,{once:!0}),F.then(function(t){U.removeEventListener("abort",r),e(t)},function(e){U.removeEventListener("abort",r),t(e)})}))]:[3,7];case 6:return _=l.sent(),[3,9];case 7:return[4,fetch(P,R)];case 8:_=l.sent(),l.label=9;case 9:return A=_,[3,11];case 10:return T&&clearTimeout(T),[7];case 11:if(null===A)return this.completeRequest({context:r,err:"Unexpected error occurred"}),[2];if(A.status>=200&&A.status<300&&(L=null!==(f=null===(p=null===(d=A.headers)||void 0===d?void 0:d.get)||void 0===p?void 0:p.call(d,pe))&&void 0!==f?f:null,this.applyServerDirective(r.sessionId,L)),s)return[3,12];N="";try{N=JSON.stringify(A.body,null,2)}catch(e){}return this.completeRequest({context:r,success:"".concat(A.status,": ").concat(N)}),[3,18];case 12:if(N="",413!==A.status)return[3,16];l.label=13;case 13:return l.trys.push([13,15,,16]),[4,A.text()];case 14:return N=l.sent(),[3,16];case 15:return l.sent(),[3,16];case 16:return[4,this.handleReponse(A.status,r,N)];case 17:l.sent(),l.label=18;case 18:return[3,23];case 19:return(D=l.sent())&&"object"==typeof D&&"AbortError"===D.name&&s?[4,this.handleOtherResponse(r)]:[3,21];case 20:return l.sent(),[3,22];case 21:this.completeRequest({context:r,err:D}),l.label=22;case 22:return[3,23];case 23:return[2]}var F,U})})},e.prototype.handleReponse=function(e,t,r){return void 0===r&&(r=""),a(this,void 0,void 0,function(){return l(this,function(n){switch(n.label){case 0:switch((new j).buildStatus(e)){case d.Success:return[3,1];case d.Failed:case d.Timeout:case d.RateLimit:return[3,2];case d.PayloadTooLarge:return[3,4]}return[3,5];case 1:return this.handleSuccessResponse(t),[3,8];case 2:return[4,this.handleOtherResponse(t)];case 3:return n.sent(),[3,8];case 4:return this.handlePayloadTooLargeResponse(t,ue.test(r)),[3,8];case 5:return 499!==e?[3,7]:[4,this.handleOtherResponse(t)];case 6:return n.sent(),[3,8];case 7:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"}),n.label=8;case 8:return[2]}})})},e.prototype.handlePayloadTooLargeResponse=function(e,t){var r=t?"WAF (compressed payload too large)":"server (event too large)",n=Math.round(e.events.reduce(function(e,t){return e+t.length},0)/de);if(t)if(1!==e.events.length){this.loggerProvider.warn("Session replay event batch rejected by ".concat(r," (").concat(e.events.length," events, ").concat(n," KB total) — splitting and retrying")),e.onComplete();var s=function(){return Promise.resolve()},o=Math.floor(e.events.length/2);this.sendEventsList(i(i({},e),{events:e.events.slice(0,o),onComplete:s})),this.sendEventsList(i(i({},e),{events:e.events.slice(o),onComplete:s}))}else this.completeRequest({context:e,err:"Session replay event dropped: single event (".concat(n," KB, 1 event) rejected by ").concat(r," — cannot split further")});else this.completeRequest({context:e,err:"Session replay event batch dropped: ".concat(r," rejected payload (").concat(e.events.length," events, ").concat(n," KB) — not retrying non-WAF 413")})},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/de);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(t," KB")})},e.prototype.handleOtherResponse=function(e){return a(this,void 0,void 0,function(){var t;return l(this,function(r){switch(r.label){case 0:return t=Math.random()*e.attempts*this.retryTimeout,e.attempts++,e.attempts>(e.flushMaxRetries||0)?(this.completeRequest({context:e,err:He}),[2]):[4,new Promise(function(e){return setTimeout(e,t)})];case 1:return r.sent(),[4,this.send(e,!0)];case 2:return r.sent(),[2]}})})},e.prototype.completeRequest=function(e){var t=e.context,r=e.err,n=e.success;t.onComplete(),r?this.loggerProvider.warn(r):n&&this.loggerProvider.log(n)},e.prototype.applyServerDirective=function(e,t){if(null===t)return this.flushPauseUntilMs=0,void(this.mergeLogFiredThisPause=!1);if("429"===t){var r=this.flushPauseUntilMs>Date.now();return this.flushPauseUntilMs=Date.now()+6e4,void(r||this.loggerProvider.log("Session replay throttled by server; pausing flush schedule for ".concat(60,"s")))}"4005"!==t&&"4004"!==t||this.killSession(e,t)},e.prototype.killSession=function(e,t){var r,n,s,i;if(!this.killedSessions.has(e)){if(this.killedSessions.add(e),this.killedSessions.size>256)try{for(var o=c(this.killedSessions),a=o.next();!a.done;a=o.next()){var l=a.value;this.killedSessions.delete(l);break}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}this.loggerProvider.log("Session replay capture stopped for session ".concat(e," by server directive ").concat(t,"; remaining events will be dropped"));var u=[];try{for(var h=c(this.queue),d=h.next();!d.done;d=h.next()){var p=d.value;p.sessionId===e?this.completeRequest({context:p,err:Ke}):u.push(p)}}catch(e){s={error:e}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(s)throw s.error}}this.queue=u}},e}();const Xe=(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 lt(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function ot(e){it=e(it)}function at(e){return"function"==typeof e?function(e){return(tt||(tt=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(ct(this),t),lt(this.request)}:function(...t){return lt(e.apply(ct(this),t))}}(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),Xe(e,et||(et=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,it):e)}function lt(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,r)=>{const n=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{t(lt(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",i)});return st.set(t,e),t}(e);if(nt.has(e))return nt.get(e);const t=at(e);return t!==e&&(nt.set(e,t),st.set(t,e)),t}const ct=e=>st.get(e);function ut(e,t,{blocked:r,upgrade:n,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=lt(o);return n&&o.addEventListener("upgradeneeded",e=>{n(lt(o.result),e.oldVersion,e.newVersion,lt(o.transaction),e)}),r&&o.addEventListener("blocked",e=>r(e.oldVersion,e.newVersion,e)),a.then(e=>{i&&e.addEventListener("close",()=>i()),s&&e.addEventListener("versionchange",e=>s(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}const ht=["get","getKey","getAll","getAllKeys","count"],dt=["put","add","delete","clear"],pt=new Map;function ft(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(pt.get(t))return pt.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=dt.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!ht.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 pt.set(t,i),i}ot(e=>({...e,get:(t,r,n)=>ft(t,r)||e.get(t,r,n),has:(t,r)=>!!ft(t,r)||e.has(t,r)}));const gt=["continue","continuePrimaryKey","advance"],mt={},vt=new WeakMap,yt=new WeakMap,wt={get(e,t){if(!gt.includes(t))return e[t];let r=mt[t];return r||(r=mt[t]=function(...e){vt.set(this,yt.get(this)[t](...e))}),r}};async function*bt(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,wt);for(yt.set(r,t),st.set(r,ct(t));t;)yield r,t=await(vt.get(r)||t.continue()),vt.delete(r)}function St(e,t){return t===Symbol.asyncIterator&&Xe(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Xe(e,[IDBIndex,IDBObjectStore])}ot(e=>({...e,get:(t,r,n)=>St(t,r)?bt:e.get(t,r,n),has:(t,r)=>St(t,r)||e.has(t,r)}));var xt=function(){function e(e){var t,r,n,s=this;this.minInterval=500,this.maxInterval=he,this.maxPersistedEventsSize=6e6,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var r=s.getStringSize(t);return s.getEventsArraySize(e)+r>=s.maxPersistedEventsSize||!!(Date.now()-s.timeAtLastSplit>s.interval&&e.length)&&(s.interval=Math.min(s.maxInterval,s.interval+s.minInterval),s._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}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(e){for(var t=0,r=0;r=55296&&n<=56319){var s=r+1=56320&&s<=57343?(t+=4,r++):t+=3}else t+=3}return t},e.prototype.getEventsArraySize=function(e){var t,r,n=0;try{for(var s=c(e),i=s.next();!i.done;i=s.next()){var o=i.value;n+=this.getStringSize(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return n+(2+Math.max(0,e.length-1)+2*e.length)},e}(),Ct=function(e,t,r){var n;"object"==typeof(n=r)&&null!==n&&"AbortError"===n.name?e.debug(t):e.warn(t)},kt="sessionCurrentSequence",It="sequencesToSend",Ot=5e3;function Et(e,t,r){var n=setTimeout(r,t);return e.then(function(){return clearTimeout(n)},function(){return clearTimeout(n)}),function(){return clearTimeout(n)}}var Mt,Rt,Pt,Tt=function(e){var t,r;return e.objectStoreNames.contains(kt)||(r=e.createObjectStore(kt,{keyPath:"sessionId"})),e.objectStoreNames.contains(It)||(t=e.createObjectStore(It,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},At=function(e){return a(void 0,void 0,void 0,function(){return l(this,function(t){switch(t.label){case 0:return[4,(r=ut(e,1,{upgrade:Tt}),n="IDB openDB timed out",void 0===n&&(n="IDB operation timed out"),new Promise(function(e,t){var s=setTimeout(function(){return t(new Error("".concat(n," after ").concat(2e3,"ms")))},2e3);r.then(function(t){clearTimeout(s),e(t)},function(e){clearTimeout(s),t(e)})}))];case 1:return[2,t.sent()]}var r,n})})},_t=function(e){function t(t){var r,n=this;return(n=e.call(this,t)||this).consecutiveFailures=0,n.hasTriggeredFallback=!1,n.emptyFilteredCount=0,n.getSequencesToSend=function(){return a(n,void 0,void 0,function(){var e,t,r,n,s,i,o,a,c,u,h=this;return l(this,function(l){switch(l.label){case 0:e=!1,t=!1,l.label=1;case 1:return l.trys.push([1,9,,10]),r=[],(n=this.db.transaction("sequencesToSend","readwrite")).done.catch(function(r){e||t||(Ct(h.loggerProvider,"".concat(Je,": ").concat(r),r),h.recordFailure())}),s=Et(n.done,Ot,function(){e||t||(t=!0,Ct(h.loggerProvider,"".concat(Je,": transaction timed out")),h.recordFailure())}),[4,n.store.openCursor()];case 2:i=l.sent(),l.label=3;case 3:return i?(o=i.value,a=o.sessionId,0!==(c=o.events).length?[3,5]:(this.maybeLogEmptyFiltered("getSequencesToSend"),[4,i.delete()])):[3,8];case 4:return l.sent(),[3,6];case 5:r.push({events:c,sequenceId:i.key,sessionId:a}),l.label=6;case 6:return[4,i.continue()];case 7:return i=l.sent(),[3,3];case 8:return this.recordSuccess(),s(),[2,r];case 9:return u=l.sent(),t||(e=!0,Ct(this.loggerProvider,"".concat(Je,": ").concat(u),u),this.recordFailure()),[3,10];case 10:return[2,void 0]}})})},n.storeCurrentSequence=function(e){return a(n,void 0,void 0,function(){var t,r,n,s,a,c,u,h,d=this;return l(this,function(l){switch(l.label){case 0:t=!1,r=!1,l.label=1;case 1:return l.trys.push([1,5,,6]),(n=this.db.transaction([kt,It],"readwrite")).done.catch(function(e){t||r||(Ct(d.loggerProvider,"".concat(Je,": ").concat(e),e),d.recordFailure())}),s=Et(n.done,Ot,function(){t||r||(r=!0,Ct(d.loggerProvider,"".concat(Je,": transaction timed out")),d.recordFailure())}),[4,n.objectStore(kt).get(e)];case 2:return!(a=l.sent())||a.tabId&&a.tabId!==this.tabId?(s(),[2,void 0]):0===a.events.length?(this.maybeLogEmptyFiltered("storeCurrentSequence"),s(),[2,void 0]):[4,n.objectStore(It).put({sessionId:e,events:a.events,tabId:this.tabId})];case 3:return c=l.sent(),[4,n.objectStore(kt).put({sessionId:e,events:[],tabId:this.tabId})];case 4:return l.sent(),this.recordSuccess(),s(),a.tabId,u=o(a,["tabId"]),[2,i(i({},u),{sessionId:e,sequenceId:c})];case 5:return h=l.sent(),r||(t=!0,Ct(this.loggerProvider,"".concat(Je,": ").concat(h),h),this.recordFailure()),[3,6];case 6:return[2,void 0]}})})},n.addEventToCurrentSequence=function(e,t){return a(n,void 0,void 0,function(){var r,n,s,i,o,a,c,u,h,d=this;return l(this,function(l){switch(l.label){case 0:r=!1,n=!1,l.label=1;case 1:return l.trys.push([1,15,,16]),(s=this.db.transaction([kt,It],"readwrite")).done.catch(function(e){r||n||(Ct(d.loggerProvider,"".concat(Je,": ").concat(e),e),d.recordFailure())}),i=Et(s.done,Ot,function(){r||n||(n=!0,Ct(d.loggerProvider,"".concat(Je,": transaction timed out")),d.recordFailure())}),[4,s.objectStore(kt).get(e)];case 2:return(null==(o=l.sent())?void 0:o.tabId)&&o.tabId!==this.tabId?o.events.length>0?[4,s.objectStore(It).put({sessionId:e,events:o.events,tabId:o.tabId})]:[3,4]:[3,6];case 3:l.sent(),l.label=4;case 4:return[4,s.objectStore(kt).put({sessionId:e,events:[t],tabId:this.tabId})];case 5:return l.sent(),this.recordSuccess(),i(),[2,void 0];case 6:return(a=o)?[3,8]:[4,s.objectStore(kt).put({sessionId:e,events:[t],tabId:this.tabId})];case 7:return l.sent(),this.recordSuccess(),i(),[2,void 0];case 8:return this.shouldSplitEventsList(a.events,t)?[3,10]:[4,s.objectStore(kt).put({sessionId:e,events:a.events.concat(t),tabId:this.tabId})];case 9:return l.sent(),this.recordSuccess(),i(),[2,void 0];case 10:return 0!==(c=a.events).length?[3,12]:(this.maybeLogEmptyFiltered("addEventToCurrentSequence"),[4,s.objectStore(kt).put({sessionId:e,events:[t],tabId:this.tabId})]);case 11:return l.sent(),this.recordSuccess(),i(),[2,void 0];case 12:return[4,s.objectStore(kt).put({sessionId:e,events:[t],tabId:this.tabId})];case 13:return l.sent(),[4,s.objectStore(It).put({sessionId:e,events:c,tabId:this.tabId})];case 14:return u=l.sent(),this.recordSuccess(),i(),[2,{events:c,sessionId:e,sequenceId:u}];case 15:return h=l.sent(),n||(r=!0,Ct(this.loggerProvider,"".concat(Je,": ").concat(h),h),this.recordFailure()),[3,16];case 16:return[2,void 0]}})})},n.storeSendingEvents=function(e,t){return a(n,void 0,void 0,function(){var r,n;return l(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.db.put(It,{sessionId:e,events:t,tabId:this.tabId})];case 1:return r=s.sent(),this.recordSuccess(),[2,r];case 2:return n=s.sent(),Ct(this.loggerProvider,"".concat(Je,": ").concat(n),n),this.recordFailure(),[3,3];case 3:return[2,void 0]}})})},n.cleanUpSessionEventsStore=function(e,t){return a(n,void 0,void 0,function(){var e;return l(this,function(r){switch(r.label){case 0:if(!t)return[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.db.delete(It,t)];case 2:return r.sent(),this.recordSuccess(),[3,4];case 3:return e=r.sent(),Ct(this.loggerProvider,"".concat(Je,": ").concat(e),e),this.recordFailure(),[3,4];case 4:return[2]}})})},n.db=t.db,n.tabId=t.tabId,n.onPersistentFailure=t.onPersistentFailure,n.consecutiveFailureThreshold=null!==(r=t.consecutiveFailureThreshold)&&void 0!==r?r:1,n}return r(t,e),t.prototype.maybeLogEmptyFiltered=function(e){this.emptyFilteredCount++%100==0&&this.loggerProvider.debug("Filtered empty session replay sequence at ".concat(e," (idb store)"))},t.prototype.recordFailure=function(){var e;this.consecutiveFailures++,!this.hasTriggeredFallback&&this.consecutiveFailures>=this.consecutiveFailureThreshold&&(this.hasTriggeredFallback=!0,null===(e=this.onPersistentFailure)||void 0===e||e.call(this))},t.prototype.recordSuccess=function(){this.consecutiveFailures=0},t.new=function(e,r){var n;return a(this,void 0,void 0,function(){var s,o,a,c,u;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),s="replay"===e?"":"_".concat(e),o="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(s),[4,At(o)];case 1:return a=l.sent(),c=null!==(n=r.tabId)&&void 0!==n?n:function(){try{return crypto.randomUUID()}catch(e){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}(),[2,new t(i(i({},r),{db:a,tabId:c}))];case 2:return u=l.sent(),Ct(r.loggerProvider,"".concat(Je,": ").concat(u),u),[3,3];case 3:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return a(this,void 0,void 0,function(){var t,r,n,s,i,a,u,h;return l(this,function(l){switch(l.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(s=l.sent())?s.tabId&&s.tabId!==this.tabId?[2,void 0]:(s.tabId,[2,[i=o(s,["tabId"])]]):[2,void 0];case 2:t=[],l.label=3;case 3:return l.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=c.apply(void 0,[l.sent()]),n=r.next(),l.label=5;case 5:if(n.done)return[3,7];if((s=n.value).tabId&&s.tabId!==this.tabId)return[3,6];s.tabId,i=o(s,["tabId"]),t.push(i),l.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return a=l.sent(),u={error:a},[3,10];case 9:try{n&&!n.done&&(h=r.return)&&h.call(r)}finally{if(u)throw u.error}return[7];case 10:return[2,t]}})})},t}(xt),Lt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t.emptyFilteredCount=0,t}return r(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=h([],u(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},t.prototype.maybeLogEmptyFiltered=function(e){this.emptyFilteredCount++%100==0&&this.loggerProvider.debug("Filtered empty session replay sequence at ".concat(e," (in-memory store)"))},t.prototype.getSequencesToSend=function(){return a(this,void 0,void 0,function(){var e,t,r,n,s,i,o,a,h,d;return l(this,function(l){e=[];try{for(t=c(Object.entries(this.finalizedSequences)),r=t.next();!r.done;r=t.next())n=u(r.value,2),s=n[0],i=n[1],o=i.sessionId,0!==(a=i.events).length?e.push({sequenceId:Number(s),sessionId:o,events:a}):(this.maybeLogEmptyFiltered("getSequencesToSend"),delete this.finalizedSequences[Number(s)])}catch(e){h={error:e}}finally{try{r&&!r.done&&(d=t.return)&&d.call(t)}finally{if(h)throw h.error}}return[2,e]})})},t.prototype.storeCurrentSequence=function(e){return a(this,void 0,void 0,function(){var t;return l(this,function(r){return(t=this.sequences[e])?0===t.length?(this.maybeLogEmptyFiltered("storeCurrentSequence"),[2,void 0]):[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return a(this,void 0,void 0,function(){var r;return l(this,function(n){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(0===this.sequences[e].length?this.maybeLogEmptyFiltered("addEventToCurrentSequence"):r=this.addSequence(e)),this.sequences[e].push(t),[2,r]})})},t.prototype.storeSendingEvents=function(e,t){return a(this,void 0,void 0,function(){return l(this,function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return a(this,void 0,void 0,function(){return l(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(xt),Nt=function(e){var t=e.config,r=e.minInterval,n=e.maxInterval,s=e.maxPersistedEventsSize,o=e.type,c=e.payloadBatcher,d=e.storeType,p=e.trackDestinationWorkerScript,f=e.shouldSend;return a(void 0,void 0,void 0,function(){function e(e){return void 0===e&&(e=!1),a(this,void 0,void 0,function(){return l(this,function(t){return[2,m.flush(e)]})})}var g,m,v,y,w,b,S,x,C,k,I,O,E,M,R,P,T;return l(this,function(A){switch(A.label){case 0:return g=null!==(T=t.maxSingleEventSizeBytes)&&void 0!==T?T:ce,m=new Qe(i(i({},t),{loggerProvider:t.loggerProvider,payloadBatcher:c,workerScript:p})),v=function(){return new Lt({loggerProvider:t.loggerProvider,maxInterval:n,minInterval:r,maxPersistedEventsSize:s})},w=!1,S=function(){return a(void 0,void 0,void 0,function(){var e,r,n;return l(this,function(s){switch(s.label){case 0:return w?(w=!1,t.loggerProvider.warn("IDB store is experiencing repeated failures; falling back to in-memory event store."),y?[4,b.getSequencesToSend()]:[3,2]):[2];case 1:return r=s.sent(),[3,3];case 2:r=void 0,s.label=3;case 3:return e=r,b=v(),e&&y&&(n=y,e.forEach(function(e){E({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})})),[2]}})})},x=function(){return a(void 0,void 0,void 0,function(){var e;return l(this,function(i){switch(i.label){case 0:return[4,_t.new(o,{loggerProvider:t.loggerProvider,minInterval:r,maxInterval:n,maxPersistedEventsSize:s,apiKey:t.apiKey,onPersistentFailure:function(){S()}})];case 1:return(e=i.sent())?(w=!0,[2,e]):(t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,v()])}})})},"idb"!==d?[3,2]:[4,x()];case 1:return C=A.sent(),[3,3];case 2:C=v(),A.label=3;case 3:return b=C,k=[],I=0,O=function(e){if(!(e<=I)){var t=Math.min(e-I,k.length);t>0&&(k.splice(0,t),I=e)}},E=function(e){var r=e.events,n=e.sessionId,s=e.deviceId,i=e.sequenceId,c=r.map(function(e){return{event:e,bytes:new Blob([e]).size}}),u=c.filter(function(e){return e.bytes>g});u.length>0&&t.loggerProvider.warn("Dropping ".concat(u.length," oversized event(s) from session replay sequence before send. Sizes: ").concat(u.map(function(e){return"".concat(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."));var h=u.length>0?c.filter(function(e){return e.bytes<=g}).map(function(e){return e.event}):r;0!==h.length?(t.debugMode&&Ee().then(function(e){var r=e.totalStorageSize,n=e.percentOfQuota,s=e.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(r," KB, percentage of quota: ").concat(n,"%, usage details: ").concat(s))}).catch(function(){}),m.sendEventsList({events:h,sessionId:n,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:s,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:o,onComplete:function(){return a(void 0,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,b.cleanUpSessionEventsStore(n,i)];case 1:return e.sent(),[2]}})})}})):b.cleanUpSessionEventsStore(n,i).catch(function(e){t.loggerProvider.warn("Failed to clean up session replay events store:",e)})},M=function(e){var r=e.sessionId,n=e.deviceId;if(y=n,!f||f()){var s=I+k.length;b.storeCurrentSequence(r).then(function(e){e&&(O(s),E({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n}))}).catch(function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)})}},R=function(e){var r=e.deviceId;return a(void 0,void 0,void 0,function(){var e;return l(this,function(n){switch(n.label){case 0:return y=r,[4,b.getSequencesToSend()];case 1:return(null==(e=n.sent())?void 0:e.length)?(t.loggerProvider.log("Draining ".concat(e.length," stored sequence(s) from previous session.")),e.length>1&&m.markCoalesceNextFlush(),e.forEach(function(e){E({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:r})}),[2]):[2]}})})},P=function(e){var r=e.event,n=e.sessionId,s=e.deviceId;y=s;var i=!f||f(),o=I+k.length;k.push(r.data),b.addEventToCurrentSequence(n,r.data).then(function(e){if(e){if(!i)return b.cleanUpSessionEventsStore(e.sessionId,e.sequenceId).catch(function(e){t.loggerProvider.warn("Failed to clean up dropped session replay sequence:",e)}),void O(o);O(o),E({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:s})}}).catch(function(e){t.loggerProvider.warn("Failed to add event to session replay capture:",e)})},[2,{sendCurrentSequenceEvents:M,addEvent:P,sendStoredEvents:R,flush:e,getBeaconEvents:function(){return h([],u(k),!1)},dropPendingBeaconEvents:function(){O(I+k.length)},trackDestination:m}]}})})},Dt=function(){function e(){for(var e=[],t=0;t0&&(n=s[0]),Bt(n)}throw new Error("Selector was not found.")}function Ut(e,t,r){for(var n=null,s=[],i=e,o=0,a=function(){var e,a,l=(new Date).getTime()-Pt.getTime();if(void 0!==Mt.timeoutMs&&l>Mt.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(l,"ms"));var d=Vt(function(e){var t=e.getAttribute("id");return t&&Mt.idName(t)?{name:"#"+CSS.escape(t),penalty:0}:null}(i))||Vt.apply(void 0,h([],u(function(e){return Array.from(e.attributes).filter(function(e){return Mt.attr(e.name,e.value)}).map(function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}})}(i)),!1))||Vt.apply(void 0,h([],u(function(e){return Array.from(e.classList).filter(Mt.className).map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(i)),!1))||Vt(function(e){var t=e.tagName.toLowerCase();return Mt.tagName(t)?{name:t,penalty:2}:null}(i))||[{name:"*",penalty:3}],p=function(e){var t=e.parentNode;if(!t)return null;var r=t.firstChild;if(!r)return null;for(var n=0;r&&(r.nodeType===Node.ELEMENT_NODE&&n++,r!==e);)r=r.nextSibling;return n}(i);if("all"==t)p&&(d=d.concat(d.filter($t).map(function(e){return Wt(e,p)})));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter($t).map(function(e){return Wt(e,p)})));else if("one"==t){var f=u(d=d.slice(0,1),1)[0];p&&$t(f)&&(d=[Wt(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[Wt(d[0],p)]));try{for(var g=(e=void 0,c(d)),m=g.next();!m.done;m=g.next())(f=m.value).level=o}catch(t){e={error:t}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(e)throw e.error}}if(s.push(d),s.length>=Mt.seedMinLength&&(n=jt(s,r)))return"break";i=i.parentElement,o++};i&&"break"!==a(););return n||(n=jt(s,r)),!n&&r?r():n}function jt(e,t){var r,n,s=Jt(Ht(e));if(s.length>Mt.threshold)return t?t():null;try{for(var i=c(s),o=i.next();!o.done;o=i.next()){var a=o.value;if(qt(a))return a}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return null}function Bt(e){for(var t=e[0],r=t.name,n=1;n ").concat(r):"".concat(e[n].name," ").concat(r),t=e[n]}return r}function zt(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function qt(e){var t=Bt(e);switch(Rt.querySelectorAll(t).length){case 0:throw new Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function Wt(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function $t(e){return"html"!==e.name&&!e.name.startsWith("#")}function Vt(){for(var e=[],t=0;t0?r:null}function Gt(e){return null!=e}function Ht(e,t){var r,n,s,i,o,a;return void 0===t&&(t=[]),l(this,function(l){switch(l.label){case 0:if(!(e.length>0))return[3,9];l.label=1;case 1:l.trys.push([1,6,7,8]),r=c(e[0]),n=r.next(),l.label=2;case 2:return n.done?[3,5]:(s=n.value,[5,c(Ht(e.slice(1,e.length),t.concat(s)))]);case 3:l.sent(),l.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return i=l.sent(),o={error:i},[3,8];case 7:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:l.sent(),l.label=11;case 11:return[2]}})}function Jt(e){return h([],u(e),!1).sort(function(e,t){return zt(e)-zt(t)})}function Kt(e,t,r){var n,s,i;return void 0===r&&(r={counter:0,visited:new Map}),l(this,function(o){switch(o.label){case 0:if(!(e.length>2&&e.length>Mt.optimizedMinLength))return[3,5];n=1,o.label=1;case 1:return nMt.maxNumberOfTries?[2]:(r.counter+=1,(s=h([],u(e),!1)).splice(n,1),i=Bt(s),r.visited.has(i)?[2]:qt(s)&&function(e,t){return Rt.querySelector(Bt(e))===t}(s,t)?[4,s]:[3,4]):[3,5];case 2:return o.sent(),r.visited.set(i,!0),[5,c(Kt(s,t,r))];case 3:o.sent(),o.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var Yt=function(e){var t=e.version,r=e.events,n=[];return r.forEach(function(e){var t=JSON.parse(e);t.count=1,"click"===t.type&&n.push(t)}),{version:t,events:n}},Zt=function(e){var t=e.version,r=e.events,n=[];r.forEach(function(e){var t=JSON.parse(e);"click"===t.type&&n.push(t)});var s=n.reduce(function(e,t){var r=t.x,n=t.y,s=t.selector,o=t.timestamp,a=o-o%36e5,l="".concat(r,":").concat(n,":").concat(null!=s?s:"",":").concat(a);return e[l]?e[l].count+=1:e[l]=i(i({},t),{timestamp:a,count:1}),e},{});return{version:t,events:Object.values(s)}},Qt=function(e,t){var r=this;this.createHook=function(e){var t=e.eventsManager,n=e.sessionId,s=e.deviceIdFn,i=e.mirror,o=e.ugcFilterRules,a=e.performanceOptions;return function(e){if(e.type===Ue.Click){var l=m();if(l){var c=l.location,u=l.innerHeight,h=l.innerWidth;if(c){var d=e.x,p=e.y;if(void 0!==d&&void 0!==p){var f,g=i.getNode(e.id);if(g)try{f=Ft(g,a)}catch(e){r.logger.debug("error resolving selector from finder")}var v=Oe(c.href,o),y={x:d+r.scrollWatcher.currentScrollX,y:p+r.scrollWatcher.currentScrollY,selector:f,viewportHeight:u,viewportWidth:h,pageUrl:v,timestamp:Date.now(),type:"click"},w=s();w&&t.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(y)},deviceId:w})}}}}}},this.logger=e,this.scrollWatcher=t};function Xt(){var e=m();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||0}function er(){var e=m();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||0}var tr=function(){function e(e,t){var r=m();r&&r.navigator&&"function"==typeof r.navigator.sendBeacon?this.sendBeacon=function(e,t){try{if(r.navigator.sendBeacon(e,JSON.stringify(t)))return!0}catch(e){}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(e,t){var r=new XMLHttpRequest;return r.open("POST",e,!0),r.setRequestHeader("Accept","*/*"),r.send(JSON.stringify(t)),!0},this.basePageUrl=ve(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e,this.handleSendEvents=t.handleSendEvents,this.loggerProvider=t.loggerProvider}return e.prototype.send=function(e,t){var r,n=this,s=this.context,i=s.sessionId,o=s.type;if(this.handleSendEvents){var a=new URLSearchParams({device_id:e,session_id:String(i),type:String(o)}),l="".concat(this.basePageUrl,"?").concat(a.toString()),c={"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(this.apiKey)};try{this.handleSendEvents({url:l,method:"POST",headers:c,body:JSON.stringify(t),keepalive:!0}).catch(function(e){var t;null===(t=n.loggerProvider)||void 0===t||t.warn("Custom transport failed to send session replay interaction beacon:",e)})}catch(e){null===(r=this.loggerProvider)||void 0===r||r.warn("Custom transport threw while sending session replay interaction beacon:",e)}}else{var u=new URLSearchParams({device_id:e,session_id:String(i),type:String(o),api_key:this.apiKey}),h="".concat(this.basePageUrl,"?").concat(u.toString());this.sendBeacon(h,t)||this.sendXhr(h,t)}},e}(),rr=function(){function e(e,t){var r=this;this.timestamp=Date.now(),this.hook=function(e){r.update(e)},this.send=function(e){return function(t){var n,s,i,o,a=e(),l=m();if(l&&a){var c=null!==(n=l.scrollX)&&void 0!==n?n:0,u=null!==(s=l.scrollY)&&void 0!==s?s:0;(c>0||u>0)&&r.update({id:1,x:c,y:u}),r.transport.send(a,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:Xt(),viewportWidth:er(),pageUrl:Oe(l.location.href,null!==(o=null===(i=r.config.interactionConfig)||void 0===i?void 0:i.ugcFilterRules)&&void 0!==o?o:[]),timestamp:r.timestamp,type:"scroll"}]})}}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=er(),this._maxScrollHeight=Xt(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new tr(t,r),r)},Object.defineProperty(e.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollX",{get:function(){return this._currentScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollY",{get:function(){return this._currentScrollY},enumerable:!1,configurable:!0}),e.prototype.update=function(e){var t=Date.now();if(this._currentScrollX=e.x,this._currentScrollY=e.y,e.x>this._maxScrollX){var r=er();this._maxScrollX=e.x;var n=e.x+r;n>this._maxScrollWidth&&(this._maxScrollWidth=n),this.timestamp=t}if(e.y>this._maxScrollY){var s=Xt();this._maxScrollY=e.y;var i=e.y+s;i>this._maxScrollHeight&&(this._maxScrollHeight=i),this.timestamp=t}},e}(),nr=function(e){var t=e.sessionId,r=e.deviceId;this.deviceId=r,this.sessionId=t,t&&r&&(this.sessionReplayId=function(e,t){return"".concat(t,"/").concat(e)}(t,r))},sr=864e5,ir=function(e){return"".concat("AMP_SR_START_").concat(e.substring(0,10),"_")},or=function(e,t){return"".concat(ir(e)).concat(t)},ar=function(){try{var e=m();return null==e?void 0:e.localStorage}catch(e){return}},lr=new function(){var e=this;this.dbs={},this.createStore=function(t){return a(e,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,ut(t,1,{upgrade:function(e){e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return a(e,void 0,void 0,function(){var e,r;return l(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.getTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.sessionId;return a(e,void 0,void 0,function(){var e,t,i,o;return l(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(s),[4,e.get("sessionTargetingMatch",t)];case 2:return[2,null==(i=a.sent())?void 0:i.targetingMatch];case 3:return o=a.sent(),Ct(r,"Failed to get targeting match for session id ".concat(s,": ").concat(o),o),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.sessionId,i=t.targetingMatch;return a(e,void 0,void 0,function(){var e,t,o;return l(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(s),[4,e.put("sessionTargetingMatch",{targetingMatch:i,sessionId:t,lastUpdated:Date.now()})];case 2:return[2,a.sent()];case 3:return o=a.sent(),Ct(r,"Failed to store targeting match for session id ".concat(s,": ").concat(o),o),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.currentSessionId;return a(e,void 0,void 0,function(){var e,t,i,o,a,c,u,h;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,8,,9]),[4,this.openOrCreateDB(n)];case 1:return e=l.sent(),t=String(s),[4,(i=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:o=l.sent(),a=0,l.label=3;case 3:return a1728e5?[4,i.store.delete(c.sessionId)]:[3,5]):[3,6];case 4:l.sent(),l.label=5;case 5:return a++,[3,3];case 6:return[4,i.done];case 7:return l.sent(),[3,9];case 8:return h=l.sent(),Ct(r,"Failed to clear old targeting matches for sessions: ".concat(h),h),[3,9];case 9:return[2]}})})}},cr=function(e){var t=e.sessionId,r=e.targetingConfig,n=e.loggerProvider,s=e.apiKey,o=e.targetingParams,c=e.urlChange,u=void 0!==c&&c;return a(void 0,void 0,void 0,function(){var e,a,c,h,d,p;return l(this,function(l){switch(l.label){case 0:return[4,lr.clearStoreOfOldSessions({loggerProvider:n,apiKey:s,currentSessionId:t})];case 1:return l.sent(),[4,lr.getTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t})];case 2:if(!0===l.sent()&&!u)return[2,!0];e=!0,l.label=3;case 3:return l.trys.push([3,6,,7]),[4,Promise.resolve().then(function(){return Sn})];case 4:return a=l.sent().evaluateTargeting,c=i(i({},o),{flag:r,sessionId:"string"==typeof t?parseInt(t,10):t,apiKey:s,loggerProvider:n}),[4,a(c)];case 5:return(h=l.sent())&&h.sr_targeting_config&&(e="on"===h.sr_targeting_config.key),lr.storeTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t,targetingMatch:e}),[3,7];case 6:return d=l.sent(),p=d,n.warn(p.message),[3,7];case 7:return[2,e]}})})},ur=2654435761,hr=2246822519,dr=3266489917,pr=374761393;function fr(e,t){return(e<>>32-t)>>>0}function gr(e,t){return e=fr(e=e+Math.imul(t,hr)>>>0,13),Math.imul(e,ur)>>>0}function mr(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}var vr="__amplitude_url_tracking_patched__",yr=new WeakMap;function wr(e,t,r){if(void 0===r&&(r={}),!(null==e?void 0:e.location))return function(){};var n=r.enablePolling,s=void 0!==n&&n,i=r.pollingInterval,o=void 0===i?re:i;if(s){var a=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""},l=a(),c=e.setInterval(function(){var e=a();e!==l&&(l=e,t(e))},o);return function(){null!=c&&e.clearInterval(c)}}var u=yr.get(e);if(!u){var h=void 0,d=new Set,p=function(){var t=function(){var t;return null!==(t=e.location.href)&&void 0!==t?t:""}();void 0!==h&&t===h||(h=t,d.forEach(function(e){return e(t)}))},f=function(e){var t=function(){for(var t=[],r=0;r0?Oe(s,c):s,title:i,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();t(n)}},m=wr(r,function(){return g()},u?{enablePolling:!0,pollingInterval:h}:{});return g(),function(){return m()}},options:e}}br();var Sr,xr,Cr,kr=function(){function e(){this.pendingLoadListeners=new Map}return e.prototype.start=function(){var e,t=this;null===(e=this.mutationObserver)||void 0===e||e.disconnect(),m()&&(this.sendToAllIframes({type:fe,action:"start"}),this.mutationObserver=new MutationObserver(function(e){var r,n,s,i,o,a;try{for(var l=c(e),u=l.next();!u.done;u=l.next()){var h=u.value;try{for(var d=(s=void 0,c(Array.from(h.addedNodes))),p=d.next();!p.done;p=d.next())(m=p.value)instanceof HTMLIFrameElement?t.sendToIframeAfterLoad(m):m instanceof Element&&m.querySelectorAll("iframe").forEach(function(e){t.sendToIframeAfterLoad(e)})}catch(e){s={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(s)throw s.error}}try{for(var f=(o=void 0,c(Array.from(h.removedNodes))),g=f.next();!g.done;g=f.next()){var m;if((m=g.value)instanceof HTMLIFrameElement){var v=t.pendingLoadListeners.get(m);v&&(m.removeEventListener("load",v),t.pendingLoadListeners.delete(m))}}}catch(e){o={error:e}}finally{try{g&&!g.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}),this.mutationObserver.observe(document.documentElement,{childList:!0,subtree:!0}))},e.prototype.stop=function(){var e;null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=void 0,this.pendingLoadListeners.forEach(function(e,t){t.removeEventListener("load",e)}),this.pendingLoadListeners.clear(),this.sendToAllIframes({type:fe,action:"stop"})},e.prototype.sendToIframeAfterLoad=function(e){var t=this,r=function(){t.pendingLoadListeners.delete(e),t.sendToIframe(e,{type:fe,action:"start"})};this.pendingLoadListeners.set(e,r),e.addEventListener("load",r,{once:!0})},e.prototype.sendToAllIframes=function(e){var t=this;document.querySelectorAll("iframe").forEach(function(r){return t.sendToIframe(r,e)})},e.prototype.sendToIframe=function(e,t){var r;try{null===(r=e.contentWindow)||void 0===r||r.postMessage(t,"*")}catch(e){}},e}(),Ir=function(){function e(){var e=this;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=function(t){var r=m();r&&(r.removeEventListener("blur",e.blurListener),r.removeEventListener("focus",e.focusListener),!t&&r.addEventListener("blur",e.blurListener),!t&&r.addEventListener("focus",e.focusListener),r.self&&"onpagehide"in r.self?(r.removeEventListener("pagehide",e.pageLeaveListener),!t&&r.addEventListener("pagehide",e.pageLeaveListener)):(r.removeEventListener("beforeunload",e.pageLeaveListener),!t&&r.addEventListener("beforeunload",e.pageLeaveListener)))},this.blurListener=function(){e.sendEvents()},this.focusListener=function(){var t;if(e.recordCancelCallback&&e.recordFunction){if(!1===(null===(t=e.config)||void 0===t?void 0:t.captureFullSnapshotOnFocus))return;try{e.recordFunction.takeFullSnapshot(!0)}catch(t){e.loggerProvider.warn("Failed to take full snapshot on focus:",t)}}else e.recordEventsInFlight||e.recordEvents(!1)},this.pageLeaveListener=function(t){var r;null===(r=e.eventCompressor)||void 0===r||r.flushQueue(),e.sendEvents(),e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,r,n,i){return void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===i&&(i=!1),a(e,void 0,void 0,function(){var e,o,a,c,u,h,d,p,f,g,v,y;return l(this,function(l){switch(l.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig){if(!r)return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.")}return this.lastTargetingParams=t,(e=this.config.targetingConfig)&&!this.sessionTargetingMatch?(o=i?this.latestUrlChangeTargetingEvaluationId:void 0,(a=t.event)&&Object.values(s).includes(a.event_type)&&(a=void 0),c=null!==(v=null!==(p=null===(d=t.page)||void 0===d?void 0:d.url)&&void 0!==p?p:null===(g=null===(f=m())||void 0===f?void 0:f.location)||void 0===g?void 0:g.href)&&void 0!==v?v:"",u=null!==(y=t.page)&&void 0!==y?y:""!==c?{url:c}:void 0,[4,cr({sessionId:this.identifiers.sessionId,targetingConfig:e,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:a,page:u},urlChange:i})]):[3,2];case 1:if(h=l.sent(),i&&void 0!==o&&o!==this.latestUrlChangeTargetingEvaluationId)return this.loggerProvider.debug("Ignoring stale URL-change targeting result #".concat(o,"; latest is #").concat(this.latestUrlChangeTargetingEvaluationId,".")),[2];this.sessionTargetingMatch=this.sessionTargetingMatch||h,this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:a,targetingParams:t},null,2)),l.label=2;case 2:return r?(this.initialize(!0),[3,5]):[3,3];case 3:return!n&&this.recordCancelCallback?[3,5]:(this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),[4,this.recordEvents()]);case 4:l.sent(),l.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n=!0),a(e,void 0,void 0,function(){var e,s,o,a;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=void 0,(s=this.config)&&t!==Y.METADATA?(e={config:Me(s),version:Ye},n?[4,Ee()]:[3,2]):[3,2];case 1:o=l.sent(),e=i(i({},o),e),l.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(t,i(i({},r),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(t," due to no ongoing recording.")),[3,4];case 3:return a=l.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",a),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var t,r,n;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null===(t=e.networkObservers)||void 0===t||t.stop(),null===(r=e.crossOriginIframeCoordinator)||void 0===r||r.stop(),e.crossOriginIframeCoordinator=null,null===(n=e.crossOriginParentSignalCleanup)||void 0===n||n.call(e),e.crossOriginParentSignalCleanup=null}catch(t){var s=t;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(s.toString()))}},this.loggerProvider=new ge(new S)}return e.prototype.init=function(e,t){return w(this._init(e,t))},e.prototype.setupUrlChangeListener=function(){var e,t,r=this;null===(e=this.urlChangeCleanup)||void 0===e||e.call(this);var n=m();if(null==n?void 0:n.location){var s=!!(null===(t=this.config)||void 0===t?void 0:t.targetingConfig),i=wr(n,function(e){if(r.currentPageUrl=e,s){var t=++r.latestUrlChangeTargetingEvaluationId;r.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:e}},!1,!1,!0),r.loggerProvider.debug("Queued URL-change targeting re-evaluation #".concat(t," for ").concat(e,"."))}});this.urlChangeCleanup=function(){i(),r.urlChangeCleanup=null}}},e.prototype.isBelowMinSessionDuration=function(){var e,t=null===(e=this.config)||void 0===e?void 0:e.minSessionDurationMs;return void 0!==t&&void 0!==this.sessionStartTime&&Date.now()-this.sessionStartTime=sr)&&a.push(f)}}try{for(var d=c(a),p=d.next();!p.done;p=d.next()){var f=p.value;i.removeItem(f)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(n)throw n.error}}}catch(e){null==r||r.debug("Failed to prune stale replay start times: ".concat(String(e)))}}}(e,a,this.loggerProvider),this.sessionStartTime=void 0!==t.sessionId&&null!==(n=function(e,t,r,n){var s=ar();if(s){var i=or(e,t);try{var o=s.getItem(i);if(null!==o){var a=Number(o);if(Number.isFinite(a)&&a>0&&a<=r&&r-a0){G=this.pendingEmitEvents.splice(0);try{for(H=c(G),J=H.next();!J.done;J=H.next())Y=J.value,Q=Y.event,X=Y.sessionId,this.eventCompressor.enqueueEvent(Q,X)}catch(e){te={error:e}}finally{try{J&&!J.done&&(re=H.return)&&re.call(H)}finally{if(te)throw te.error}}}return this.pageLeaveFns=h(h([],u(this.pageLeaveFns),!1),[function(){var e;if(ne.config&&(null===(e=ne.identifiers)||void 0===e?void 0:e.sessionId)&&U){var t=U.getBeaconEvents();if(t.length){var r=ne.getDeviceId();r&&(ne.isBelowMinSessionDuration()||U.trackDestination.sendBeacon({events:t,sessionId:ne.identifiers.sessionId,deviceId:r,apiKey:ne.config.apiKey,serverZone:ne.config.serverZone}))}}}],!1),[4,this.initializeNetworkObservers()];case 12:return l.sent(),(null===(w=m())||void 0===w?void 0:w.opener)&&(function(e){var t=e;if(!0!==t[Z]){t[Z]=!0;var r="https://cdn.amplitude.com/libs/background-capture-1.0.3.js.gz",n=null,s=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,i;null===(i=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===i||i.call(t,"Initializing background capture (external script)");var o=new URL(r,e.endpoint).toString();e.loadScriptOnce(o).then(function(){var t,r,i;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Background capture script loaded (external)"),n=null===(i=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===i?void 0:i.call(window,{messenger:e,onBackgroundCapture:s}),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==n?void 0:n.close)||void 0===e||e.call(n),n=null})}}(ee=K()),ee.setup(i({logger:this.loggerProvider},this.config.serverZone&&{endpoint:V[this.config.serverZone]}))),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:t.userProperties,page:this.getCurrentPageForTargeting()},!0)];case 13:return l.sent(),(this.config.targetingConfig||(null!==(C=null===(x=null===(b=this.config.privacyConfig)||void 0===b?void 0:b.urlMaskLevels)||void 0===x?void 0:x.length)&&void 0!==C?C:0)>0)&&this.setupUrlChangeListener(),[2]}})})},e.prototype.setSessionId=function(e,t){return w(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n,s,i,o;return a(this,void 0,void 0,function(){var a,c,u,h,d;return l(this,function(l){switch(l.label){case 0:return a=null===(n=this.identifiers)||void 0===n?void 0:n.sessionId,c=this.getDeviceId(),void 0===a||a!==e||void 0!==t&&t!==c||void 0!==(null==r?void 0:r.userProperties)&&0!==Object.keys(r.userProperties).length?(this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,a&&this.sendEvents(a),(u=a!==e)&&(null===(s=this.rrwebEventManager)||void 0===s||s.dropPendingBeaconEvents()),h=t||this.getDeviceId(),this.identifiers=new nr({sessionId:e,deviceId:h}),u&&(this.sessionStartTime=Date.now(),this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,(null===(i=this.config)||void 0===i?void 0:i.apiKey)&&(function(e,t,r,n){var s=ar();if(s)try{s.setItem(or(e,t),String(r))}catch(e){null==n||n.debug("Failed to write replay start time to storage: ".concat(String(e)))}}(this.config.apiKey,e,this.sessionStartTime,this.loggerProvider),void 0!==a&&function(e,t,r){var n=ar();if(n)try{n.removeItem(or(e,t))}catch(e){null==r||r.debug("Failed to remove replay start time from storage: ".concat(String(e)))}}(this.config.apiKey,a,this.loggerProvider))),this.joinedConfigGenerator&&a?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2]):[2];case 1:d=l.sent().joinedConfig,this.config=d,l.label=2;case 2:return(null===(o=this.config)||void 0===o?void 0:o.targetingConfig)?[4,this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties,page:this.getCurrentPageForTargeting()},!1,!0)]:[3,4];case 3:return l.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:l.sent(),l.label=6;case 6:return[2]}})})},e.prototype.getSessionReplayProperties=function(){var e,t=this.config,r=this.identifiers;if(!t||!r)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var n=this.getShouldRecord(),s={};return n&&((e={})[X]=r.sessionReplayId?r.sessionReplayId:null,s=e,t.debugMode&&(s[ne]=JSON.stringify({appHash:U(t.apiKey).toString()}))),this.addCustomRRWebEvent(Y.GET_SR_PROPS,{shouldRecord:n,eventProperties:s},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,s},e.prototype.sendEvents=function(e){var t,r,n=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),s=this.getDeviceId();if(this.eventsManager&&n&&s){if(this.isBelowMinSessionDuration()){var i=this.sessionStartTime,o=this.config.minSessionDurationMs;return this.loggerProvider.log("Session ".concat(n," not sent: duration ").concat(Date.now()-i,"ms is below minimum ").concat(o,"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;var a=void 0!==this.sessionStartTime?Date.now()-this.sessionStartTime:void 0;this.addCustomRRWebEvent(Y.REPLAY_GATE_DECISION,{sessionId:n,suppressedSendCount:this.suppressedSendCount,elapsedMs:a,minSessionDurationMs:this.config.minSessionDurationMs},!1)}this.eventsManager.sendCurrentSequenceEvents({sessionId:n,deviceId:s})}},e.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),a(this,void 0,void 0,function(){var r;return l(this,function(n){return(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId)?(r=this.getDeviceId())?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:r}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()]):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])})})},e.prototype.shouldOptOut=function(){var e,t,r,n;return(null===(e=this.config)||void 0===e?void 0:e.instanceName)&&(r=(n=this.config.instanceName,void 0===n&&(n=p),F.getInstance(n)).identityStore.getIdentity().optOut),void 0!==r?r:null===(t=this.config)||void 0===t?void 0:t.optOut},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e,t,r=!1,n="",s=!1;return this.config.targetingConfig?this.sessionTargetingMatch?(n="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(n),r=!0,s=!0):(n="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(n),r=!1,s=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,function(e,t){void 0===t&&(t=0);var r,n=function(e){for(var t=[],r=0;r=55296&&n<=56319&&r+1=56320&&s<=57343&&(n=s-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),s=n.length,i=0;if(s>=16){for(var o=t+ur+hr>>>0,a=t+hr>>>0,l=t>>>0,c=t-ur>>>0;i<=s-16;)o=gr(o,mr(n,i)),a=gr(a,mr(n,i+=4)),l=gr(l,mr(n,i+=4)),c=gr(c,mr(n,i+=4)),i+=4;r=fr(o,1)+fr(a,7)+fr(l,12)+fr(c,18)>>>0}else r=t+pr>>>0;for(r=r+s>>>0;i<=s-4;)r=r+Math.imul(mr(n,i),dr)>>>0,r=Math.imul(fr(r,17),668265263)>>>0,i+=4;for(;i>>0,r=Math.imul(fr(r,11),ur)>>>0,i++;return r^=r>>>15,r=Math.imul(r,hr)>>>0,r^=r>>>13,r=Math.imul(r,dr)>>>0,(r^=r>>>16)>>>0}(e.toString())%1e6/1e60?"*":(null==r?void 0:r.maskSelector)||void 0},e.prototype.getRecordingPlugins=function(e){var t,r,n,s,i,o;return a(this,void 0,void 0,function(){var a,c,u,h;return l(this,function(l){switch(l.label){case 0:a=[];try{c=br({ugcFilterRules:(null===(r=null===(t=this.config)||void 0===t?void 0:t.interactionConfig)||void 0===r?void 0:r.ugcFilterRules)||[],enablePolling:(null===(n=this.config)||void 0===n?void 0:n.enableUrlChangePolling)||!1,pollingInterval:null===(s=this.config)||void 0===s?void 0:s.urlChangePollingInterval,captureDocumentTitle:null===(i=this.config)||void 0===i?void 0:i.captureDocumentTitle}),a.push(c)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null===(o=null==e?void 0:e.console)||void 0===o?void 0:o.enabled))return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return Ma})];case 2:return u=l.sent().getRecordConsolePlugin,a.push(u({level:e.console.levels})),[3,4];case 3:return h=l.sent(),this.loggerProvider.warn("Failed to load console plugin:",h),[3,4];case 4:return[2,a.length>0?a:void 0]}})})},e.prototype.getRecordFunction=function(){return a(this,void 0,void 0,function(){var e,t;return l(this,function(r){switch(r.label){case 0:if(this.recordFunction)return[2,this.recordFunction];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return wp})];case 2:return e=r.sent().record,this.recordFunction=e,[2,e];case 3:return t=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",t),[2,null];case 4:return[2]}})})},e.prototype.recordEvents=function(e){return void 0===e&&(e=!0),a(this,void 0,void 0,function(){var t;return l(this,function(r){switch(r.label){case 0:if(this.recordEventsInFlight)return this.recordEventsPendingShouldLogMetadata=e,[2];this.recordEventsInFlight=!0,r.label=1;case 1:return r.trys.push([1,,6,7]),[4,this._recordEvents(e)];case 2:r.sent(),r.label=3;case 3:return null===this.recordEventsPendingShouldLogMetadata?[3,5]:(t=this.recordEventsPendingShouldLogMetadata,this.recordEventsPendingShouldLogMetadata=null,[4,this._recordEvents(t)]);case 4:return r.sent(),[3,3];case 5:return[3,7];case 6:return this.recordEventsInFlight=!1,this.recordEventsPendingShouldLogMetadata=null,[7];case 7:return[2]}})})},e.prototype._recordEvents=function(e){var t,r,n,s,o,c,u,h;return void 0===e&&(e=!0),a(this,void 0,void 0,function(){var a,d,p,f,g,v,y,w,b,S,x,C,k,I,O,E,M,R,P,T=this;return l(this,function(l){switch(l.label){case 0:return a=this.config,d=this.getShouldRecord(),p=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,d&&p&&a?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(f=l.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:l.sent(),g=null===(r=a.loggingConfig)||void 0===r?void 0:r.network,v=ve(a.serverZone,a.trackServerUrl),y=[oe,ae,le,v],null===(n=this.networkObservers)||void 0===n||n.start(function(e){y.some(function(t){return e.url.startsWith(t)})||T.addCustomRRWebEvent(Y.FETCH_REQUEST,e)},g),w=a.interactionConfig,b=a.loggingConfig,S=(null==w?void 0:w.enabled)?{mouseInteraction:this.eventsManager&&(null===(s=this.clickHandler)||void 0===s?void 0:s.createHook({eventsManager:this.eventsManager,sessionId:p,deviceIdFn:this.getDeviceId.bind(this),mirror:f.mirror,ugcFilterRules:null!==(o=w.ugcFilterRules)&&void 0!==o?o:[],performanceOptions:null===(c=a.performanceConfig)||void 0===c?void 0:c.interaction})),scroll:this.scrollHook}:{},x=(null==w?void 0:w.enabled)&&w.ugcFilterRules?w.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(p,".")),l.label=3;case 3:return l.trys.push([3,5,,6]),C=!!(null===(u=a.crossOriginIframes)||void 0===u?void 0:u.enabled),k=!1!==(null===(h=a.crossOriginIframes)||void 0===h?void 0:h.coordinateChildren),(I=C&&function(){try{var e=m();return!!e&&e.parent!==e}catch(e){return!0}}())&&k?(this.crossOriginParentSignalCleanup=function(e){var t=m();if(!t)return function(){};var r=t.parent;function n(t){if(t.source===r){var 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),function(){return t.removeEventListener("message",n)}}({onStart:function(){return T._recordEventsInChildMode(f,p,a,S)},onStop:function(){try{T.recordCancelCallback&&T.recordCancelCallback(),T.recordCancelCallback=null}catch(t){var e=t;T.loggerProvider.warn("Error occurred while stopping child iframe replay capture: ".concat(e.toString()))}}}),[2]):(O=this,E=f,M=[i({},this.buildRRWebRecordOptions(a,S,function(e){if(T.shouldOptOut())return T.loggerProvider.log("Opting session ".concat(p," out of recording due to optOut config.")),T.stopRecordingEvents(),void T.sendEvents();e.type===De.Meta&&(e.data.href=Oe(e.data.href,x)),T.eventCompressor?T.eventCompressor.enqueueEvent(e,p):T.pendingEmitEvents.push({event:e,sessionId:p})},"Error while capturing replay: "))],P={},[4,this.getRecordingPlugins(b)]);case 4:return O.recordCancelCallback=E.apply(void 0,[i.apply(void 0,M.concat([(P.plugins=l.sent(),P.recordCrossOriginIframes=C,P)]))]),C&&!I&&k&&(this.crossOriginIframeCoordinator||(this.crossOriginIframeCoordinator=new kr),this.crossOriginIframeCoordinator.start()),this.addCustomRRWebEvent(Y.DEBUG_INFO),e&&this.addCustomRRWebEvent(Y.METADATA,this.metadata),[3,6];case 5:return R=l.sent(),this.loggerProvider.warn("Failed to initialize session replay:",R),[3,6];case 6:return[2]}})})},e.prototype.buildRRWebRecordOptions=function(e,t,r,n){var s=this,o=e.privacyConfig;return i(i({emit:r,inlineStylesheet:e.shouldInlineStylesheet,hooks:t,maskAllInputs:!0,maskTextClass:se,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:e.applyBackgroundColorToBlockedElements,maskInputFn:Se("input",o,function(){return s.currentPageUrl}),maskTextFn:Se("text",o,function(){return s.currentPageUrl}),maskAttributeFn:xe(o,function(){return s.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:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return s.loggerProvider.warn(n,t.toString()),!0}})},e.prototype._recordEventsInChildMode=function(e,t,r,n){try{this.recordCancelCallback&&this.recordCancelCallback(),this.recordCancelCallback=null,this.recordCancelCallback=e(i(i({},this.buildRRWebRecordOptions(r,n,function(){},"Error while capturing replay (child iframe): ")),{recordCrossOriginIframes:!0})),this.loggerProvider.log("Session Replay child iframe capture beginning for session ".concat(t,"."))}catch(e){this.loggerProvider.warn("Failed to initialize session replay in child iframe mode:",e)}},e.prototype.getDeviceId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.deviceId},e.prototype.getSessionId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.sessionId},e.prototype.flush=function(e){var t;return void 0===e&&(e=!1),a(this,void 0,void 0,function(){return l(this,function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]})})},e.prototype.shutdown=function(){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()},e.prototype.mapSDKType=function(e){return"plugin"===e?"@amplitude/plugin-session-replay-browser":"segment"===e?"@amplitude/segment-session-replay-plugin":null},e.prototype.setMetadata=function(e,t,r,n,s,i,o){var a=(null==e?void 0:e.toString())?U(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}},e.prototype.initializeNetworkObservers=function(){var e,t,r;return a(this,void 0,void 0,function(){var n,s;return l(this,function(i){switch(i.label){case 0:if(!(null===(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.loggingConfig)||void 0===t?void 0:t.network)||void 0===r?void 0:r.enabled)||this.networkObservers)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return Cp})];case 2:return n=i.sent().NetworkObservers,this.networkObservers=new n,[3,4];case 3:return s=i.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",s),[3,4];case 4:return[2]}})})},e}(),Or=function(e){return function(){var t=e.config||Re();return{logger:t.loggerProvider,logLevel:t.logLevel}}},Er=function(){var e=new Ir;return{init:O(e.init.bind(e),"init",Or(e)),evaluateTargetingAndCapture:O(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",Or(e)),setSessionId:O(e.setSessionId.bind(e),"setSessionId",Or(e)),getSessionId:O(e.getSessionId.bind(e),"getSessionId",Or(e)),getSessionReplayProperties:O(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",Or(e)),flush:O(e.flush.bind(e),"flush",Or(e)),shutdown:O(e.shutdown.bind(e),"shutdown",Or(e))}}(),Mr=Er.init,Rr=Er.setSessionId,Pr=Er.getSessionId,Tr=Er.getSessionReplayProperties,Ar=Er.flush,_r=Er.shutdown,Lr=Er.evaluateTargetingAndCapture;!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(Sr||(Sr={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue"}(xr||(xr={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(Cr||(Cr={}));const Nr=[Sr.SET,Sr.SET_ONCE,Sr.ADD,Sr.APPEND,Sr.PREPEND,Sr.POSTINSERT],Dr="1.33.5";class Fr{constructor(e){this.name=Fr.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:Ar,getSessionId:Pr,getSessionReplayProperties:Tr,init:Mr,setSessionId:Rr,shutdown:_r,evaluateTargetingAndCapture:Lr},this.options=Object.assign({forceSessionTracking:!1},e),this.srInitOptions=this.options}setup(e,t){var r,n,s,i,o,l,c,u;return a(this,void 0,void 0,function*(){try{null==e||e.loggerProvider.log(`Installing @amplitude/plugin-session-replay, version ${Dr}.`),this.config=e,this.options.forceSessionTracking&&("boolean"==typeof e.defaultTracking?!1===e.defaultTracking&&(e.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):e.defaultTracking=Object.assign(Object.assign({},e.defaultTracking),{sessions:!0}));const a=(t=this.config.instanceName,void 0===t&&(t="$default_instance"),F.getInstance(t)).identityStore.getIdentity().userProperties;this.srInitOptions={instanceName:this.config.instanceName,deviceId:null!==(r=this.options.deviceId)&&void 0!==r?r:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl||(null===(n=this.config.remoteConfig)||void 0===n?void 0:n.serverUrl),trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:null===(s=this.options.privacyConfig)||void 0===s?void 0:s.blockSelector,maskSelector:null===(i=this.options.privacyConfig)||void 0===i?void 0:i.maskSelector,unmaskSelector:null===(o=this.options.privacyConfig)||void 0===o?void 0:o.unmaskSelector,defaultMaskLevel:null===(l=this.options.privacyConfig)||void 0===l?void 0:l.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:Dr},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:null!==(c=this.options.useWebWorker)&&void 0!==c?c:null===(u=this.options.experimental)||void 0===u?void 0:u.useWebWorker,userProperties:a,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval,captureAdoptedStyleSheets:this.options.captureAdoptedStyleSheets,crossOriginIframes:this.options.crossOriginIframes,flushIntervalConfig:this.options.flushIntervalConfig,eagerFullSnapshotSend:this.options.eagerFullSnapshotSend,captureFullSnapshotOnFocus:this.options.captureFullSnapshotOnFocus,maxPersistedEventsSizeBytes:this.options.maxPersistedEventsSizeBytes,maxSingleEventSizeBytes:this.options.maxSingleEventSizeBytes,sendTimeoutMs:this.options.sendTimeoutMs,handleSendEvents:this.options.handleSendEvents,handleFetchConfig:this.options.handleFetchConfig},yield this.sessionReplay.init(e.apiKey,this.srInitOptions).promise}catch(t){null==e||e.loggerProvider.error(`Session Replay: Failed to initialize due to ${t.message}`)}var t})}onSessionIdChanged(e){var t;return a(this,void 0,void 0,function*(){null===(t=this.config)||void 0===t||t.loggerProvider.debug(`Analytics session id is changed to ${e}, SR session id is ${String(this.sessionReplay.getSessionId())}.`),yield this.sessionReplay.setSessionId(e).promise})}onOptOutChanged(e){var t;return a(this,void 0,void 0,function*(){null===(t=this.config)||void 0===t||t.loggerProvider.debug(`optOut is changed to ${String(e)}, calling ${e?"sessionReplay.shutdown()":"sessionReplay.init()"}.`),e?this.sessionReplay.shutdown():null!=this.config&&(yield this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise)})}execute(e){var t,r,n;return a(this,void 0,void 0,function*(){try{if(this.options.customSessionId){const t=this.options.customSessionId(e);if(t){t!==this.sessionReplay.getSessionId()&&(yield this.sessionReplay.setSessionId(t).promise);const r=this.sessionReplay.getSessionReplayProperties();e.event_properties=Object.assign(Object.assign({},e.event_properties),r)}}else{const n=null===(t=this.config)||void 0===t?void 0:t.sessionId;if(n&&n!==this.sessionReplay.getSessionId()&&(yield this.sessionReplay.setSessionId(n).promise),n&&n===e.session_id){let t;e.event_type===s.IDENTIFY&&(t=(e=>{if(!e.user_properties)return;let t={};return Object.keys(e.user_properties).forEach(r=>{if(Nr.includes(r)){const n=e.user_properties&&e.user_properties[r];t=Object.assign(Object.assign({},t),n)}}),t})(e));const n=m();yield this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:t,page:null!=(null===(r=null==n?void 0:n.location)||void 0===r?void 0:r.href)?{url:n.location.href}:void 0});const i=this.sessionReplay.getSessionReplayProperties();e.event_properties=Object.assign(Object.assign({},e.event_properties),i)}}return e.event_type===s.IDENTIFY&&e.event_properties&&delete e.event_properties["[Amplitude] Session Replay ID"],Promise.resolve(e)}catch(t){return null===(n=this.config)||void 0===n||n.loggerProvider.error(`Session Replay: Failed to enrich event due to ${t.message}`),Promise.resolve(e)}})}teardown(){var e;return a(this,void 0,void 0,function*(){try{this.sessionReplay.shutdown(),this.config=null}catch(t){null===(e=this.config)||void 0===e||e.loggerProvider.error(`Session Replay: teardown failed due to ${t.message}`)}})}getSessionReplayProperties(){return this.sessionReplay.getSessionReplayProperties()}}Fr.pluginName="@amplitude/plugin-session-replay-browser";const Ur=e=>new Fr(e);var jr=function(e,t){return jr=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])},jr(e,t)},Br=function(){return Br=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=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 qr="is not",Wr="contains",$r="does not contain",Vr="less",Gr="less or equal",Hr="greater",Jr="greater or equal",Kr="version less",Yr="version less or equal",Zr="version greater",Qr="version greater or equal",Xr="set is",en="set is not",tn="set contains",rn="set does not contain",nn="set contains any",sn="set does not contain any",on=-862048943,an=461845907,ln=function(e,t){var r=e,n=t;return r=Math.imul(r,on),r=un(r,15),r=Math.imul(r,an),n=un(n^=r,13),(n=Math.imul(n,5))+-430675100|0},cn=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,(t=Math.imul(t,-1028477387))^t>>>16},un=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<>>0)>>>0>>>r-t>>>0)>>>0},hn=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 dn(r)},dn=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},pn=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}},fn="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),gn=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(fn).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.majore.minor?1:this.minore.patch?1:this.patche.preRelease?1:this.preRelease>6|192,t[r++]=63&s|128):55296==(64512&s)&&n+1>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>>0}(e)},e.prototype.bucket=function(e,t){var r,n,s,i;if(!t.bucket)return t.variant;var o=this.coerceString(pn(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],g=p.range[1];if(c>=f&&c=w&&ur;case Jr:case Qr:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Vr:case Kr:return n<0;case Gr:case Yr:return n<=0;case Hr:case Zr:return n>0;case Jr:case Qr: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 Xr:case en:case tn:case rn:case nn:case sn: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;s0)&&!(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.lengtht),String.fromCharCode.bind(String),"function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),function(e){!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}jr(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(function t(r,n){var s=e.call(this,n)||this;return s.statusCode=r,Object.setPrototypeOf(s,t.prototype),s},e)}(Error);var vn,yn=new function(){var e=this;this.dbs={},this.createStore=function(t){return a(e,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,ut(t,1,{upgrade:function(e){e.objectStoreNames.contains("eventTypesForSession")||e.createObjectStore("eventTypesForSession",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return a(e,void 0,void 0,function(){var e,r;return l(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.updateEventListForSession=function(t){var r=t.sessionId,n=t.eventType,s=t.eventTime,o=t.loggerProvider,c=t.tx;return a(e,void 0,void 0,function(){var e,t,a,u,h,d,p,f,g;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),e=String(r),[4,c.store.get(e)];case 1:return t=l.sent(),a=t?t.eventTypes:{},u=a[n]||{},h=i(i({},a),((f={})[n]=i(i({},u),((g={})[s]={event_type:n},g)),f)),d={sessionId:e,eventTypes:h,lastUpdated:Date.now()},[4,c.store.put(d)];case 2:return l.sent(),[2,h];case 3:return p=l.sent(),o.warn("Failed to store events for targeting ".concat(r,": ").concat(p)),[3,4];case 4:return[2,void 0]}})})},this.deleteOldSessionEventTypes=function(t){var r=t.currentSessionId,n=t.loggerProvider,s=t.tx;return a(e,void 0,void 0,function(){var e,t,i,o,a,c;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),e=String(r),[4,s.store.getAll()];case 1:t=l.sent(),i=0,l.label=2;case 2:return i1728e5?[4,s.store.delete(o.sessionId)]:[3,4]):[3,5];case 3:l.sent(),l.label=4;case 4:return i++,[3,2];case 5:return[3,7];case 6:return c=l.sent(),n.warn("Failed to clear old session event types for targeting: ".concat(c)),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,s=t.eventType,i=t.eventTime,o=t.apiKey;return a(e,void 0,void 0,function(){var e,t,a,c;return l(this,function(l){switch(l.label){case 0:return l.trys.push([0,5,,6]),[4,this.openOrCreateDB(o)];case 1:return e=l.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:s,eventTime:i})]:[2];case 2:return a=l.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return l.sent(),[4,t.done];case 4:return l.sent(),[2,a];case 5:return c=l.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(c)),[3,6];case 6:return[2,void 0]}})})}},wn=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,s=t.event,o=t.sessionId,c=t.userProperties,u=t.deviceId,h=t.page,d=t.flag;return a(e,void 0,void 0,function(){var e,t,a,p;return l(this,function(l){switch(l.label){case 0:return s&&s.time?[4,yn.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:o,eventType:s.event_type,eventTime:s.time})]:[3,2];case 1:return t=l.sent(),[3,3];case 2:t=void 0,l.label=3;case 3:return a=(e=t)&&new Set(Object.keys(e)),p={session_id:o,event:s,event_types:a&&Array.from(a),user:i(i({},c),{device_id:u,user_properties:c}),page:h},[2,this.evaluationEngine.evaluate(p,[d])]}})})},this.evaluationEngine=new mn},bn=function(){var e=new wn;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,Sn=Object.freeze({__proto__:null,evaluateTargeting:bn}),xn=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;r0&&s[s.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(u),v=f.next();!v.done;v=f.next())y=v.value,d.set(y,p),p+=y.length}catch(e){h={error:e}}finally{try{v&&!v.done&&(b=f.return)&&b.call(f)}finally{if(h)throw h.error}}return[2,d];case 4:return m.sent(),[2,null];case 5:return[2]}})})}var l=0,d=new Map,p=function(e,t){return fetch(e,t)},f=function(e,t){var r="".concat(++l);return new Promise(function(n,s){var o=t.signal,a=function(){d.delete(r);var e=new Error("Delegated session replay fetch aborted by send timeout");e.name="AbortError",s(e)};o.addEventListener("abort",a,{once:!0}),d.set(r,function(e){o.removeEventListener("abort",a),e.error?s(new Error(e.body)):n({status:e.status,headers:{get:function(t){return t===i?e.skipHeader:null}},text:function(){return Promise.resolve(e.body)}})}),postMessage({type:"fetch-request",requestId:r,url:e,method:"POST",headers:t.headers,body:t.body,keepalive:t.keepalive})})};function v(e,t,o){var l,d,p,f,v,y,h,b;return n(this,void 0,void 0,function(){var n,g,m,w,S,T,E,k,R,x,C,I,A,M,O;return s(this,function(s){switch(s.label){case 0:n=null!==(l=t.sendTimeoutMs)&&void 0!==l?l: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 m=s.sent(),[3,4];case 3:m=null,s.label=4;case 4:g=m,w="".concat(null!==(p=null===(d=t.version)||void 0===d?void 0:d.type)&&void 0!==p?p:"standalone","/").concat(null!==(v=null===(f=t.version)||void 0===f?void 0:f.version)&&void 0!==v?v:t.sdkVersion),S=new URLSearchParams({device_id:t.deviceId,session_id:"".concat(t.sessionId),type:t.eventType}),T="".concat((U=t.serverZone,P=t.trackServerUrl,P||("STAGING"===U?"https://api-sr.stag2.amplitude.com/sessions/v2/track":"EU"===U?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")),"?").concat(S.toString()),E=r({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(t.apiKey),"X-Client-Version":t.sdkVersion,"X-Client-Library":w,"X-Client-Url":t.currentUrl.substring(0,1e3),"X-Client-Sample-Rate":"".concat(t.sampleRate),"X-Sampling-Hash-Alg":"xxhash32"},g?{"Content-Encoding":"gzip"}:{}),k=g?g.byteLength:new Blob([e]).size,R=new AbortController,x=n>0?setTimeout(function(){R.abort()},n):void 0,C=void 0,s.label=5;case 5:return s.trys.push([5,,7,8]),[4,o(T,{method:"POST",headers:E,body:null!=g?g:e,keepalive:k<=65536,signal:R.signal})];case 6:return C=s.sent(),[3,8];case 7:return x&&clearTimeout(x),[7];case 8:if(null===C)return[2,{shouldRetry:!1,success:!1,message:"Unexpected error occurred"}];if(C.status>=200&&C.status<300)return I=Math.round(new Blob(t.events).size/1024),A=null!==(b=null===(h=null===(y=C.headers)||void 0===y?void 0:y.get)||void 0===h?void 0:h.call(y,i))&&void 0!==b?b:null,[2,{shouldRetry:!1,success:!0,message:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(I," KB"),skipCode:A}];if(413!==C.status)return[3,13];M="",s.label=9;case 9:return s.trys.push([9,11,,12]),[4,C.text()];case 10:return M=s.sent(),[3,12];case 11:return s.sent(),[3,12];case 12:return[2,{shouldRetry:!1,success:!1,message:u,payloadTooLarge:!0,isWaf:a.test(M)}];case 13:return C.status>=500||408===C.status||429===C.status||499===C.status?[2,{shouldRetry:!0,success:!1,message:"HTTP ".concat(C.status)}]:[2,{shouldRetry:!1,success:!1,message:u}];case 14:return(O=s.sent())&&"object"==typeof O&&"AbortError"===O.name?[2,{shouldRetry:!0,success:!1,message:"Session replay worker request timed out after ".concat(n,"ms")}]:[2,{shouldRetry:!1,success:!1,message:String(O)}];case 15:return[2]}var U,P})})}function y(e,t,r,o,a){var i;return n(this,void 0,void 0,function(){var n,u,c;return s(this,function(s){switch(s.label){case 0:n=1,s.label=1;case 1:return[4,v(t,r,a)];case 2:return(u=s.sent()).success?(postMessage({type:"log",id:e,message:u.message}),postMessage({type:"complete",id:e,skipCode:null!==(i=u.skipCode)&&void 0!==i?i:null}),[2]):u.payloadTooLarge&&o?(postMessage({type:"payload_too_large",id:e,isWaf:!0===u.isWaf}),[2]):o&&u.shouldRetry&&n=r.flushMaxRetries?"Session replay event batch rejected due to exceeded retry count":u.message,postMessage({type:"warn",id:e,message:c}),postMessage({type:"complete",id:e}),[2];case 5:return[3,1];case 6:return[2]}})})}onmessage=function(e){return n(void 0,void 0,void 0,function(){var t,r,n,o,a,i,u,c;return s(this,function(s){switch(s.label){case 0:return"fetch-response"===(t=e.data).type?((r=d.get(t.requestId))&&(d.delete(t.requestId),r(t)),[2]):"send"!==t.type?[3,2]:(n=t.id,o=t.payload,a=t.context,i=t.useRetry,u=t.useCustomTransport,c=JSON.stringify(o),[4,y(n,c,a,i,u?f:p)]);case 1:s.sent(),s.label=2;case 2:return[2]}})})};var h=onmessage;return e.trackDestinationOnMessage=h,Object.defineProperty(e,"__esModule",{value:!0}),e}({});\n'}),Cn=Object.defineProperty,kn=(e,t,r)=>((e,t,r)=>t in e?Cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),In=Object.defineProperty,On=(e,t,r)=>((e,t,r)=>t in e?In(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),En=Object.defineProperty,Mn=(e,t,r)=>((e,t,r)=>t in e?En(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const Rn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Pn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Tn={};function An(e){if(Tn[e])return Tn[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 Rn?Rn[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 Pn?Pn[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 Tn[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?Tn[e]=i:r}catch{return r}}const _n={};function Ln(e,t,r){var n;const s=`${e}.${String(r)}`;if(_n[s])return _n[s].call(t);const i=An(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(_n[s]=o,o.call(t)):t[r]}const Nn=function(e){return Ln("Node",e,"parentNode")},Dn=function(e){return e&&"host"in e?Ln("ShadowRoot",e,"host"):null},Fn=function(e){return e&&"shadowRoot"in e?Ln("Element",e,"shadowRoot"):null};function Un(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Un(Nn(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&Un(Nn(e),t,r)}var jn,Bn={exports:{}};const zn=function(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}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var qn,Wn;function $n(){if(Wn)return qn;Wn=1;let e=function(){if(jn)return Bn.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 Bn.exports=t(),Bn.exports.createColors=t,Bn.exports}(),t=zn;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:"",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 qn=r,r.default=r,qn}var Vn,Gn,Hn,Jn,Kn,Yn,Zn,Qn,Xn,es,ts,rs,ns,ss,is,os,as,ls,cs,us,hs,ds,ps,fs,gs,ms,vs,ys,ws,bs,Ss,xs,Cs,ks,Is,Os,Es,Ms,Rs,Ps,Ts,As,_s,Ls,Ns,Ds,Fs,Us,js,Bs,zs,qs,Ws,$s={};function Vs(){return Vn||(Vn=1,$s.isClean=Symbol("isClean"),$s.my=Symbol("my")),$s}function Gs(){if(Hn)return Gn;Hn=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;e0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n{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 Gn=t,t.default=t,Gn}function Hs(){if(Kn)return Jn;Kn=1;let e=Gs();function t(t,r){new e(r).stringify(t)}return Jn=t,t.default=t,Jn}function Js(){if(Zn)return Yn;Zn=1;let{isClean:e,my:t}=Vs(),r=$n(),n=Gs(),s=Hs();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"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 Yn=o,o.default=o,Yn}function Ks(){if(Xn)return Qn;Xn=1;let e=Js();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 Qn=t,t.default=t,Qn}function Ys(){if(ns)return rs;ns=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=zn,{existsSync:r,readFileSync:n}=zn,{dirname:s,join:i}=zn;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 Zs(){if(is)return ss;is=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=zn,{fileURLToPath:r,pathToFileURL:n}=zn,{isAbsolute:s,resolve:i}=zn,{nanoid:o}=(ts||(ts=1,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),a=zn,l=$n(),c=Ys(),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=""),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=t)n=r.length-1;else{let t,s=r.length-2;for(;n>1),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 ss=p,p.default=p,a&&a.registerInput&&a.registerInput(p),ss}function Qs(){if(as)return os;as=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=zn,{dirname:r,relative:n,resolve:s,sep:i}=zn,{pathToFileURL:o}=zn,a=Zs(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&i);return os=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)):""});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="",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)):"";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 Xs(){if(cs)return ls;cs=1;let e=Js();class t extends e{constructor(e){super(e),this.type="comment"}}return ls=t,t.default=t,ls}function ei(){if(hs)return us;hs=1;let e,t,r,n,{isClean:s,my:i}=Vs(),o=Ks(),a=Xs(),l=Js();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]"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(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},us=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)})},us}function ti(){if(ps)return ds;ps=1;let e,t,r=ei();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},ds=n,n.default=n,ds}function ri(){if(gs)return fs;gs=1;let e={};return fs=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function ni(){if(vs)return ms;vs=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 ms=e,e.default=e,ms}function si(){if(ws)return ys;ws=1;let e=ni();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 ys=t,t.default=t,ys}function ii(){if(Cs)return xs;Cs=1;let e=ei();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 xs=t,t.default=t,e.registerAtRule(t),xs}function oi(){if(Is)return ks;Is=1;let e,t,r=ei();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},ks=n,n.default=n,r.registerRoot(n),ks}function ai(){if(Es)return Os;Es=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 Os=e,e.default=e,Os}function li(){if(Rs)return Ms;Rs=1;let e=ei(),t=ai();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 Ms=r,r.default=r,e.registerRule(r),Ms}function ci(){if(_s)return As;_s=1;let e=ei(),t=function(){if(Ts)return Ps;Ts=1;let e=Ks(),t=function(){if(Ss)return bs;Ss=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"'(/\\]/,x=/[\da-f]/i;return bs=function(C,k={}){let I,O,E,M,R,P,T,A,_,L,N=C.css.valueOf(),D=k.ignoreErrors,F=N.length,U=0,j=[],B=[];function z(e){throw C.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(C){if(B.length)return B.pop();if(U>=F)return;let k=!!C&&C.ignoreUnclosed;switch(I=N.charCodeAt(U),I){case s:case i:case a:case l:case o:O=U;do{O+=1,I=N.charCodeAt(O)}while(I===i||I===s||I===a||I===l||I===o);L=["space",N.slice(U,O)],U=O-1;break;case c:case u:case p:case f:case v:case g:case d:{let e=String.fromCharCode(I);L=[e,e,U];break}case h:if(A=j.length?j.pop()[1]:"",_=N.charCodeAt(U+1),"url"===A&&_!==e&&_!==t&&_!==i&&_!==s&&_!==a&&_!==o&&_!==l){O=U;do{if(P=!1,O=N.indexOf(")",O+1),-1===O){if(D||k){O=U;break}z("bracket")}for(T=O;N.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);L=["brackets",N.slice(U,O+1),U,O],U=O}else O=N.indexOf(")",U+1),M=N.slice(U,O+1),-1===O||S.test(M)?L=["(","(",U]:(L=["brackets",M,U,O],U=O);break;case e:case t:E=I===e?"'":'"',O=U;do{if(P=!1,O=N.indexOf(E,O+1),-1===O){if(D||k){O=U+1;break}z("string")}for(T=O;N.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);L=["string",N.slice(U,O+1),U,O],U=O;break;case y:w.lastIndex=U+1,w.test(N),O=0===w.lastIndex?N.length-1:w.lastIndex-2,L=["at-word",N.slice(U,O+1),U,O],U=O;break;case r:for(O=U,R=!0;N.charCodeAt(O+1)===r;)O+=1,R=!R;if(I=N.charCodeAt(O+1),R&&I!==n&&I!==i&&I!==s&&I!==a&&I!==l&&I!==o&&(O+=1,x.test(N.charAt(O)))){for(;x.test(N.charAt(O+1));)O+=1;N.charCodeAt(O+1)===i&&(O+=1)}L=["word",N.slice(U,O+1),U,O],U=O;break;default:I===n&&N.charCodeAt(U+1)===m?(O=N.indexOf("*/",U+2)+1,0===O&&(D||k?O=N.length:z("comment")),L=["comment",N.slice(U,O+1),U,O],U=O):(b.lastIndex=U+1,b.test(N),O=0===b.lastIndex?N.length-1:b.lastIndex-2,L=["word",N.slice(U,O+1),U,O],j.push(L),U=O)}return U++,L},position:function(){return U}}}}(),r=Xs(),n=ii(),s=oi(),i=li();const o={empty:!0,space:!0};return Ps=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;ee+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;nm(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 o=l;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(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;e0;){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 s;this.result.lastPlugin=r;try{s=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(s))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{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},Ls=y,y.default=y,c.registerLazyResult(y),i.registerLazyResult(y),Ls}const hi=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(function(){if(Ws)return qs;Ws=1;let e=$n(),t=Ks(),r=ui(),n=ei(),s=function(){if(js)return Us;js=1;let e=function(){if(Fs)return Ds;Fs=1;let e=Qs(),t=Hs(),r=ri(),n=ci();const s=si();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 Ds=i,i.default=i,Ds}(),t=ui(),r=ti(),n=oi();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 Us=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Us}(),i=Hs(),o=function(){if(zs)return Bs;zs=1;let e=Ks(),t=Ys(),r=Xs(),n=ii(),s=Zs(),i=oi(),o=li();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 Bs=a,a.default=a,Bs}(),a=ti(),l=ni(),c=Xs(),u=ii(),h=si(),d=Zs(),p=ci(),f=ai(),g=li(),m=oi(),v=Js();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),qs=y,y.default=y,qs}());hi.stringify,hi.fromJSON,hi.plugin,hi.parse,hi.list,hi.document,hi.comment,hi.atRule,hi.rule,hi.decl,hi.root,hi.CssSyntaxError,hi.Declaration,hi.Container,hi.Processor,hi.Document,hi.Comment,hi.Warning,hi.AtRule,hi.Result,hi.Input,hi.Rule,hi.Root,hi.Node;var di=Object.defineProperty,pi=(e,t,r)=>((e,t,r)=>t in e?di(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);var fi,gi={exports:{}};const mi=function(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}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var vi,yi;function wi(){if(yi)return vi;yi=1;let e=function(){if(fi)return gi.exports;fi=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}(),t=mi;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:"",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 vi=r,r.default=r,vi}var bi,Si,xi,Ci,ki,Ii,Oi,Ei,Mi,Ri,Pi,Ti,Ai,_i,Li,Ni,Di,Fi,Ui,ji,Bi,zi,qi,Wi,$i,Vi,Gi,Hi,Ji,Ki,Yi,Zi,Qi,Xi,eo,to,ro,no,so,io,oo,ao,lo,co,uo,ho,po,fo,go,mo,vo,yo,wo,bo={};function So(){return bi||(bi=1,bo.isClean=Symbol("isClean"),bo.my=Symbol("my")),bo}function xo(){if(xi)return Si;xi=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;e0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n{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 Si=t,t.default=t,Si}function Co(){if(ki)return Ci;ki=1;let e=xo();function t(t,r){new e(r).stringify(t)}return Ci=t,t.default=t,Ci}function ko(){if(Oi)return Ii;Oi=1;let{isClean:e,my:t}=So(),r=wi(),n=xo(),s=Co();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"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 Ii=o,o.default=o,Ii}function Io(){if(Mi)return Ei;Mi=1;let e=ko();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 Ei=t,t.default=t,Ei}function Oo(){if(Ai)return Ti;Ai=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=mi,{existsSync:r,readFileSync:n}=mi,{dirname:s,join:i}=mi;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 Ti=o,o.default=o,Ti}function Eo(){if(Li)return _i;Li=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=mi,{fileURLToPath:r,pathToFileURL:n}=mi,{isAbsolute:s,resolve:i}=mi,{nanoid:o}=(Pi||(Pi=1,Ri={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}}),Ri),a=mi,l=wi(),c=Oo(),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=""),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=t)n=r.length-1;else{let t,s=r.length-2;for(;n>1),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 _i=p,p.default=p,a&&a.registerInput&&a.registerInput(p),_i}function Mo(){if(Di)return Ni;Di=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=mi,{dirname:r,relative:n,resolve:s,sep:i}=mi,{pathToFileURL:o}=mi,a=Eo(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&i);return Ni=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)):""});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="",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)):"";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 Ro(){if(Ui)return Fi;Ui=1;let e=ko();class t extends e{constructor(e){super(e),this.type="comment"}}return Fi=t,t.default=t,Fi}function Po(){if(Bi)return ji;Bi=1;let e,t,r,n,{isClean:s,my:i}=So(),o=Io(),a=Ro(),l=ko();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]"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(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},ji=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)})},ji}function To(){if(qi)return zi;qi=1;let e,t,r=Po();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},zi=n,n.default=n,zi}function Ao(){if($i)return Wi;$i=1;let e={};return Wi=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function _o(){if(Gi)return Vi;Gi=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return Vi=e,e.default=e,Vi}function Lo(){if(Ji)return Hi;Ji=1;let e=_o();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 Hi=t,t.default=t,Hi}function No(){if(Qi)return Zi;Qi=1;let e=Po();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 Zi=t,t.default=t,e.registerAtRule(t),Zi}function Do(){if(eo)return Xi;eo=1;let e,t,r=Po();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},Xi=n,n.default=n,r.registerRoot(n),Xi}function Fo(){if(ro)return to;ro=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 to=e,e.default=e,to}function Uo(){if(so)return no;so=1;let e=Po(),t=Fo();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 no=r,r.default=r,e.registerRule(r),no}function jo(){if(lo)return ao;lo=1;let e=Po(),t=function(){if(oo)return io;oo=1;let e=Io(),t=function(){if(Yi)return Ki;Yi=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"'(/\\]/,x=/[\da-f]/i;return Ki=function(C,k={}){let I,O,E,M,R,P,T,A,_,L,N=C.css.valueOf(),D=k.ignoreErrors,F=N.length,U=0,j=[],B=[];function z(e){throw C.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(C){if(B.length)return B.pop();if(U>=F)return;let k=!!C&&C.ignoreUnclosed;switch(I=N.charCodeAt(U),I){case s:case i:case a:case l:case o:O=U;do{O+=1,I=N.charCodeAt(O)}while(I===i||I===s||I===a||I===l||I===o);L=["space",N.slice(U,O)],U=O-1;break;case c:case u:case p:case f:case v:case g:case d:{let e=String.fromCharCode(I);L=[e,e,U];break}case h:if(A=j.length?j.pop()[1]:"",_=N.charCodeAt(U+1),"url"===A&&_!==e&&_!==t&&_!==i&&_!==s&&_!==a&&_!==o&&_!==l){O=U;do{if(P=!1,O=N.indexOf(")",O+1),-1===O){if(D||k){O=U;break}z("bracket")}for(T=O;N.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);L=["brackets",N.slice(U,O+1),U,O],U=O}else O=N.indexOf(")",U+1),M=N.slice(U,O+1),-1===O||S.test(M)?L=["(","(",U]:(L=["brackets",M,U,O],U=O);break;case e:case t:E=I===e?"'":'"',O=U;do{if(P=!1,O=N.indexOf(E,O+1),-1===O){if(D||k){O=U+1;break}z("string")}for(T=O;N.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);L=["string",N.slice(U,O+1),U,O],U=O;break;case y:w.lastIndex=U+1,w.test(N),O=0===w.lastIndex?N.length-1:w.lastIndex-2,L=["at-word",N.slice(U,O+1),U,O],U=O;break;case r:for(O=U,R=!0;N.charCodeAt(O+1)===r;)O+=1,R=!R;if(I=N.charCodeAt(O+1),R&&I!==n&&I!==i&&I!==s&&I!==a&&I!==l&&I!==o&&(O+=1,x.test(N.charAt(O)))){for(;x.test(N.charAt(O+1));)O+=1;N.charCodeAt(O+1)===i&&(O+=1)}L=["word",N.slice(U,O+1),U,O],U=O;break;default:I===n&&N.charCodeAt(U+1)===m?(O=N.indexOf("*/",U+2)+1,0===O&&(D||k?O=N.length:z("comment")),L=["comment",N.slice(U,O+1),U,O],U=O):(b.lastIndex=U+1,b.test(N),O=0===b.lastIndex?N.length-1:b.lastIndex-2,L=["word",N.slice(U,O+1),U,O],j.push(L),U=O)}return U++,L},position:function(){return U}}}}(),r=Ro(),n=No(),s=Do(),i=Uo();const o={empty:!0,space:!0};return io=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;ee+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;nm(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 o=l;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(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;e0;){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 s;this.result.lastPlugin=r;try{s=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(s))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{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},co=y,y.default=y,c.registerLazyResult(y),i.registerLazyResult(y),co}const zo=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(function(){if(wo)return yo;wo=1;let e=wi(),t=Io(),r=Bo(),n=Po(),s=function(){if(go)return fo;go=1;let e=function(){if(po)return ho;po=1;let e=Mo(),t=Co(),r=Ao(),n=jo();const s=Lo();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 ho=i,i.default=i,ho}(),t=Bo(),r=To(),n=Do();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 fo=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),fo}(),i=Co(),o=function(){if(vo)return mo;vo=1;let e=Io(),t=Oo(),r=Ro(),n=No(),s=Eo(),i=Do(),o=Uo();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 mo=a,a.default=a,mo}(),a=To(),l=_o(),c=Ro(),u=No(),h=Lo(),d=Eo(),p=jo(),f=Fo(),g=Uo(),m=Do(),v=ko();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),yo=y,y.default=y,yo}());zo.stringify,zo.fromJSON,zo.plugin,zo.parse,zo.list,zo.document,zo.comment,zo.atRule,zo.rule,zo.decl,zo.root,zo.CssSyntaxError,zo.Declaration,zo.Container,zo.Processor,zo.Document,zo.Comment,zo.Warning,zo.AtRule,zo.Result,zo.Input,zo.Rule,zo.Root,zo.Node;class qo{constructor(...e){pi(this,"parentElement",null),pi(this,"parentNode",null),pi(this,"ownerDocument"),pi(this,"firstChild",null),pi(this,"lastChild",null),pi(this,"previousSibling",null),pi(this,"nextSibling",null),pi(this,"ELEMENT_NODE",1),pi(this,"TEXT_NODE",3),pi(this,"nodeType"),pi(this,"nodeName"),pi(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 qo))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 Wo={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},$o={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Vo={};function Go(e){if(Vo[e])return Vo[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 Wo?Wo[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 $o?$o[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 Vo[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?Vo[e]=i:r}catch{return r}}const Ho={};function Jo(e,t,r){var n;const s=`${e}.${String(r)}`;if(Ho[s])return Ho[s].call(t);const i=Go(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(Ho[s]=o,o.call(t)):t[r]}const Ko={};function Yo(e,t,r){const n=`${e}.${String(r)}`;if(Ko[n])return Ko[n].bind(t);const s=Go(e)[r];return"function"!=typeof s?t[r]:(Ko[n]=s,s.bind(t))}const Zo=function(e){return Jo("Node",e,"parentNode")},Qo=function(e){return Jo("Node",e,"parentElement")},Xo=function(e,t){return Yo("Node",e,"contains")(t)},ea=function(e){return Yo("Node",e,"getRootNode")()},ta=function(e){return e&&"host"in e?Jo("ShadowRoot",e,"host"):null},ra=function(e){return e&&"shadowRoot"in e?Jo("Element",e,"shadowRoot"):null},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 sa={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&&(sa=new Proxy(sa,{get:(e,t,r)=>("map"===t&&console.error(na),Reflect.get(e,t,r))}));let ia=Date.now;function oa(e){return e?e.nodeType===e.ELEMENT_NODE?e:Qo(e):null}function aa(e){var t;let r=null;return"getRootNode"in e&&(null==(t=ea(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ta(ea(e))&&(r=ta(ea(e))),r}function la(e){let t,r=e;for(;t=aa(r);)r=t;return r}function ca(e){const t=e.ownerDocument;if(!t)return!1;const r=la(e);return Xo(t,r)}/[1-9][0-9]{12}/.test(Date.now().toString())||(ia=()=>(new Date).getTime());const ua=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){On(this,"id",1),On(this,"styleIDMap",new WeakMap),On(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 sa},closestElementOfNode:oa,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:la,getShadowHost:aa,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=Qo(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=Qo(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 qo&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ra(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&&(Xo(t,e)||ca(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&Dn(e)||null;return Boolean(t&&"shadowRoot"in t&&Fn(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=Zo(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))},isBlocked:function(e,t,r,n){if(!e)return!1;const s=oa(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(Un(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 ia},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:ca,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 ha="undefined"==typeof Uint8Array?[]:new Uint8Array(256),da=0;da<64;da++)ha["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(da)]=da;"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==(vn=e.contentWindow)?void 0:vn.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var pa,fa;new class{constructor(){Mn(this,"idNodeMap",new Map),Mn(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?(null==(t=this.getMeta(e))?void 0:t.id)??-1:-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}},(fa=pa||(pa={}))[fa.NotStarted=0]="NotStarted",fa[fa.Running=1]="Running",fa[fa.Stopped=2]="Stopped";class ga{constructor(e){kn(this,"fileName"),kn(this,"functionName"),kn(this,"lineNumber"),kn(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 ma=/(^|@)\S+:\d+/,va=/^\s*at .*(\S+:\d+|\(native\))/m,ya=/^(eval@)?(\[native code])?$/,wa={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(va)?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(va)},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",""].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/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new ga({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function ba(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;e1&&(r+=`:eq(${s.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function Sa(e){return"[object Object]"===Object.prototype.toString.call(e)}function xa(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Sa(e[n])&&xa(e[n],t-1))return!0;return!1}function Ca(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){return!!(Sa(e)&&Object.keys(e).length>r.numOfKeysLimit)||("function"==typeof e||!(!Sa(e)||!xa(e,r.depthOfLimit)))}(t))return function(e){let t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=`${t.slice(0,r.stringLengthLimit)}...`),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]=ba(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 ka={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 Ia(e,t,r){const n=r?Object.assign({},ka,r):ka,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=wa.parse(s).map(e=>e.toString()),o=[Ca(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=[Ca(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[Ca("Uncaught (in promise)",n.stringifyOptions),Ca(t.reason,n.stringifyOptions)]);const i=wa.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]?ua.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=wa.parse(new Error).map(e=>e.toString()).splice(1),i=("assert"===r?s.slice(1):s).map(e=>Ca(e,n.stringifyOptions));o++,o{}}}const Oa="rrweb/console@1";var Ea,Ma=Object.freeze({__proto__:null,PLUGIN_NAME:Oa,getRecordConsolePlugin:e=>({name:Oa,observer:Ia,options:e})}),Ra=Object.defineProperty,Pa=(e,t,r)=>((e,t,r)=>t in e?Ra(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ta=Object.defineProperty,Aa=(e,t,r)=>((e,t,r)=>t in e?Ta(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),_a=(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))(_a||{});const La={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Na={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Da={};function Fa(e){if(Da[e])return Da[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in 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 Na?Na[e]:void 0,o=Boolean(i&&i.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&o)return Da[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const i=s[e].prototype;return document.body.removeChild(n),i?Da[e]=i:r}catch{return r}}const Ua={};function ja(e,t,r){var n;const s=`${e}.${String(r)}`;if(Ua[s])return Ua[s].call(t);const i=Fa(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(Ua[s]=o,o.call(t)):t[r]}const Ba=function(e){return ja("Node",e,"childNodes")},za=function(e){return ja("Node",e,"parentNode")},qa=function(e){return ja("Node",e,"parentElement")},Wa=function(e){return ja("Node",e,"textContent")},$a=function(e){return e&&"host"in e?ja("ShadowRoot",e,"host"):null},Va=function(e){return e&&"shadowRoot"in e?ja("Element",e,"shadowRoot"):null};function Ga(e){return e.nodeType===e.ELEMENT_NODE}function Ha(e){const t=e&&"host"in e&&"mode"in e&&$a(e)||null;return Boolean(t&&"shadowRoot"in t&&Va(t)===e)}function Ja(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Ka(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=>Ya(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 Ya(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Ka(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?al(t,e.styleSheet.href):t}{let r=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=function(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}(r)),t?al(r,t):r}}class Za{constructor(){Aa(this,"idNodeMap",new Map),Aa(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?(null==(t=this.getMeta(e))?void 0:t.id)??-1:-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 Qa({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:i}){let o=s||"";const a=n&&Xa(n);return(t[r.toLowerCase()]||a&&t[a])&&(o=i?i(o,e):"*".repeat(o.length)),o}function Xa(e){return e.toLowerCase()}const el="__rrweb_original__";function tl(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Xa(t):null}function rl(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 nl=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,sl=/^(?:[a-z+]+:)?\/\//i,il=/^www\..*/i,ol=/^(data:)([^,]*),(.*)/i;function al(e,t){return(e||"").replace(nl,(e,r,n,s,i,o)=>{const a=n||i||o,l=r||s||"";if(!a)return e;if(sl.test(a)||il.test(a))return`url(${l}${a}${l})`;if(ol.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 ll(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}let cl=1;const ul=new RegExp("[^a-z0-9-_:]");function hl(){return cl++}let dl,pl;const fl=/^[^ \t\n\r\u000c]+/,gl=/^[, \t\n\r\u000c]+/,ml=new WeakMap;function vl(e,t){return t&&""!==t.trim()?wl(e,t):t}function yl(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function wl(e,t){let r=ml.get(e);if(r||(r=e.createElement("a"),ml.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function bl(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?vl(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(gl),!(r>=t.length);){let i=n(fl);if(","===i.slice(-1))i=vl(e,i.substring(0,i.length-1)),s.push(i);else{let n="";i=vl(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?al(n,wl(e)):"object"===t&&"data"===r?vl(e,n):n:vl(e,n):n}function Sl(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function xl(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&xl(za(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&xl(za(e),t,r)}function Cl(e,t,r,n){let s;if(Ga(e)){if(s=e,!Ba(s).length)return!1}else{if(null===qa(e))return!1;s=qa(e)}try{if("string"==typeof t){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(xl(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 kl(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:_a.Document,childNodes:[],compatMode:e.compatMode}:{type:_a.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:_a.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=Xa(e.tagName);return ul.test(t)?"div":t}(e);let y={};const w=e.attributes.length;for(let t=0;tt.href===e.href);let n=null;t&&(n=Ka(t)),n&&(delete y.rel,delete y.href,y._cssText=n)}if("style"===v&&e.sheet){let t=Ka(e.sheet);t&&(e.childNodes.length>1&&(t=function(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=ll(e,r);const o=t.length/e.length;for(let a=1;a2&&""===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=ll(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&&a50*n.length)return s.push(e),s;const l=ll(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.length0!==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){dl||(dl=r.createElement("canvas"),pl=dl.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"",s=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{dl.width=t.naturalWidth,dl.height=t.naturalHeight,pl.drawImage(t,0,0),y.rr_dataURL=dl.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}if(p||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),m){const{width:t,height:r}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${r}px`,...g?{rr_background_color:"lightgrey"}:{}}}let b;"iframe"!==v||d(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(v)&&(b=!0)}catch(e){}return{type:_a.Element,tagName:v,attributes:y,childNodes:[],isSVG:yl(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=za(e),a=o&&o.tagName;let l="";const c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;return u?l="SCRIPT_PLACEHOLDER":i||(l=Wa(e),c&&l&&(l=al(l,wl(t.doc)))),!c&&!u&&l&&r&&(l=n?n(l,qa(e)):l.replace(/[\S]/g,"*")),{type:_a.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:c,rootId:w,cssCaptured:v});case e.CDATA_SECTION_NODE:return{type:_a.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:_a.Comment,textContent:Wa(e)||"",rootId:w};default:return!1}}function Il(e){return null==e?"":e.toLowerCase()}function Ol(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:Ya(t,e.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}return{styleId:n,rules:s}})}function El(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:x,iframeLoadTimeout:C=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:O=()=>!1,newlyAddedElement:E=!1,cssCaptured:M=!1,applyBackgroundColorToBlockedElements:R=!1}=t,P=t._emittedStyleIds??new Set;let{needsMask:T}=t,{preserveWhiteSpace:A=!0}=t;T||(T=Cl(e,l,c,void 0===T));const _=kl(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:O,newlyAddedElement:E,cssCaptured:M,applyBackgroundColorToBlockedElements:R});if(!_)return console.warn(e,"not serialized"),null;let L;L=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===_a.Comment)return!0;if(e.type===_a.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"===rl(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Il(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Il(e.attributes.name)||"icon"===Il(e.attributes.rel)||"apple-touch-icon"===Il(e.attributes.rel)||"shortcut icon"===Il(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Il(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Il(e.attributes.property).match(/^(og|twitter|fb):/)||Il(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Il(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Il(e.attributes.name)||"googlebot"===Il(e.attributes.name)||"bingbot"===Il(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Il(e.attributes.name)||"generator"===Il(e.attributes.name)||"framework"===Il(e.attributes.name)||"publisher"===Il(e.attributes.name)||"progid"===Il(e.attributes.name)||Il(e.attributes.property).match(/^article:/)||Il(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Il(e.attributes.name)||"yandex-verification"===Il(e.attributes.name)||"csrf-token"===Il(e.attributes.name)||"p:domain_verify"===Il(e.attributes.name)||"verify-v1"===Il(e.attributes.name)||"verification"===Il(e.attributes.name)||"shopify-checkout-api-token"===Il(e.attributes.name)))return!0}}return!1}(_,m)||!A&&_.type===_a.Text&&!_.textContent.replace(/^\s+|\s+$/gm,"").length?-2:hl();const N=Object.assign(_,{id:L});if(i.add(e,N),-2===L)return null;b&&b(e);let D=!u;if(N.type===_a.Element){D=D&&!N.needBlock,delete N.needBlock;const t=Va(e);t&&Ja(t)&&(N.isShadowHost=!0,S&&(null==(r=t.adoptedStyleSheets)?void 0:r.length)&&(N.adoptedStyleSheets=Ol(t.adoptedStyleSheets,S,P)))}if(N.type===_a.Document&&S){const t=e;(null==(n=t.adoptedStyleSheets)?void 0:n.length)&&(N.adoptedStyleSheets=Ol(t.adoptedStyleSheets,S,P))}if((N.type===_a.Document||N.type===_a.Element)&&D){m.headWhitespace&&N.type===_a.Element&&"head"===N.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:x,iframeLoadTimeout:C,onStylesheetLoad:k,stylesheetLoadTimeout:I,keepIframeSrcFn:O,cssCaptured:!1,applyBackgroundColorToBlockedElements:R};if(N.type===_a.Element&&"textarea"===N.tagName&&void 0!==N.attributes.value);else{N.type===_a.Element&&void 0!==N.attributes._cssText&&"string"==typeof N.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(Ba(e))){const e=El(r,t);e&&N.childNodes.push(e)}}let r=null;if(Ga(e)&&(r=Va(e)))for(const e of Array.from(Ba(r))){const n=El(e,t);n&&(Ja(r)&&(n.isShadow=!0),N.childNodes.push(n))}}const F=za(e);return F&&Ha(F)&&Ja(F)&&(N.isShadow=!0),N.type===_a.Element&&"iframe"===N.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&&x){const r=El(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:x,iframeLoadTimeout:C,onStylesheetLoad:k,stylesheetLoadTimeout:I,keepIframeSrcFn:O});r&&x(e,r)}},C),N.type===_a.Element&&"link"===N.tagName&&"string"==typeof N.attributes.rel&&("stylesheet"===N.attributes.rel||"preload"===N.attributes.rel&&"string"==typeof N.attributes.href&&"css"===rl(N.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=El(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:x,iframeLoadTimeout:C,onStylesheetLoad:k,stylesheetLoadTimeout:I,keepIframeSrcFn:O});t&&k(e,t)}},I),N}var Ml,Rl={exports:{}};const Pl=function(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}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Tl,Al;function _l(){if(Al)return Tl;Al=1;let e=function(){if(Ml)return Rl.exports;Ml=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 Rl.exports=t(),Rl.exports.createColors=t,Rl.exports}(),t=Pl;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:"",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 Tl=r,r.default=r,Tl}var Ll,Nl,Dl,Fl,Ul,jl,Bl,zl,ql,Wl,$l,Vl,Gl,Hl,Jl,Kl,Yl,Zl,Ql,Xl,ec,tc,rc,nc,sc,ic,oc,ac,lc,cc,uc,hc,dc,pc,fc,gc,mc,vc,yc,wc,bc,Sc,xc,Cc,kc,Ic,Oc,Ec,Mc,Rc,Pc,Tc,Ac,_c={};function Lc(){return Ll||(Ll=1,_c.isClean=Symbol("isClean"),_c.my=Symbol("my")),_c}function Nc(){if(Dl)return Nl;Dl=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;e0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n{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 Nl=t,t.default=t,Nl}function Dc(){if(Ul)return Fl;Ul=1;let e=Nc();function t(t,r){new e(r).stringify(t)}return Fl=t,t.default=t,Fl}function Fc(){if(Bl)return jl;Bl=1;let{isClean:e,my:t}=Lc(),r=_l(),n=Nc(),s=Dc();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"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 jl=o,o.default=o,jl}function Uc(){if(ql)return zl;ql=1;let e=Fc();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 zl=t,t.default=t,zl}function jc(){if(Gl)return Vl;Gl=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Pl,{existsSync:r,readFileSync:n}=Pl,{dirname:s,join:i}=Pl;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 Vl=o,o.default=o,Vl}function Bc(){if(Jl)return Hl;Jl=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Pl,{fileURLToPath:r,pathToFileURL:n}=Pl,{isAbsolute:s,resolve:i}=Pl,{nanoid:o}=($l||($l=1,Wl={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}}),Wl),a=Pl,l=_l(),c=jc(),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=""),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=t)n=r.length-1;else{let t,s=r.length-2;for(;n>1),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 Hl=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Hl}function zc(){if(Yl)return Kl;Yl=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Pl,{dirname:r,relative:n,resolve:s,sep:i}=Pl,{pathToFileURL:o}=Pl,a=Bc(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&i);return Kl=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)):""});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="",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)):"";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}},Kl}function qc(){if(Ql)return Zl;Ql=1;let e=Fc();class t extends e{constructor(e){super(e),this.type="comment"}}return Zl=t,t.default=t,Zl}function Wc(){if(ec)return Xl;ec=1;let e,t,r,n,{isClean:s,my:i}=Lc(),o=Uc(),a=qc(),l=Fc();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]"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(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},Xl=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)})},Xl}function $c(){if(rc)return tc;rc=1;let e,t,r=Wc();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},tc=n,n.default=n,tc}function Vc(){if(sc)return nc;sc=1;let e={};return nc=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function Gc(){if(oc)return ic;oc=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 ic=e,e.default=e,ic}function Hc(){if(lc)return ac;lc=1;let e=Gc();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 ac=t,t.default=t,ac}function Jc(){if(dc)return hc;dc=1;let e=Wc();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 hc=t,t.default=t,e.registerAtRule(t),hc}function Kc(){if(fc)return pc;fc=1;let e,t,r=Wc();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 Yc(){if(mc)return gc;mc=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 gc=e,e.default=e,gc}function Zc(){if(yc)return vc;yc=1;let e=Wc(),t=Yc();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 vc=r,r.default=r,e.registerRule(r),vc}function Qc(){if(xc)return Sc;xc=1;let e=Wc(),t=function(){if(bc)return wc;bc=1;let e=Uc(),t=function(){if(uc)return cc;uc=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"'(/\\]/,x=/[\da-f]/i;return cc=function(C,k={}){let I,O,E,M,R,P,T,A,_,L,N=C.css.valueOf(),D=k.ignoreErrors,F=N.length,U=0,j=[],B=[];function z(e){throw C.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(C){if(B.length)return B.pop();if(U>=F)return;let k=!!C&&C.ignoreUnclosed;switch(I=N.charCodeAt(U),I){case s:case i:case a:case l:case o:O=U;do{O+=1,I=N.charCodeAt(O)}while(I===i||I===s||I===a||I===l||I===o);L=["space",N.slice(U,O)],U=O-1;break;case c:case u:case p:case f:case v:case g:case d:{let e=String.fromCharCode(I);L=[e,e,U];break}case h:if(A=j.length?j.pop()[1]:"",_=N.charCodeAt(U+1),"url"===A&&_!==e&&_!==t&&_!==i&&_!==s&&_!==a&&_!==o&&_!==l){O=U;do{if(P=!1,O=N.indexOf(")",O+1),-1===O){if(D||k){O=U;break}z("bracket")}for(T=O;N.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);L=["brackets",N.slice(U,O+1),U,O],U=O}else O=N.indexOf(")",U+1),M=N.slice(U,O+1),-1===O||S.test(M)?L=["(","(",U]:(L=["brackets",M,U,O],U=O);break;case e:case t:E=I===e?"'":'"',O=U;do{if(P=!1,O=N.indexOf(E,O+1),-1===O){if(D||k){O=U+1;break}z("string")}for(T=O;N.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);L=["string",N.slice(U,O+1),U,O],U=O;break;case y:w.lastIndex=U+1,w.test(N),O=0===w.lastIndex?N.length-1:w.lastIndex-2,L=["at-word",N.slice(U,O+1),U,O],U=O;break;case r:for(O=U,R=!0;N.charCodeAt(O+1)===r;)O+=1,R=!R;if(I=N.charCodeAt(O+1),R&&I!==n&&I!==i&&I!==s&&I!==a&&I!==l&&I!==o&&(O+=1,x.test(N.charAt(O)))){for(;x.test(N.charAt(O+1));)O+=1;N.charCodeAt(O+1)===i&&(O+=1)}L=["word",N.slice(U,O+1),U,O],U=O;break;default:I===n&&N.charCodeAt(U+1)===m?(O=N.indexOf("*/",U+2)+1,0===O&&(D||k?O=N.length:z("comment")),L=["comment",N.slice(U,O+1),U,O],U=O):(b.lastIndex=U+1,b.test(N),O=0===b.lastIndex?N.length-1:b.lastIndex-2,L=["word",N.slice(U,O+1),U,O],j.push(L),U=O)}return U++,L},position:function(){return U}}}}(),r=qc(),n=Jc(),s=Kc(),i=Zc();const o={empty:!0,space:!0};return wc=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;ee+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;nm(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 o=l;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(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;e0;){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 s;this.result.lastPlugin=r;try{s=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(s))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{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},Cc=y,y.default=y,c.registerLazyResult(y),i.registerLazyResult(y),Cc}var eu=function(){if(Ac)return Tc;Ac=1;let e=_l(),t=Uc(),r=Xc(),n=Wc(),s=function(){if(Mc)return Ec;Mc=1;let e=function(){if(Oc)return Ic;Oc=1;let e=zc(),t=Dc(),r=Vc(),n=Qc();const s=Hc();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 Ic=i,i.default=i,Ic}(),t=Xc(),r=$c(),n=Kc();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 Ec=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Ec}(),i=Dc(),o=function(){if(Pc)return Rc;Pc=1;let e=Uc(),t=jc(),r=qc(),n=Jc(),s=Bc(),i=Kc(),o=Zc();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 Rc=a,a.default=a,Rc}(),a=$c(),l=Gc(),c=qc(),u=Jc(),h=Hc(),d=Bc(),p=Qc(),f=Yc(),g=Zc(),m=Kc(),v=Fc();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),Tc=y,y.default=y,Tc}();const tu=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(eu);tu.stringify,tu.fromJSON,tu.plugin,tu.parse,tu.list,tu.document,tu.comment,tu.atRule,tu.rule,tu.decl,tu.root,tu.CssSyntaxError,tu.Declaration,tu.Container,tu.Processor,tu.Document,tu.Comment,tu.Warning,tu.AtRule,tu.Result,tu.Input,tu.Rule,tu.Root,tu.Node;var ru=Object.defineProperty,nu=(e,t,r)=>((e,t,r)=>t in e?ru(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);var su,iu={exports:{}};const ou=function(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}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var au,lu;function cu(){if(lu)return au;lu=1;let e=function(){if(su)return iu.exports;su=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return iu.exports=t(),iu.exports.createColors=t,iu.exports}(),t=ou;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:"",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 au=r,r.default=r,au}var uu,hu,du,pu,fu,gu,mu,vu,yu,wu,bu,Su,xu,Cu,ku,Iu,Ou,Eu,Mu,Ru,Pu,Tu,Au,_u,Lu,Nu,Du,Fu,Uu,ju,Bu,zu,qu,Wu,$u,Vu,Gu,Hu,Ju,Ku,Yu,Zu,Qu,Xu,eh,th,rh,nh,sh,ih,oh,ah,lh,ch={};function uh(){return uu||(uu=1,ch.isClean=Symbol("isClean"),ch.my=Symbol("my")),ch}function hh(){if(du)return hu;du=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;e0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n{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 hu=t,t.default=t,hu}function dh(){if(fu)return pu;fu=1;let e=hh();function t(t,r){new e(r).stringify(t)}return pu=t,t.default=t,pu}function ph(){if(mu)return gu;mu=1;let{isClean:e,my:t}=uh(),r=cu(),n=hh(),s=dh();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"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 gu=o,o.default=o,gu}function fh(){if(yu)return vu;yu=1;let e=ph();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 vu=t,t.default=t,vu}function gh(){if(xu)return Su;xu=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ou,{existsSync:r,readFileSync:n}=ou,{dirname:s,join:i}=ou;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 Su=o,o.default=o,Su}function mh(){if(ku)return Cu;ku=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ou,{fileURLToPath:r,pathToFileURL:n}=ou,{isAbsolute:s,resolve:i}=ou,{nanoid:o}=(bu||(bu=1,wu={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}}),wu),a=ou,l=cu(),c=gh(),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=""),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=t)n=r.length-1;else{let t,s=r.length-2;for(;n>1),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 Cu=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Cu}function vh(){if(Ou)return Iu;Ou=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ou,{dirname:r,relative:n,resolve:s,sep:i}=ou,{pathToFileURL:o}=ou,a=mh(),l=Boolean(e&&t),c=Boolean(r&&s&&n&&i);return Iu=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)):""});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="",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)):"";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}},Iu}function yh(){if(Mu)return Eu;Mu=1;let e=ph();class t extends e{constructor(e){super(e),this.type="comment"}}return Eu=t,t.default=t,Eu}function wh(){if(Pu)return Ru;Pu=1;let e,t,r,n,{isClean:s,my:i}=uh(),o=fh(),a=yh(),l=ph();function c(e){return e.map(e=>(e.nodes&&(e.nodes=c(e.nodes)),delete e.source,e))}function u(e){if(e[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]"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(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},Ru=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)})},Ru}function bh(){if(Au)return Tu;Au=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},Tu=n,n.default=n,Tu}function Sh(){if(Lu)return _u;Lu=1;let e={};return _u=function(t){e[t]||(e[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))}}function xh(){if(Du)return Nu;Du=1;class e{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return Nu=e,e.default=e,Nu}function Ch(){if(Uu)return Fu;Uu=1;let e=xh();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 Fu=t,t.default=t,Fu}function kh(){if(qu)return zu;qu=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 zu=t,t.default=t,e.registerAtRule(t),zu}function Ih(){if($u)return Wu;$u=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},Wu=n,n.default=n,r.registerRoot(n),Wu}function Oh(){if(Gu)return Vu;Gu=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 Vu=e,e.default=e,Vu}function Eh(){if(Ju)return Hu;Ju=1;let e=wh(),t=Oh();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 Hu=r,r.default=r,e.registerRule(r),Hu}function Mh(){if(Qu)return Zu;Qu=1;let e=wh(),t=function(){if(Yu)return Ku;Yu=1;let e=fh(),t=function(){if(Bu)return ju;Bu=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"'(/\\]/,x=/[\da-f]/i;return ju=function(C,k={}){let I,O,E,M,R,P,T,A,_,L,N=C.css.valueOf(),D=k.ignoreErrors,F=N.length,U=0,j=[],B=[];function z(e){throw C.error("Unclosed "+e,U)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&U>=F},nextToken:function(C){if(B.length)return B.pop();if(U>=F)return;let k=!!C&&C.ignoreUnclosed;switch(I=N.charCodeAt(U),I){case s:case i:case a:case l:case o:O=U;do{O+=1,I=N.charCodeAt(O)}while(I===i||I===s||I===a||I===l||I===o);L=["space",N.slice(U,O)],U=O-1;break;case c:case u:case p:case f:case v:case g:case d:{let e=String.fromCharCode(I);L=[e,e,U];break}case h:if(A=j.length?j.pop()[1]:"",_=N.charCodeAt(U+1),"url"===A&&_!==e&&_!==t&&_!==i&&_!==s&&_!==a&&_!==o&&_!==l){O=U;do{if(P=!1,O=N.indexOf(")",O+1),-1===O){if(D||k){O=U;break}z("bracket")}for(T=O;N.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);L=["brackets",N.slice(U,O+1),U,O],U=O}else O=N.indexOf(")",U+1),M=N.slice(U,O+1),-1===O||S.test(M)?L=["(","(",U]:(L=["brackets",M,U,O],U=O);break;case e:case t:E=I===e?"'":'"',O=U;do{if(P=!1,O=N.indexOf(E,O+1),-1===O){if(D||k){O=U+1;break}z("string")}for(T=O;N.charCodeAt(T-1)===r;)T-=1,P=!P}while(P);L=["string",N.slice(U,O+1),U,O],U=O;break;case y:w.lastIndex=U+1,w.test(N),O=0===w.lastIndex?N.length-1:w.lastIndex-2,L=["at-word",N.slice(U,O+1),U,O],U=O;break;case r:for(O=U,R=!0;N.charCodeAt(O+1)===r;)O+=1,R=!R;if(I=N.charCodeAt(O+1),R&&I!==n&&I!==i&&I!==s&&I!==a&&I!==l&&I!==o&&(O+=1,x.test(N.charAt(O)))){for(;x.test(N.charAt(O+1));)O+=1;N.charCodeAt(O+1)===i&&(O+=1)}L=["word",N.slice(U,O+1),U,O],U=O;break;default:I===n&&N.charCodeAt(U+1)===m?(O=N.indexOf("*/",U+2)+1,0===O&&(D||k?O=N.length:z("comment")),L=["comment",N.slice(U,O+1),U,O],U=O):(b.lastIndex=U+1,b.test(N),O=0===b.lastIndex?N.length-1:b.lastIndex-2,L=["word",N.slice(U,O+1),U,O],j.push(L),U=O)}return U++,L},position:function(){return U}}}}(),r=yh(),n=kh(),s=Ih(),i=Eh();const o={empty:!0,space:!0};return Ku=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;ee+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;nm(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 o=l;n.syntax&&(o=n.syntax.parse),n.parser&&(o=n.parser),o.parse&&(o=o.parse);try{i=o(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;e0;){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 s;this.result.lastPlugin=r;try{s=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(s))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{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},Xu=y,y.default=y,c.registerLazyResult(y),i.registerLazyResult(y),Xu}var Ph=function(){if(lh)return ah;lh=1;let e=cu(),t=fh(),r=Rh(),n=wh(),s=function(){if(sh)return nh;sh=1;let e=function(){if(rh)return th;rh=1;let e=vh(),t=dh(),r=Sh(),n=Mh();const s=Ch();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 th=i,i.default=i,th}(),t=Rh(),r=bh(),n=Ih();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 nh=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),nh}(),i=dh(),o=function(){if(oh)return ih;oh=1;let e=fh(),t=gh(),r=yh(),n=kh(),s=mh(),i=Ih(),o=Eh();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 ih=a,a.default=a,ih}(),a=bh(),l=xh(),c=yh(),u=kh(),h=Ch(),d=mh(),p=Mh(),f=Oh(),g=Eh(),m=Ih(),v=ph();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),ah=y,y.default=y,ah}();const Th=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(Ph);Th.stringify,Th.fromJSON,Th.plugin,Th.parse,Th.list,Th.document,Th.comment,Th.atRule,Th.rule,Th.decl,Th.root,Th.CssSyntaxError,Th.Declaration,Th.Container,Th.Processor,Th.Document,Th.Comment,Th.Warning,Th.AtRule,Th.Result,Th.Input,Th.Rule,Th.Root,Th.Node;class Ah{constructor(...e){nu(this,"parentElement",null),nu(this,"parentNode",null),nu(this,"ownerDocument"),nu(this,"firstChild",null),nu(this,"lastChild",null),nu(this,"previousSibling",null),nu(this,"nextSibling",null),nu(this,"ELEMENT_NODE",1),nu(this,"TEXT_NODE",3),nu(this,"nodeType"),nu(this,"nodeName"),nu(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 Ah))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 _h={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Lh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Nh={};function Dh(e){if(Nh[e])return Nh[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 _h?_h[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 Lh?Lh[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 Nh[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?Nh[e]=i:r}catch{return r}}const Fh={};function Uh(e,t,r){var n;const s=`${e}.${String(r)}`;if(Fh[s])return Fh[s].call(t);const i=Dh(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(Fh[s]=o,o.call(t)):t[r]}const jh={};function Bh(e,t,r){const n=`${e}.${String(r)}`;if(jh[n])return jh[n].bind(t);const s=Dh(e)[r];return"function"!=typeof s?t[r]:(jh[n]=s,s.bind(t))}function zh(){return Dh("MutationObserver").constructor}const qh=function(e){return Uh("Node",e,"childNodes")},Wh=function(e){return Uh("Node",e,"parentNode")},$h=function(e){return Uh("Node",e,"parentElement")},Vh=function(e){return Uh("Node",e,"textContent")},Gh=function(e,t){return Bh("Node",e,"contains")(t)},Hh=function(e){return Bh("Node",e,"getRootNode")()},Jh=function(e){return e&&"host"in e?Uh("ShadowRoot",e,"host"):null},Kh=function(e){return e&&"shadowRoot"in e?Uh("Element",e,"shadowRoot"):null};function Yh(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Zh="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 Qh={map:{},getId:()=>(console.error(Zh),-1),getNode:()=>(console.error(Zh),null),removeNodeFromMap(){console.error(Zh)},has:()=>(console.error(Zh),!1),reset(){console.error(Zh)}};function Xh(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 ed(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)}}),()=>ed(e,t,i||{},!0)}function td(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&&(Qh=new Proxy(Qh,{get:(e,t,r)=>("map"===t&&console.error(Zh),Reflect.get(e,t,r))}));let rd=Date.now;function nd(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=$h(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=$h(i.body))?void 0:n.scrollTop)||(null==(s=null==i?void 0:i.body)?void 0:s.scrollTop)||0}}function sd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function id(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function od(e){return e?e.nodeType===e.ELEMENT_NODE?e:$h(e):null}function ad(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(xl(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 ld(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function cd(e,t){if(Ha(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=Wh(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||cd(n,t))}function ud(e){return Boolean(e.changedTouches)}function hd(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function dd(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function pd(e){return!!e&&(e instanceof Ah&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Kh(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(rd=()=>(new Date).getTime());class fd{constructor(){Pa(this,"id",1),Pa(this,"styleIDMap",new WeakMap),Pa(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 gd(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Hh(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Jh(Hh(e))&&(r=Jh(Hh(e))),r}function md(e){const t=e.ownerDocument;return!!t&&(Gh(t,e)||function(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=gd(r);)r=t;return r}(e);return Gh(t,r)}(e))}var vd=(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))(vd||{}),yd=(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))(yd||{}),wd=(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))(wd||{}),bd=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(bd||{}),Sd=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Sd||{}),xd=(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))(xd||{}),Cd=(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))(Cd||{});function kd(e){return"__ln"in e}class Id{constructor(){Pa(this,"length",0),Pa(this,"head",null),Pa(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}@${t}`;class Ed{constructor(){Pa(this,"frozen",!1),Pa(this,"locked",!1),Pa(this,"texts",[]),Pa(this,"attributes",[]),Pa(this,"attributeMap",new WeakMap),Pa(this,"removes",[]),Pa(this,"mapRemoves",[]),Pa(this,"movedMap",{}),Pa(this,"addedSet",new Set),Pa(this,"movedSet",new Set),Pa(this,"droppedSet",new Set),Pa(this,"removesSubTreeCache",new Set),Pa(this,"mutationCb"),Pa(this,"blockClass"),Pa(this,"blockSelector"),Pa(this,"maskTextClass"),Pa(this,"maskTextSelector"),Pa(this,"inlineStylesheet"),Pa(this,"maskInputOptions"),Pa(this,"maskTextFn"),Pa(this,"maskInputFn"),Pa(this,"maskAttributeFn"),Pa(this,"keepIframeSrcFn"),Pa(this,"recordCanvas"),Pa(this,"inlineImages"),Pa(this,"slimDOMOptions"),Pa(this,"dataURLOptions"),Pa(this,"doc"),Pa(this,"mirror"),Pa(this,"iframeManager"),Pa(this,"stylesheetManager"),Pa(this,"shadowDomManager"),Pa(this,"canvasManager"),Pa(this,"processedNodeManager"),Pa(this,"unattachedDoc"),Pa(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Pa(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Id,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=Wh(s);if(!i||!md(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=Ha(i)?this.mirror.getId(gd(s)):this.mirror.getId(i),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=El(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=>{hd(e,this.mirror)&&this.iframeManager.addIframe(e),dd(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),pd(s)&&this.shadowDomManager.addShadowRoot(Kh(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)Rd(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Wh(e))||s(e);for(const e of this.addedSet)Pd(this.droppedSet,e)||Rd(this.removesSubTreeCache,e,this.mirror)?Pd(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(Wh(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(Wh(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=Wh(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Jh(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=Wh(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.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))}),Pa(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(qh(e),e=>Vh(e)||"").join("");t.attributes.value=Qa({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:tl(e),value:r,maskInputFn:this.maskInputFn})}),Pa(this,"processMutation",e=>{if(!ld(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Vh(e.target);ad(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Cl(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=tl(t);n=Qa({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(ad(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"),!Sl(t.tagName,r)){if(s.attributes[r]=bl(this.doc,Xa(t.tagName),Xa(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(ad(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=Ha(e.target)?this.mirror.getId(Jh(e.target)):this.mirror.getId(e.target);ad(e.target,this.blockClass,this.blockSelector,!1)||ld(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Md(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||cd(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Od(r,n)]?Md(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!Ha(e.target)||!Ja(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),qh(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Pa(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(ld(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[Od(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ad(e,this.blockClass,this.blockSelector,!1)||(qh(e).forEach(e=>this.genAdds(e)),pd(e)&&qh(Kh(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 Md(e,t){e.delete(t),qh(t).forEach(t=>Md(e,t))}function Rd(e,t,r){return 0!==e.size&&function(e,t){const r=Wh(t);return!!r&&e.has(r)}(e,t)}function Pd(e,t){return 0!==e.size&&Td(e,t)}function Td(e,t){const r=Wh(t);return!!r&&(!!e.has(r)||Td(e,r))}let Ad;const _d=e=>Ad?(...t)=>{try{return e(...t)}catch(e){if(Ad&&!0===Ad(e))return;throw e}}:e;function Ld(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const Nd=[];function Dd(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 Fd(e,t){const r=new Ed;Nd.push(r),r.init(e);const n=new(zh())(_d(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function Ud({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){const o=_d(Xh(_d(i=>{const o=Dd(i);if(!o||ad(o,n,s,!0))return;const a=r.getId(o);if(o===t&&t.defaultView){const r=nd(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 Yh("scroll",o,t)}const jd=["INPUT","TEXTAREA","SELECT"],Bd=new WeakMap;function zd(e){return function(e,t){if(Vd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Vd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Vd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Vd("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 qd(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Wd({mirror:e,stylesheetManager:t},r){var n,s,i;let o=null;o="#document"===r.nodeName?e.getId(r):e.getId(Jh(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}}),_d(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function $d(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=Fd(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=Xh(_d(t=>{const r=Date.now()-o;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],o=null}),i),c=_d(Xh(_d(e=>{const t=Dd(e),{clientX:r,clientY:s}=ud(e)?e.changedTouches[0]:e;o||(o=rd()),a.push({x:r,y:s,id:n.getId(t),timeOffset:rd()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?yd.Drag:e instanceof MouseEvent?yd.MouseMove:yd.TouchMove)}),s,{trailing:!1})),u=[Yh("mousemove",c,r),Yh("touchmove",c,r),Yh("drag",c,r)];return _d(()=>{u.forEach(e=>e())})}(e),i=function({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(wd).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]).forEach(i=>{let o=Xa(i);const c=(t=>i=>{const o=Dd(i);if(ad(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?wd[t]===wd.MouseDown?c="TouchStart":wd[t]===wd.MouseUp&&(c="TouchEnd"):bd.Pen}else ud(i)&&(a=bd.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===bd.Touch||c.startsWith("Mouse")&&a===bd.Mouse)&&(a=null)):wd[t]===wd.Click&&(a=l,l=null);const u=ud(i)?i.changedTouches[0]:i;if(!u)return;const h=r.getId(o),{clientX:d,clientY:p}=u;_d(e)({type:wd[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(i);if(window.PointerEvent)switch(wd[i]){case wd.MouseDown:case wd.MouseUp:o=o.replace("mouse","pointer");break;case wd.TouchStart:case wd.TouchEnd:return}a.push(Yh(o,c,t))}),_d(()=>{a.forEach(e=>e())})}(e),o=Ud(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return Yh("resize",_d(Xh(_d(()=>{const t=sd(),s=id();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=Dd(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=$h(r)),!r||!h||jd.indexOf(h)<0||ad(r,n,s,!0))return;if(r.classList.contains(i)||o&&r.matches(o))return;let p=r.value,f=!1;const g=tl(r)||"";"radio"===g||"checkbox"===g?f=r.checked:(a[h.toLowerCase()]||a[g])&&(p=Qa({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=Bd.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){Bd.set(t,n);const s=r.getId(t);_d(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>Yh(e,_d(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=>ed(e[0],e[1],{set(){_d(h)({target:this,isTrusted:!1})}},!1,f))),_d(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:i}){const o=_d(i=>Xh(_d(s=>{const o=Dd(s);if(!o||ad(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=[Yh("play",o(xd.Play),i),Yh("pause",o(xd.Pause),i),Yh("seeked",o(xd.Seeked),i),Yh("volumechange",o(xd.VolumeChange),i),Yh("ratechange",o(xd.RateChange),i)];return _d(()=>{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:_d((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=qd(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:a}]}),Ld(()=>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:_d((n,s,i)=>{const[o]=i,{id:a,styleId:l}=qd(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:o}]}),Ld(()=>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:_d((n,s,i)=>{const[o]=i,{id:a,styleId:l}=qd(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:_d((n,s,i)=>{const[o]=i,{id:a,styleId:l}=qd(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:o}),n.apply(s,i)})}));const l={};Gd("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(Gd("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),Gd("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),Gd("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:_d((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=qd(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:[...zd(s),a||0]}]}),n.apply(s,i)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:_d((n,s,i)=>{const[o]=i,{id:a,styleId:l}=qd(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...zd(s),o]}]}),n.apply(s,i)})})}),_d(()=>{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=Wd(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:_d((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}=qd(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:zd(o.parentRule)}),s.apply(o,a)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:_d((s,i,a)=>{var l;const[c]=a;if(r.has(c))return o.apply(i,[c]);const{id:u,styleId:h}=qd(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:zd(i.parentRule)}),s.apply(i,a)})}),_d(()=>{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=td(t.fonts,"add",function(t){return function(r){return setTimeout(_d(()=>{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),_d(()=>{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=_d(()=>{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{}}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,r,t.options));return _d(()=>{Nd.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 Vd(e){return void 0!==window[e]}function Gd(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Hd{constructor(e){Pa(this,"iframeIdToRemoteIdMap",new WeakMap),Pa(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;return n.get(t)||-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 Jd{constructor(e){Pa(this,"iframes",new WeakMap),Pa(this,"crossOriginIframeMap",new WeakMap),Pa(this,"crossOriginIframeMirror",new Hd(hl)),Pa(this,"crossOriginIframeStyleMirror"),Pa(this,"crossOriginIframeRootIdMap",new WeakMap),Pa(this,"mirror"),Pa(this,"mutationCb"),Pa(this,"wrappedEmit"),Pa(this,"loadListener"),Pa(this,"stylesheetManager"),Pa(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Hd(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 vd.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:vd.IncrementalSnapshot,data:{source:yd.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case vd.Meta:case vd.Load:case vd.DomContentLoaded:return!1;case vd.Plugin:return t;case vd.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case vd.IncrementalSnapshot:switch(t.data.source){case yd.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 yd.Drag:case yd.TouchMove:case yd.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case yd.ViewportResize:return!1;case yd.MediaInteraction:case yd.MouseInteraction:case yd.Scroll:case yd.CanvasMutation:case yd.Input:return this.replaceIds(t.data,e,["id"]),t;case yd.StyleSheetRule:case yd.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case yd.Font:return t;case yd.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case yd.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===Cd.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Kd{constructor(e){Pa(this,"shadowDoms",new WeakSet),Pa(this,"mutationCb"),Pa(this,"scrollCb"),Pa(this,"bypassOptions"),Pa(this,"mirror"),Pa(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(!Ja(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Fd({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Ud({...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(Jh(e))),this.restoreHandlers.push(Wd({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(td(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),i=Kh(this);return i&&md(this)&&r.addShadowRoot(i,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Yd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Qd=0;Qd<64;Qd++)Zd[Yd.charCodeAt(Qd)]=Qd;const Xd=new Map,ep=(e,t,r)=>{if(!e||!np(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=Xd.get(e);return r||(r=new Map,Xd.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 tp(e,t,r){if(e instanceof Array)return e.map(e=>tp(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>2],s+=Yd[(3&r[t])<<4|r[t+1]>>4],s+=Yd[(15&r[t+1])<<2|r[t+2]>>6],s+=Yd[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:[tp(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}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[tp(e.data,t,r),e.width,e.height]}:np(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:ep(e,t,r)}:e}const rp=(e,t,r)=>e.map(e=>tp(e,t,r)),np=(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 sp(e,t,r,n){const s=[];try{const i=td(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...i){if(!ad(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=td(e,l,function(e){return function(...o){const a=e.apply(this,o);if(ep(a,i,this),"tagName"in this.canvas&&!ad(this.canvas,n,s,!0)){const e=rp(o,i,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});o.push(a)}catch{const n=ed(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});o.push(n)}return o}const op='(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',ap="undefined"!=typeof self&&self.Blob&&new Blob([op],{type:"text/javascript;charset=utf-8"});function lp(e){let t;try{if(t=ap&&(self.URL||self.webkitURL).createObjectURL(ap),!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(op),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class cp{constructor(e){Pa(this,"pendingCanvasMutations",new Map),Pa(this,"rafStamps",{latestId:0,invokeId:null}),Pa(this,"mirror"),Pa(this,"mutationCb"),Pa(this,"resetObservers"),Pa(this,"frozen",!1),Pa(this,"locked",!1),Pa(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=sp(t,r,n,!0),o=new Map,a=new lp;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:Sd["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{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{ad(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=sp(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=td(t.CanvasRenderingContext2D.prototype,o,function(s){return function(...i){return ad(this.canvas,r,n,!0)||setTimeout(()=>{const r=rp(i,t,this);e(this.canvas,{type:Sd["2D"],property:o,args:r})},0),s.apply(this,i)}});s.push(i)}catch{const r=ed(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:Sd["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,Sd.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...ip(t.WebGL2RenderingContext.prototype,Sd.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 up{constructor(e){Pa(this,"trackedLinkElements",new WeakSet),Pa(this,"mutationCb"),Pa(this,"adoptedStyleSheetCb"),Pa(this,"styleMirror",new fd),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 s;if(this.styleMirror.has(t))s=this.styleMirror.getId(t);else{s=this.styleMirror.add(t);let r=[];try{r=Array.from(t.cssRules,(e,r)=>({rule:Ya(e,t.href),index:r}))}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}n.push({styleId:s,rules:r})}r.styleIds.push(s)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class hp{constructor(){Pa(this,"nodeMap",new WeakMap),Pa(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 dp,pp,fp,gp=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Ea=e.contentWindow)?void 0:Ea.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const mp=new Za;function vp(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:x=!0,recordCanvas:C=!1,recordCrossOriginIframes:k=!1,recordAfter:I=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:O=!1,collectFonts:E=!1,inlineImages:M=!1,captureAdoptedStyleSheets:R=!0,plugins:P,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:_,applyBackgroundColorToBlockedElements:L=!1}=e;Ad=_;const N=!k||window.parent===window;let D=!1;if(!N)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!D)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),mp.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},U=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let j;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let B=0;const z=e=>{for(const t of P||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!D&&(e=y(e)),e};dp=(e,s)=>{var i;const o=e;if(o.timestamp=rd(),!(null==(i=Nd[0])?void 0:i.isFrozen())||o.type===vd.FullSnapshot||o.type===vd.IncrementalSnapshot&&o.data.source===yd.Mutation||Nd.forEach(e=>e.unfreeze()),N)null==t||t(z(o),s);else if(D){const e={type:"rrweb",event:z(o),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(o.type===vd.FullSnapshot)j=o,B=0;else if(o.type===vd.IncrementalSnapshot){if(o.data.source===yd.Mutation&&o.data.isAttachIframe)return;B++;const e=n&&B>=n,t=r&&o.timestamp-j.timestamp>r;(e||t)&&pp(!0)}};const q=e=>{dp({type:vd.IncrementalSnapshot,data:{source:yd.Mutation,...e}})},W=e=>dp({type:vd.IncrementalSnapshot,data:{source:yd.Scroll,...e}}),$=e=>dp({type:vd.IncrementalSnapshot,data:{source:yd.CanvasMutation,...e}}),V=new up({mutationCb:q,adoptedStyleSheetCb:e=>dp({type:vd.IncrementalSnapshot,data:{source:yd.AdoptedStyleSheet,...e}})}),G=new Jd({mirror:mp,mutationCb:q,stylesheetManager:V,recordCrossOriginIframes:k,wrappedEmit:dp});for(const e of P||[])e.getMirror&&e.getMirror({nodeMirror:mp,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const H=new hp;fp=new cp({recordCanvas:C,mutationCb:$,win:window,blockClass:s,blockSelector:i,mirror:mp,sampling:w.canvas,dataURLOptions:b});const J=new Kd({mutationCb:q,scrollCb:W,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:F,dataURLOptions:b,maskTextFn:g,maskInputFn:f,maskAttributeFn:m,recordCanvas:C,inlineImages:M,sampling:w,slimDOMOptions:U,iframeManager:G,stylesheetManager:V,canvasManager:fp,keepIframeSrcFn:T,processedNodeManager:H},mirror:mp});pp=(e=!1)=>{if(!x)return;dp({type:vd.Meta,data:{href:window.location.href,width:id(),height:sd()}},e),V.reset(),J.init(),Nd.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new Za,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:x,keepIframeSrcFn:C=()=>!1,applyBackgroundColorToBlockedElements:k=!1}=t||{};return El(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:x,keepIframeSrcFn:C,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:k})}(document,{mirror:mp,blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:F,maskTextFn:g,maskInputFn:f,maskAttributeFn:m,slimDOM:U,dataURLOptions:b,recordCanvas:C,inlineImages:M,applyBackgroundColorToBlockedElements:L,onSerialize:e=>{hd(e,mp)&&G.addIframe(e),dd(e,mp)&&V.trackLinkElement(e),pd(e)&&J.addShadowRoot(Kh(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:T});if(!t)return console.warn("Failed to snapshot the document");dp({type:vd.FullSnapshot,data:{node:t,initialOffset:nd(window)}},e),Nd.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,mp.getId(document))};try{const e=[],t=e=>{var t;return _d($d)({mutationCb:q,mousemoveCb:(e,t)=>dp({type:vd.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>dp({type:vd.IncrementalSnapshot,data:{source:yd.MouseInteraction,...e}}),scrollCb:W,viewportResizeCb:e=>dp({type:vd.IncrementalSnapshot,data:{source:yd.ViewportResize,...e}}),inputCb:e=>dp({type:vd.IncrementalSnapshot,data:{source:yd.Input,...e}}),mediaInteractionCb:e=>dp({type:vd.IncrementalSnapshot,data:{source:yd.MediaInteraction,...e}}),styleSheetRuleCb:e=>dp({type:vd.IncrementalSnapshot,data:{source:yd.StyleSheetRule,...e}}),styleDeclarationCb:e=>dp({type:vd.IncrementalSnapshot,data:{source:yd.StyleDeclaration,...e}}),canvasMutationCb:$,fontCb:e=>dp({type:vd.IncrementalSnapshot,data:{source:yd.Font,...e}}),selectionCb:e=>{dp({type:vd.IncrementalSnapshot,data:{source:yd.Selection,...e}})},customElementCb:e=>{dp({type:vd.IncrementalSnapshot,data:{source:yd.CustomElement,...e}})},blockClass:s,ignoreClass:o,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:F,inlineStylesheet:u,sampling:w,recordDOM:x,recordCanvas:C,inlineImages:M,userTriggeredOnInput:O,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:g,maskAttributeFn:m,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:U,dataURLOptions:b,mirror:mp,iframeManager:G,stylesheetManager:V,shadowDomManager:J,processedNodeManager:H,canvasManager:fp,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=>dp({type:vd.Plugin,data:{plugin:e.name,payload:t}})})))||[]},v)};G.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{pp(),e.push(t(document)),gp=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Yh("DOMContentLoaded",()=>{dp({type:vd.DomContentLoaded,data:{}}),"DOMContentLoaded"===I&&r()})),e.push(Yh("load",()=>{dp({type:vd.Load,data:{}}),"load"===I&&r()},window))),()=>{e.forEach(e=>e()),H.destroy(),gp=!1,Ad=void 0}}catch(e){console.warn(e)}}var yp;vp.addCustomEvent=(e,t)=>{if(!gp)throw new Error("please add custom event after start recording");dp({type:vd.Custom,data:{tag:e,payload:t}})},vp.freezePage=()=>{Nd.forEach(e=>e.freeze())},vp.takeFullSnapshot=e=>{if(!gp)throw new Error("please take full snapshot after start recording");pp(e)},vp.mirror=mp,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(yp||(yp={}));var wp=Object.freeze({__proto__:null,record:vp}),bp=["image/","audio/","video/","application/octet-stream","font/"];function Sp(e,t){if(new Blob([e]).size<=t)return{value:e,truncated:!1};for(var r=0,n=Math.min(e.length,t);r0&&e.charCodeAt(r-1)>=55296&&e.charCodeAt(r-1)<=56319&&(r-=1),{value:e.slice(0,r),truncated:!0}}var xp=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e,t){this.eventCallback=e,this.networkConfig=t,this.observeFetch()},e.prototype.stop=function(){var e;null===(e=this.fetchObserver)||void 0===e||e.call(this),this.fetchObserver=null,this.eventCallback=void 0,this.networkConfig=void 0},e.prototype.notifyEvent=function(e){var t;null===(t=this.eventCallback)||void 0===t||t.call(this,e)},e.prototype.observeFetch=function(){var e=this,t=m();if(t){var r=t.fetch;r&&(t.fetch=function(t,n){return a(e,void 0,void 0,function(){var e,s,i,o,a,c,u,h,d,p,f,g,m=this;return l(this,function(l){switch(l.label){case 0:e=Date.now(),s={timestamp:e,type:"fetch",method:(null==n?void 0:n.method)||"GET",url:t.toString(),requestHeaders:null==n?void 0:n.headers},(null==(i=null===(f=this.networkConfig)||void 0===f?void 0:f.body)?void 0:i.request)&&void 0!==(o=function(e){if(null!=e){if("string"==typeof e)return e;if(e instanceof URLSearchParams)return e.toString();if(e instanceof FormData){var t=[];return e.forEach(function(e,r){t.push("".concat(r,"=").concat("string"==typeof e?e:"[File]"))}),t.join("&")}}}(null==n?void 0:n.body))&&(a=null!==(g=i.maxBodySizeBytes)&&void 0!==g?g:10240,s.requestBody=Sp(o,a).value),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,r(t,n)];case 2:return c=l.sent(),d=Date.now(),s.status=c.status,s.duration=d-e,u={},c.headers.forEach(function(e,t){u[t]=e}),s.responseHeaders=u,(null==i?void 0:i.response)?function(e){return!!e&&bp.some(function(t){return e.toLowerCase().startsWith(t)})}(u["content-type"]||null)?(s.responseBodyStatus="skipped_binary",this.notifyEvent(s)):c.clone().text().then(function(e){var t,r=Sp(e,null!==(t=i.maxBodySizeBytes)&&void 0!==t?t:10240),n=r.value,o=r.truncated;s.responseBody=n,s.responseBodyStatus=o?"truncated":"captured",m.notifyEvent(s)},function(){s.responseBodyStatus="error",m.notifyEvent(s)}):this.notifyEvent(s),[2,c];case 3:throw h=l.sent(),d=Date.now(),s.duration=d-e,p=h,s.error={name:p.name||"UnknownError",message:p.message||"An unknown error occurred"},this.notifyEvent(s),h;case 4:return[2]}})})},this.fetchObserver=function(){t.fetch=r})}},e}(),Cp=Object.freeze({__proto__:null,NetworkObservers:xp});return e.SessionReplayPlugin=Fr,e.plugin=Ur,e.sessionReplayPlugin=Ur,Object.defineProperty(e,"__esModule",{value:!0}),e}({}),n=r,s=function(){(()=>{var e=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:t(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),t=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},r=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}(),n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=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 i(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}var o=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var a=s(["string","number","boolean","undefined"]),l=a.next();!l.done;l=a.next()){if(l.value===i)return e===t}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var c=Array.isArray(e),u=Array.isArray(t);if(c!==u)return!1;if(!c||!u){var h=Object.keys(e).sort(),d=Object.keys(t).sort();if(!o(h,d))return!1;var p=!0;return Object.keys(e).forEach(function(r){o(e[r],t[r])||(p=!1)}),p}for(var f=0;f{if(typeof window<"u"&&window.opener)for(let t of Object.values(d))window.opener.postMessage({message:e},t)})("ENGAGEMENT_SNIPPET"),function(e){var t,r,n,s,i,o,a,l,h;let d=typeof window<"u"?window.engagement:void 0,p={_q:null!=(t=null==d?void 0:d._q)?t:[],_configuration:{apiKey:null!=(n=null==(r=null==d?void 0:d._configuration)?void 0:r.apiKey)?n:"",serverUrl:null==(s=null==d?void 0:d._configuration)?void 0:s.serverUrl,chatUrl:null==(i=null==d?void 0:d._configuration)?void 0:i.chatUrl,mediaUrl:null==(o=null==d?void 0:d._configuration)?void 0:o.mediaUrl,serverZone:null!=(l=null==(a=null==d?void 0:d._configuration)?void 0:a.serverZone)?l:"US",options:{...null==(h=null==d?void 0:d._configuration)?void 0:h.options}},init(t,r){var n,s,i;if(p._configuration.apiKey)return void console.log("Engagement SDK has already been initialized. Ignoring additional init call.");let o;if(p._configuration={...p._configuration,...r,apiKey:t,options:{splitting:!0,...p._configuration.options,...null==r?void 0:r.options}},null!=(s=null==(n=p._configuration)?void 0:n.options)&&s.logger&&p._configuration.options.logger.enable(null!=(i=p._configuration.options.logLevel)?i:2),null!=r&&r.cdnUrl)o=p._configuration.options.splitting?`${r.cdnUrl}/engagement-browser/prod/split/index.js`:r.cdnUrl+"/engagement-browser/prod/index.min.js.gz";else{let e="EU"===p._configuration.serverZone?"https://cdn.eu.amplitude.com":"https://cdn.amplitude.com";o=p._configuration.options.splitting?`${e}/engagement-browser/prod/split/index.js`:`${e}/engagement-browser/prod/index.min.js.gz`}let a=null,l=()=>{if(a&&(clearTimeout(a),a=null),p._q&&p._q.length>0)for(console.warn(`Engagement SDK failed to load within ${c}ms. Resolving pending calls gracefully.`);p._q.length>0;){let e=p._q.shift();if(!e)continue;let t=e[0],r=u.includes(t);if(console.warn(`Engagement SDK method '${t}' still in queue (isAsyncMethod=${r}); attempting to resolve as no-op.`),r&&e[1]instanceof Function&&e[2]instanceof Function){let r=e[1];console.warn(`Engagement SDK method '${t}' resolved as no-op due to script loading failure`),r(void 0)}}};e(o,p._configuration.options.splitting?"module":void 0,null==r?void 0:r.nonce,l);let c=1e4;a=setTimeout(()=>{l()},c)},plugin(e){let t=p.init;return{name:"@amplitude/engagement-browser",type:"enrichment",async setup(r,n){var s;let i=null!=(s=r.instanceName)?s:"$default_instance",o=c.getInstance(i).identityStore;t(r.apiKey,{serverZone:r.serverZone,...e,options:{logLevel:r.logLevel,logger:r.loggerProvider,...null==e?void 0:e.options}});let a=[{track:e=>{n.track(e)}}];await window.engagement.boot({user:()=>{let e=o.getIdentity();return{user_id:n.getUserId(),device_id:n.getDeviceId(),user_properties:e.userProperties,getSessionId:n.getSessionId}},integrations:a}),o.addIdentityListener(e=>{var t,r,s,i;null!=(t=window.engagement)&&t._.user&&null!=(r=window.engagement)&&r._analytics.hasBooted?(null==(i=null==(s=window.engagement)?void 0:s._.user)?void 0:i.user_id)!==e.userId?(window.engagement.shutdown(),window.engagement.boot({user:()=>{let e=o.getIdentity();return{user_id:n.getUserId(),device_id:n.getDeviceId(),user_properties:e.userProperties,getSessionId:n.getSessionId}},integrations:a})):window.engagement._setUserProperties(e.userProperties):console.warn("Engagement SDK not booted. Ignoring identity change.")})},execute:async e=>(window.engagement.forwardEvent(e),e)}}},f=p;return new Proxy(p,{get:function(e,t){return t in f?f[t]:"then"!==t?"gs"===t||"rc"===t?new Proxy({},{get:function(e,r){return function(){let e=Array.from(arguments),n=`${t}.${r}`;e.unshift(n),p._q.push(e)}}}):u.includes(t)?function(){let e=Array.prototype.slice.call(arguments);return new Promise((r,n)=>{e.unshift(t,r,n),p._q.push(e)})}:function(){let e=Array.prototype.slice.call(arguments);e.unshift(t),p._q.push(e)}:void 0}})}((e,t,r,n)=>function(e,t,r,n){for(let s of e){let e=document.createElement("script");e.src=s,e.id="engagement-sdk-bundle",r&&e.setAttribute("nonce",r),t&&e.setAttribute("type",t),n&&(e.onerror=n),document.getElementsByTagName("head")[0].appendChild(e)}}([e||"https://cdn.amplitude.com/engagement-browser/prod/index.min.js.gz"],t,r,n))),setTimeout(()=>{var e,t;null!=(t=null==(e=window.engagement)?void 0:e._configuration)&&t.apiKey},500)})()};!function(r,i){const o=r.amplitudeGTM;if(o&&"function"==typeof o.init){var a=["init","track","identify","setGroup","groupIdentify","revenue","flush","getUserId","setUserId","getSessionId","setSessionId","setDeviceId","getDeviceId","reset","setOptOut","setTransport"],l=["add","append","clearAll","prepend","set","setOnce","remove","preInsert","postInsert","unset"],c=function(e,t,r){if(t=t.shift(),Array.isArray(t)&&0!==t.length){var n=new o.Identify;if(t.forEach(function(e){if(Array.isArray(e)){var t=e.shift();-1!==l.indexOf(t)&&("unset"===t&&n.unset(e[0]),"clearAll"===t&&n.clearAll(),n[t].apply(n,e))}}),!0===r)return n;e.identify(n)}},u=function(e){return e?.reduce((e,t)=>{var r=function(e){try{return new RegExp(e)}catch(e){return console.error(`[Amplitude / GTM] - ${e}`),null}}(t);return null!==r&&e.push(r),e},[])};r[i]=r[i]||function(){var r=[].slice.call(arguments,0),i=r.shift(),l=i?o._iq[i]:o;l||(l=o.createInstance(i));var h=r.shift();if(-1!==a.indexOf(h))return"revenue"===h?function(e,t){if((t=t.shift()).price&&t.productId){var r=(new o.Revenue).setProductId(t.productId).setQuantity(t.quantity||1).setPrice(t.price).setRevenue(t.revenue||t.price*(t.quantity||1));t.revenueType&&r.setRevenueType(t.revenueType),t.eventProperties&&r.setEventProperties(t.eventProperties),t.currency&&r.setCurrency(t.currency),t.receipt&&r.setReceipt(t.receipt),t.receiptSig&&r.setReceiptSig(t.receiptSig),e.revenue(r)}}(l,r):"identify"===h?c(l,r):"groupIdentify"===h?function(e,t){if(!(t.length<3)&&"string"==typeof t[0]&&"string"==typeof t[1]&&Array.isArray(t[2])&&0!==t[2].length){var r=c(e,[t[2]],!0);e.groupIdentify(t[0],t[1],r)}}(l,r):"init"===h?function(r,i){const o=i[i.length-1];if(o.autocapture.attribution){const e=[...o.autocapture.attribution.excludeReferrersText||[],...u(o.autocapture.attribution.excludeReferrersRegex)||[]];delete o.autocapture.attribution.excludeReferrersText,delete o.autocapture.attribution.excludeReferrersRegex,0!==e.length&&(o.autocapture.attribution.excludeReferrers=e)}if(o.autocapture.elementInteractions){const e=[...o.autocapture.elementInteractions.pageUrlAllowlistString||[],...u(o.autocapture.elementInteractions.pageUrlAllowlistRegex)||[]];delete o.autocapture.elementInteractions.pageUrlAllowlistString,delete o.autocapture.elementInteractions.pageUrlAllowlistRegex,0!==e.length&&(o.autocapture.elementInteractions.pageUrlAllowlist=e);const t=[...o.autocapture.elementInteractions.dataAttributePrefixString||[],...u(o.autocapture.elementInteractions.dataAttributePrefixRegex)||[]];delete o.autocapture.elementInteractions.dataAttributePrefixString,delete o.autocapture.elementInteractions.dataAttributePrefixRegex,0!==t.length&&(o.autocapture.elementInteractions.dataAttributePrefix=t)}o.autocapture.networkTracking&&(o.autocapture.networkTracking.captureRules||[]).forEach(e=>{e.urls=[...e.urls||[],...u(e.urlsRegex)||[]],0===e.urls.length&&delete e.urls,delete e.urlsRegex});const a=o.userAgentEnrichmentOptions,l=o.pageViewLegacy,c=o.sessionReplay,h=o.guidesSurveys;a&&r.add(t.userAgentEnrichmentPlugin(a)),l&&r.add(e.pageViewV1EnrichmentPlugin()),c&&r.add(n.plugin()),h&&(s(),r.add(window.engagement.plugin()));let d=r.init(...i).promise;return d.then(()=>r.add({name:"gtm-library-enrichment",type:"enrichment",setup:async()=>{},execute:async e=>(e.library="amplitude-ts-gtm-snippet/2.45.3",e)})),d}(l,r):l[h].apply(this,r)}}}(window,"_amplitude")}(); //# sourceMappingURL=analytics-browser-gtm-wrapper.min.js.map