@amplitude/gtm-snippet 2.31.4 → 2.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!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;t<g.length;t++)i(e,g[t],!1);for(var r=0;r<m.length;r++)i(e,m[r],!0)};r.invoked=!0;var a=t.createElement("script");a.type="text/javascript",a.integrity="sha384-6Yt2pmGqpmnhhEh+yQVQblo2vVGOBnAcUKEySW6zg8d4YcX6mjH4AGMGmWWSMqP0",a.crossOrigin="anonymous",a.async=!0,a.src="https://cdn.amplitude.com/libs/analytics-browser-gtm-2.31.4-min.js.gz",a.onload=function(){e.amplitudeGTM.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var l=t.getElementsByTagName("script")[0];l.parentNode.insertBefore(a,l);for(var c=function(){return this._q=[],this},u=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],h=0;h<u.length;h++)n(c,u[h]);r.Identify=c;for(var d=function(){return this._q=[],this},p=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setReceipt","setReceiptSig","setCurrency","setEventProperties"],f=0;f<p.length;f++)n(d,p[f]);r.Revenue=d;var g=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],m=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];o(r),r.createInstance=function(e){return r._iq[e]={_q:[]},o(r._iq[e]),r._iq[e]},e.amplitudeGTM=r,e.amplitude||(e.amplitude=e.amplitudeGTM)}}(window,document);var e=function(e){var t=function(){return t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},t.apply(this,arguments)};function r(e,t,r,n){return new(r||(r=Promise))(function(s,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function n(e,t){var r,n,s,i,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>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]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}var s=function(){var e=this;return{name:"@amplitude/plugin-page-view-v1-enrichment-browser",type:"enrichment",setup:function(e){return r(this,void 0,void 0,function(){return n(this,function(t){return e.loggerProvider.log("Installing @amplitude/plugin-page-view-v1-enrichment-browser."),[2]})})},execute:function(s){return r(e,void 0,void 0,function(){var e,r,i,o,a,l;return n(this,function(n){return"[Amplitude] Page Viewed"==s.event_type&&(e=s.event_properties||{},r=e["[Amplitude] Page Domain"],i=e["[Amplitude] Page Location"],o=e["[Amplitude] Page Path"],a=e["[Amplitude] Page Title"],l=e["[Amplitude] Page URL"],(s=t(t({},s),{event_type:"Page View",event_properties:t(t({},s.event_properties),{page_domain:null!=r?r:"",page_location:null!=i?i:"",page_path:null!=o?o:"",page_title:null!=a?a:"",page_url:null!=l?l:""})})).event_properties&&(delete s.event_properties["[Amplitude] Page Domain"],delete s.event_properties["[Amplitude] Page Location"],delete s.event_properties["[Amplitude] Page Path"],delete s.event_properties["[Amplitude] Page Title"],delete s.event_properties["[Amplitude] Page URL"])),[2,s]})})}}};return e.pageViewV1EnrichmentPlugin=s,e.plugin=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({}),t=function(e){var t=function(){return t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},t.apply(this,arguments)};function r(e,t,r,n){return new(r||(r=Promise))(function(s,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function n(e,t){var r,n,s,i,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>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]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={exports:{}};!function(e,t){!function(r,n){var s="function",i="undefined",o="object",a="string",l="model",c="name",u="type",h="vendor",d="version",p="architecture",f="console",g="mobile",m="tablet",y="smarttv",v="wearable",w="embedded",b="Amazon",S="Apple",C="ASUS",I="BlackBerry",x="Browser",k="Chrome",O="Firefox",E="Google",A="Huawei",R="LG",M="Microsoft",P="Motorola",T="Opera",N="Samsung",_="Sharp",D="Sony",L="Xiaomi",F="Zebra",B="Facebook",U=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},j=function(e,t){return typeof e===a&&-1!==z(t).indexOf(z(e))},z=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===i?e:e.substring(0,350)},V=function(e,t){for(var r,i,a,l,c,u,h=0;h<t.length&&!c;){var d=t[h],p=t[h+1];for(r=i=0;r<d.length&&!c;)if(c=d[r++].exec(e))for(a=0;a<p.length;a++)u=c[++i],typeof(l=p[a])===o&&l.length>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}},G=function(e,t){for(var r in t)if(typeof t[r]===o&&t[r].length>0){for(var s=0;s<t[r].length;s++)if(j(t[r][s],e))return"?"===r?n:r}else if(j(t[r],e))return"?"===r?n:r;return e},Z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Y={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,d],[/opios[\/ ]+([\w\.]+)/i],[d,[c,T+" Mini"]],[/\bopr\/([\w\.]+)/i],[d,[c,T]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[c,"UC"+x]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[d,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+x],d],[/\bfocus\/([\w\.]+)/i],[d,[c,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[d,[c,T+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[c,T+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[c,"MIUI "+x]],[/fxios\/([-\w\.]+)/i],[d,[c,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+x]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+x],d],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,B],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[c,k+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,k+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[c,"Android "+x]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,d],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[d,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[d,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[d,G,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[c,O+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,d],[/(cobalt)\/([\w\.]+)/i],[c,[d,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,z]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",z]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[h,N],[u,m]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[h,N],[u,g]],[/((ipod|iphone)\d+,\d+)/i],[l,[h,S],[u,g]],[/(ipad\d+,\d+)/i],[l,[h,S],[u,m]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[h,S],[u,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[h,S],[u,m]],[/(macintosh);/i],[l,[h,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[h,A],[u,m]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[h,A],[u,g]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[h,L],[u,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[h,L],[u,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[h,"OPPO"],[u,g]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[h,"Vivo"],[u,g]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[h,"Realme"],[u,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[h,P],[u,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[h,P],[u,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[h,R],[u,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[h,R],[u,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[h,"Lenovo"],[u,m]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[h,"Nokia"],[u,g]],[/(pixel c)\b/i],[l,[h,E],[u,m]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[h,E],[u,g]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[h,D],[u,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[h,D],[u,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[h,"OnePlus"],[u,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[h,b],[u,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[h,b],[u,g]],[/(playbook);[-\w\),; ]+(rim)/i],[l,h,[u,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[h,I],[u,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[h,C],[u,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[h,C],[u,g]],[/(nexus 9)/i],[l,[h,"HTC"],[u,m]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[l,/_/g," "],[u,g]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[h,"Acer"],[u,m]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[h,"Meizu"],[u,g]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[h,_],[u,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,l,[u,g]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,l,[u,m]],[/(surface duo)/i],[l,[h,M],[u,m]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[h,"Fairphone"],[u,g]],[/(u304aa)/i],[l,[h,"AT&T"],[u,g]],[/\bsie-(\w*)/i],[l,[h,"Siemens"],[u,g]],[/\b(rct\w+) b/i],[l,[h,"RCA"],[u,m]],[/\b(venue[\d ]{2,7}) b/i],[l,[h,"Dell"],[u,m]],[/\b(q(?:mv|ta)\w+) b/i],[l,[h,"Verizon"],[u,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[h,"Barnes & Noble"],[u,m]],[/\b(tm\d{3}\w+) b/i],[l,[h,"NuVision"],[u,m]],[/\b(k88) b/i],[l,[h,"ZTE"],[u,m]],[/\b(nx\d{3}j) b/i],[l,[h,"ZTE"],[u,g]],[/\b(gen\d{3}) b.+49h/i],[l,[h,"Swiss"],[u,g]],[/\b(zur\d{3}) b/i],[l,[h,"Swiss"],[u,m]],[/\b((zeki)?tb.*\b) b/i],[l,[h,"Zeki"],[u,m]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],l,[u,m]],[/\b(ns-?\w{0,9}) b/i],[l,[h,"Insignia"],[u,m]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[h,"NextBook"],[u,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],l,[u,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],l,[u,g]],[/\b(ph-1) /i],[l,[h,"Essential"],[u,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[h,"Envizen"],[u,m]],[/\b(trio[-\w\. ]+) b/i],[l,[h,"MachSpeed"],[u,m]],[/\btu_(1491) b/i],[l,[h,"Rotor"],[u,m]],[/(shield[\w ]+) b/i],[l,[h,"Nvidia"],[u,m]],[/(sprint) (\w+)/i],[h,l,[u,g]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[h,M],[u,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[h,F],[u,m]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[h,F],[u,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,l,[u,f]],[/droid.+; (shield) bui/i],[l,[h,"Nvidia"],[u,f]],[/(playstation [345portablevi]+)/i],[l,[h,D],[u,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[h,M],[u,f]],[/smart-tv.+(samsung)/i],[h,[u,y]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[h,N],[u,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,R],[u,y]],[/(apple) ?tv/i],[h,[l,S+" TV"],[u,y]],[/crkey/i],[[l,k+"cast"],[h,E],[u,y]],[/droid.+aft(\w)( bui|\))/i],[l,[h,b],[u,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[h,_],[u,y]],[/(bravia[\w ]+)( bui|\))/i],[l,[h,D],[u,y]],[/(mitv-\w{5}) bui/i],[l,[h,L],[u,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,W],[l,W],[u,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,y]],[/((pebble))app/i],[h,l,[u,v]],[/droid.+; (glass) \d/i],[l,[h,E],[u,v]],[/droid.+; (wt63?0{2,3})\)/i],[l,[h,F],[u,v]],[/(quest( 2)?)/i],[l,[h,B],[u,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[u,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[u,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[u,m]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,m]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[u,g]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[c,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[d,G,Z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[d,G,Z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[d,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,d],[/\(bb(10);/i],[d,[c,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[c,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[c,k+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],d],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,d],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,d]]},q=function(e,t){if(typeof e===o&&(t=e,e=n),!(this instanceof q))return new q(e,t).getResult();var s=e||(typeof r!==i&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),f=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(Y,t):Y;return this.getBrowser=function(){var e,t={};return t[c]=n,t[d]=n,V.call(t,s,f.browser),t.major=typeof(e=t.version)===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n,t},this.getCPU=function(){var e={};return e[p]=n,V.call(e,s,f.cpu),e},this.getDevice=function(){var e={};return e[h]=n,e[l]=n,e[u]=n,V.call(e,s,f.device),e},this.getEngine=function(){var e={};return e[c]=n,e[d]=n,V.call(e,s,f.engine),e},this.getOS=function(){var e={};return e[c]=n,e[d]=n,V.call(e,s,f.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return s},this.setUA=function(e){return s=typeof e===a&&e.length>350?W(e,350):e,this},this.setUA(s),this};q.VERSION="0.7.33",q.BROWSER=U([c,d,"major"]),q.CPU=U([p]),q.DEVICE=U([l,h,u,f,g,y,m,v,w]),q.ENGINE=q.OS=U([c,d]),e.exports&&(t=e.exports=q),t.UAParser=q;var K=typeof r!==i&&(r.jQuery||r.Zepto);if(K&&!K.ua){var J=new q;K.ua=J.getResult(),K.ua.get=function(){return J.getUA()},K.ua.set=function(e){J.setUA(e);var t=J.getResult();for(var r in t)K.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;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)};function o(e,t,r,n){return new(r||(r=Promise))(function(s,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function a(e,t){var r,n,s,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((s=(s=i.trys).length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(6===a[0]&&i.label<s[1]){i.label=s[1],s=a;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(a);break}s[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function l(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function u(e,t,r){if(r||2===arguments.length)for(var n,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(n||(n={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(s||(s={}));var h,d="".concat("AMP","_unsent"),p="$default_instance",f="https://api2.amplitude.com/2/httpapi";!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(h||(h={}));var g,m=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},y=u([],c(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),v=function(e){var t,r=m();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,v)}(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,u([],c(n.entries()),!1).map(function(e){var t=c(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(y[n]):y[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;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Verbose||console.log("".concat(b,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Warn||console.warn("".concat(b,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Error||console.error("".concat(b,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Debug||console.log("".concat(b,"[Debug]: ").concat(e.join(" ")))},e}(),C=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:p,logLevel:g.Warn,loggerProvider:new S,offline:!1,optOut:!1,serverUrl:f,serverZone:"US",useBatch:!1}},I=function(){function e(e){var t,r,n,s;this._optOut=!1;var i=C();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:i.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||i.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||i.flushQueueSize,this.instanceName=e.instanceName||i.instanceName,this.loggerProvider=e.loggerProvider||i.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:i.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:i.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:i.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||i.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(s=e.useBatch)&&void 0!==s?s:i.useBatch,this.loggerProvider.enable(this.logLevel);var o=k(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),x=function(e,t){return"EU"===e?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":f},k=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=C().serverZone),void 0===r&&(r=C().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:C().serverZone;return{serverZone:n,serverUrl:x(n,r)}},O=function(e,t,r,n,s){return void 0===s&&(s=null),function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var a=r(),l=a.logger,c=a.logLevel;if(c&&c<g.Debug||!c||!l)return e.apply(s,i);var u,h={type:"invoke public method",name:t,args:i,stacktrace:(u=1,void 0===u&&(u=0),((new Error).stack||"").split("\n").slice(2+u).map(function(e){return e.trim()})),time:{start:(new Date).toISOString()},states:{}};n&&h.states&&(h.states.before=n());var d=e.apply(s,i);return d&&d.promise?d.promise.then(function(){n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))}):(n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))),d}},E=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:A(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),A=function(){return"undefined"!=typeof navigator&&(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}(),M=function(){return M=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},M.apply(this,arguments)};function P(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function T(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}"function"==typeof SuppressedError&&SuppressedError;var N=function(e,t){var r,n,s=typeof e;if(s!==typeof t)return!1;try{for(var i=P(["string","number","boolean","undefined"]),o=i.next();!o.done;o=i.next())if(o.value===s)return e===t}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var c=Object.keys(e).sort(),u=Object.keys(t).sort();if(!N(c,u))return!1;var h=!0;return Object.keys(e).forEach(function(r){N(e[r],t[r])||(h=!1)}),h}for(var d=0;d<e.length;d++)if(!N(e[d],t[d]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var _,D=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=M({},this.identity.userProperties),r=M(M({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,s,i,o,a,l=r.userProperties||{};try{for(var c=P(Object.entries(e)),u=c.next();!u.done;u=c.next()){var h=T(u.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(s=void 0,P(Object.entries(p))),g=f.next();!g.done;g=f.next()){var m=T(g.value,2),y=m[0],v=m[1];l[y]=v}}catch(e){s={error:e}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(s)throw s.error}}break;case"$unset":try{for(var w=(o=void 0,P(Object.keys(p))),b=w.next();!b.done;b=w.next())delete l[y=b.value]}catch(e){o={error:e}}finally{try{b&&!b.done&&(a=w.return)&&a.call(w)}finally{if(o)throw o.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return M({},this.identity)},e.prototype.setIdentity=function(e){var t=M({},this.identity);this.identity=M({},e),N(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,F=function(){function e(){this.identityStore=new D,this.eventBridge=new R,this.applicationContextProvider=new E}return e.getInstance=function(t){return L.analyticsConnectorInstances||(L.analyticsConnectorInstances={}),L.analyticsConnectorInstances[t]||(L.analyticsConnectorInstances[t]=new e),L.analyticsConnectorInstances[t]},e}(),B=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t},U=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,i,o,a,l,c,u,d,p,f,g,m,y,v,w,b,S,C,I;if("object"!=typeof e)return null;var x=e.code||0,k=this.buildStatus(x);switch(k){case h.Success:return{status:k,statusCode:x,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case h.Invalid:return{status:k,statusCode:x,body:{error:null!==(s=e.error)&&void 0!==s?s:"",missingField:null!==(i=e.missing_field)&&void 0!==i?i:"",eventsWithInvalidFields:null!==(o=e.events_with_invalid_fields)&&void 0!==o?o:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(c=e.eps_threshold)&&void 0!==c?c:0,exceededDailyQuotaDevices:null!==(u=e.exceeded_daily_quota_devices)&&void 0!==u?u:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(g=e.throttled_events)&&void 0!==g?g:[]}};case h.PayloadTooLarge:return{status:k,statusCode:x,body:{error:null!==(m=e.error)&&void 0!==m?m:""}};case h.RateLimit:return{status:k,statusCode:x,body:{error:null!==(y=e.error)&&void 0!==y?y:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(w=e.throttled_devices)&&void 0!==w?w:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(S=e.exceeded_daily_quota_devices)&&void 0!==S?S:{},exceededDailyQuotaUsers:null!==(C=e.exceeded_daily_quota_users)&&void 0!==C?C:{},throttledEvents:null!==(I=e.throttled_events)&&void 0!==I?I:[]}};case h.Timeout:default:return{status:k,statusCode:x}}},e.prototype.buildStatus=function(e){return function(e){return e>=200&&e<300}(e)?h.Success:429===e?h.RateLimit:413===e?h.PayloadTooLarge:408===e?h.Timeout:e>=400&&e<500?h.Invalid:e>=500?h.Failed:h.Unknown},e}(),j=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.send=function(e,t){return o(this,void 0,void 0,function(){var r,n,s;return a(this,function(i){switch(i.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=i.sent()).text()];case 2:s=i.sent();try{return[2,this.buildResponse(JSON.parse(s))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}})})},t}(U),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}(),W=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new z(e,t)}return e.prototype.subscribe=function(e,t,r){var n=v(),s={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(s),"all"===t?this.subscribeAll(s):this.subscribeWaitForRemote(s,t.timeout),n},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return o(this,void 0,void 0,function(){var e,t=this;return a(this,function(r){switch(r.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise||(this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null})),this.fetchPromise},e.prototype.subscribeAll=function(e){return o(this,void 0,void 0,function(){var t,r,n,s=this;return a(this,function(i){switch(i.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){s.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),s.sendCallback(e,t,"remote"),s.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=i.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return i.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return o(this,void 0,void 0,function(){var r,n;return a(this,function(s){switch(s.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),s.label=1;case 1:return s.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=s.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[3,5];case 3:return s.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(n=s.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),o(this,void 0,void 0,function(){var r,n,s,i,o,l,c=this;return a(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},s=function(n){var s,o,l,u,h;return a(this,function(a){switch(a.label){case 0:s=new AbortController,o=setTimeout(function(){return s.abort()},t),a.label=1;case 1:return a.trys.push([1,7,8,9]),[4,fetch(i.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:s.signal})];case 2:return(l=a.sent()).ok?[3,4]:[4,l.text()];case 3:return u=a.sent(),i.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(l.status,": ").concat(u)),[3,6];case 4:return[4,l.json()];case 5:return[2,{value:{remoteConfig:a.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(h=a.sent())instanceof Error&&"AbortError"===h.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: "),h),[3,9];case 8:return clearTimeout(o),[7];case 9:return n<e-1?[4,new Promise(function(e){return setTimeout(e,c.getJitterDelay(r))})]:[3,11];case 10:a.sent(),a.label=11;case 11:return[2]}})},i=this,o=0,u.label=1;case 1:return o<e?[5,s(o)]:[3,4];case 2:if("object"==typeof(l=u.sent()))return[2,l.value];u.label=3;case 3:return o++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}();!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(_||(_={}));var V,G="[Amplitude]",Z="".concat(G," Session Replay ID"),Y=_.US,q={enabled:!0},K="".concat(G," Session Replay Debug"),J="amp-mask";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision"}(V||(V={}));var $=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}(),X="medium",H=function(e,t,r){switch(t){case"light":if("input"!==e)return!0;var n=r?function(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}(r):"";return!(!n||!["password","hidden","email","tel"].includes(n)&&!r.autocomplete.startsWith("cc-"));case"medium":case"conservative":return!0;default:return H(e,X,r)}},Q=function(e,t){return function(r,n){return function(e,t,r){var n,s,i;if(void 0===t&&(t={defaultMaskLevel:X}),r){if(r.closest("."+J))return!0;var o=(null!==(n=t.maskSelector)&&void 0!==n?n:[]).some(function(e){return r.closest(e)});if(o)return!0;if(r.closest(".amp-unmask"))return!1;var a=(null!==(s=t.unmaskSelector)&&void 0!==s?s:[]).some(function(e){return r.closest(e)});if(a)return!1}return H(e,null!==(i=t.defaultMaskLevel)&&void 0!==i?i:X,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},ee=function(e,t){return t||(e===_.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===_.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},te=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},re=function(e,t){var r,n;try{for(var s=l(t),i=s.next();!i.done;i=s.next()){var o=i.value,a=te(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},ne=function(){return o(void 0,void 0,void 0,function(){var e,t,r,n,s,i,o;return a(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/1024):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:""}]}})})},se=function(e){var t=i({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},ie=function(){return{flushMaxRetries:2,logLevel:g.Warn,loggerProvider:new S,transportProvider:new j}},oe=function(e){function t(t,r){var n,s,o,a,l,c,u=this,h=ie();if((u=e.call(this,i(i({transportProvider:h.transportProvider,loggerProvider:new $(r.loggerProvider||h.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=h.flushMaxRetries?r.flushMaxRetries:h.flushMaxRetries,u.apiKey=t,u.sampleRate=r.sampleRate||0,u.serverZone=r.serverZone||Y,u.configServerUrl=r.configServerUrl,u.trackServerUrl=r.trackServerUrl,u.shouldInlineStylesheet=r.shouldInlineStylesheet,u.version=r.version,u.performanceConfig=r.performanceConfig||q,u.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",u.applyBackgroundColorToBlockedElements=null!==(s=r.applyBackgroundColorToBlockedElements)&&void 0!==s&&s,u.enableUrlChangePolling=null!==(o=r.enableUrlChangePolling)&&void 0!==o&&o,u.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:1e3,u.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,r.privacyConfig&&(u.privacyConfig=r.privacyConfig),r.interactionConfig&&(u.interactionConfig=r.interactionConfig,u.interactionConfig.ugcFilterRules&&function(e){if(!e.every(function(e){return"string"==typeof e.selector&&"string"==typeof e.replacement}))throw new Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every(function(e){return"string"==typeof(t=e.selector)&&""!==t.trim()&&!!/^\/|^https?:\/\/[^\s]+$/.test(t);var t}))throw new Error("ugcFilterRules must be an array of objects with valid globs")}(u.interactionConfig.ugcFilterRules)),r.debugMode&&(u.debugMode=r.debugMode),void 0!==r.useWebWorker)u.useWebWorker=r.useWebWorker;else{var d=r;void 0!==(null===(c=d.experimental)||void 0===c?void 0:c.useWebWorker)&&(u.useWebWorker=d.experimental.useWebWorker)}return r.omitElementTags&&(u.omitElementTags=r.omitElementTags),u}return r(t,e),t}(I),ae=(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))(ae||{}),le=(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))(le||{}),ce=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,r;return o(this,void 0,void 0,function(){var n,s,o,u,h,d,p,f,g,m,y,v,w,b,S,C,I,x=this;return a(this,function(a){switch(a.label){case 0:(n=i({},this.localConfig)).optOut=this.localConfig.optOut,n.captureEnabled=!0,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,new Promise(function(e,t){x.remoteConfigClient.subscribe("configs.sessionReplay","all",function(r,i){var o;if(x.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(i,":"),JSON.stringify(r,null,2)),r){var a=r,l=a.sr_sampling_config,c=a.sr_privacy_config,u=a.sr_targeting_config,h=null===(o=n.interactionConfig)||void 0===o?void 0:o.ugcFilterRules;n.interactionConfig=a.sr_interaction_config,n.interactionConfig&&h&&(n.interactionConfig.ugcFilterRules=h),n.loggingConfig=a.sr_logging_config,(l||c||u)&&(s={},l&&(s.sr_sampling_config=l),c&&(s.sr_privacy_config=c),u&&(s.sr_targeting_config=u)),e()}else t(new Error("No remote config received"))})})];case 2:return a.sent(),[3,4];case 3:return o=a.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",o),n.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:void 0}];case 4:if(!s)return[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:s}];if(u=s.sr_sampling_config,h=s.sr_privacy_config,d=s.sr_targeting_config,u&&Object.keys(u).length>0?(Object.prototype.hasOwnProperty.call(u,"capture_enabled")?n.captureEnabled=u.capture_enabled:n.captureEnabled=!1,Object.prototype.hasOwnProperty.call(u,"sample_rate")&&(n.sampleRate=u.sample_rate)):(n.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),h){p=null!==(e=n.privacyConfig)&&void 0!==e?e:{},f={defaultMaskLevel:null!==(r=null!==(t=h.defaultMaskLevel)&&void 0!==t?t:p.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},g=function(e){var t,r,n,s,i,o,a,c,u,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=l(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=l(null!==(c=e.maskSelector)&&void 0!==c?c:[]),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=l(null!==(u=e.unmaskSelector)&&void 0!==u?u:[]),y=m.next();!y.done;y=m.next())h[y.value]="unmask"}catch(e){i={error:e}}finally{try{y&&!y.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}return h},m=i(i({},g(p)),g(h));try{for(y=l(Object.entries(m)),v=y.next();!v.done;v=y.next())w=c(v.value,2),b=w[0],"mask"===(S=w[1])?f.maskSelector.push(b):"block"===S?f.blockSelector.push(b):"unmask"===S&&f.unmaskSelector.push(b)}catch(e){C={error:e}}finally{try{v&&!v.done&&(I=y.return)&&I.call(y)}finally{if(C)throw C.error}}n.privacyConfig=(k=f,O=this.localConfig.loggerProvider,E=document.createDocumentFragment(),A=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),0!==(e=e.filter(function(e){try{E.querySelector(e)}catch(t){return O.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0})).length)return e},k.blockSelector=A(k.blockSelector),k.maskSelector=A(k.maskSelector),k.unmaskSelector=A(k.unmaskSelector),k)}return d&&Object.keys(d).length>0&&(n.targetingConfig=d),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:se(n)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:s}]}var k,O,E,A})})},e}(),ue=function(e,t){return o(void 0,void 0,void 0,function(){var r,n;return a(this,function(s){return r=new oe(e,t),n=new W(e,r.loggerProvider,r.serverZone,t.configServerUrl),[2,new ce(n,r)]})})},he=Uint8Array,de=Uint16Array,pe=Uint32Array,fe=new he([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ge=new he([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),me=new he([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ye=function(e,t){for(var r=new de(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var s=new pe(r[30]);for(n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)s[i]=i-r[n]<<5|n;return[r,s]},ve=ye(fe,2),we=ve[0],be=ve[1];we[28]=258,be[258]=28;for(var Se=ye(ge,0)[1],Ce=new de(32768),Ie=0;Ie<32768;++Ie){var xe=(43690&Ie)>>>1|(21845&Ie)<<1;xe=(61680&(xe=(52428&xe)>>>2|(13107&xe)<<2))>>>4|(3855&xe)<<4,Ce[Ie]=((65280&xe)>>>8|(255&xe)<<8)>>>1}var ke=function(e,t,r){for(var n=e.length,s=0,i=new de(t);s<n;++s)++i[e[s]-1];var o,a=new de(t);for(s=0;s<t;++s)a[s]=a[s-1]+i[s-1]<<1;if(r){o=new de(1<<t);var l=15-t;for(s=0;s<n;++s)if(e[s])for(var c=s<<4|e[s],u=t-e[s],h=a[e[s]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)o[Ce[h]>>>l]=c}else for(o=new de(n),s=0;s<n;++s)o[s]=Ce[a[e[s]-1]++]>>>15-e[s];return o},Oe=new he(288);for(Ie=0;Ie<144;++Ie)Oe[Ie]=8;for(Ie=144;Ie<256;++Ie)Oe[Ie]=9;for(Ie=256;Ie<280;++Ie)Oe[Ie]=7;for(Ie=280;Ie<288;++Ie)Oe[Ie]=8;var Ee=new he(32);for(Ie=0;Ie<32;++Ie)Ee[Ie]=5;var Ae=ke(Oe,9,0),Re=ke(Ee,5,0),Me=function(e){return(e/8|0)+(7&e&&1)},Pe=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof de?de:e instanceof pe?pe:he)(r-t);return n.set(e.subarray(t,r)),n},Te=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},Ne=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},_e=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var s=r.length,i=r.slice();if(!s)return[new he(0),0];if(1==s){var o=new he(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort(function(e,t){return e.f-t.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=s-1;)a=r[r[c].f<r[h].f?c++:h++],l=r[c!=u&&r[c].f<r[h].f?c++:h++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};var d=i[0].s;for(n=1;n<s;++n)i[n].s>d&&(d=i[n].s);var p=new de(d+1),f=De(r[u-1],p,0);if(f>t){n=0;var g=0,m=f-t,y=1<<m;for(i.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});n<s;++n){var v=i[n].s;if(!(p[v]>t))break;g+=y-(1<<f-p[v]),p[v]=t}for(g>>>=m;g>0;){var w=i[n].s;p[w]<t?g-=1<<t-p[w]++-1:++n}for(;n>=0&&g;--n){var b=i[n].s;p[b]==t&&(--p[b],++g)}f=t}return[new he(p),f]},De=function(e,t,r){return-1==e.s?Math.max(De(e.l,t,r+1),De(e.r,t,r+1)):t[e.s]=r},Le=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new de(++t),n=0,s=e[0],i=1,o=function(e){r[n++]=e},a=1;a<=t;++a)if(e[a]==s&&a!=t)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=e[a]}return[r.subarray(0,n),t]},Fe=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},Be=function(e,t,r){var n=r.length,s=Me(t+2);e[s]=255&n,e[s+1]=n>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var i=0;i<n;++i)e[s+i+4]=r[i];return 8*(s+4+n)},Ue=function(e,t,r,n,s,i,o,a,l,c,u){Te(t,u++,r),++s[256];for(var h=_e(s,15),d=h[0],p=h[1],f=_e(i,15),g=f[0],m=f[1],y=Le(d),v=y[0],w=y[1],b=Le(g),S=b[0],C=b[1],I=new de(19),x=0;x<v.length;++x)I[31&v[x]]++;for(x=0;x<S.length;++x)I[31&S[x]]++;for(var k=_e(I,7),O=k[0],E=k[1],A=19;A>4&&!O[me[A-1]];--A);var R,M,P,T,N=c+5<<3,_=Fe(s,Oe)+Fe(i,Ee)+o,D=Fe(s,d)+Fe(i,g)+o+14+3*A+Fe(I,O)+(2*I[16]+3*I[17]+7*I[18]);if(N<=_&&N<=D)return Be(t,u,e.subarray(l,l+c));if(Te(t,u,1+(D<_)),u+=2,D<_){R=ke(d,p,0),M=d,P=ke(g,m,0),T=g;var L=ke(O,E,0);for(Te(t,u,w-257),Te(t,u+5,C-1),Te(t,u+10,A-4),u+=14,x=0;x<A;++x)Te(t,u+3*x,O[me[x]]);u+=3*A;for(var F=[v,S],B=0;B<2;++B){var U=F[B];for(x=0;x<U.length;++x){var j=31&U[x];Te(t,u,L[j]),u+=O[j],j>15&&(Te(t,u,U[x]>>>5&127),u+=U[x]>>>12)}}}else R=Ae,M=Oe,P=Re,T=Ee;for(x=0;x<a;++x)if(n[x]>255){j=n[x]>>>18&31,Ne(t,u,R[j+257]),u+=M[j+257],j>7&&(Te(t,u,n[x]>>>23&31),u+=fe[j]);var z=31&n[x];Ne(t,u,P[z]),u+=T[z],z>3&&(Ne(t,u,n[x]>>>5&8191),u+=ge[z])}else Ne(t,u,R[n[x]]),u+=M[n[x]];return Ne(t,u,R[256]),u+M[256]},je=new pe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]);function ze(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,s=t,i=r.length,o=0;o!=i;){for(var a=Math.min(o+5552,i);o<a;++o)s+=n+=r[o];n%=65521,s%=65521}e=n,t=s},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n,s,i,o=function(e,t,r,n,s){return function(e,t,r,n,s,i){var o=e.length,a=new he(n+o+5*(1+Math.floor(o/7e3))+s),l=a.subarray(n,a.length-s),c=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var h=u+65535;h<o?c=Be(l,c,e.subarray(u,h)):(l[u]=i,c=Be(l,c,e.subarray(u,o)))}else{for(var d=je[t-1],p=d>>>13,f=8191&d,g=(1<<r)-1,m=new de(32768),y=new de(g+1),v=Math.ceil(r/3),w=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<w)&g},S=new pe(25e3),C=new de(288),I=new de(32),x=0,k=0,O=(u=0,0),E=0,A=0;u<o;++u){var R=b(u),M=32767&u,P=y[R];if(m[M]=P,y[R]=M,E<=u){var T=o-u;if((x>7e3||O>24576)&&T>423){c=Ue(e,l,0,S,C,I,k,O,A,u-A,c),O=x=k=0,A=u;for(var N=0;N<286;++N)C[N]=0;for(N=0;N<30;++N)I[N]=0}var _=2,D=0,L=f,F=M-P&32767;if(T>2&&R==b(u-F))for(var B=Math.min(p,T)-1,U=Math.min(32767,u),j=Math.min(258,T);F<=U&&--L&&M!=P;){if(e[u+_]==e[u+_-F]){for(var z=0;z<j&&e[u+z]==e[u+z-F];++z);if(z>_){if(_=z,D=F,z>B)break;var W=Math.min(F,z-2),V=0;for(N=0;N<W;++N){var G=u-F+N+32768&32767,Z=G-m[G]+32768&32767;Z>V&&(V=Z,P=G)}}}F+=(M=P)-(P=m[M])+32768&32767}if(D){S[O++]=268435456|be[_]<<18|Se[D];var Y=31&be[_],q=31&Se[D];k+=fe[Y]+ge[q],++C[257+Y],++I[q],E=u+_,++x}else S[O++]=e[u],++C[e[u]]}}c=Ue(e,l,i,S,C,I,k,O,A,u-A,c)}return Pe(a,0,n+Me(c)+s)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!s)}(e,t,2,4);return n=o,i=0==(s=t.level)?0:s<6?1:9==s?3:2,n[0]=120,n[1]=i<<6|(i?32-2*i:1),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(o,o.length-4,r.d()),o}var We=function(){function e(e,t,r,n){var s,i=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=(e=>{const t={...e,v:"v1"};return function(e){for(var t="",r=0;r<e.length;){var n=e[r++];t+=String.fromCharCode(n)}return t}(ze(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new he(e.length+(e.length>>>1)),n=0,s=function(e){r[n++]=e},i=0;i<t;++i){if(n+5>r.length){var o=new he(n+8+(t-i<<1));o.set(r),r=o}var a=e.charCodeAt(i);a<128?s(a):a<2048?(s(192|a>>>6),s(128|63&a)):a>55295&&a<57344?(s(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++i))>>>18),s(128|a>>>12&63),s(128|a>>>6&63),s(128|63&a)):(s(224|a>>>12),s(128|a>>>6&63),s(128|63&a))}return Pe(r,0,n)}(JSON.stringify(t))))})(e);return JSON.stringify(t)},this.addCompressedEventToManager=function(e,t){i.eventsManager&&i.deviceId&&i.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:i.deviceId})},this.addCompressedEvent=function(e,t){if(i.worker)try{i.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?i.worker.postMessage(JSON.stringify({event:e,sessionId:t})):i.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{var r=i.compressEvent(e);i.addCompressedEventToManager(r,t)}},this.terminate=function(){var e;null===(e=i.worker)||void 0===e||e.terminate()};var o=m();if(this.canUseIdleCallback=o&&"requestIdleCallback"in o,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(s=t.performanceConfig)||void 0===s?void 0:s.timeout)||2e3,n){t.loggerProvider.log("Enabling web worker for compression");var a=new Worker(URL.createObjectURL(new Blob([n],{type:"application/javascript"})));a.onerror=function(e){t.loggerProvider.error(e)},a.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;i.addCompressedEventToManager(r,n)},this.worker=a}}return e.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(t){e.processQueue(t)},{timeout:this.timeout}))},e.prototype.enqueueEvent=function(e,t){var r;this.canUseIdleCallback&&(null===(r=this.config.performanceConfig)||void 0===r?void 0:r.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))},e.prototype.processQueue=function(e){for(var t=this;this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var r=this.taskQueue.shift();if(r){var n=r.event,s=r.sessionId;this.addCompressedEvent(n,s)}}this.taskQueue.length>0?requestIdleCallback(function(e){t.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e}(),Ve="Failed to store session replay events in IndexedDB",Ge="1.30.0",Ze=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t}return e.prototype.sendEventsList=function(e){this.addToQueue(i(i({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.filter(function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:"Session replay event batch rejected due to exceeded retry count"}),!1)}).forEach(function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout(function(){t.timeout=0,e.schedule(0)},t.timeout):e.schedule(0)})},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=setTimeout(function(){t.flush(!0).then(function(){t.queue.length>0&&t.schedule(e)})},e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,function(){var t,r,n=this;return a(this,function(s){switch(s.label){case 0:return t=[],r=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):r.push(e)}),this.queue=r,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),[4,Promise.all(t.map(function(t){return n.send(t,e)}))];case 1:return s.sent(),[2]}})})},e.prototype.send=function(e,t){var r,n;return void 0===t&&(t=!0),o(this,void 0,void 0,function(){var s,i,o,l,c,u,h,d,p,f,g,y,v;return a(this,function(a){switch(a.label){case 0:if(!(s=e.apiKey))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})];if(!(i=e.deviceId))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})];if(w=m(),o=(null==w?void 0:w.location)?w.location.href:"",l=Ge,c=e.sampleRate,u=new URLSearchParams({device_id:i,session_id:"".concat(e.sessionId),type:"".concat(e.type)}),h="".concat((null===(r=e.version)||void 0===r?void 0:r.type)||"standalone","/").concat((null===(n=e.version)||void 0===n?void 0:n.version)||l),0===(d=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];a.label=1;case 1:return a.trys.push([1,3,,4]),p={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(s),"X-Client-Version":l,"X-Client-Library":h,"X-Client-Url":o.substring(0,1e3),"X-Client-Sample-Rate":"".concat(c)},body:JSON.stringify(d),method:"POST"},f="".concat(ee(e.serverZone,this.trackServerUrl),"?").concat(u.toString()),[4,fetch(f,p)];case 2:if(null===(g=a.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)this.handleReponse(g.status,e);else{y="";try{y=JSON.stringify(g.body,null,2)}catch(e){}this.completeRequest({context:e,success:"".concat(g.status,": ").concat(y)})}return[3,4];case 3:return v=a.sent(),this.completeRequest({context:e,err:v}),[3,4];case 4:return[2]}var w})})},e.prototype.handleReponse=function(e,t){switch((new U).buildStatus(e)){case h.Success:this.handleSuccessResponse(t);break;case h.Failed:this.handleOtherResponse(t);break;default:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"})}},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/1024);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(t," KB")})},e.prototype.handleOtherResponse=function(e){this.addToQueue(i(i({},e),{timeout:e.attempts*this.retryTimeout}))},e.prototype.completeRequest=function(e){var t=e.context,r=e.err,n=e.success;t.onComplete(),r?this.loggerProvider.warn(r):n&&this.loggerProvider.log(n)},e}();const Ye=(e,t)=>t.some(t=>e instanceof t);let qe,Ke;const Je=new WeakMap,$e=new WeakMap,Xe=new WeakMap;let He={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return Je.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return tt(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Qe(e){He=e(He)}function et(e){return"function"==typeof e?function(e){return(Ke||(Ke=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(rt(this),t),tt(this.request)}:function(...t){return tt(e.apply(rt(this),t))}}(e):(e instanceof IDBTransaction&&function(e){if(Je.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)});Je.set(e,t)}(e),Ye(e,qe||(qe=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,He):e)}function tt(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(tt(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",i)});return Xe.set(t,e),t}(e);if($e.has(e))return $e.get(e);const t=et(e);return t!==e&&($e.set(e,t),Xe.set(t,e)),t}const rt=e=>Xe.get(e);function nt(e,t,{blocked:r,upgrade:n,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=tt(o);return n&&o.addEventListener("upgradeneeded",e=>{n(tt(o.result),e.oldVersion,e.newVersion,tt(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 st=["get","getKey","getAll","getAllKeys","count"],it=["put","add","delete","clear"],ot=new Map;function at(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(ot.get(t))return ot.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=it.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!st.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 ot.set(t,i),i}Qe(e=>({...e,get:(t,r,n)=>at(t,r)||e.get(t,r,n),has:(t,r)=>!!at(t,r)||e.has(t,r)}));const lt=["continue","continuePrimaryKey","advance"],ct={},ut=new WeakMap,ht=new WeakMap,dt={get(e,t){if(!lt.includes(t))return e[t];let r=ct[t];return r||(r=ct[t]=function(...e){ut.set(this,ht.get(this)[t](...e))}),r}};async function*pt(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,dt);for(ht.set(r,t),Xe.set(r,rt(t));t;)yield r,t=await(ut.get(r)||t.continue()),ut.delete(r)}function ft(e,t){return t===Symbol.asyncIterator&&Ye(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Ye(e,[IDBIndex,IDBObjectStore])}Qe(e=>({...e,get:(t,r,n)=>ft(t,r)?pt:e.get(t,r,n),has:(t,r)=>ft(t,r)||e.has(t,r)}));var gt,mt=function(){function e(e){var t,r,n,s=this;this.minInterval=500,this.maxInterval=1e4,this.maxPersistedEventsSize=1e6,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var r=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}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(e){return e.length},e.prototype.getEventsArraySize=function(e){var t,r,n=0;try{for(var s=l(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}();!function(e){e.RECORDING="recording",e.SENT="sent"}(gt||(gt={}));var yt,vt,wt,bt="sessionCurrentSequence",St="sequencesToSend",Ct=function(){var e=m();return new Promise(function(t,r){if(!e)return r(new Error("Global scope not found"));if(!e.indexedDB)return r(new Error("Session Replay: cannot find indexedDB"));try{var n=e.indexedDB.open("keyval-store");n.onupgradeneeded=function(){1===n.result.version&&(n.result.close(),n.transaction&&n.transaction.abort(),e.indexedDB.deleteDatabase("keyval-store"),t())},n.onsuccess=function(){t(n.result)},n.onerror=function(){r(n.error)}}catch(e){r(e)}})},It=function(e){return o(void 0,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:return e.length>0?(t=e.splice(0,10),[4,Promise.all(t)]):[3,2];case 1:return r.sent(),[3,0];case 2:return[2]}})})},xt=function(e){var t,r;return e.objectStoreNames.contains(bt)||(r=e.createObjectStore(bt,{keyPath:"sessionId"})),e.objectStoreNames.contains(St)||(t=e.createObjectStore(St,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},kt=function(e){return o(void 0,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,nt(e,1,{upgrade:xt})];case 1:return[2,t.sent()]}})})},Ot=function(e){function t(t){var r=e.call(this,t)||this;return r.getSequencesToSend=function(){return o(r,void 0,void 0,function(){var e,t,r,n,s,i;return a(this,function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=o.sent(),o.label=2;case 2:return t?(r=t.value,n=r.sessionId,s=r.events,e.push({events:s,sequenceId:t.key,sessionId:n}),[4,t.continue()]):[3,4];case 3:return t=o.sent(),[3,2];case 4:return[2,e];case 5:return i=o.sent(),this.loggerProvider.warn("".concat(Ve,": ").concat(i)),[3,6];case 6:return[2,void 0]}})})},r.storeCurrentSequence=function(e){return o(r,void 0,void 0,function(){var t,r,n;return a(this,function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.db.get(bt,e)];case 1:return(t=s.sent())?[4,this.db.put(St,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=s.sent(),[4,this.db.put(bt,{sessionId:e,events:[]})];case 3:return s.sent(),[2,i(i({},t),{sessionId:e,sequenceId:r})];case 4:return n=s.sent(),this.loggerProvider.warn("".concat(Ve,": ").concat(n)),[3,5];case 5:return[2,void 0]}})})},r.addEventToCurrentSequence=function(e,t){return o(r,void 0,void 0,function(){var r,n,s,i,o,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,10,,11]),[4,(r=this.db.transaction(bt,"readwrite")).store.get(e)];case 1:return(n=a.sent())?[3,3]:[4,r.store.put({sessionId:e,events:[t]})];case 2:return a.sent(),[2];case 3:return s=void 0,this.shouldSplitEventsList(n.events,t)?(s=n.events,[4,r.store.put({sessionId:e,events:[t]})]):[3,5];case 4:return a.sent(),[3,7];case 5:return i=n.events.concat(t),[4,r.store.put({sessionId:e,events:i})];case 6:a.sent(),a.label=7;case 7:return[4,r.done];case 8:return a.sent(),s?[4,this.storeSendingEvents(e,s)]:[2,void 0];case 9:return(o=a.sent())?[2,{events:s,sessionId:e,sequenceId:o}]:[2,void 0];case 10:return l=a.sent(),this.loggerProvider.warn("".concat(Ve,": ").concat(l)),[3,11];case 11:return[2,void 0]}})})},r.storeSendingEvents=function(e,t){return o(r,void 0,void 0,function(){var r;return a(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.db.put(St,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(Ve,": ").concat(r)),[3,3];case 3:return[2,void 0]}})})},r.cleanUpSessionEventsStore=function(e,t){return o(r,void 0,void 0,function(){var e;return a(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(St,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(Ve,": ").concat(e)),[3,4];case 4:return[2]}})})},r.transitionFromKeyValStore=function(e){return o(r,void 0,void 0,function(){var t,r,n,s,i,l,h,p,f=this;return a(this,function(g){switch(g.label){case 0:return g.trys.push([0,6,,7]),[4,Ct()];case 1:if(!(t=g.sent()))return[2];r=function(e,t){return o(f,void 0,void 0,function(){var r,n,s=this;return a(this,function(i){switch(i.label){case 0:return r=t.sessionSequences,n=[],Object.keys(r).forEach(function(i){var l=parseInt(i,10),h=r[l];if(l===t.currentSequenceId){var d=h.events.map(function(t){return o(s,void 0,void 0,function(){return a(this,function(r){return[2,this.addEventToCurrentSequence(e,t)]})})});n.push.apply(n,u([],c(d),!1))}else h.status!==gt.SENT&&n.push(s.storeSendingEvents(e,h.events))}),[4,It(n)];case 1:return i.sent(),[2]}})})},n="".concat(d,"_").concat(this.apiKey.substring(0,10)),g.label=2;case 2:return g.trys.push([2,4,,5]),s=t.transaction("keyval").objectStore("keyval").getAll(n),i=new Promise(function(t){s.onsuccess=function(n){return o(f,void 0,void 0,function(){var s,i,o,l=this;return a(this,function(a){switch(a.label){case 0:return s=n&&n.target.result,(i=s&&s[0])?(o=[],Object.keys(i).forEach(function(t){var n=parseInt(t,10),s=i[n];if(e===n)o.push(r(n,s));else{var a=s.sessionSequences;Object.keys(a).forEach(function(e){var t=parseInt(e,10);a[t].status!==gt.SENT&&o.push(l.storeSendingEvents(n,a[t].events))})}}),[4,It(o)]):[3,2];case 1:a.sent(),a.label=2;case 2:return t(),[2]}})})}}),[4,i];case 3:return g.sent(),(l=m())&&l.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return h=g.sent(),this.loggerProvider.warn("Failed to transition session replay events from keyval to new store: ".concat(h)),[3,5];case 5:return[3,7];case 6:return p=g.sent(),this.loggerProvider.warn("Failed to access keyval store: ".concat(p,". For more information, visit: https://www.docs.developers.amplitude.com/session-replay/sdks/standalone/#indexeddb-best-practices")),[3,7];case 7:return[2]}})})},r.apiKey=t.apiKey,r.db=t.db,r}return r(t,e),t.new=function(e,r,n){return o(this,void 0,void 0,function(){var s,o,l,c,u;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),s="replay"===e?"":"_".concat(e),o="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(s),[4,kt(o)];case 1:return l=a.sent(),[4,(c=new t(i(i({},r),{db:l}))).transitionFromKeyValStore(n)];case 2:return a.sent(),[2,c];case 3:return u=a.sent(),r.loggerProvider.warn("".concat(Ve,": ").concat(u)),[3,4];case 4:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return o(this,void 0,void 0,function(){var t,r,n,s,i,o,c;return a(this,function(a){switch(a.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(s=a.sent())?[2,[s]]:[2,void 0];case 2:t=[],a.label=3;case 3:return a.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=l.apply(void 0,[a.sent()]),n=r.next(),a.label=5;case 5:if(n.done)return[3,7];s=n.value,t.push(s),a.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return i=a.sent(),o={error:i},[3,10];case 9:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(o)throw o.error}return[7];case 10:return[2,t]}})})},t}(mt),Et=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t}return r(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=u([],c(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},t.prototype.getSequencesToSend=function(){return o(this,void 0,void 0,function(){return a(this,function(e){return[2,Object.entries(this.finalizedSequences).map(function(e){var t=c(e,2),r=t[0],n=t[1],s=n.sessionId,i=n.events;return{sequenceId:Number(r),sessionId:s,events:i}})]})})},t.prototype.storeCurrentSequence=function(e){return o(this,void 0,void 0,function(){return a(this,function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return o(this,void 0,void 0,function(){var r;return a(this,function(n){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(r=this.addSequence(e)),this.sequences[e].push(t),[2,r]})})},t.prototype.storeSendingEvents=function(e,t){return o(this,void 0,void 0,function(){return a(this,function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return o(this,void 0,void 0,function(){return a(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(mt),At=function(e){var t=e.config,r=e.sessionId,n=e.minInterval,s=e.maxInterval,l=e.type,c=e.payloadBatcher,u=e.storeType;return o(void 0,void 0,void 0,function(){function e(e){return void 0===e&&(e=!1),o(this,void 0,void 0,function(){return a(this,function(t){return[2,h.flush(e)]})})}var h,d,p,f,g,m,y,v,w;return a(this,function(b){switch(b.label){case 0:return h=new Ze(i(i({},t),{loggerProvider:t.loggerProvider,payloadBatcher:c})),d=function(){return new Et({loggerProvider:t.loggerProvider,maxInterval:s,minInterval:n})},p=function(){return o(void 0,void 0,void 0,function(){var e;return a(this,function(i){switch(i.label){case 0:return[4,Ot.new(l,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:s,apiKey:t.apiKey},r)];case 1:return e=i.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,null!=e?e:d()]}})})},"idb"!==u?[3,2]:[4,p()];case 1:return g=b.sent(),[3,3];case 2:g=d(),b.label=3;case 3:return f=g,m=function(e){var r=e.events,n=e.sessionId,s=e.deviceId,i=e.sequenceId;t.debugMode&&ne().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(){}),h.sendEventsList({events:r,sessionId:n,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:s,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:l,onComplete:function(){return o(void 0,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,f.cleanUpSessionEventsStore(n,i)];case 1:return e.sent(),[2]}})})}})},y=function(e){var r=e.sessionId,n=e.deviceId;f.storeCurrentSequence(r).then(function(e){e&&m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})}).catch(function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)})},v=function(e){var t=e.deviceId;return o(void 0,void 0,void 0,function(){var e;return a(this,function(r){switch(r.label){case 0:return[4,f.getSequencesToSend()];case 1:return(e=r.sent())&&e.forEach(function(e){m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]}})})},w=function(e){var r=e.event,n=e.sessionId,s=e.deviceId;f.addEventToCurrentSequence(n,r.data).then(function(e){return e&&m({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:y,addEvent:w,sendStoredEvents:v,flush:e}]}})})},Rt=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=new Map;e.forEach(function(e){r.set(e.name,e.manager)}),this.managers=r}return e.prototype.sendStoredEvents=function(e){return o(this,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:return t=[],this.managers.forEach(function(r){t.push(r.sendStoredEvents(e))}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e.prototype.addEvent=function(e){var t,r=e.sessionId,n=e.event,s=e.deviceId;null===(t=this.managers.get(n.type))||void 0===t||t.addEvent({sessionId:r,event:n,deviceId:s})},e.prototype.sendCurrentSequenceEvents=function(e){var t=e.sessionId,r=e.deviceId;this.managers.forEach(function(e){e.sendCurrentSequenceEvents({sessionId:t,deviceId:r})})},e.prototype.flush=function(e){return o(this,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:return t=[],this.managers.forEach(function(r){t.push(r.flush(e))}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e}();function Mt(e,t){if(wt=new Date,e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var r={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};yt=i(i({},r),t),vt=function(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}(yt.root,r);var n=Pt(e,"all",function(){return Pt(e,"two",function(){return Pt(e,"one",function(){return Pt(e,"none")})})});if(n){var s=zt(Wt(n,e));return s.length>0&&(n=s[0]),Nt(n)}throw new Error("Selector was not found.")}function Pt(e,t,r){for(var n=null,s=[],i=e,o=0,a=function(){var e,a,h=(new Date).getTime()-wt.getTime();if(void 0!==yt.timeoutMs&&h>yt.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(h,"ms"));var d=Bt(function(e){var t=e.getAttribute("id");return t&&yt.idName(t)?{name:"#"+CSS.escape(t),penalty:0}:null}(i))||Bt.apply(void 0,u([],c(function(e){return Array.from(e.attributes).filter(function(e){return yt.attr(e.name,e.value)}).map(function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}})}(i)),!1))||Bt.apply(void 0,u([],c(function(e){return Array.from(e.classList).filter(yt.className).map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(i)),!1))||Bt(function(e){var t=e.tagName.toLowerCase();return yt.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(Ft).map(function(e){return Lt(e,p)})));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(Ft).map(function(e){return Lt(e,p)})));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&Ft(f)&&(d=[Lt(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[Lt(d[0],p)]));try{for(var g=(e=void 0,l(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>=yt.seedMinLength&&(n=Tt(s,r)))return"break";i=i.parentElement,o++};i&&"break"!==a(););return n||(n=Tt(s,r)),!n&&r?r():n}function Tt(e,t){var r,n,s=zt(jt(e));if(s.length>yt.threshold)return t?t():null;try{for(var i=l(s),o=i.next();!o.done;o=i.next()){var a=o.value;if(Dt(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 Nt(e){for(var t=e[0],r=t.name,n=1;n<e.length;n++){var s=e[n].level||0;r=t.level===s-1?"".concat(e[n].name," > ").concat(r):"".concat(e[n].name," ").concat(r),t=e[n]}return r}function _t(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function Dt(e){var t=Nt(e);switch(vt.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 Lt(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Ft(e){return"html"!==e.name&&!e.name.startsWith("#")}function Bt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(Ut);return r.length>0?r:null}function Ut(e){return null!=e}function jt(e,t){var r,n,s,i,o,c;return void 0===t&&(t=[]),a(this,function(a){switch(a.label){case 0:if(!(e.length>0))return[3,9];a.label=1;case 1:a.trys.push([1,6,7,8]),r=l(e[0]),n=r.next(),a.label=2;case 2:return n.done?[3,5]:(s=n.value,[5,l(jt(e.slice(1,e.length),t.concat(s)))]);case 3:a.sent(),a.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return i=a.sent(),o={error:i},[3,8];case 7:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(o)throw o.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:a.sent(),a.label=11;case 11:return[2]}})}function zt(e){return u([],c(e),!1).sort(function(e,t){return _t(e)-_t(t)})}function Wt(e,t,r){var n,s,i;return void 0===r&&(r={counter:0,visited:new Map}),a(this,function(o){switch(o.label){case 0:if(!(e.length>2&&e.length>yt.optimizedMinLength))return[3,5];n=1,o.label=1;case 1:return n<e.length-1?r.counter>yt.maxNumberOfTries?[2]:(r.counter+=1,(s=u([],c(e),!1)).splice(n,1),i=Nt(s),r.visited.has(i)?[2]:Dt(s)&&function(e,t){return vt.querySelector(Nt(e))===t}(s,t)?[4,s]:[3,4]):[3,5];case 2:return o.sent(),r.visited.set(i,!0),[5,l(Wt(s,t,r))];case 3:o.sent(),o.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var Vt=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}},Gt=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)}},Zt=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===le.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=Mt(g,a)}catch(e){r.logger.debug("error resolving selector from finder")}var y=re(c.href,o),v={x:d+r.scrollWatcher.currentScrollX,y:p+r.scrollWatcher.currentScrollY,selector:f,viewportHeight:u,viewportWidth:h,pageUrl:y,timestamp:Date.now(),type:"click"},w=s();w&&t.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(v)},deviceId:w})}}}}}},this.logger=e,this.scrollWatcher=t};function Yt(){var e=m();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function qt(){var e=m();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}var Kt=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=ee(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}return e.prototype.send=function(e,t){var r=this.context,n=r.sessionId,s=r.type,i=new URLSearchParams({device_id:e,session_id:String(n),type:String(s),api_key:this.apiKey}),o="".concat(this.basePageUrl,"?").concat(i.toString());this.sendBeacon(o,t)||this.sendXhr(o,t)},e}(),Jt=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=e(),o=m();o&&i&&r.transport.send(i,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:Yt(),viewportWidth:qt(),pageUrl:re(o.location.href,null!==(s=null===(n=r.config.interactionConfig)||void 0===n?void 0:n.ugcFilterRules)&&void 0!==s?s:[]),timestamp:r.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=qt(),this._maxScrollHeight=Yt(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new Kt(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=qt();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=Yt();this._maxScrollY=e.y;var i=e.y+s;i>this._maxScrollHeight&&(this._maxScrollHeight=i),this.timestamp=t}},e}(),$t=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))},Xt=new function(){var e=this;this.dbs={},this.createStore=function(t){return o(e,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,nt(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 o(e,void 0,void 0,function(){var e,r;return a(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_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 o(e,void 0,void 0,function(){var e,t,i,o;return a(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(),r.warn("Failed to get targeting match for session id ".concat(s,": ").concat(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 o(e,void 0,void 0,function(){var e,t,o;return a(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(),r.warn("Failed to store targeting match for session id ".concat(s,": ").concat(o)),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.currentSessionId;return o(e,void 0,void 0,function(){var e,t,i,o,l,c,u,h;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,8,,9]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(s),[4,(i=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:o=a.sent(),l=0,a.label=3;case 3:return l<o.length?(c=o[l],u=Date.now()-c.lastUpdated,c.sessionId!==t&&u>1728e5?[4,i.store.delete(c.sessionId)]:[3,5]):[3,6];case 4:a.sent(),a.label=5;case 5:return l++,[3,3];case 6:return[4,i.done];case 7:return a.sent(),[3,9];case 8:return h=a.sent(),r.warn("Failed to clear old targeting matches for sessions: ".concat(h)),[3,9];case 9:return[2]}})})}},Ht=function(e){var t=e.sessionId,r=e.targetingConfig,n=e.loggerProvider,s=e.apiKey,l=e.targetingParams;return o(void 0,void 0,void 0,function(){var e,o,c,u;return a(this,function(a){switch(a.label){case 0:return[4,Xt.clearStoreOfOldSessions({loggerProvider:n,apiKey:s,currentSessionId:t})];case 1:return a.sent(),[4,Xt.getTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t})];case 2:if(!0===a.sent())return[2,!0];e=!0,a.label=3;case 3:return a.trys.push([3,6,,7]),[4,Promise.resolve().then(function(){return Hr})];case 4:return[4,(0,a.sent().evaluateTargeting)(i(i({},l),{flag:r,sessionId:t,apiKey:s,loggerProvider:n}))];case 5:return(o=a.sent())&&o.sr_targeting_config&&(e="on"===o.sr_targeting_config.key),Xt.storeTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t,targetingMatch:e}),[3,7];case 6:return c=a.sent(),u=c,n.warn(u.message),[3,7];case 7:return[2,e]}})})};function Qt(e){return void 0===e&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,r,n){var s,o,a,l=i(i({},e),n),c=l.ugcFilterRules||[],u=null!==(s=l.enablePolling)&&void 0!==s&&s,h=null!==(o=l.pollingInterval)&&void 0!==o?o:1e3,d=null!==(a=l.captureDocumentTitle)&&void 0!==a&&a;if(!r)return function(){};var p=void 0,f="__amplitude_url_tracking_patched__",g="__amplitude_url_tracking_reset__",m=function(){return r.location&&r.location.href||""},y=function(){var e=m();if(void 0===p||e!==p){p=e;var n=function(){var e=r.innerHeight,t=r.innerWidth,n=r.document,s=m(),i="";return d&&(i=(null==n?void 0:n.title)||""),{href:c.length>0?re(s,c):s,title:i,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();t(n)}},v=function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var s=e.apply(this,t);return r[g]||y(),s};return t[f]=!0,t},w=function(){y()};if(u){var b=r.setInterval(function(){y()},h);return y(),function(){b&&r.clearInterval(b)}}if(r.history){var S=r.history.pushState.bind(r.history),C=r.history.replaceState.bind(r.history);return r.history.pushState[f]||(r.history.pushState=v(S),r.history.replaceState=v(C)),r.addEventListener("popstate",y),r.addEventListener("hashchange",w),y(),function(){r[g]=!0,r.removeEventListener("popstate",y),r.removeEventListener("hashchange",w)}}return r.addEventListener("hashchange",w),y(),function(){r.removeEventListener("hashchange",w)}},options:e}}Qt();var er,tr,rr,nr=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,this.teardownEventListeners=function(t){var r=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(){e.recordEvents(!1)},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),o(e,void 0,void 0,function(){var e,i;return a(this,function(o){switch(o.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig){if(!r)return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.")}return this.lastTargetingParams=t,!this.config.targetingConfig||this.sessionTargetingMatch?[3,2]:((e=t.event)&&Object.values(s).includes(e.event_type)&&(e=void 0),i=this,[4,Ht({sessionId:this.identifiers.sessionId,targetingConfig:this.config.targetingConfig,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:e}})]);case 1:i.sessionTargetingMatch=o.sent(),this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:e,targetingParams:t},null,2)),o.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:o.sent(),o.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n=!0),o(e,void 0,void 0,function(){var e,s,o,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=void 0,(s=this.config)&&t!==V.METADATA?(e={config:se(s),version:Ge},n?[4,ne()]:[3,2]):[3,2];case 1:o=a.sent(),e=i(i({},o),e),a.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 l=a.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",l),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var t;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null===(t=e.networkObservers)||void 0===t||t.stop()}catch(t){var r=t;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(r.toString()))}},this.loggerProvider=new $(new S)}return e.prototype.init=function(e,t){return w(this._init(e,t))},e.prototype._init=function(e,t){var r,n,s,i,l,h;return o(this,void 0,void 0,function(){var o,d,p,f,g,y,v,w,b,C,I,x,k,O,E,A,R;return a(this,function(a){switch(a.label){case 0:return this.loggerProvider=new $(t.loggerProvider||new S),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new $t({sessionId:t.sessionId,deviceId:t.deviceId}),o=this,[4,ue(e,t)];case 1:return o.joinedConfigGenerator=a.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:d=a.sent(),p=d.joinedConfig,f=d.localConfig,g=d.remoteConfig,this.config=p,this.setMetadata(t.sessionId,p,f,g,null===(r=t.version)||void 0===r?void 0:r.version,Ge,null===(n=t.version)||void 0===n?void 0:n.type),t.sessionId&&(null===(s=this.config.interactionConfig)||void 0===s?void 0:s.enabled)&&(y=Jt.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[y.send(this.getDeviceId.bind(this)).bind(y)],this.scrollHook=y.hook.bind(y),this.clickHandler=new Zt(this.loggerProvider,y)),v=[],"idb"!==(w=this.config.storeType)||(null===(i=m())||void 0===i?void 0:i.indexedDB)||(w="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(w," for event storage.")),a.label=3;case 3:return a.trys.push([3,5,,6]),[4,At({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:w})];case 4:return b=a.sent(),v.push({name:"replay",manager:b}),[3,6];case 5:return C=a.sent(),O=C,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(O.toString())),[3,6];case 6:if(!(null===(l=this.config.interactionConfig)||void 0===l?void 0:l.enabled))return[3,10];I=this.config.interactionConfig.batch?Gt:Vt,a.label=7;case 7:return a.trys.push([7,9,,10]),[4,At({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!==(h=this.config.interactionConfig.trackEveryNms)&&void 0!==h?h:3e4,maxInterval:6e4,payloadBatcher:I,storeType:w})];case 8:return x=a.sent(),v.push({name:"interaction",manager:x}),[3,10];case 9:return k=a.sent(),O=k,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(O.toString())),[3,10];case 10:return this.eventsManager=new(Rt.bind.apply(Rt,u([void 0],c(v),!1))),this.eventCompressor&&this.eventCompressor.terminate(),E=void 0,A=m(),this.config.useWebWorker&&A&&A.Worker?[4,Promise.resolve().then(function(){return Qr})]:[3,12];case 11:R=a.sent().compressionScript,E=R,a.label=12;case 12:return this.eventCompressor=new We(this.eventsManager,this.config,this.getDeviceId(),E),[4,this.initializeNetworkObservers()];case 13:return a.sent(),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:t.userProperties},!0)];case 14:return a.sent(),[2]}})})},e.prototype.setSessionId=function(e,t){return w(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n;return o(this,void 0,void 0,function(){var s,i,o;return a(this,function(a){switch(a.label){case 0:return this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(s=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(s),i=t||this.getDeviceId(),this.identifiers=new $t({sessionId:e,deviceId:i}),this.joinedConfigGenerator&&s?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2];case 1:o=a.sent().joinedConfig,this.config=o,a.label=2;case 2:return(null===(n=this.config)||void 0===n?void 0:n.targetingConfig)?[4,this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties},!1,!0)]:[3,4];case 3:return a.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:a.sent(),a.label=6;case 6:return[2]}})})},e.prototype.getSessionReplayProperties=function(){var e,t=this.config,r=this.identifiers;if(!t||!r)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var n=this.getShouldRecord(),s={};return n&&((e={})[Z]=r.sessionReplayId?r.sessionReplayId:null,s=e,t.debugMode&&(s[K]=JSON.stringify({appHash:B(t.apiKey).toString()}))),this.addCustomRRWebEvent(V.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=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),n=this.getDeviceId();this.eventsManager&&r&&n&&this.eventsManager.sendCurrentSequenceEvents({sessionId:r,deviceId:n})},e.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),o(this,void 0,void 0,function(){var r;return a(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,n=!1,s="",i=!1;return this.config.targetingConfig?this.sessionTargetingMatch?(s="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(s),n=!0,i=!0):(s="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(s),n=!1,i=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,r=B(e.toString()),31*Math.abs(r)%1e6/1e6<t?(n=!0,i=!0):(s="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(s),n=!1,i=!1)),this.lastShouldRecordDecision!==n&&this.config.targetingConfig&&(this.addCustomRRWebEvent(V.TARGETING_DECISION,{message:s,sessionId:this.identifiers.sessionId,matched:i,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=n),n},e.prototype.getBlockSelectors=function(){var e,t,r,n=null!==(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.blockSelector)&&void 0!==r?r:[];if(0!==n.length)return n},e.prototype.getMaskTextSelectors=function(){var e,t,r,n;return"conservative"===(null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.defaultMaskLevel)?"*":(null===(n=null===(r=this.config)||void 0===r?void 0:r.privacyConfig)||void 0===n?void 0:n.maskSelector)||void 0},e.prototype.getRecordingPlugins=function(e){var t,r,n,s,i,l;return o(this,void 0,void 0,function(){var o,c,u,h;return a(this,function(a){switch(a.label){case 0:o=[];try{c=Qt({ugcFilterRules:(null===(r=null===(t=this.config)||void 0===t?void 0:t.interactionConfig)||void 0===r?void 0:r.ugcFilterRules)||[],enablePolling:(null===(n=this.config)||void 0===n?void 0:n.enableUrlChangePolling)||!1,pollingInterval:null===(s=this.config)||void 0===s?void 0:s.urlChangePollingInterval,captureDocumentTitle:null===(i=this.config)||void 0===i?void 0:i.captureDocumentTitle}),o.push(c)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null===(l=null==e?void 0:e.console)||void 0===l?void 0:l.enabled))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return Mh})];case 2:return u=a.sent().getRecordConsolePlugin,o.push(u({level:e.console.levels})),[3,4];case 3:return h=a.sent(),this.loggerProvider.warn("Failed to load console plugin:",h),[3,4];case 4:return[2,o.length>0?o:void 0]}})})},e.prototype.getRecordFunction=function(){return o(this,void 0,void 0,function(){var e,t;return a(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 VS})];case 2:return e=r.sent().record,this.recordFunction=e,[2,e];case 3:return t=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",t),[2,null];case 4:return[2]}})})},e.prototype.recordEvents=function(e){var t,r,n,s,i,l,c;return void 0===e&&(e=!0),o(this,void 0,void 0,function(){var o,u,h,d,p,f,g,m,y,v,w,b,S,C=this;return a(this,function(a){switch(a.label){case 0:return o=this.config,u=this.getShouldRecord(),h=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,u&&h&&o?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(d=a.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:a.sent(),null===(r=this.networkObservers)||void 0===r||r.start(function(e){C.addCustomRRWebEvent(V.FETCH_REQUEST,e)}),p=o.privacyConfig,f=o.interactionConfig,g=o.loggingConfig,m=(null==f?void 0:f.enabled)?{mouseInteraction:this.eventsManager&&(null===(n=this.clickHandler)||void 0===n?void 0:n.createHook({eventsManager:this.eventsManager,sessionId:h,deviceIdFn:this.getDeviceId.bind(this),mirror:d.mirror,ugcFilterRules:null!==(s=f.ugcFilterRules)&&void 0!==s?s:[],performanceOptions:null===(i=o.performanceConfig)||void 0===i?void 0:i.interaction})),scroll:this.scrollHook}:{},y=(null==f?void 0:f.enabled)&&f.ugcFilterRules?f.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(h,".")),a.label=3;case 3:return a.trys.push([3,5,,6]),v=this,w=d,S={emit:function(e){if(C.shouldOptOut())return C.loggerProvider.log("Opting session ".concat(h," out of recording due to optOut config.")),C.stopRecordingEvents(),void C.sendEvents();e.type===ae.Meta&&(e.data.href=re(e.data.href,y)),C.eventCompressor&&C.eventCompressor.enqueueEvent(e,h)},inlineStylesheet:o.shouldInlineStylesheet,hooks:m,maskAllInputs:!0,maskTextClass:J,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:o.applyBackgroundColorToBlockedElements,maskInputFn:Q("input",p),maskTextFn:Q("text",p),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:null===(l=o.omitElementTags)||void 0===l?void 0:l.script,comment:null===(c=o.omitElementTags)||void 0===c?void 0:c.comment},errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return C.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(g)];case 4:return v.recordCancelCallback=w.apply(void 0,[(S.plugins=a.sent(),S)]),this.addCustomRRWebEvent(V.DEBUG_INFO),e&&this.addCustomRRWebEvent(V.METADATA,this.metadata),[3,6];case 5:return b=a.sent(),this.loggerProvider.warn("Failed to initialize session replay:",b),[3,6];case 6:return[2]}})})},e.prototype.getDeviceId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.deviceId},e.prototype.getSessionId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.sessionId},e.prototype.flush=function(e){var t;return void 0===e&&(e=!1),o(this,void 0,void 0,function(){return a(this,function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]})})},e.prototype.shutdown=function(){this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},e.prototype.mapSDKType=function(e){return"plugin"===e?"@amplitude/plugin-session-replay-browser":"segment"===e?"@amplitude/segment-session-replay-plugin":null},e.prototype.setMetadata=function(e,t,r,n,s,i,o){var a=(null==e?void 0:e.toString())?B(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 o(this,void 0,void 0,function(){var n,s;return a(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 ZS})];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}(),sr=function(e){return function(){var t=e.config||ie();return{logger:t.loggerProvider,logLevel:t.logLevel}}},ir=function(){var e=new nr;return{init:O(e.init.bind(e),"init",sr(e)),evaluateTargetingAndCapture:O(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",sr(e)),setSessionId:O(e.setSessionId.bind(e),"setSessionId",sr(e)),getSessionId:O(e.getSessionId.bind(e),"getSessionId",sr(e)),getSessionReplayProperties:O(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",sr(e)),flush:O(e.flush.bind(e),"flush",sr(e)),shutdown:O(e.shutdown.bind(e),"shutdown",sr(e))}}(),or=ir.init,ar=ir.setSessionId,lr=ir.getSessionId,cr=ir.getSessionReplayProperties,ur=ir.flush,hr=ir.shutdown,dr=ir.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"}(er||(er={})),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"}(tr||(tr={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(rr||(rr={}));const pr=[er.SET,er.SET_ONCE,er.ADD,er.APPEND,er.PREPEND,er.POSTINSERT],fr="1.24.1";class gr{constructor(e){this.name=gr.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:ur,getSessionId:lr,getSessionReplayProperties:cr,init:or,setSessionId:ar,shutdown:hr,evaluateTargetingAndCapture:dr},this.options=Object.assign({forceSessionTracking:!1},e),this.srInitOptions=this.options}setup(e,t){var r,n,s,i,a,l,c,u;return o(this,void 0,void 0,function*(){try{null==e||e.loggerProvider.log(`Installing @amplitude/plugin-session-replay, version ${fr}.`),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 o=(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===(a=this.options.privacyConfig)||void 0===a?void 0:a.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:fr},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:o,omitElementTags:this.options.omitElementTags,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval},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 o(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 o(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;return o(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 r=null===(t=this.config)||void 0===t?void 0:t.sessionId;if(r&&r!==this.sessionReplay.getSessionId()&&(yield this.sessionReplay.setSessionId(r).promise),r&&r===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(pr.includes(r)){const n=e.user_properties&&e.user_properties[r];t=Object.assign(Object.assign({},t),n)}}),t})(e)),yield this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:t});const r=this.sessionReplay.getSessionReplayProperties();e.event_properties=Object.assign(Object.assign({},e.event_properties),r)}}return Promise.resolve(e)}catch(t){return null===(r=this.config)||void 0===r||r.loggerProvider.error(`Session Replay: Failed to enrich event due to ${t.message}`),Promise.resolve(e)}})}teardown(){var e;return o(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()}}gr.pluginName="@amplitude/plugin-session-replay-browser";const mr=e=>new gr(e);var yr=function(e,t){return yr=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])},yr(e,t)},vr=function(){return vr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},vr.apply(this,arguments)};function wr(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}"function"==typeof SuppressedError&&SuppressedError;var br="is not",Sr="contains",Cr="does not contain",Ir="less",xr="less or equal",kr="greater",Or="greater or equal",Er="version less",Ar="version less or equal",Rr="version greater",Mr="version greater or equal",Pr="set is",Tr="set is not",Nr="set contains",_r="set does not contain",Dr="set contains any",Lr="set does not contain any",Fr=-862048943,Br=461845907,Ur=function(e,t){var r=e,n=t;return r=Math.imul(r,Fr),r=zr(r,15),r=Math.imul(r,Br),n=zr(n^=r,13),(n=Math.imul(n,5))+-430675100|0},jr=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,(t=Math.imul(t,-1028477387))^t>>>16},zr=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},Wr=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 Vr(r)},Vr=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Gr=function(e,t){var r,n;if(t&&0!==t.length){try{for(var s=wr(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}},Zr="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),Yr=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(Zr).exec(t);if(r){var n=Number(r[1]),s=Number(r[2]);if(!isNaN(n)&&!isNaN(s))return new e(n,s,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),qr=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,s={},i={context:e,result:s};try{for(var o=wr(t),a=o.next();!a.done;a=o.next()){var l=a.value,c=this.evaluateFlag(i,l);c&&(s[l.key]=c)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},e.prototype.evaluateFlag=function(e,t){var r,n,s;try{for(var i=wr(t.segments),o=i.next();!o.done;o=i.next()){var a=o.value;if(s=this.evaluateSegment(e,t,a)){var l=vr(vr(vr({},t.metadata),a.metadata),s.metadata);s=vr(vr({},s),{metadata:l});break}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s},e.prototype.evaluateSegment=function(e,t,r){var n,s,i,o;if(!r.conditions)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0;try{for(var a=wr(r.conditions),l=a.next();!l.done;l=a.next()){var c,u=l.value,h=!0;try{for(var d=(i=void 0,wr(u)),p=d.next();!p.done;p=d.next()){var f=p.value;if(!(h=this.matchCondition(e,f)))break}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}if(h)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}},e.prototype.matchCondition=function(e,t){var r=Gr(e,t.selector);if(r){if(this.isSetOperator(t.op)){var n=this.coerceStringArray(r);return!!n&&this.matchSet(n,t.op,t.values)}var s=this.coerceString(r);return void 0!==s&&this.matchString(s,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return function(e,t){void 0===t&&(t=0);for(var r=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var s=e.charCodeAt(n);s<128?t[r++]=s:s<2048?(t[r++]=s>>6|192,t[r++]=63&s|128):55296==(64512&s)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++n)),t[r++]=s>>18|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128,t[r++]=63&s|128):(t[r++]=s>>12|224,t[r++]=s>>6&63|128,t[r++]=63&s|128)}return Uint8Array.from(t)}(e),n=r.length,s=n>>2,i=t,o=0;o<s;o++){var a=Wr(r,o<<2);i=Ur(a,i)}var l=s<<2,c=0;switch(n-l){case 3:c^=r[l+2]<<16,c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Fr),c=zr(c,15),i^=c=Math.imul(c,Br);break;case 2:c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Fr),c=zr(c,15),i^=c=Math.imul(c,Br);break;case 1:c^=r[l],c=Math.imul(c,Fr),c=zr(c,15),i^=c=Math.imul(c,Br)}return jr(i^=n)>>>0}(e)},e.prototype.bucket=function(e,t){var r,n,s,i;if(!t.bucket)return t.variant;var o=this.coerceString(Gr(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=wr(t.bucket.allocations),d=h.next();!d.done;d=h.next()){var p=d.value,f=p.range[0],g=p.range[1];if(c>=f&&c<g)try{for(var m=(s=void 0,wr(p.distributions)),y=m.next();!y.done;y=m.next()){var v=y.value,w=v.range[0],b=v.range[1];if(u>=w&&u<b)return v.variant}}catch(e){s={error:e}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(s)throw s.error}}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case"is":case Sr:case Ir:case xr:case kr:case Or:case Er:case Ar:case Rr:case Mr:case Pr:case Nr:case Dr:return r;case br:case Cr:case _r:case Lr:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Pr:return this.setEquals(e,r);case Tr:return!this.setEquals(e,r);case Nr:return this.matchesSetContainsAll(e,r);case _r:return!this.matchesSetContainsAll(e,r);case Dr:return this.matchesSetContainsAny(e,r);case Lr:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case"is":return this.matchesIs(e,r);case br:return!this.matchesIs(e,r);case Sr:return this.matchesContains(e,r);case Cr:return!this.matchesContains(e,r);case Ir:case xr:case kr:case Or:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case Er:case Ar:case Rr:case Mr:return this.matchesComparable(e,t,r,function(e){return Yr.parse(e)},this.versionComparator);case"regex match":return this.matchesRegex(e,r);case"regex does not match":return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some(function(e){return e.toLowerCase()===r})}return t.some(function(t){return e===t})},e.prototype.matchesContains=function(e,t){var r,n;try{for(var s=wr(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(e.toLowerCase().includes(o.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,s){var i=this,o=n(e),a=r.map(function(e){return n(e)}).filter(function(e){return void 0!==e});return void 0===o||0===a.length?r.some(function(r){return i.comparator(e,t,r)}):a.some(function(e){return s(o,t,e)})},e.prototype.comparator=function(e,t,r){switch(t){case Ir:case Er:return e<r;case xr:case Ar:return e<=r;case kr:case Rr:return e>r;case Or:case Mr:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Ir:case Er:return n<0;case xr:case Ar:return n<=0;case kr:case Rr:return n>0;case Or:case Mr: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 Pr:case Tr:case Nr:case _r:case Dr:case Lr:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&function(e,t,r){if(r||2===arguments.length)for(var n,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))}([],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}(n),!1).every(function(e){return r.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var s=wr(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(!this.matchesIs(o,e))return!1}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var s=wr(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(this.matchesIs(o,e))return!0}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e}();"function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder&&new TextEncoder,Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=").forEach((e,t)=>t),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}yr(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 Kr,Jr=new function(){var e=this;this.dbs={},this.createStore=function(t){return o(e,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,nt(t,1,{upgrade:function(e){e.objectStoreNames.contains("eventTypesForSession")||e.createObjectStore("eventTypesForSession",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return o(e,void 0,void 0,function(){var e,r;return a(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.updateEventListForSession=function(t){var r=t.sessionId,n=t.eventType,s=t.eventTime,l=t.loggerProvider,c=t.tx;return o(e,void 0,void 0,function(){var e,t,o,u,h,d,p,f,g;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=String(r),[4,c.store.get(e)];case 1:return t=a.sent(),o=t?t.eventTypes:{},u=o[n]||{},h=i(i({},o),((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 a.sent(),[2,h];case 3:return p=a.sent(),l.warn("Failed to store events for targeting ".concat(r,": ").concat(p)),[3,4];case 4:return[2,void 0]}})})},this.deleteOldSessionEventTypes=function(t){var r=t.currentSessionId,n=t.loggerProvider,s=t.tx;return o(e,void 0,void 0,function(){var e,t,i,o,l,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),e=String(r),[4,s.store.getAll()];case 1:t=a.sent(),i=0,a.label=2;case 2:return i<t.length?(o=t[i],l=Date.now()-o.lastUpdated,o.sessionId!==e&&l>1728e5?[4,s.store.delete(o.sessionId)]:[3,4]):[3,5];case 3:a.sent(),a.label=4;case 4:return i++,[3,2];case 5:return[3,7];case 6:return c=a.sent(),n.warn("Failed to clear old session event types for targeting: ".concat(c)),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,s=t.eventType,i=t.eventTime,l=t.apiKey;return o(e,void 0,void 0,function(){var e,t,o,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,5,,6]),[4,this.openOrCreateDB(l)];case 1:return e=a.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:s,eventTime:i})]:[2];case 2:return o=a.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return a.sent(),[4,t.done];case 4:return a.sent(),[2,o];case 5:return c=a.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(c)),[3,6];case 6:return[2,void 0]}})})}},$r=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,s=t.event,i=t.sessionId,l=t.userProperties,c=t.deviceId,u=t.flag;return o(e,void 0,void 0,function(){var e,t,o,h;return a(this,function(a){switch(a.label){case 0:return s&&s.time?[4,Jr.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:i,eventType:s.event_type,eventTime:s.time})]:[3,2];case 1:return t=a.sent(),[3,3];case 2:t=void 0,a.label=3;case 3:return o=(e=t)&&new Set(Object.keys(e)),h={session_id:i,event:s,event_types:o&&Array.from(o),user:{device_id:c,user_properties:l}},[2,this.evaluationEngine.evaluate(h,[u])]}})})},this.evaluationEngine=new qr},Xr=function(){var e=new $r;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,Hr=Object.freeze({__proto__:null,evaluateTargeting:Xr}),Qr=Object.freeze({__proto__:null,compressionScript:'var WebWorker=function(r){"use strict";var n=Uint8Array,e=Uint16Array,f=Uint32Array,t=new n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i=function(r,n){for(var t=new e(31),a=0;a<31;++a)t[a]=n+=1<<r[a-1];var o=new f(t[30]);for(a=1;a<30;++a)for(var i=t[a];i<t[a+1];++i)o[i]=i-t[a]<<5|a;return[t,o]},v=i(t,2),u=v[0],s=v[1];u[28]=258,s[258]=28;for(var l=i(a,0)[1],c=new e(32768),h=0;h<32768;++h){var g=(43690&h)>>>1|(21845&h)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,c[h]=((65280&g)>>>8|(255&g)<<8)>>>1}var w=function(r,n,f){for(var t=r.length,a=0,o=new e(n);a<t;++a)++o[r[a]-1];var i,v=new e(n);for(a=0;a<n;++a)v[a]=v[a-1]+o[a-1]<<1;if(f){i=new e(1<<n);var u=15-n;for(a=0;a<t;++a)if(r[a])for(var s=a<<4|r[a],l=n-r[a],h=v[r[a]-1]++<<l,g=h|(1<<l)-1;h<=g;++h)i[c[h]>>>u]=s}else for(i=new e(t),a=0;a<t;++a)i[a]=c[v[r[a]-1]++]>>>15-r[a];return i},d=new n(288);for(h=0;h<144;++h)d[h]=8;for(h=144;h<256;++h)d[h]=9;for(h=256;h<280;++h)d[h]=7;for(h=280;h<288;++h)d[h]=8;var m=new n(32);for(h=0;h<32;++h)m[h]=5;var y=w(d,9,0),M=w(m,5,0),p=function(r){return(r/8|0)+(7&r&&1)},b=function(r,t,a){(null==a||a>r.length)&&(a=r.length);var o=new(r instanceof e?e:r instanceof f?f:n)(a-t);return o.set(r.subarray(t,a)),o},C=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8},S=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8,r[f+2]|=e>>>16},x=function(r,f){for(var t=[],a=0;a<r.length;++a)r[a]&&t.push({s:a,f:r[a]});var o=t.length,i=t.slice();if(!o)return[new n(0),0];if(1==o){var v=new n(t[0].s+1);return v[t[0].s]=1,[v,1]}t.sort(function(r,n){return r.f-n.f}),t.push({s:-1,f:25001});var u=t[0],s=t[1],l=0,c=1,h=2;for(t[0]={s:-1,f:u.f+s.f,l:u,r:s};c!=o-1;)u=t[t[l].f<t[h].f?l++:h++],s=t[l!=c&&t[l].f<t[h].f?l++:h++],t[c++]={s:-1,f:u.f+s.f,l:u,r:s};var g=i[0].s;for(a=1;a<o;++a)i[a].s>g&&(g=i[a].s);var w=new e(g+1),d=A(t[c-1],w,0);if(d>f){a=0;var m=0,y=d-f,M=1<<y;for(i.sort(function(r,n){return w[n.s]-w[r.s]||r.f-n.f});a<o;++a){var p=i[a].s;if(!(w[p]>f))break;m+=M-(1<<d-w[p]),w[p]=f}for(m>>>=y;m>0;){var b=i[a].s;w[b]<f?m-=1<<f-w[b]++-1:++a}for(;a>=0&&m;--a){var C=i[a].s;w[C]==f&&(--w[C],++m)}d=f}return[new n(w),d]},A=function(r,n,e){return-1==r.s?Math.max(A(r.l,n,e+1),A(r.r,n,e+1)):n[r.s]=e},O=function(r){for(var n=r.length;n&&!r[--n];);for(var f=new e(++n),t=0,a=r[0],o=1,i=function(r){f[t++]=r},v=1;v<=n;++v)if(r[v]==a&&v!=n)++o;else{if(!a&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(a),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(a);o=1,a=r[v]}return[f.subarray(0,t),n]},T=function(r,n){for(var e=0,f=0;f<n.length;++f)e+=r[f]*n[f];return e},k=function(r,n,e){var f=e.length,t=p(n+2);r[t]=255&f,r[t+1]=f>>>8,r[t+2]=255^r[t],r[t+3]=255^r[t+1];for(var a=0;a<f;++a)r[t+a+4]=e[a];return 8*(t+4+f)},E=function(r,n,f,i,v,u,s,l,c,h,g){C(n,g++,f),++v[256];for(var p=x(v,15),b=p[0],A=p[1],E=x(u,15),J=E[0],N=E[1],U=O(b),D=U[0],I=U[1],W=O(J),_=W[0],j=W[1],P=new e(19),q=0;q<D.length;++q)P[31&D[q]]++;for(q=0;q<_.length;++q)P[31&_[q]]++;for(var z=x(P,7),B=z[0],F=z[1],G=19;G>4&&!B[o[G-1]];--G);var H,K,L,Q,R=h+5<<3,V=T(v,d)+T(u,m)+s,X=T(v,b)+T(u,J)+s+14+3*G+T(P,B)+(2*P[16]+3*P[17]+7*P[18]);if(R<=V&&R<=X)return k(n,g,r.subarray(c,c+h));if(C(n,g,1+(X<V)),g+=2,X<V){H=w(b,A,0),K=b,L=w(J,N,0),Q=J;var Y=w(B,F,0);C(n,g,I-257),C(n,g+5,j-1),C(n,g+10,G-4),g+=14;for(q=0;q<G;++q)C(n,g+3*q,B[o[q]]);g+=3*G;for(var Z=[D,_],$=0;$<2;++$){var rr=Z[$];for(q=0;q<rr.length;++q){var nr=31&rr[q];C(n,g,Y[nr]),g+=B[nr],nr>15&&(C(n,g,rr[q]>>>5&127),g+=rr[q]>>>12)}}}else H=y,K=d,L=M,Q=m;for(q=0;q<l;++q)if(i[q]>255){nr=i[q]>>>18&31;S(n,g,H[nr+257]),g+=K[nr+257],nr>7&&(C(n,g,i[q]>>>23&31),g+=t[nr]);var er=31&i[q];S(n,g,L[er]),g+=Q[er],er>3&&(S(n,g,i[q]>>>5&8191),g+=a[er])}else S(n,g,H[i[q]]),g+=K[i[q]];return S(n,g,H[256]),g+K[256]},J=new f([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),N=function(r,o,i,v,u){return function(r,o,i,v,u,c){var h=r.length,g=new n(v+h+5*(1+Math.floor(h/7e3))+u),w=g.subarray(v,g.length-u),d=0;if(!o||h<8)for(var m=0;m<=h;m+=65535){var y=m+65535;y<h?d=k(w,d,r.subarray(m,y)):(w[m]=c,d=k(w,d,r.subarray(m,h)))}else{for(var M=J[o-1],C=M>>>13,S=8191&M,x=(1<<i)-1,A=new e(32768),O=new e(x+1),T=Math.ceil(i/3),N=2*T,U=function(n){return(r[n]^r[n+1]<<T^r[n+2]<<N)&x},D=new f(25e3),I=new e(288),W=new e(32),_=0,j=0,P=(m=0,0),q=0,z=0;m<h;++m){var B=U(m),F=32767&m,G=O[B];if(A[F]=G,O[B]=F,q<=m){var H=h-m;if((_>7e3||P>24576)&&H>423){d=E(r,w,0,D,I,W,j,P,z,m-z,d),P=_=j=0,z=m;for(var K=0;K<286;++K)I[K]=0;for(K=0;K<30;++K)W[K]=0}var L=2,Q=0,R=S,V=F-G&32767;if(H>2&&B==U(m-V))for(var X=Math.min(C,H)-1,Y=Math.min(32767,m),Z=Math.min(258,H);V<=Y&&--R&&F!=G;){if(r[m+L]==r[m+L-V]){for(var $=0;$<Z&&r[m+$]==r[m+$-V];++$);if($>L){if(L=$,Q=V,$>X)break;var rr=Math.min(V,$-2),nr=0;for(K=0;K<rr;++K){var er=m-V+K+32768&32767,fr=er-A[er]+32768&32767;fr>nr&&(nr=fr,G=er)}}}V+=(F=G)-(G=A[F])+32768&32767}if(Q){D[P++]=268435456|s[L]<<18|l[Q];var tr=31&s[L],ar=31&l[Q];j+=t[tr]+a[ar],++I[257+tr],++W[ar],q=m+L,++_}else D[P++]=r[m],++I[r[m]]}}d=E(r,w,c,D,I,W,j,P,z,m-z,d)}return b(g,0,v+p(d)+u)}(r,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,i,v,!u)};function U(r,n){void 0===n&&(n={});var e=function(){var r=1,n=0;return{p:function(e){for(var f=r,t=n,a=e.length,o=0;o!=a;){for(var i=Math.min(o+5552,a);o<i;++o)t+=f+=e[o];f%=65521,t%=65521}r=f,n=t},d:function(){return(r>>>8<<16|(255&n)<<8|n>>>8)+2*((255&r)<<23)}}}();e.p(r);var f,t,a,o=N(r,n,2,4);return f=o,t=n.level,a=0==t?0:t<6?1:9==t?3:2,f[0]=120,f[1]=a<<6|(a?32-2*a:1),function(r,n,e){for(;e;++n)r[n]=e,e>>>=8}(o,o.length-4,e.d()),o}const D=r=>{const e={...r,v:"v1"};return function(r,n){var e="";if(!n&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(r);for(var f=0;f<r.length;){var t=r[f++];t<128||n?e+=String.fromCharCode(t):t<224?e+=String.fromCharCode((31&t)<<6|63&r[f++]):t<240?e+=String.fromCharCode((15&t)<<12|(63&r[f++])<<6|63&r[f++]):(t=((15&t)<<18|(63&r[f++])<<12|(63&r[f++])<<6|63&r[f++])-65536,e+=String.fromCharCode(55296|t>>10,56320|1023&t))}return e}(U(function(r,e){var f=r.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(r);for(var t=new n(r.length+(r.length>>>1)),a=0,o=function(r){t[a++]=r},i=0;i<f;++i){if(a+5>t.length){var v=new n(a+8+(f-i<<1));v.set(t),t=v}var u=r.charCodeAt(i);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&r.charCodeAt(++i))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return b(t,0,a)}(JSON.stringify(e))),!0)};onmessage=r=>{const{event:n,sessionId:e}="string"==typeof r.data?JSON.parse(r.data):r.data,f=JSON.stringify(D(n));postMessage({compressedEvent:f,sessionId:e})};const I=onmessage;return r.compressionOnMessage=I,Object.defineProperty(r,"__esModule",{value:!0}),r}({});\n'}),en=Object.defineProperty,tn=(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),rn=Object.defineProperty,nn=(e,t,r)=>((e,t,r)=>t in e?rn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),sn=Object.defineProperty,on=(e,t,r)=>((e,t,r)=>t in e?sn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const an={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ln={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},cn={};function un(e){if(cn[e])return cn[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 an?an[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 ln?ln[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 cn[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?cn[e]=i:r}catch{return r}}const hn={};function dn(e,t,r){var n;const s=`${e}.${String(r)}`;if(hn[s])return hn[s].call(t);const i=un(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(hn[s]=o,o.call(t)):t[r]}const pn=function(e){return dn("Node",e,"parentNode")},fn=function(e){return e&&"host"in e?dn("ShadowRoot",e,"host"):null},gn=function(e){return e&&"shadowRoot"in e?dn("Element",e,"shadowRoot"):null};function mn(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&mn(pn(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&mn(pn(e),t,r)}var yn={exports:{}},vn=String,wn=function(){return{isColorSupported:!1,reset:vn,bold:vn,dim:vn,italic:vn,underline:vn,inverse:vn,hidden:vn,strikethrough:vn,black:vn,red:vn,green:vn,yellow:vn,blue:vn,magenta:vn,cyan:vn,white:vn,gray:vn,bgBlack:vn,bgRed:vn,bgGreen:vn,bgYellow:vn,bgBlue:vn,bgMagenta:vn,bgCyan:vn,bgWhite:vn}};yn.exports=wn(),yn.exports.createColors=wn;var bn=yn.exports;const Sn=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Cn=bn,In=Sn,xn=class e extends Error{constructor(t,r,n,s,i,o){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Cn.isColorSupported),In&&e&&(t=In(t));let r,n,s=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,s.length),a=String(o).length;if(e){let{bold:e,gray:t,red:s}=Cn.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(i,o).map((e,t)=>{let s=i+1+t,o=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(o)+e+"\n "+t+r("^")}return" "+n(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var kn=xn;xn.default=xn;var On={};On.isClean=Symbol("isClean"),On.my=Symbol("my");const En={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let An=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return En[r];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[r])return i.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((o=r)[0].toUpperCase()+o.slice(1));this[s]?n=this[s](i,e):i.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var o;return void 0===n&&(n=En[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Rn=An;An.default=An;let Mn=Rn;function Pn(e,t){new Mn(t).stringify(e)}var Tn=Pn;Pn.default=Pn;let{isClean:Nn,my:_n}=On,Dn=kn,Ln=Rn,Fn=Tn;function Bn(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>Bn(e,r)):("object"===i&&null!==s&&(s=Bn(s)),r[n]=s)}return r}let Un=class{constructor(e={}){this.raws={},this[Nn]=!1,this[_n]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Bn(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 Dn(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[Nn]){this[Nn]=!1;let e=this;for(;e=e.parent;)e[Nn]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Ln).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Fn){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var jn=Un;Un.default=Un;let zn=jn,Wn=class extends zn{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Vn=Wn;Wn.default=Wn;var Gn={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}};let{SourceMapConsumer:Zn,SourceMapGenerator:Yn}=Sn,{existsSync:qn,readFileSync:Kn}=Sn,{dirname:Jn,join:$n}=Sn,Xn=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Jn(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Zn(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=Jn(e),qn(e))return this.mapFile=e,Kn(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Zn)return Yn.fromSourceMap(t).toString();if(t instanceof Yn)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=$n(Jn(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Hn=Xn;Xn.default=Xn;let{SourceMapConsumer:Qn,SourceMapGenerator:es}=Sn,{fileURLToPath:ts,pathToFileURL:rs}=Sn,{isAbsolute:ns,resolve:ss}=Sn,{nanoid:is}=Gn,os=Sn,as=kn,ls=Hn,cs=Symbol("fromOffsetCache"),us=Boolean(Qn&&es),hs=Boolean(ss&&ns),ds=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!hs||/^\w+:\/\//.test(t.from)||ns(t.from)?this.file=t.from:this.file=ss(t.from)),hs&&us){let e=new ls(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+is(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;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);i=e.line,o=e.col}else i=n.line,o=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return s=a?new as(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new as(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(rs&&(s.input.url=rs(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[cs])r=this[cs];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[cs]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ss(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,i,o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=o.originalPositionFor({column:n,line:r})),i=ns(a.source)?rs(a.source):new URL(a.source,this.map.consumer().sourceRoot||rs(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:i.toString()};if("file:"===i.protocol){if(!ts)throw new Error("file: protocol is not available in this PostCSS build");l.file=ts(i)}let c=o.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var ps=ds;ds.default=ds,os&&os.registerInput&&os.registerInput(ds);let{SourceMapConsumer:fs,SourceMapGenerator:gs}=Sn,{dirname:ms,relative:ys,resolve:vs,sep:ws}=Sn,{pathToFileURL:bs}=Sn,Ss=ps,Cs=Boolean(fs&&gs),Is=Boolean(ms&&vs&&ys&&ws);var xs=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||ms(e.file);!1===this.mapOpts.sourcesContent?(t=new fs(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Is&&Cs&&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=gs.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new gs({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new gs({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=o.match(/\n/g),e?(r+=e.length,t=o.lastIndexOf("\n"),n=o.length-t):n+=o.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?ms(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=ms(vs(r,this.mapOpts.annotation)));let n=ys(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Ss(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(bs){let t=bs(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;"\\"===ws&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let ks=jn,Os=class extends ks{constructor(e){super(e),this.type="comment"}};var Es=Os;Os.default=Os;let As,Rs,Ms,Ps,{isClean:Ts,my:Ns}=On,_s=Vn,Ds=Es,Ls=jn;function Fs(e){return e.map(e=>(e.nodes&&(e.nodes=Fs(e.nodes)),delete e.source,e))}function Bs(e){if(e[Ts]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Bs(t)}let Us=class e extends Ls{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Fs(As(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new _s(t)]}else if(t.selector)t=[new Rs(t)];else if(t.name)t=[new Ms(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Ds(t)]}return t.map(t=>(t[Ns]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Ts]&&Bs(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Us.registerParse=e=>{As=e},Us.registerRule=e=>{Rs=e},Us.registerAtRule=e=>{Ms=e},Us.registerRoot=e=>{Ps=e};var js=Us;Us.default=Us,Us.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ms.prototype):"rule"===e.type?Object.setPrototypeOf(e,Rs.prototype):"decl"===e.type?Object.setPrototypeOf(e,_s.prototype):"comment"===e.type?Object.setPrototypeOf(e,Ds.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ps.prototype),e[Ns]=!0,e.nodes&&e.nodes.forEach(e=>{Us.rebuild(e)})};let zs,Ws,Vs=js,Gs=class extends Vs{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new zs(new Ws,this,e).stringify()}};Gs.registerLazyResult=e=>{zs=e},Gs.registerProcessor=e=>{Ws=e};var Zs=Gs;Gs.default=Gs;let Ys={};var qs=function(e){Ys[e]||(Ys[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Ks=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Js=Ks;Ks.default=Ks;let $s=Js,Xs=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new $s(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Hs=Xs;Xs.default=Xs;const Qs="'".charCodeAt(0),ei='"'.charCodeAt(0),ti="\\".charCodeAt(0),ri="/".charCodeAt(0),ni="\n".charCodeAt(0),si=" ".charCodeAt(0),ii="\f".charCodeAt(0),oi="\t".charCodeAt(0),ai="\r".charCodeAt(0),li="[".charCodeAt(0),ci="]".charCodeAt(0),ui="(".charCodeAt(0),hi=")".charCodeAt(0),di="{".charCodeAt(0),pi="}".charCodeAt(0),fi=";".charCodeAt(0),gi="*".charCodeAt(0),mi=":".charCodeAt(0),yi="@".charCodeAt(0),vi=/[\t\n\f\r "#'()/;[\\\]{}]/g,wi=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,bi=/.[\r\n"'(/\\]/,Si=/[\da-f]/i;let Ci=js,Ii=class extends Ci{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var xi=Ii;Ii.default=Ii,Ci.registerAtRule(Ii);let ki,Oi,Ei=js,Ai=class extends Ei{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new ki(new Oi,this,e).stringify()}};Ai.registerLazyResult=e=>{ki=e},Ai.registerProcessor=e=>{Oi=e};var Ri=Ai;Ai.default=Ai,Ei.registerRoot(Ai);let Mi={comma:e=>Mi.split(e,[","],!0),space:e=>Mi.split(e,[" ","\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}};var Pi=Mi;Mi.default=Mi;let Ti=js,Ni=Pi,_i=class extends Ti{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Ni.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Di=_i;_i.default=_i,Ti.registerRule(_i);let Li=Vn,Fi=Es,Bi=xi,Ui=Ri,ji=Di;const zi={empty:!0,space:!0};let Wi=js,Vi=class{constructor(e){this.input=e,this.root=new Ui,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Bi;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),i&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),o&&(s.nodes=[],this.current=s)}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 Fi;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=function(e,t={}){let r,n,s,i,o,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],y=[];function v(t){throw e.error("Unclosed "+t,g)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&g>=f},nextToken:function(e){if(y.length)return y.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case ni:case si:case oi:case ai:case ii:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===si||r===ni||r===oi||r===ai||r===ii);h=["space",d.slice(g,n)],g=n-1;break;case li:case ci:case di:case pi:case mi:case fi:case hi:{let e=String.fromCharCode(r);h=[e,e,g];break}case ui:if(c=m.length?m.pop()[1]:"",u=d.charCodeAt(g+1),"url"===c&&u!==Qs&&u!==ei&&u!==si&&u!==ni&&u!==oi&&u!==ii&&u!==ai){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===ti;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),i=d.slice(g,n+1),-1===n||bi.test(i)?h=["(","(",g]:(h=["brackets",i,g,n],g=n);break;case Qs:case ei:s=r===Qs?"'":'"',n=g;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=g+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===ti;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case yi:vi.lastIndex=g+1,vi.test(d),n=0===vi.lastIndex?d.length-1:vi.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case ti:for(n=g,o=!0;d.charCodeAt(n+1)===ti;)n+=1,o=!o;if(r=d.charCodeAt(n+1),o&&r!==ri&&r!==si&&r!==ni&&r!==oi&&r!==ai&&r!==ii&&(n+=1,Si.test(d.charAt(n)))){for(;Si.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===si&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===ri&&d.charCodeAt(g+1)===gi?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(wi.lastIndex=g+1,wi.test(d),n=0===wi.lastIndex?d.length-1:wi.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}}(this.input)}decl(e,t){let r=new Li;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,o=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=o.map(e=>e[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new ji;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,o,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],i=s[0],"space"!==i||e!==l-1||n?"comment"===i?(a=r[e-1]?r[e-1][0]:"empty",o=r[e+1]?r[e+1][0]:"empty",zi[a]||zi[o]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new ji;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Gi=ps;function Zi(e,t){let r=new Gi(e,t),n=new Vi(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var Yi=Zi;Zi.default=Zi,Wi.registerParse(Zi);let{isClean:qi,my:Ki}=On,Ji=xs,$i=Tn,Xi=js,Hi=Zs,Qi=qs,eo=Hs,to=Yi,ro=Ri;const no={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},so={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},io={Once:!0,postcssPlugin:!0,prepare:!0};function oo(e){return"object"==typeof e&&"function"==typeof e.then}function ao(e){let t=!1,r=no[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function lo(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ao(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function co(e){return e[qi]=!1,e.nodes&&e.nodes.forEach(e=>co(e)),e}let uo={},ho=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof eo)s=co(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=to;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[Ki]&&Xi.rebuild(s)}else s=co(r);this.result=new eo(t,s,n),this.helpers={...uo,postcss:uo,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(!so[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!io[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(oo(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qi];){e[qi]=!0;let t=[lo(e)];for(;t.length>0;){let e=this.visitTick(t);if(oo(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return oo(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=$i;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Ji(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(oo(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qi];)e[qi]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Qi("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(oo(s))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[s,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=s;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[qi])return n[qi]=!0,void e.push(lo(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[qi]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[qi]=!0;let t=ao(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[qi]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};ho.registerPostcss=e=>{uo=e};var po=ho;ho.default=ho,ro.registerLazyResult(ho),Hi.registerLazyResult(ho);let fo=xs,go=Tn,mo=qs,yo=Yi;const vo=Hs;let wo=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=go;this.result=new vo(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let o=new fo(s,n,this._opts,t);if(o.isMap()){let[e,t]=o.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else o.clearAnnotation(),this.result.css=o.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||mo("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=yo;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var bo=wo;wo.default=wo;let So=bo,Co=po,Io=Zs,xo=Ri,ko=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Co(this,e,t):new So(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Oo=ko;ko.default=ko,xo.registerProcessor(ko),Io.registerProcessor(ko);let Eo=Vn,Ao=Hn,Ro=Es,Mo=xi,Po=ps,To=Ri,No=Di;function _o(e,t){if(Array.isArray(e))return e.map(e=>_o(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Po.prototype};r.map&&(r.map={...r.map,__proto__:Ao.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>_o(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new To(n);if("decl"===n.type)return new Eo(n);if("rule"===n.type)return new No(n);if("comment"===n.type)return new Ro(n);if("atrule"===n.type)return new Mo(n);throw new Error("Unknown node type: "+e.type)}var Do=_o;_o.default=_o;let Lo=kn,Fo=Vn,Bo=po,Uo=js,jo=Oo,zo=Tn,Wo=Do,Vo=Zs,Go=Js,Zo=Es,Yo=xi,qo=Hs,Ko=ps,Jo=Yi,$o=Pi,Xo=Di,Ho=Ri,Qo=jn;function ea(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new jo(e)}ea.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new jo).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return ea([s(r)]).process(e,t)},s},ea.stringify=zo,ea.parse=Jo,ea.fromJSON=Wo,ea.list=$o,ea.comment=e=>new Zo(e),ea.atRule=e=>new Yo(e),ea.decl=e=>new Fo(e),ea.rule=e=>new Xo(e),ea.root=e=>new Ho(e),ea.document=e=>new Vo(e),ea.CssSyntaxError=Lo,ea.Declaration=Fo,ea.Container=Uo,ea.Processor=jo,ea.Document=Vo,ea.Comment=Zo,ea.Warning=Go,ea.AtRule=Yo,ea.Result=qo,ea.Input=Ko,ea.Rule=Xo,ea.Root=Ho,ea.Node=Qo,Bo.registerPostcss(ea);var ta=ea;ea.default=ea;const ra=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(ta);ra.stringify,ra.fromJSON,ra.plugin,ra.parse,ra.list,ra.document,ra.comment,ra.atRule,ra.rule,ra.decl,ra.root,ra.CssSyntaxError,ra.Declaration,ra.Container,ra.Processor,ra.Document,ra.Comment,ra.Warning,ra.AtRule,ra.Result,ra.Input,ra.Rule,ra.Root,ra.Node;var na=Object.defineProperty,sa=(e,t,r)=>((e,t,r)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);var ia={exports:{}},oa=String,aa=function(){return{isColorSupported:!1,reset:oa,bold:oa,dim:oa,italic:oa,underline:oa,inverse:oa,hidden:oa,strikethrough:oa,black:oa,red:oa,green:oa,yellow:oa,blue:oa,magenta:oa,cyan:oa,white:oa,gray:oa,bgBlack:oa,bgRed:oa,bgGreen:oa,bgYellow:oa,bgBlue:oa,bgMagenta:oa,bgCyan:oa,bgWhite:oa}};ia.exports=aa(),ia.exports.createColors=aa;var la=ia.exports;const ca=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let ua=la,ha=ca,da=class e extends Error{constructor(t,r,n,s,i,o){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=ua.isColorSupported),ha&&e&&(t=ha(t));let r,n,s=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,s.length),a=String(o).length;if(e){let{bold:e,gray:t,red:s}=ua.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(i,o).map((e,t)=>{let s=i+1+t,o=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(o)+e+"\n "+t+r("^")}return" "+n(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var pa=da;da.default=da;var fa={};fa.isClean=Symbol("isClean"),fa.my=Symbol("my");const ga={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let ma=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return ga[r];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[r])return i.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((o=r)[0].toUpperCase()+o.slice(1));this[s]?n=this[s](i,e):i.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var o;return void 0===n&&(n=ga[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var ya=ma;ma.default=ma;let va=ya;function wa(e,t){new va(t).stringify(e)}var ba=wa;wa.default=wa;let{isClean:Sa,my:Ca}=fa,Ia=pa,xa=ya,ka=ba;function Oa(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>Oa(e,r)):("object"===i&&null!==s&&(s=Oa(s)),r[n]=s)}return r}let Ea=class{constructor(e={}){this.raws={},this[Sa]=!1,this[Ca]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Oa(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 Ia(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[Sa]){this[Sa]=!1;let e=this;for(;e=e.parent;)e[Sa]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new xa).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ka){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var Aa=Ea;Ea.default=Ea;let Ra=Aa,Ma=class extends Ra{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Pa=Ma;Ma.default=Ma;var Ta={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}};let{SourceMapConsumer:Na,SourceMapGenerator:_a}=ca,{existsSync:Da,readFileSync:La}=ca,{dirname:Fa,join:Ba}=ca,Ua=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Fa(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Na(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=Fa(e),Da(e))return this.mapFile=e,La(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Na)return _a.fromSourceMap(t).toString();if(t instanceof _a)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Ba(Fa(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var ja=Ua;Ua.default=Ua;let{SourceMapConsumer:za,SourceMapGenerator:Wa}=ca,{fileURLToPath:Va,pathToFileURL:Ga}=ca,{isAbsolute:Za,resolve:Ya}=ca,{nanoid:qa}=Ta,Ka=ca,Ja=pa,$a=ja,Xa=Symbol("fromOffsetCache"),Ha=Boolean(za&&Wa),Qa=Boolean(Ya&&Za),el=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Qa||/^\w+:\/\//.test(t.from)||Za(t.from)?this.file=t.from:this.file=Ya(t.from)),Qa&&Ha){let e=new $a(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+qa(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;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);i=e.line,o=e.col}else i=n.line,o=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return s=a?new Ja(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new Ja(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Ga&&(s.input.url=Ga(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Xa])r=this[Xa];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[Xa]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Ya(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,i,o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=o.originalPositionFor({column:n,line:r})),i=Za(a.source)?Ga(a.source):new URL(a.source,this.map.consumer().sourceRoot||Ga(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:i.toString()};if("file:"===i.protocol){if(!Va)throw new Error("file: protocol is not available in this PostCSS build");l.file=Va(i)}let c=o.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var tl=el;el.default=el,Ka&&Ka.registerInput&&Ka.registerInput(el);let{SourceMapConsumer:rl,SourceMapGenerator:nl}=ca,{dirname:sl,relative:il,resolve:ol,sep:al}=ca,{pathToFileURL:ll}=ca,cl=tl,ul=Boolean(rl&&nl),hl=Boolean(sl&&ol&&il&&al);var dl=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||sl(e.file);!1===this.mapOpts.sourcesContent?(t=new rl(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),hl&&ul&&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=nl.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new nl({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new nl({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=o.match(/\n/g),e?(r+=e.length,t=o.lastIndexOf("\n"),n=o.length-t):n+=o.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?sl(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=sl(ol(r,this.mapOpts.annotation)));let n=il(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new cl(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(ll){let t=ll(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;"\\"===al&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let pl=Aa,fl=class extends pl{constructor(e){super(e),this.type="comment"}};var gl=fl;fl.default=fl;let ml,yl,vl,wl,{isClean:bl,my:Sl}=fa,Cl=Pa,Il=gl,xl=Aa;function kl(e){return e.map(e=>(e.nodes&&(e.nodes=kl(e.nodes)),delete e.source,e))}function Ol(e){if(e[bl]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ol(t)}let El=class e extends xl{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=kl(ml(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Cl(t)]}else if(t.selector)t=[new yl(t)];else if(t.name)t=[new vl(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Il(t)]}return t.map(t=>(t[Sl]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[bl]&&Ol(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};El.registerParse=e=>{ml=e},El.registerRule=e=>{yl=e},El.registerAtRule=e=>{vl=e},El.registerRoot=e=>{wl=e};var Al=El;El.default=El,El.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,vl.prototype):"rule"===e.type?Object.setPrototypeOf(e,yl.prototype):"decl"===e.type?Object.setPrototypeOf(e,Cl.prototype):"comment"===e.type?Object.setPrototypeOf(e,Il.prototype):"root"===e.type&&Object.setPrototypeOf(e,wl.prototype),e[Sl]=!0,e.nodes&&e.nodes.forEach(e=>{El.rebuild(e)})};let Rl,Ml,Pl=Al,Tl=class extends Pl{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Rl(new Ml,this,e).stringify()}};Tl.registerLazyResult=e=>{Rl=e},Tl.registerProcessor=e=>{Ml=e};var Nl=Tl;Tl.default=Tl;let _l={};var Dl=function(e){_l[e]||(_l[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Ll=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Fl=Ll;Ll.default=Ll;let Bl=Fl,Ul=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Bl(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var jl=Ul;Ul.default=Ul;const zl="'".charCodeAt(0),Wl='"'.charCodeAt(0),Vl="\\".charCodeAt(0),Gl="/".charCodeAt(0),Zl="\n".charCodeAt(0),Yl=" ".charCodeAt(0),ql="\f".charCodeAt(0),Kl="\t".charCodeAt(0),Jl="\r".charCodeAt(0),$l="[".charCodeAt(0),Xl="]".charCodeAt(0),Hl="(".charCodeAt(0),Ql=")".charCodeAt(0),ec="{".charCodeAt(0),tc="}".charCodeAt(0),rc=";".charCodeAt(0),nc="*".charCodeAt(0),sc=":".charCodeAt(0),ic="@".charCodeAt(0),oc=/[\t\n\f\r "#'()/;[\\\]{}]/g,ac=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,lc=/.[\r\n"'(/\\]/,cc=/[\da-f]/i;let uc=Al,hc=class extends uc{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var dc=hc;hc.default=hc,uc.registerAtRule(hc);let pc,fc,gc=Al,mc=class extends gc{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new pc(new fc,this,e).stringify()}};mc.registerLazyResult=e=>{pc=e},mc.registerProcessor=e=>{fc=e};var yc=mc;mc.default=mc,gc.registerRoot(mc);let vc={comma:e=>vc.split(e,[","],!0),space:e=>vc.split(e,[" ","\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}};var wc=vc;vc.default=vc;let bc=Al,Sc=wc,Cc=class extends bc{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Sc.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Ic=Cc;Cc.default=Cc,bc.registerRule(Cc);let xc=Pa,kc=gl,Oc=dc,Ec=yc,Ac=Ic;const Rc={empty:!0,space:!0};let Mc=Al,Pc=class{constructor(e){this.input=e,this.root=new Ec,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Oc;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),i&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),o&&(s.nodes=[],this.current=s)}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 kc;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=function(e,t={}){let r,n,s,i,o,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],y=[];function v(t){throw e.error("Unclosed "+t,g)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&g>=f},nextToken:function(e){if(y.length)return y.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case Zl:case Yl:case Kl:case Jl:case ql:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===Yl||r===Zl||r===Kl||r===Jl||r===ql);h=["space",d.slice(g,n)],g=n-1;break;case $l:case Xl:case ec:case tc:case sc:case rc:case Ql:{let e=String.fromCharCode(r);h=[e,e,g];break}case Hl:if(c=m.length?m.pop()[1]:"",u=d.charCodeAt(g+1),"url"===c&&u!==zl&&u!==Wl&&u!==Yl&&u!==Zl&&u!==Kl&&u!==ql&&u!==Jl){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===Vl;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),i=d.slice(g,n+1),-1===n||lc.test(i)?h=["(","(",g]:(h=["brackets",i,g,n],g=n);break;case zl:case Wl:s=r===zl?"'":'"',n=g;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=g+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===Vl;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case ic:oc.lastIndex=g+1,oc.test(d),n=0===oc.lastIndex?d.length-1:oc.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case Vl:for(n=g,o=!0;d.charCodeAt(n+1)===Vl;)n+=1,o=!o;if(r=d.charCodeAt(n+1),o&&r!==Gl&&r!==Yl&&r!==Zl&&r!==Kl&&r!==Jl&&r!==ql&&(n+=1,cc.test(d.charAt(n)))){for(;cc.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Yl&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===Gl&&d.charCodeAt(g+1)===nc?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(ac.lastIndex=g+1,ac.test(d),n=0===ac.lastIndex?d.length-1:ac.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}}(this.input)}decl(e,t){let r=new xc;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,o=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=o.map(e=>e[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Ac;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,o,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],i=s[0],"space"!==i||e!==l-1||n?"comment"===i?(a=r[e-1]?r[e-1][0]:"empty",o=r[e+1]?r[e+1][0]:"empty",Rc[a]||Rc[o]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new Ac;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Tc=tl;function Nc(e,t){let r=new Tc(e,t),n=new Pc(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var _c=Nc;Nc.default=Nc,Mc.registerParse(Nc);let{isClean:Dc,my:Lc}=fa,Fc=dl,Bc=ba,Uc=Al,jc=Nl,zc=Dl,Wc=jl,Vc=_c,Gc=yc;const Zc={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Yc={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},qc={Once:!0,postcssPlugin:!0,prepare:!0};function Kc(e){return"object"==typeof e&&"function"==typeof e.then}function Jc(e){let t=!1,r=Zc[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function $c(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Jc(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Xc(e){return e[Dc]=!1,e.nodes&&e.nodes.forEach(e=>Xc(e)),e}let Hc={},Qc=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof Wc)s=Xc(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=Vc;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[Lc]&&Uc.rebuild(s)}else s=Xc(r);this.result=new Wc(t,s,n),this.helpers={...Hc,postcss:Hc,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(!Yc[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!qc[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(Kc(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Dc];){e[Dc]=!0;let t=[$c(e)];for(;t.length>0;){let e=this.visitTick(t);if(Kc(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return Kc(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=Bc;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Fc(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(Kc(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Dc];)e[Dc]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||zc("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(Kc(s))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[s,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=s;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[Dc])return n[Dc]=!0,void e.push($c(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[Dc]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Dc]=!0;let t=Jc(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[Dc]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Qc.registerPostcss=e=>{Hc=e};var eu=Qc;Qc.default=Qc,Gc.registerLazyResult(Qc),jc.registerLazyResult(Qc);let tu=dl,ru=ba,nu=Dl,su=_c;const iu=jl;let ou=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=ru;this.result=new iu(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let o=new tu(s,n,this._opts,t);if(o.isMap()){let[e,t]=o.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else o.clearAnnotation(),this.result.css=o.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||nu("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=su;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var au=ou;ou.default=ou;let lu=au,cu=eu,uu=Nl,hu=yc,du=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new cu(this,e,t):new lu(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var pu=du;du.default=du,hu.registerProcessor(du),uu.registerProcessor(du);let fu=Pa,gu=ja,mu=gl,yu=dc,vu=tl,wu=yc,bu=Ic;function Su(e,t){if(Array.isArray(e))return e.map(e=>Su(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:vu.prototype};r.map&&(r.map={...r.map,__proto__:gu.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Su(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new wu(n);if("decl"===n.type)return new fu(n);if("rule"===n.type)return new bu(n);if("comment"===n.type)return new mu(n);if("atrule"===n.type)return new yu(n);throw new Error("Unknown node type: "+e.type)}var Cu=Su;Su.default=Su;let Iu=pa,xu=Pa,ku=eu,Ou=Al,Eu=pu,Au=ba,Ru=Cu,Mu=Nl,Pu=Fl,Tu=gl,Nu=dc,_u=jl,Du=tl,Lu=_c,Fu=wc,Bu=Ic,Uu=yc,ju=Aa;function zu(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Eu(e)}zu.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new Eu).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return zu([s(r)]).process(e,t)},s},zu.stringify=Au,zu.parse=Lu,zu.fromJSON=Ru,zu.list=Fu,zu.comment=e=>new Tu(e),zu.atRule=e=>new Nu(e),zu.decl=e=>new xu(e),zu.rule=e=>new Bu(e),zu.root=e=>new Uu(e),zu.document=e=>new Mu(e),zu.CssSyntaxError=Iu,zu.Declaration=xu,zu.Container=Ou,zu.Processor=Eu,zu.Document=Mu,zu.Comment=Tu,zu.Warning=Pu,zu.AtRule=Nu,zu.Result=_u,zu.Input=Du,zu.Rule=Bu,zu.Root=Uu,zu.Node=ju,ku.registerPostcss(zu);var Wu=zu;zu.default=zu;const Vu=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(Wu);Vu.stringify,Vu.fromJSON,Vu.plugin,Vu.parse,Vu.list,Vu.document,Vu.comment,Vu.atRule,Vu.rule,Vu.decl,Vu.root,Vu.CssSyntaxError,Vu.Declaration,Vu.Container,Vu.Processor,Vu.Document,Vu.Comment,Vu.Warning,Vu.AtRule,Vu.Result,Vu.Input,Vu.Rule,Vu.Root,Vu.Node;class Gu{constructor(...e){sa(this,"parentElement",null),sa(this,"parentNode",null),sa(this,"ownerDocument"),sa(this,"firstChild",null),sa(this,"lastChild",null),sa(this,"previousSibling",null),sa(this,"nextSibling",null),sa(this,"ELEMENT_NODE",1),sa(this,"TEXT_NODE",3),sa(this,"nodeType"),sa(this,"nodeName"),sa(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 Gu))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 Zu={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Yu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},qu={};function Ku(e){if(qu[e])return qu[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 Zu?Zu[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 Yu?Yu[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 qu[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?qu[e]=i:r}catch{return r}}const Ju={};function $u(e,t,r){var n;const s=`${e}.${String(r)}`;if(Ju[s])return Ju[s].call(t);const i=Ku(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(Ju[s]=o,o.call(t)):t[r]}const Xu={};function Hu(e,t,r){const n=`${e}.${String(r)}`;if(Xu[n])return Xu[n].bind(t);const s=Ku(e)[r];return"function"!=typeof s?t[r]:(Xu[n]=s,s.bind(t))}const Qu=function(e){return $u("Node",e,"parentNode")},eh=function(e){return $u("Node",e,"parentElement")},th=function(e,t){return Hu("Node",e,"contains")(t)},rh=function(e){return Hu("Node",e,"getRootNode")()},nh=function(e){return e&&"host"in e?$u("ShadowRoot",e,"host"):null},sh=function(e){return e&&"shadowRoot"in e?$u("Element",e,"shadowRoot"):null},ih="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 oh={map:{},getId:()=>(console.error(ih),-1),getNode:()=>(console.error(ih),null),removeNodeFromMap(){console.error(ih)},has:()=>(console.error(ih),!1),reset(){console.error(ih)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(oh=new Proxy(oh,{get:(e,t,r)=>("map"===t&&console.error(ih),Reflect.get(e,t,r))}));let ah=Date.now;function lh(e){return e?e.nodeType===e.ELEMENT_NODE?e:eh(e):null}function ch(e){var t;let r=null;return"getRootNode"in e&&(null==(t=rh(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&nh(rh(e))&&(r=nh(rh(e))),r}function uh(e){let t,r=e;for(;t=ch(r);)r=t;return r}function hh(e){const t=e.ownerDocument;if(!t)return!1;const r=uh(e);return th(t,r)}/[1-9][0-9]{12}/.test(Date.now().toString())||(ah=()=>(new Date).getTime());const dh=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){nn(this,"id",1),nn(this,"styleIDMap",new WeakMap),nn(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 oh},closestElementOfNode:lh,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:uh,getShadowHost:ch,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=eh(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=eh(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 Gu&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(sh(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&&(th(t,e)||hh(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&fn(e)||null;return Boolean(t&&"shadowRoot"in t&&gn(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=Qu(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))},isBlocked:function(e,t,r,n){if(!e)return!1;const s=lh(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(mn(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 ah},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:hh,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 ph="undefined"==typeof Uint8Array?[]:new Uint8Array(256),fh=0;fh<64;fh++)ph["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(fh)]=fh;var gh,mh;"undefined"!=typeof window&&window.Blob&&new Blob([Uint8Array.from(atob("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo="),e=>e.charCodeAt(0))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Kr=e.contentWindow)?void 0:Kr.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}new class{constructor(){on(this,"idNodeMap",new Map),on(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}},(mh=gh||(gh={}))[mh.NotStarted=0]="NotStarted",mh[mh.Running=1]="Running",mh[mh.Stopped=2]="Stopped";class yh{constructor(e){tn(this,"fileName"),tn(this,"functionName"),tn(this,"lineNumber"),tn(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 vh=/(^|@)\S+:\d+/,wh=/^\s*at .*(\S+:\d+|\(native\))/m,bh=/^(eval@)?(\[native code])?$/,Sh={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(wh)?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(wh)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const r=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=r?t.replace(r[0],""):t;const n=t.split(/\s+/).slice(1),s=this.extractLocation(r?r[1]:n.pop()),i=n.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0];return new yh({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(bh)},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 yh({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new yh({functionName:n,fileName:s[0],lineNumber:s[1],columnNumber:s[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[];for(let e=2,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new yh({fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[];for(let e=0,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new yh({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(vh)&&!e.match(/^Error created at/)},this).map(function(e){const t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new yh({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Ch(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,s=[];if(n.children&&n.children.length>0)for(let e=0;e<n.children.length;e++){const t=n.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===r&&s.push(t)}s.length>1&&(r+=`:eq(${s.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function Ih(e){return"[object Object]"===Object.prototype.toString.call(e)}function xh(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Ih(e[n])&&xh(e[n],t-1))return!0;return!1}function kh(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!!(Ih(e)&&Object.keys(e).length>r.numOfKeysLimit)||("function"==typeof e||!(!Ih(e)||!xh(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]=Ch(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 Oh={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 Eh(e,t,r){const n=r?Object.assign({},Oh,r):Oh,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=Sh.parse(s).map(e=>e.toString()),o=[kh(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=[kh(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[kh("Uncaught (in promise)",n.stringifyOptions),kh(t.reason,n.stringifyOptions)]);const i=Sh.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]?dh.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=Sh.parse(new Error).map(e=>e.toString()).splice(1),i=("assert"===r?s.slice(1):s).map(e=>kh(e,n.stringifyOptions));o++,o<n.lengthThreshold?e({level:r,trace:t,payload:i}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[kh("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}const Ah="rrweb/console@1";var Rh,Mh=Object.freeze({__proto__:null,PLUGIN_NAME:Ah,getRecordConsolePlugin:e=>({name:Ah,observer:Eh,options:e})}),Ph=Object.defineProperty,Th=(e,t,r)=>((e,t,r)=>t in e?Ph(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Nh=Object.defineProperty,_h=(e,t,r)=>((e,t,r)=>t in e?Nh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Dh=(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))(Dh||{});const Lh={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Fh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Bh={};function Uh(e){if(Bh[e])return Bh[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in Lh?Lh[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 Fh?Fh[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 Bh[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?Bh[e]=i:r}catch{return r}}const jh={};function zh(e,t,r){var n;const s=`${e}.${String(r)}`;if(jh[s])return jh[s].call(t);const i=Uh(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(jh[s]=o,o.call(t)):t[r]}const Wh=function(e){return zh("Node",e,"childNodes")},Vh=function(e){return zh("Node",e,"parentNode")},Gh=function(e){return zh("Node",e,"parentElement")},Zh=function(e){return zh("Node",e,"textContent")},Yh=function(e){return e&&"host"in e?zh("ShadowRoot",e,"host"):null},qh=function(e){return e&&"shadowRoot"in e?zh("Element",e,"shadowRoot"):null};function Kh(e){return e.nodeType===e.ELEMENT_NODE}function Jh(e){const t=e&&"host"in e&&"mode"in e&&Yh(e)||null;return Boolean(t&&"shadowRoot"in t&&qh(t)===e)}function $h(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Xh(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=>Hh(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 Hh(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Xh(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?cd(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?cd(r,t):r}}class Qh{constructor(){_h(this,"idNodeMap",new Map),_h(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 ed({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:i}){let o=s||"";const a=n&&td(n);return(t[r.toLowerCase()]||a&&t[a])&&(o=i?i(o,e):"*".repeat(o.length)),o}function td(e){return e.toLowerCase()}const rd="__rrweb_original__";function nd(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?td(t):null}function sd(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 id=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,od=/^(?:[a-z+]+:)?\/\//i,ad=/^www\..*/i,ld=/^(data:)([^,]*),(.*)/i;function cd(e,t){return(e||"").replace(id,(e,r,n,s,i,o)=>{const a=n||i||o,l=r||s||"";if(!a)return e;if(od.test(a)||ad.test(a))return`url(${l}${a}${l})`;if(ld.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 ud(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}let hd=1;const dd=new RegExp("[^a-z0-9-_:]");function pd(){return hd++}let fd,gd;const md=/^[^ \t\n\r\u000c]+/,yd=/^[, \t\n\r\u000c]+/,vd=new WeakMap;function wd(e,t){return t&&""!==t.trim()?Sd(e,t):t}function bd(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Sd(e,t){let r=vd.get(e);if(r||(r=e.createElement("a"),vd.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Cd(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?wd(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(yd),!(r>=t.length);){let i=n(md);if(","===i.slice(-1))i=wd(e,i.substring(0,i.length-1)),s.push(i);else{let n="";i=wd(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?cd(n,Sd(e)):"object"===t&&"data"===r?wd(e,n):n:wd(e,n):n}function Id(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function xd(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&xd(Vh(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&xd(Vh(e),t,r)}function kd(e,t,r,n){let s;if(Kh(e)){if(s=e,!Wh(s).length)return!1}else{if(null===Gh(e))return!1;s=Gh(e)}try{if("string"==typeof t){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(xd(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 Od(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:h={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:g=!1,cssCaptured:m=!1,applyBackgroundColorToBlockedElements:y=!1}=t,v=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:Dh.Document,childNodes:[],compatMode:e.compatMode}:{type:Dh.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Dh.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:i,maskInputOptions:o={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:p,applyBackgroundColorToBlockedElements:f=!1}=t,g=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,s),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=td(e.tagName);return dd.test(t)?"div":t}(e);let y={};const v=e.attributes.length;for(let t=0;t<v;t++){const n=e.attributes[t];Id(m,n.name,n.value)||(y[n.name]=Cd(r,m,td(n.name),n.value))}if("link"===m&&i){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=Xh(t)),n&&(delete y.rel,delete y.href,y._cssText=n)}if("style"===m&&e.sheet){let t=Xh(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=ud(e,r);const o=t.length/e.length;for(let a=1;a<n.length;a++)if(n[a].textContent&&"string"==typeof n[a].textContent){const l=ud(n[a].textContent,r),c=100;let u=3;for(;u<l.length&&(l[u].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,u),1));u++);for(;u<l.length;u++){let h=l.substring(0,u),d=t.split(h),p=-1;if(2===d.length)p=d[0].length;else if(d.length>2&&""===d[0]&&""!==n[a-1].textContent)p=t.indexOf(h,1);else if(1===d.length){if(h=h.substring(0,h.length-1),d=t.split(h),d.length<=1)return s.push(e),s;u=c+1}else u===l.length-1&&(p=t.indexOf(h));if(d.length>=2&&u>c){const e=n[a-1].textContent;if(e&&"string"==typeof e){const r=ud(e).length;p=t.indexOf(h,r)}-1===p&&(p=d[0].length)}if(-1!==p){let a=Math.floor(p/o);for(;a>0&&a<e.length;){if(i+=1,i>50*n.length)return s.push(e),s;const l=ud(e.substring(0,a),r);if(l.length===p){s.push(e.substring(0,a)),e=e.substring(a),t=t.substring(p);break}l.length<p?a+=Math.max(1,Math.floor((p-l.length)/o)):a-=Math.max(1,Math.floor((l.length-p)*o))}break}}}}return s.push(e),s}(e,t).join("/* rr_split */")}(t,e)),y._cssText=t)}if("input"===m||"textarea"===m||"select"===m){const t=e.value,r=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=ed({element:e,type:nd(e),tagName:m,value:t,maskInputOptions:o,maskInputFn:a}):r&&(y.checked=r)}if("option"===m&&(e.selected&&!o.select?y.selected=!0:delete y.selected),"dialog"===m&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),"canvas"===m&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let n=0;n<e.height;n+=50){const s=t.getImageData,i=rd in s?s[rd]:s;if(new Uint32Array(i.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height,t!==n.toDataURL(l.type,l.quality)&&(y.rr_dataURL=t)}if("img"===m&&c){fd||(fd=r.createElement("canvas"),gd=fd.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{fd.width=t.naturalWidth,fd.height=t.naturalHeight,gd.drawImage(t,0,0),y.rr_dataURL=fd.toDataURL(l.type,l.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"===m||"video"===m){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(d||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),g){const{width:t,height:r}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${r}px`,...f?{rr_background_color:"lightgrey"}:{}}}let w;"iframe"!==m||h(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(w=!0)}catch(e){}return{type:Dh.Element,tagName:m,attributes:y,childNodes:[],isSVG:bd(e)||void 0,needBlock:g,rootId:p,isCustom:w}}(e,{doc:r,blockClass:s,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:g,rootId:v,applyBackgroundColorToBlockedElements:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:i}=t,o=Vh(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=Zh(e),c&&l&&(l=cd(l,Sd(t.doc)))),!c&&!u&&l&&r&&(l=n?n(l,Gh(e)):l.replace(/[\S]/g,"*")),{type:Dh.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:c,rootId:v,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:Dh.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:Dh.Comment,textContent:Zh(e)||"",rootId:v};default:return!1}}function Ed(e){return null==e?"":e.toLowerCase()}function Ad(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:I=!1,cssCaptured:x=!1,applyBackgroundColorToBlockedElements:k=!1}=t;let{needsMask:O}=t,{preserveWhiteSpace:E=!0}=t;O||(O=kd(e,o,a,void 0===O));const A=Od(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:O,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:x,applyBackgroundColorToBlockedElements:k});if(!A)return console.warn(e,"not serialized"),null;let R;R=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===Dh.Comment)return!0;if(e.type===Dh.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"===sd(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ed(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ed(e.attributes.name)||"icon"===Ed(e.attributes.rel)||"apple-touch-icon"===Ed(e.attributes.rel)||"shortcut icon"===Ed(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ed(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ed(e.attributes.property).match(/^(og|twitter|fb):/)||Ed(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ed(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Ed(e.attributes.name)||"googlebot"===Ed(e.attributes.name)||"bingbot"===Ed(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Ed(e.attributes.name)||"generator"===Ed(e.attributes.name)||"framework"===Ed(e.attributes.name)||"publisher"===Ed(e.attributes.name)||"progid"===Ed(e.attributes.name)||Ed(e.attributes.property).match(/^article:/)||Ed(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Ed(e.attributes.name)||"yandex-verification"===Ed(e.attributes.name)||"csrf-token"===Ed(e.attributes.name)||"p:domain_verify"===Ed(e.attributes.name)||"verify-v1"===Ed(e.attributes.name)||"verification"===Ed(e.attributes.name)||"shopify-checkout-api-token"===Ed(e.attributes.name)))return!0}}return!1}(A,p)||!E&&A.type===Dh.Text&&!A.textContent.replace(/^\s+|\s+$/gm,"").length?-2:pd();const M=Object.assign(A,{id:R});if(n.add(e,M),-2===R)return null;y&&y(e);let P=!l;if(M.type===Dh.Element){P=P&&!M.needBlock,delete M.needBlock;const t=qh(e);t&&$h(t)&&(M.isShadowHost=!0)}if((M.type===Dh.Document||M.type===Dh.Element)&&P){p.headWhitespace&&M.type===Dh.Element&&"head"===M.tagName&&(E=!1);const t={doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:O,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1,applyBackgroundColorToBlockedElements:k};if(M.type===Dh.Element&&"textarea"===M.tagName&&void 0!==M.attributes.value);else{M.type===Dh.Element&&void 0!==M.attributes._cssText&&"string"==typeof M.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(Wh(e))){const e=Ad(r,t);e&&M.childNodes.push(e)}}let I=null;if(Kh(e)&&(I=qh(e)))for(const e of Array.from(Wh(I))){const r=Ad(e,t);r&&($h(I)&&(r.isShadow=!0),M.childNodes.push(r))}}const T=Vh(e);return T&&Jh(T)&&$h(T)&&(M.isShadow=!0),M.type===Dh.Element&&"iframe"===M.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&&v){const r=Ad(t,{doc:t,mirror:n,blockClass:s,blockSelector:i,needsMask:O,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});r&&v(e,r)}},w),M.type===Dh.Element&&"link"===M.tagName&&"string"==typeof M.attributes.rel&&("stylesheet"===M.attributes.rel||"preload"===M.attributes.rel&&"string"==typeof M.attributes.href&&"css"===sd(M.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(b){const t=Ad(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:O,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&b(e,t)}},S),M}var Rd={exports:{}},Md=String,Pd=function(){return{isColorSupported:!1,reset:Md,bold:Md,dim:Md,italic:Md,underline:Md,inverse:Md,hidden:Md,strikethrough:Md,black:Md,red:Md,green:Md,yellow:Md,blue:Md,magenta:Md,cyan:Md,white:Md,gray:Md,bgBlack:Md,bgRed:Md,bgGreen:Md,bgYellow:Md,bgBlue:Md,bgMagenta:Md,bgCyan:Md,bgWhite:Md}};Rd.exports=Pd(),Rd.exports.createColors=Pd;var Td=Rd.exports;const Nd=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let _d=Td,Dd=Nd,Ld=class e extends Error{constructor(t,r,n,s,i,o){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=_d.isColorSupported),Dd&&e&&(t=Dd(t));let r,n,s=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,s.length),a=String(o).length;if(e){let{bold:e,gray:t,red:s}=_d.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(i,o).map((e,t)=>{let s=i+1+t,o=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(o)+e+"\n "+t+r("^")}return" "+n(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Fd=Ld;Ld.default=Ld;var Bd={};Bd.isClean=Symbol("isClean"),Bd.my=Symbol("my");const Ud={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let jd=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return Ud[r];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[r])return i.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((o=r)[0].toUpperCase()+o.slice(1));this[s]?n=this[s](i,e):i.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var o;return void 0===n&&(n=Ud[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var zd=jd;jd.default=jd;let Wd=zd;function Vd(e,t){new Wd(t).stringify(e)}var Gd=Vd;Vd.default=Vd;let{isClean:Zd,my:Yd}=Bd,qd=Fd,Kd=zd,Jd=Gd;function $d(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>$d(e,r)):("object"===i&&null!==s&&(s=$d(s)),r[n]=s)}return r}let Xd=class{constructor(e={}){this.raws={},this[Zd]=!1,this[Yd]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$d(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 qd(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[Zd]){this[Zd]=!1;let e=this;for(;e=e.parent;)e[Zd]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Kd).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Jd){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var Hd=Xd;Xd.default=Xd;let Qd=Hd,ep=class extends Qd{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var tp=ep;ep.default=ep;var rp={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}};let{SourceMapConsumer:np,SourceMapGenerator:sp}=Nd,{existsSync:ip,readFileSync:op}=Nd,{dirname:ap,join:lp}=Nd,cp=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=ap(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new np(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=ap(e),ip(e))return this.mapFile=e,op(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof np)return sp.fromSourceMap(t).toString();if(t instanceof sp)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=lp(ap(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var up=cp;cp.default=cp;let{SourceMapConsumer:hp,SourceMapGenerator:dp}=Nd,{fileURLToPath:pp,pathToFileURL:fp}=Nd,{isAbsolute:gp,resolve:mp}=Nd,{nanoid:yp}=rp,vp=Nd,wp=Fd,bp=up,Sp=Symbol("fromOffsetCache"),Cp=Boolean(hp&&dp),Ip=Boolean(mp&&gp),xp=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Ip||/^\w+:\/\//.test(t.from)||gp(t.from)?this.file=t.from:this.file=mp(t.from)),Ip&&Cp){let e=new bp(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+yp(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;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);i=e.line,o=e.col}else i=n.line,o=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return s=a?new wp(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new wp(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(fp&&(s.input.url=fp(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Sp])r=this[Sp];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[Sp]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:mp(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,i,o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=o.originalPositionFor({column:n,line:r})),i=gp(a.source)?fp(a.source):new URL(a.source,this.map.consumer().sourceRoot||fp(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:i.toString()};if("file:"===i.protocol){if(!pp)throw new Error("file: protocol is not available in this PostCSS build");l.file=pp(i)}let c=o.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var kp=xp;xp.default=xp,vp&&vp.registerInput&&vp.registerInput(xp);let{SourceMapConsumer:Op,SourceMapGenerator:Ep}=Nd,{dirname:Ap,relative:Rp,resolve:Mp,sep:Pp}=Nd,{pathToFileURL:Tp}=Nd,Np=kp,_p=Boolean(Op&&Ep),Dp=Boolean(Ap&&Mp&&Rp&&Pp);var Lp=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||Ap(e.file);!1===this.mapOpts.sourcesContent?(t=new Op(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Dp&&_p&&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=Ep.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Ep({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Ep({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=o.match(/\n/g),e?(r+=e.length,t=o.lastIndexOf("\n"),n=o.length-t):n+=o.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Ap(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Ap(Mp(r,this.mapOpts.annotation)));let n=Rp(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Np(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Tp){let t=Tp(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;"\\"===Pp&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Fp=Hd,Bp=class extends Fp{constructor(e){super(e),this.type="comment"}};var Up=Bp;Bp.default=Bp;let jp,zp,Wp,Vp,{isClean:Gp,my:Zp}=Bd,Yp=tp,qp=Up,Kp=Hd;function Jp(e){return e.map(e=>(e.nodes&&(e.nodes=Jp(e.nodes)),delete e.source,e))}function $p(e){if(e[Gp]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)$p(t)}let Xp=class e extends Kp{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Jp(jp(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Yp(t)]}else if(t.selector)t=[new zp(t)];else if(t.name)t=[new Wp(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new qp(t)]}return t.map(t=>(t[Zp]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Gp]&&$p(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Xp.registerParse=e=>{jp=e},Xp.registerRule=e=>{zp=e},Xp.registerAtRule=e=>{Wp=e},Xp.registerRoot=e=>{Vp=e};var Hp=Xp;Xp.default=Xp,Xp.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Wp.prototype):"rule"===e.type?Object.setPrototypeOf(e,zp.prototype):"decl"===e.type?Object.setPrototypeOf(e,Yp.prototype):"comment"===e.type?Object.setPrototypeOf(e,qp.prototype):"root"===e.type&&Object.setPrototypeOf(e,Vp.prototype),e[Zp]=!0,e.nodes&&e.nodes.forEach(e=>{Xp.rebuild(e)})};let Qp,ef,tf=Hp,rf=class extends tf{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Qp(new ef,this,e).stringify()}};rf.registerLazyResult=e=>{Qp=e},rf.registerProcessor=e=>{ef=e};var nf=rf;rf.default=rf;let sf={};var of=function(e){sf[e]||(sf[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let af=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var lf=af;af.default=af;let cf=lf,uf=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new cf(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var hf=uf;uf.default=uf;const df="'".charCodeAt(0),pf='"'.charCodeAt(0),ff="\\".charCodeAt(0),gf="/".charCodeAt(0),mf="\n".charCodeAt(0),yf=" ".charCodeAt(0),vf="\f".charCodeAt(0),wf="\t".charCodeAt(0),bf="\r".charCodeAt(0),Sf="[".charCodeAt(0),Cf="]".charCodeAt(0),If="(".charCodeAt(0),xf=")".charCodeAt(0),kf="{".charCodeAt(0),Of="}".charCodeAt(0),Ef=";".charCodeAt(0),Af="*".charCodeAt(0),Rf=":".charCodeAt(0),Mf="@".charCodeAt(0),Pf=/[\t\n\f\r "#'()/;[\\\]{}]/g,Tf=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Nf=/.[\r\n"'(/\\]/,_f=/[\da-f]/i;let Df=Hp,Lf=class extends Df{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Ff=Lf;Lf.default=Lf,Df.registerAtRule(Lf);let Bf,Uf,jf=Hp,zf=class extends jf{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Bf(new Uf,this,e).stringify()}};zf.registerLazyResult=e=>{Bf=e},zf.registerProcessor=e=>{Uf=e};var Wf=zf;zf.default=zf,jf.registerRoot(zf);let Vf={comma:e=>Vf.split(e,[","],!0),space:e=>Vf.split(e,[" ","\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}};var Gf=Vf;Vf.default=Vf;let Zf=Hp,Yf=Gf,qf=class extends Zf{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Yf.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Kf=qf;qf.default=qf,Zf.registerRule(qf);let Jf=tp,$f=Up,Xf=Ff,Hf=Wf,Qf=Kf;const eg={empty:!0,space:!0};let tg=Hp,rg=class{constructor(e){this.input=e,this.root=new Hf,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Xf;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),i&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),o&&(s.nodes=[],this.current=s)}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 $f;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=function(e,t={}){let r,n,s,i,o,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],y=[];function v(t){throw e.error("Unclosed "+t,g)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&g>=f},nextToken:function(e){if(y.length)return y.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case mf:case yf:case wf:case bf:case vf:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===yf||r===mf||r===wf||r===bf||r===vf);h=["space",d.slice(g,n)],g=n-1;break;case Sf:case Cf:case kf:case Of:case Rf:case Ef:case xf:{let e=String.fromCharCode(r);h=[e,e,g];break}case If:if(c=m.length?m.pop()[1]:"",u=d.charCodeAt(g+1),"url"===c&&u!==df&&u!==pf&&u!==yf&&u!==mf&&u!==wf&&u!==vf&&u!==bf){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===ff;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),i=d.slice(g,n+1),-1===n||Nf.test(i)?h=["(","(",g]:(h=["brackets",i,g,n],g=n);break;case df:case pf:s=r===df?"'":'"',n=g;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=g+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===ff;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case Mf:Pf.lastIndex=g+1,Pf.test(d),n=0===Pf.lastIndex?d.length-1:Pf.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case ff:for(n=g,o=!0;d.charCodeAt(n+1)===ff;)n+=1,o=!o;if(r=d.charCodeAt(n+1),o&&r!==gf&&r!==yf&&r!==mf&&r!==wf&&r!==bf&&r!==vf&&(n+=1,_f.test(d.charAt(n)))){for(;_f.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===yf&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===gf&&d.charCodeAt(g+1)===Af?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(Tf.lastIndex=g+1,Tf.test(d),n=0===Tf.lastIndex?d.length-1:Tf.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}}(this.input)}decl(e,t){let r=new Jf;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,o=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=o.map(e=>e[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Qf;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,o,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],i=s[0],"space"!==i||e!==l-1||n?"comment"===i?(a=r[e-1]?r[e-1][0]:"empty",o=r[e+1]?r[e+1][0]:"empty",eg[a]||eg[o]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new Qf;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},ng=kp;function sg(e,t){let r=new ng(e,t),n=new rg(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var ig=sg;sg.default=sg,tg.registerParse(sg);let{isClean:og,my:ag}=Bd,lg=Lp,cg=Gd,ug=Hp,hg=nf,dg=of,pg=hf,fg=ig,gg=Wf;const mg={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},yg={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},vg={Once:!0,postcssPlugin:!0,prepare:!0};function wg(e){return"object"==typeof e&&"function"==typeof e.then}function bg(e){let t=!1,r=mg[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function Sg(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:bg(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Cg(e){return e[og]=!1,e.nodes&&e.nodes.forEach(e=>Cg(e)),e}let Ig={},xg=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof pg)s=Cg(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=fg;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[ag]&&ug.rebuild(s)}else s=Cg(r);this.result=new pg(t,s,n),this.helpers={...Ig,postcss:Ig,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(!yg[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!vg[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(wg(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[og];){e[og]=!0;let t=[Sg(e)];for(;t.length>0;){let e=this.visitTick(t);if(wg(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return wg(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=cg;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new lg(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(wg(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[og];)e[og]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||dg("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(wg(s))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[s,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=s;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[og])return n[og]=!0,void e.push(Sg(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[og]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[og]=!0;let t=bg(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[og]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};xg.registerPostcss=e=>{Ig=e};var kg=xg;xg.default=xg,gg.registerLazyResult(xg),hg.registerLazyResult(xg);let Og=Lp,Eg=Gd,Ag=of,Rg=ig;const Mg=hf;let Pg=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=Eg;this.result=new Mg(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let o=new Og(s,n,this._opts,t);if(o.isMap()){let[e,t]=o.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else o.clearAnnotation(),this.result.css=o.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||Ag("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=Rg;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Tg=Pg;Pg.default=Pg;let Ng=Tg,_g=kg,Dg=nf,Lg=Wf,Fg=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new _g(this,e,t):new Ng(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Bg=Fg;Fg.default=Fg,Lg.registerProcessor(Fg),Dg.registerProcessor(Fg);let Ug=tp,jg=up,zg=Up,Wg=Ff,Vg=kp,Gg=Wf,Zg=Kf;function Yg(e,t){if(Array.isArray(e))return e.map(e=>Yg(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Vg.prototype};r.map&&(r.map={...r.map,__proto__:jg.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Yg(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Gg(n);if("decl"===n.type)return new Ug(n);if("rule"===n.type)return new Zg(n);if("comment"===n.type)return new zg(n);if("atrule"===n.type)return new Wg(n);throw new Error("Unknown node type: "+e.type)}var qg=Yg;Yg.default=Yg;let Kg=Fd,Jg=tp,$g=kg,Xg=Hp,Hg=Bg,Qg=Gd,em=qg,tm=nf,rm=lf,nm=Up,sm=Ff,im=hf,om=kp,am=ig,lm=Gf,cm=Kf,um=Wf,hm=Hd;function dm(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Hg(e)}dm.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new Hg).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return dm([s(r)]).process(e,t)},s},dm.stringify=Qg,dm.parse=am,dm.fromJSON=em,dm.list=lm,dm.comment=e=>new nm(e),dm.atRule=e=>new sm(e),dm.decl=e=>new Jg(e),dm.rule=e=>new cm(e),dm.root=e=>new um(e),dm.document=e=>new tm(e),dm.CssSyntaxError=Kg,dm.Declaration=Jg,dm.Container=Xg,dm.Processor=Hg,dm.Document=tm,dm.Comment=nm,dm.Warning=rm,dm.AtRule=sm,dm.Result=im,dm.Input=om,dm.Rule=cm,dm.Root=um,dm.Node=hm,$g.registerPostcss(dm);var pm=dm;dm.default=dm;const fm=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(pm);fm.stringify,fm.fromJSON,fm.plugin,fm.parse,fm.list,fm.document,fm.comment,fm.atRule,fm.rule,fm.decl,fm.root,fm.CssSyntaxError,fm.Declaration,fm.Container,fm.Processor,fm.Document,fm.Comment,fm.Warning,fm.AtRule,fm.Result,fm.Input,fm.Rule,fm.Root,fm.Node;var gm=Object.defineProperty,mm=(e,t,r)=>((e,t,r)=>t in e?gm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);var ym={exports:{}},vm=String,wm=function(){return{isColorSupported:!1,reset:vm,bold:vm,dim:vm,italic:vm,underline:vm,inverse:vm,hidden:vm,strikethrough:vm,black:vm,red:vm,green:vm,yellow:vm,blue:vm,magenta:vm,cyan:vm,white:vm,gray:vm,bgBlack:vm,bgRed:vm,bgGreen:vm,bgYellow:vm,bgBlue:vm,bgMagenta:vm,bgCyan:vm,bgWhite:vm}};ym.exports=wm(),ym.exports.createColors=wm;var bm=ym.exports;const Sm=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Cm=bm,Im=Sm,xm=class e extends Error{constructor(t,r,n,s,i,o){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Cm.isColorSupported),Im&&e&&(t=Im(t));let r,n,s=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,s.length),a=String(o).length;if(e){let{bold:e,gray:t,red:s}=Cm.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(i,o).map((e,t)=>{let s=i+1+t,o=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(o)+e+"\n "+t+r("^")}return" "+n(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var km=xm;xm.default=xm;var Om={};Om.isClean=Symbol("isClean"),Om.my=Symbol("my");const Em={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Am=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return Em[r];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[r])return i.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((o=r)[0].toUpperCase()+o.slice(1));this[s]?n=this[s](i,e):i.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var o;return void 0===n&&(n=Em[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Rm=Am;Am.default=Am;let Mm=Rm;function Pm(e,t){new Mm(t).stringify(e)}var Tm=Pm;Pm.default=Pm;let{isClean:Nm,my:_m}=Om,Dm=km,Lm=Rm,Fm=Tm;function Bm(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>Bm(e,r)):("object"===i&&null!==s&&(s=Bm(s)),r[n]=s)}return r}let Um=class{constructor(e={}){this.raws={},this[Nm]=!1,this[_m]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Bm(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 Dm(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[Nm]){this[Nm]=!1;let e=this;for(;e=e.parent;)e[Nm]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Lm).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Fm){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var jm=Um;Um.default=Um;let zm=jm,Wm=class extends zm{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Vm=Wm;Wm.default=Wm;var Gm={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}};let{SourceMapConsumer:Zm,SourceMapGenerator:Ym}=Sm,{existsSync:qm,readFileSync:Km}=Sm,{dirname:Jm,join:$m}=Sm,Xm=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Jm(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Zm(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=Jm(e),qm(e))return this.mapFile=e,Km(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Zm)return Ym.fromSourceMap(t).toString();if(t instanceof Ym)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=$m(Jm(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Hm=Xm;Xm.default=Xm;let{SourceMapConsumer:Qm,SourceMapGenerator:ey}=Sm,{fileURLToPath:ty,pathToFileURL:ry}=Sm,{isAbsolute:ny,resolve:sy}=Sm,{nanoid:iy}=Gm,oy=Sm,ay=km,ly=Hm,cy=Symbol("fromOffsetCache"),uy=Boolean(Qm&&ey),hy=Boolean(sy&&ny),dy=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!hy||/^\w+:\/\//.test(t.from)||ny(t.from)?this.file=t.from:this.file=sy(t.from)),hy&&uy){let e=new ly(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+iy(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;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);i=e.line,o=e.col}else i=n.line,o=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return s=a?new ay(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new ay(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(ry&&(s.input.url=ry(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[cy])r=this[cy];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[cy]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:sy(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,i,o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=o.originalPositionFor({column:n,line:r})),i=ny(a.source)?ry(a.source):new URL(a.source,this.map.consumer().sourceRoot||ry(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:i.toString()};if("file:"===i.protocol){if(!ty)throw new Error("file: protocol is not available in this PostCSS build");l.file=ty(i)}let c=o.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var py=dy;dy.default=dy,oy&&oy.registerInput&&oy.registerInput(dy);let{SourceMapConsumer:fy,SourceMapGenerator:gy}=Sm,{dirname:my,relative:yy,resolve:vy,sep:wy}=Sm,{pathToFileURL:by}=Sm,Sy=py,Cy=Boolean(fy&&gy),Iy=Boolean(my&&vy&&yy&&wy);var xy=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||my(e.file);!1===this.mapOpts.sourcesContent?(t=new fy(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Iy&&Cy&&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=gy.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new gy({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new gy({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=o.match(/\n/g),e?(r+=e.length,t=o.lastIndexOf("\n"),n=o.length-t):n+=o.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?my(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=my(vy(r,this.mapOpts.annotation)));let n=yy(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Sy(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(by){let t=by(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;"\\"===wy&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let ky=jm,Oy=class extends ky{constructor(e){super(e),this.type="comment"}};var Ey=Oy;Oy.default=Oy;let Ay,Ry,My,Py,{isClean:Ty,my:Ny}=Om,_y=Vm,Dy=Ey,Ly=jm;function Fy(e){return e.map(e=>(e.nodes&&(e.nodes=Fy(e.nodes)),delete e.source,e))}function By(e){if(e[Ty]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)By(t)}let Uy=class e extends Ly{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Fy(Ay(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new _y(t)]}else if(t.selector)t=[new Ry(t)];else if(t.name)t=[new My(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Dy(t)]}return t.map(t=>(t[Ny]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Ty]&&By(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Uy.registerParse=e=>{Ay=e},Uy.registerRule=e=>{Ry=e},Uy.registerAtRule=e=>{My=e},Uy.registerRoot=e=>{Py=e};var jy=Uy;Uy.default=Uy,Uy.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,My.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ry.prototype):"decl"===e.type?Object.setPrototypeOf(e,_y.prototype):"comment"===e.type?Object.setPrototypeOf(e,Dy.prototype):"root"===e.type&&Object.setPrototypeOf(e,Py.prototype),e[Ny]=!0,e.nodes&&e.nodes.forEach(e=>{Uy.rebuild(e)})};let zy,Wy,Vy=jy,Gy=class extends Vy{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new zy(new Wy,this,e).stringify()}};Gy.registerLazyResult=e=>{zy=e},Gy.registerProcessor=e=>{Wy=e};var Zy=Gy;Gy.default=Gy;let Yy={};var qy=function(e){Yy[e]||(Yy[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Ky=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Jy=Ky;Ky.default=Ky;let $y=Jy,Xy=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new $y(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Hy=Xy;Xy.default=Xy;const Qy="'".charCodeAt(0),ev='"'.charCodeAt(0),tv="\\".charCodeAt(0),rv="/".charCodeAt(0),nv="\n".charCodeAt(0),sv=" ".charCodeAt(0),iv="\f".charCodeAt(0),ov="\t".charCodeAt(0),av="\r".charCodeAt(0),lv="[".charCodeAt(0),cv="]".charCodeAt(0),uv="(".charCodeAt(0),hv=")".charCodeAt(0),dv="{".charCodeAt(0),pv="}".charCodeAt(0),fv=";".charCodeAt(0),gv="*".charCodeAt(0),mv=":".charCodeAt(0),yv="@".charCodeAt(0),vv=/[\t\n\f\r "#'()/;[\\\]{}]/g,wv=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,bv=/.[\r\n"'(/\\]/,Sv=/[\da-f]/i;let Cv=jy,Iv=class extends Cv{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var xv=Iv;Iv.default=Iv,Cv.registerAtRule(Iv);let kv,Ov,Ev=jy,Av=class extends Ev{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new kv(new Ov,this,e).stringify()}};Av.registerLazyResult=e=>{kv=e},Av.registerProcessor=e=>{Ov=e};var Rv=Av;Av.default=Av,Ev.registerRoot(Av);let Mv={comma:e=>Mv.split(e,[","],!0),space:e=>Mv.split(e,[" ","\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}};var Pv=Mv;Mv.default=Mv;let Tv=jy,Nv=Pv,_v=class extends Tv{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Nv.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Dv=_v;_v.default=_v,Tv.registerRule(_v);let Lv=Vm,Fv=Ey,Bv=xv,Uv=Rv,jv=Dv;const zv={empty:!0,space:!0};let Wv=jy,Vv=class{constructor(e){this.input=e,this.root=new Uv,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Bv;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),i&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),o&&(s.nodes=[],this.current=s)}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 Fv;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=function(e,t={}){let r,n,s,i,o,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],y=[];function v(t){throw e.error("Unclosed "+t,g)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&g>=f},nextToken:function(e){if(y.length)return y.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case nv:case sv:case ov:case av:case iv:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===sv||r===nv||r===ov||r===av||r===iv);h=["space",d.slice(g,n)],g=n-1;break;case lv:case cv:case dv:case pv:case mv:case fv:case hv:{let e=String.fromCharCode(r);h=[e,e,g];break}case uv:if(c=m.length?m.pop()[1]:"",u=d.charCodeAt(g+1),"url"===c&&u!==Qy&&u!==ev&&u!==sv&&u!==nv&&u!==ov&&u!==iv&&u!==av){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===tv;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),i=d.slice(g,n+1),-1===n||bv.test(i)?h=["(","(",g]:(h=["brackets",i,g,n],g=n);break;case Qy:case ev:s=r===Qy?"'":'"',n=g;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=g+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===tv;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case yv:vv.lastIndex=g+1,vv.test(d),n=0===vv.lastIndex?d.length-1:vv.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case tv:for(n=g,o=!0;d.charCodeAt(n+1)===tv;)n+=1,o=!o;if(r=d.charCodeAt(n+1),o&&r!==rv&&r!==sv&&r!==nv&&r!==ov&&r!==av&&r!==iv&&(n+=1,Sv.test(d.charAt(n)))){for(;Sv.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===sv&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===rv&&d.charCodeAt(g+1)===gv?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(wv.lastIndex=g+1,wv.test(d),n=0===wv.lastIndex?d.length-1:wv.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}}(this.input)}decl(e,t){let r=new Lv;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,o=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=o.map(e=>e[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new jv;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,o,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],i=s[0],"space"!==i||e!==l-1||n?"comment"===i?(a=r[e-1]?r[e-1][0]:"empty",o=r[e+1]?r[e+1][0]:"empty",zv[a]||zv[o]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new jv;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Gv=py;function Zv(e,t){let r=new Gv(e,t),n=new Vv(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var Yv=Zv;Zv.default=Zv,Wv.registerParse(Zv);let{isClean:qv,my:Kv}=Om,Jv=xy,$v=Tm,Xv=jy,Hv=Zy,Qv=qy,ew=Hy,tw=Yv,rw=Rv;const nw={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},sw={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},iw={Once:!0,postcssPlugin:!0,prepare:!0};function ow(e){return"object"==typeof e&&"function"==typeof e.then}function aw(e){let t=!1,r=nw[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function lw(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:aw(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function cw(e){return e[qv]=!1,e.nodes&&e.nodes.forEach(e=>cw(e)),e}let uw={},hw=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof ew)s=cw(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=tw;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[Kv]&&Xv.rebuild(s)}else s=cw(r);this.result=new ew(t,s,n),this.helpers={...uw,postcss:uw,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(!sw[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!iw[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(ow(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qv];){e[qv]=!0;let t=[lw(e)];for(;t.length>0;){let e=this.visitTick(t);if(ow(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return ow(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=$v;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Jv(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(ow(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qv];)e[qv]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Qv("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(ow(s))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[s,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=s;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[qv])return n[qv]=!0,void e.push(lw(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[qv]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[qv]=!0;let t=aw(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[qv]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};hw.registerPostcss=e=>{uw=e};var dw=hw;hw.default=hw,rw.registerLazyResult(hw),Hv.registerLazyResult(hw);let pw=xy,fw=Tm,gw=qy,mw=Yv;const yw=Hy;let vw=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=fw;this.result=new yw(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let o=new pw(s,n,this._opts,t);if(o.isMap()){let[e,t]=o.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else o.clearAnnotation(),this.result.css=o.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||gw("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=mw;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var ww=vw;vw.default=vw;let bw=ww,Sw=dw,Cw=Zy,Iw=Rv,xw=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Sw(this,e,t):new bw(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var kw=xw;xw.default=xw,Iw.registerProcessor(xw),Cw.registerProcessor(xw);let Ow=Vm,Ew=Hm,Aw=Ey,Rw=xv,Mw=py,Pw=Rv,Tw=Dv;function Nw(e,t){if(Array.isArray(e))return e.map(e=>Nw(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Mw.prototype};r.map&&(r.map={...r.map,__proto__:Ew.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Nw(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Pw(n);if("decl"===n.type)return new Ow(n);if("rule"===n.type)return new Tw(n);if("comment"===n.type)return new Aw(n);if("atrule"===n.type)return new Rw(n);throw new Error("Unknown node type: "+e.type)}var _w=Nw;Nw.default=Nw;let Dw=km,Lw=Vm,Fw=dw,Bw=jy,Uw=kw,jw=Tm,zw=_w,Ww=Zy,Vw=Jy,Gw=Ey,Zw=xv,Yw=Hy,qw=py,Kw=Yv,Jw=Pv,$w=Dv,Xw=Rv,Hw=jm;function Qw(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Uw(e)}Qw.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new Uw).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return Qw([s(r)]).process(e,t)},s},Qw.stringify=jw,Qw.parse=Kw,Qw.fromJSON=zw,Qw.list=Jw,Qw.comment=e=>new Gw(e),Qw.atRule=e=>new Zw(e),Qw.decl=e=>new Lw(e),Qw.rule=e=>new $w(e),Qw.root=e=>new Xw(e),Qw.document=e=>new Ww(e),Qw.CssSyntaxError=Dw,Qw.Declaration=Lw,Qw.Container=Bw,Qw.Processor=Uw,Qw.Document=Ww,Qw.Comment=Gw,Qw.Warning=Vw,Qw.AtRule=Zw,Qw.Result=Yw,Qw.Input=qw,Qw.Rule=$w,Qw.Root=Xw,Qw.Node=Hw,Fw.registerPostcss(Qw);var eb=Qw;Qw.default=Qw;const tb=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(eb);tb.stringify,tb.fromJSON,tb.plugin,tb.parse,tb.list,tb.document,tb.comment,tb.atRule,tb.rule,tb.decl,tb.root,tb.CssSyntaxError,tb.Declaration,tb.Container,tb.Processor,tb.Document,tb.Comment,tb.Warning,tb.AtRule,tb.Result,tb.Input,tb.Rule,tb.Root,tb.Node;class rb{constructor(...e){mm(this,"parentElement",null),mm(this,"parentNode",null),mm(this,"ownerDocument"),mm(this,"firstChild",null),mm(this,"lastChild",null),mm(this,"previousSibling",null),mm(this,"nextSibling",null),mm(this,"ELEMENT_NODE",1),mm(this,"TEXT_NODE",3),mm(this,"nodeType"),mm(this,"nodeName"),mm(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 rb))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 nb={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},sb={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ib={};function ob(e){if(ib[e])return ib[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 nb?nb[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 sb?sb[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 ib[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?ib[e]=i:r}catch{return r}}const ab={};function lb(e,t,r){var n;const s=`${e}.${String(r)}`;if(ab[s])return ab[s].call(t);const i=ob(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(ab[s]=o,o.call(t)):t[r]}const cb={};function ub(e,t,r){const n=`${e}.${String(r)}`;if(cb[n])return cb[n].bind(t);const s=ob(e)[r];return"function"!=typeof s?t[r]:(cb[n]=s,s.bind(t))}function hb(){return ob("MutationObserver").constructor}const db=function(e){return lb("Node",e,"childNodes")},pb=function(e){return lb("Node",e,"parentNode")},fb=function(e){return lb("Node",e,"parentElement")},gb=function(e){return lb("Node",e,"textContent")},mb=function(e,t){return ub("Node",e,"contains")(t)},yb=function(e){return ub("Node",e,"getRootNode")()},vb=function(e){return e&&"host"in e?lb("ShadowRoot",e,"host"):null},wb=function(e){return e&&"shadowRoot"in e?lb("Element",e,"shadowRoot"):null};function bb(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Sb="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 Cb={map:{},getId:()=>(console.error(Sb),-1),getNode:()=>(console.error(Sb),null),removeNodeFromMap(){console.error(Sb)},has:()=>(console.error(Sb),!1),reset(){console.error(Sb)}};function Ib(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 xb(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)}}),()=>xb(e,t,i||{},!0)}function kb(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&&(Cb=new Proxy(Cb,{get:(e,t,r)=>("map"===t&&console.error(Sb),Reflect.get(e,t,r))}));let Ob=Date.now;function Eb(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=fb(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=fb(i.body))?void 0:n.scrollTop)||(null==(s=null==i?void 0:i.body)?void 0:s.scrollTop)||0}}function Ab(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Rb(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Mb(e){return e?e.nodeType===e.ELEMENT_NODE?e:fb(e):null}function Pb(e,t,r,n){if(!e)return!1;const s=Mb(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(xd(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 Tb(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function Nb(e,t){if(Jh(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=pb(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Nb(n,t))}function _b(e){return Boolean(e.changedTouches)}function Db(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Lb(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Fb(e){return!!e&&(e instanceof rb&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(wb(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ob=()=>(new Date).getTime());class Bb{constructor(){Th(this,"id",1),Th(this,"styleIDMap",new WeakMap),Th(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 Ub(e){var t;let r=null;return"getRootNode"in e&&(null==(t=yb(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vb(yb(e))&&(r=vb(yb(e))),r}function jb(e){const t=e.ownerDocument;return!!t&&(mb(t,e)||function(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=Ub(r);)r=t;return r}(e);return mb(t,r)}(e))}var zb=(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))(zb||{}),Wb=(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))(Wb||{}),Vb=(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))(Vb||{}),Gb=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Gb||{}),Zb=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Zb||{}),Yb=(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))(Yb||{}),qb=(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))(qb||{});function Kb(e){return"__ln"in e}class Jb{constructor(){Th(this,"length",0),Th(this,"head",null),Th(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Kb(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Kb(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const $b=(e,t)=>`${e}@${t}`;class Xb{constructor(){Th(this,"frozen",!1),Th(this,"locked",!1),Th(this,"texts",[]),Th(this,"attributes",[]),Th(this,"attributeMap",new WeakMap),Th(this,"removes",[]),Th(this,"mapRemoves",[]),Th(this,"movedMap",{}),Th(this,"addedSet",new Set),Th(this,"movedSet",new Set),Th(this,"droppedSet",new Set),Th(this,"removesSubTreeCache",new Set),Th(this,"mutationCb"),Th(this,"blockClass"),Th(this,"blockSelector"),Th(this,"maskTextClass"),Th(this,"maskTextSelector"),Th(this,"inlineStylesheet"),Th(this,"maskInputOptions"),Th(this,"maskTextFn"),Th(this,"maskInputFn"),Th(this,"keepIframeSrcFn"),Th(this,"recordCanvas"),Th(this,"inlineImages"),Th(this,"slimDOMOptions"),Th(this,"dataURLOptions"),Th(this,"doc"),Th(this,"mirror"),Th(this,"iframeManager"),Th(this,"stylesheetManager"),Th(this,"shadowDomManager"),Th(this,"canvasManager"),Th(this,"processedNodeManager"),Th(this,"unattachedDoc"),Th(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Th(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Jb,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=pb(s);if(!i||!jb(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=Jh(i)?this.mirror.getId(Ub(s)):this.mirror.getId(i),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=Ad(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=>{Db(e,this.mirror)&&this.iframeManager.addIframe(e),Lb(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Fb(s)&&this.shadowDomManager.addShadowRoot(wb(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)Qb(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(pb(e))||s(e);for(const e of this.addedSet)eS(this.droppedSet,e)||Qb(this.removesSubTreeCache,e,this.mirror)?eS(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(pb(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(pb(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=pb(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=vb(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=pb(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(o.texts.length||o.attributes.length||o.removes.length||o.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(o))}),Th(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(db(e),e=>gb(e)||"").join("");t.attributes.value=ed({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:nd(e),value:r,maskInputFn:this.maskInputFn})}),Th(this,"processMutation",e=>{if(!Tb(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=gb(e.target);Pb(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:kd(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Mb(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=nd(t);n=ed({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(Pb(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"),!Id(t.tagName,r))if(s.attributes[r]=Cd(this.doc,td(t.tagName),td(r),n),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),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(Pb(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=Jh(e.target)?this.mirror.getId(vb(e.target)):this.mirror.getId(e.target);Pb(e.target,this.blockClass,this.blockSelector,!1)||Tb(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Hb(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Nb(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[$b(r,n)]?Hb(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!Jh(e.target)||!$h(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),db(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Th(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Tb(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[$b(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Pb(e,this.blockClass,this.blockSelector,!1)||(db(e).forEach(e=>this.genAdds(e)),Fb(e)&&db(wb(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Hb(e,t){e.delete(t),db(t).forEach(t=>Hb(e,t))}function Qb(e,t,r){return 0!==e.size&&function(e,t){const r=pb(t);return!!r&&e.has(r)}(e,t)}function eS(e,t){return 0!==e.size&&tS(e,t)}function tS(e,t){const r=pb(t);return!!r&&(!!e.has(r)||tS(e,r))}let rS;const nS=e=>rS?(...t)=>{try{return e(...t)}catch(e){if(rS&&!0===rS(e))return;throw e}}:e;function sS(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const iS=[];function oS(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function aS(e,t){const r=new Xb;iS.push(r),r.init(e);const n=new(hb())(nS(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function lS({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){const o=nS(Ib(nS(i=>{const o=oS(i);if(!o||Pb(o,n,s,!0))return;const a=r.getId(o);if(o===t&&t.defaultView){const r=Eb(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 bb("scroll",o,t)}const cS=["INPUT","TEXTAREA","SELECT"],uS=new WeakMap;function hS(e){return function(e,t){if(gS("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||gS("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||gS("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||gS("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 dS(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function pS({mirror:e,stylesheetManager:t},r){var n,s,i;let o=null;o="#document"===r.nodeName?e.getId(r):e.getId(vb(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}}),nS(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function fS(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=aS(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=Ib(nS(t=>{const r=Date.now()-o;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],o=null}),i),c=nS(Ib(nS(e=>{const t=oS(e),{clientX:r,clientY:s}=_b(e)?e.changedTouches[0]:e;o||(o=Ob()),a.push({x:r,y:s,id:n.getId(t),timeOffset:Ob()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Wb.Drag:e instanceof MouseEvent?Wb.MouseMove:Wb.TouchMove)}),s,{trailing:!1})),u=[bb("mousemove",c,r),bb("touchmove",c,r),bb("drag",c,r)];return nS(()=>{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(Vb).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]).forEach(i=>{let o=td(i);const c=(t=>i=>{const o=oS(i);if(Pb(o,n,s,!0))return;let a=null,c=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=Gb.Mouse;break;case"touch":a=Gb.Touch;break;case"pen":a=Gb.Pen}a===Gb.Touch?Vb[t]===Vb.MouseDown?c="TouchStart":Vb[t]===Vb.MouseUp&&(c="TouchEnd"):Gb.Pen}else _b(i)&&(a=Gb.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Gb.Touch||c.startsWith("Mouse")&&a===Gb.Mouse)&&(a=null)):Vb[t]===Vb.Click&&(a=l,l=null);const u=_b(i)?i.changedTouches[0]:i;if(!u)return;const h=r.getId(o),{clientX:d,clientY:p}=u;nS(e)({type:Vb[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(i);if(window.PointerEvent)switch(Vb[i]){case Vb.MouseDown:case Vb.MouseUp:o=o.replace("mouse","pointer");break;case Vb.TouchStart:case Vb.TouchEnd:return}a.push(bb(o,c,t))}),nS(()=>{a.forEach(e=>e())})}(e),o=lS(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return bb("resize",nS(Ib(nS(()=>{const t=Ab(),s=Rb();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=oS(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=fb(r)),!r||!h||cS.indexOf(h)<0||Pb(r,n,s,!0))return;if(r.classList.contains(i)||o&&r.matches(o))return;let p=r.value,f=!1;const g=nd(r)||"";"radio"===g||"checkbox"===g?f=r.checked:(a[h.toLowerCase()]||a[g])&&(p=ed({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=uS.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){uS.set(t,n);const s=r.getId(t);nS(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>bb(e,nS(h),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push(...m.map(e=>xb(e[0],e[1],{set(){nS(h)({target:this,isTrusted:!1})}},!1,f))),nS(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:i}){const o=nS(i=>Ib(nS(s=>{const o=oS(s);if(!o||Pb(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=[bb("play",o(Yb.Play),i),bb("pause",o(Yb.Pause),i),bb("seeked",o(Yb.Seeked),i),bb("volumechange",o(Yb.VolumeChange),i),bb("ratechange",o(Yb.RateChange),i)];return nS(()=>{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:nS((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=dS(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:a}]}),sS(()=>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:nS((n,s,i)=>{const[o]=i,{id:a,styleId:l}=dS(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:o}]}),sS(()=>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:nS((n,s,i)=>{const[o]=i,{id:a,styleId:l}=dS(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:nS((n,s,i)=>{const[o]=i,{id:a,styleId:l}=dS(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:o}),n.apply(s,i)})}));const l={};mS("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(mS("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),mS("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),mS("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:nS((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=dS(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:[...hS(s),a||0]}]}),n.apply(s,i)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:nS((n,s,i)=>{const[o]=i,{id:a,styleId:l}=dS(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...hS(s),o]}]}),n.apply(s,i)})})}),nS(()=>{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=pS(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:nS((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}=dS(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:hS(o.parentRule)}),s.apply(o,a)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:nS((s,i,a)=>{var l;const[c]=a;if(r.has(c))return o.apply(i,[c]);const{id:u,styleId:h}=dS(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:hS(i.parentRule)}),s.apply(i,a)})}),nS(()=>{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=kb(t.fonts,"add",function(t){return function(r){return setTimeout(nS(()=>{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),nS(()=>{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=nS(()=>{const e=t.getSelection();if(!e||o&&(null==e?void 0:e.isCollapsed))return;o=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const i=e.getRangeAt(t),{startContainer:o,startOffset:l,endContainer:c,endOffset:u}=i;Pb(o,n,s,!0)||Pb(c,n,s,!0)||a.push({start:r.getId(o),startOffset:l,end:r.getId(c),endOffset:u})}i({ranges:a})});return a(),bb("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?kb(r.customElements,"define",function(e){return function(r,n,s){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,s])}}):()=>{}}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,r,t.options));return nS(()=>{iS.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 gS(e){return void 0!==window[e]}function mS(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class yS{constructor(e){Th(this,"iframeIdToRemoteIdMap",new WeakMap),Th(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 vS{constructor(e){Th(this,"iframes",new WeakMap),Th(this,"crossOriginIframeMap",new WeakMap),Th(this,"crossOriginIframeMirror",new yS(pd)),Th(this,"crossOriginIframeStyleMirror"),Th(this,"crossOriginIframeRootIdMap",new WeakMap),Th(this,"mirror"),Th(this,"mutationCb"),Th(this,"wrappedEmit"),Th(this,"loadListener"),Th(this,"stylesheetManager"),Th(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new yS(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case zb.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:zb.IncrementalSnapshot,data:{source:Wb.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case zb.Meta:case zb.Load:case zb.DomContentLoaded:return!1;case zb.Plugin:return t;case zb.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case zb.IncrementalSnapshot:switch(t.data.source){case Wb.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 Wb.Drag:case Wb.TouchMove:case Wb.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Wb.ViewportResize:return!1;case Wb.MediaInteraction:case Wb.MouseInteraction:case Wb.Scroll:case Wb.CanvasMutation:case Wb.Input:return this.replaceIds(t.data,e,["id"]),t;case Wb.StyleSheetRule:case Wb.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Wb.Font:return t;case Wb.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Wb.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===qb.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class wS{constructor(e){Th(this,"shadowDoms",new WeakSet),Th(this,"mutationCb"),Th(this,"scrollCb"),Th(this,"bypassOptions"),Th(this,"mirror"),Th(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(!$h(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=aS({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(lS({...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(vb(e))),this.restoreHandlers.push(pS({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(kb(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),i=wb(this);return i&&jb(this)&&r.addShadowRoot(i,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var bS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",SS="undefined"==typeof Uint8Array?[]:new Uint8Array(256),CS=0;CS<64;CS++)SS[bS.charCodeAt(CS)]=CS;const IS=new Map,xS=(e,t,r)=>{if(!e||!ES(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=IS.get(e);return r||(r=new Map,IS.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 kS(e,t,r){if(e instanceof Array)return e.map(e=>kS(e,t,r));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),n=r.length,s="";for(t=0;t<n;t+=3)s+=bS[r[t]>>2],s+=bS[(3&r[t])<<4|r[t+1]>>4],s+=bS[(15&r[t+1])<<2|r[t+2]>>6],s+=bS[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:[kS(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:[kS(e.data,t,r),e.width,e.height]}:ES(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:xS(e,t,r)}:e}const OS=(e,t,r)=>e.map(e=>kS(e,t,r)),ES=(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 AS(e,t,r,n){const s=[];try{const i=kb(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...i){if(!Pb(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 RS(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=kb(e,l,function(e){return function(...o){const a=e.apply(this,o);if(xS(a,i,this),"tagName"in this.canvas&&!Pb(this.canvas,n,s,!0)){const e=OS(o,i,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});o.push(a)}catch{const n=xb(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});o.push(n)}return o}const MS="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",PS="undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0)))(MS)],{type:"text/javascript;charset=utf-8"});function TS(e){let t;try{if(t=PS&&(window.URL||window.webkitURL).createObjectURL(PS),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch(t){return new Worker("data:text/javascript;base64,"+MS,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class NS{constructor(e){Th(this,"pendingCanvasMutations",new Map),Th(this,"rafStamps",{latestId:0,invokeId:null}),Th(this,"mirror"),Th(this,"mutationCb"),Th(this,"resetObservers"),Th(this,"frozen",!1),Th(this,"locked",!1),Th(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=AS(t,r,n,!0),o=new Map,a=new TS;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:Zb["2D"],commands:[{property:"clearRect",args:[0,0,s,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const l=1e3/e;let c,u=0;const h=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Pb(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=AS(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=kb(t.CanvasRenderingContext2D.prototype,o,function(s){return function(...i){return Pb(this.canvas,r,n,!0)||setTimeout(()=>{const r=OS(i,t,this);e(this.canvas,{type:Zb["2D"],property:o,args:r})},0),s.apply(this,i)}});s.push(i)}catch{const r=xb(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:Zb["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(...RS(t.WebGLRenderingContext.prototype,Zb.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...RS(t.WebGL2RenderingContext.prototype,Zb.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 _S{constructor(e){Th(this,"trackedLinkElements",new WeakSet),Th(this,"mutationCb"),Th(this,"adoptedStyleSheetCb"),Th(this,"styleMirror",new Bb),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},n=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,r)=>({rule:Hh(e,t.href),index:r}))})),r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class DS{constructor(){Th(this,"nodeMap",new WeakMap),Th(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 LS,FS,BS,US=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Rh=e.contentWindow)?void 0:Rh.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const jS=new Qh;function zS(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,hooks:m,packFn:y,sampling:v={},dataURLOptions:w={},mousemoveWait:b,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:k=!1,collectFonts:O=!1,inlineImages:E=!1,plugins:A,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:M=new Set([]),errorHandler:P,applyBackgroundColorToBlockedElements:T=!1}=e;rS=P;const N=!I||window.parent===window;let _=!1;if(!N)try{window.parent.document&&(_=!1)}catch(e){_=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!_)return()=>{};void 0!==b&&void 0===v.mousemove&&(v.mousemove=b),jS.reset();const D=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==d?d:{password:!0},L=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let F;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let B=0;const U=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!_&&(e=y(e)),e};LS=(e,s)=>{var i;const o=e;if(o.timestamp=Ob(),!(null==(i=iS[0])?void 0:i.isFrozen())||o.type===zb.FullSnapshot||o.type===zb.IncrementalSnapshot&&o.data.source===Wb.Mutation||iS.forEach(e=>e.unfreeze()),N)null==t||t(U(o),s);else if(_){const e={type:"rrweb",event:U(o),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(o.type===zb.FullSnapshot)F=o,B=0;else if(o.type===zb.IncrementalSnapshot){if(o.data.source===Wb.Mutation&&o.data.isAttachIframe)return;B++;const e=n&&B>=n,t=r&&o.timestamp-F.timestamp>r;(e||t)&&FS(!0)}};const j=e=>{LS({type:zb.IncrementalSnapshot,data:{source:Wb.Mutation,...e}})},z=e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.Scroll,...e}}),W=e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.CanvasMutation,...e}}),V=new _S({mutationCb:j,adoptedStyleSheetCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.AdoptedStyleSheet,...e}})}),G=new vS({mirror:jS,mutationCb:j,stylesheetManager:V,recordCrossOriginIframes:I,wrappedEmit:LS});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:jS,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const Z=new DS;BS=new NS({recordCanvas:C,mutationCb:W,win:window,blockClass:s,blockSelector:i,mirror:jS,sampling:v.canvas,dataURLOptions:w});const Y=new wS({mutationCb:j,scrollCb:z,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:f,recordCanvas:C,inlineImages:E,sampling:v,slimDOMOptions:L,iframeManager:G,stylesheetManager:V,canvasManager:BS,keepIframeSrcFn:R,processedNodeManager:Z},mirror:jS});FS=(e=!1)=>{if(!S)return;LS({type:zb.Meta,data:{href:window.location.href,width:Rb(),height:Ab()}},e),V.reset(),Y.init(),iS.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new Qh,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,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S=()=>!1,applyBackgroundColorToBlockedElements:C=!1}=t||{};return Ad(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,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:C})}(document,{mirror:jS,blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:D,maskTextFn:g,maskInputFn:f,slimDOM:L,dataURLOptions:w,recordCanvas:C,inlineImages:E,applyBackgroundColorToBlockedElements:T,onSerialize:e=>{Db(e,jS)&&G.addIframe(e),Lb(e,jS)&&V.trackLinkElement(e),Fb(e)&&Y.addShadowRoot(wb(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),Y.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");LS({type:zb.FullSnapshot,data:{node:t,initialOffset:Eb(window)}},e),iS.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,jS.getId(document))};try{const e=[],t=e=>{var t;return nS(fS)({mutationCb:j,mousemoveCb:(e,t)=>LS({type:zb.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.MouseInteraction,...e}}),scrollCb:z,viewportResizeCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.ViewportResize,...e}}),inputCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.Input,...e}}),mediaInteractionCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.MediaInteraction,...e}}),styleSheetRuleCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.StyleSheetRule,...e}}),styleDeclarationCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.Font,...e}}),selectionCb:e=>{LS({type:zb.IncrementalSnapshot,data:{source:Wb.Selection,...e}})},customElementCb:e=>{LS({type:zb.IncrementalSnapshot,data:{source:Wb.CustomElement,...e}})},blockClass:s,ignoreClass:o,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:u,sampling:v,recordDOM:S,recordCanvas:C,inlineImages:E,userTriggeredOnInput:k,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:R,blockSelector:i,slimDOMOptions:L,dataURLOptions:w,mirror:jS,iframeManager:G,stylesheetManager:V,shadowDomManager:Y,processedNodeManager:Z,canvasManager:BS,ignoreCSSAttributes:M,plugins:(null==(t=null==A?void 0:A.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>LS({type:zb.Plugin,data:{plugin:e.name,payload:t}})})))||[]},m)};G.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{FS(),e.push(t(document)),US=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(bb("DOMContentLoaded",()=>{LS({type:zb.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&r()})),e.push(bb("load",()=>{LS({type:zb.Load,data:{}}),"load"===x&&r()},window))),()=>{e.forEach(e=>e()),Z.destroy(),US=!1,rS=void 0}}catch(e){console.warn(e)}}var WS;zS.addCustomEvent=(e,t)=>{if(!US)throw new Error("please add custom event after start recording");LS({type:zb.Custom,data:{tag:e,payload:t}})},zS.freezePage=()=>{iS.forEach(e=>e.freeze())},zS.takeFullSnapshot=e=>{if(!US)throw new Error("please take full snapshot after start recording");FS(e)},zS.mirror=jS,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(WS||(WS={}));var VS=Object.freeze({__proto__:null,record:zS}),GS=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e){this.eventCallback=e,this.observeFetch()},e.prototype.stop=function(){var e;null===(e=this.fetchObserver)||void 0===e||e.call(this),this.fetchObserver=null,this.eventCallback=void 0},e.prototype.notifyEvent=function(e){var t;null===(t=this.eventCallback)||void 0===t||t.call(this,e)},e.prototype.observeFetch=function(){var e=this,t=m();if(t){var r=t.fetch;r&&(t.fetch=function(t,n){return o(e,void 0,void 0,function(){var e,s,i,o,l,c,u;return a(this,function(a){switch(a.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},a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r(t,n)];case 2:return i=a.sent(),c=Date.now(),s.status=i.status,s.duration=c-e,o={},i.headers.forEach(function(e,t){o[t]=e}),s.responseHeaders=o,this.notifyEvent(s),[2,i];case 3:throw l=a.sent(),c=Date.now(),s.duration=c-e,u=l,s.error={name:u.name||"UnknownError",message:u.message||"An unknown error occurred"},this.notifyEvent(s),l;case 4:return[2]}})})},this.fetchObserver=function(){t.fetch=r})}},e}(),ZS=Object.freeze({__proto__:null,NetworkObservers:GS});return e.SessionReplayPlugin=gr,e.plugin=mr,e.sessionReplayPlugin=mr,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<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},n.apply(this,arguments)};function s(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function 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<e.length;f++)if(!o(e[f],t[f]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var a=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=n({},this.identity.userProperties),r=n(n({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,o,a,l,c,u=r.userProperties||{};try{for(var h=s(Object.entries(e)),d=h.next();!d.done;d=h.next()){var p=i(d.value,2),f=p[0],g=p[1];switch(f){case"$set":try{for(var m=(o=void 0,s(Object.entries(g))),y=m.next();!y.done;y=m.next()){var v=i(y.value,2),w=v[0],b=v[1];u[w]=b}}catch(e){o={error:e}}finally{try{y&&!y.done&&(a=m.return)&&a.call(m)}finally{if(o)throw o.error}}break;case"$unset":try{for(var S=(l=void 0,s(Object.keys(g))),C=S.next();!C.done;C=S.next()){delete u[w=C.value]}}catch(e){l={error:e}}finally{try{C&&!C.done&&(c=S.return)&&c.call(S)}finally{if(l)throw l.error}}break;case"$clearAll":u={}}}}catch(e){t={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}return r.userProperties=u,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return n({},this.identity)},e.prototype.setIdentity=function(e){var t=n({},this.identity);this.identity=n({},e),o(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),l=typeof globalThis<"u"?globalThis:typeof window<"u"?window:self,c=function(){function t(){this.identityStore=new a,this.eventBridge=new r,this.applicationContextProvider=new e}return t.getInstance=function(e){return l.analyticsConnectorInstances||(l.analyticsConnectorInstances={}),l.analyticsConnectorInstances[e]||(l.analyticsConnectorInstances[e]=new t),l.analyticsConnectorInstances[e]},t}(),u=["boot"];window.engagement=function(e){var t,r,n,s,i,o,a;let l=window.engagement,h={_q:null!=(t=null==l?void 0:l._q)?t:[],_configuration:{apiKey:null!=(n=null==(r=null==l?void 0:l._configuration)?void 0:r.apiKey)?n:"",serverUrl:null==(s=null==l?void 0:l._configuration)?void 0:s.serverUrl,serverZone:null!=(o=null==(i=null==l?void 0:l._configuration)?void 0:i.serverZone)?o:"US",options:{...null==(a=null==l?void 0:l._configuration)?void 0:a.options}},_sentry:void 0,init(t,r){var n,s,i;h._configuration.apiKey?console.log("Engagement SDK has already been initialized. Ignoring additional init call."):(h._configuration={...h._configuration,...r,apiKey:t,options:{...h._configuration.options,...null==r?void 0:r.options}},null!=(s=null==(n=h._configuration)?void 0:n.options)&&s.logger&&h._configuration.options.logger.enable(null!=(i=h._configuration.options.logLevel)?i:2),e())},plugin(e){let t=h.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,{options:{logLevel:r.logLevel},...e,serverZone:r.serverZone}),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:[{track:e=>{n.track(e)}}]}),o.addIdentityListener(e=>{window.engagement._setUserProperties(e.userProperties)})},execute:async e=>(window.engagement.forwardEvent(e),e)}}},d=h;return new Proxy(h,{get:function(e,t){return t in d?d[t]:"then"!==t?"gs"===t?new Proxy({},{get:function(e,r){return function(){let e=Array.from(arguments),n=`${t}.${r}`;e.unshift(n),h._q.push(e)}}}):u.includes(t)?function(){let e=Array.prototype.slice.call(arguments);return new Promise((r,n)=>{e.unshift(t,r,n),h._q.push(e)})}:function(){let e=Array.prototype.slice.call(arguments);e.unshift(t),h._q.push(e)}:void 0}})}(()=>function(e){for(let t of e){let e=document.createElement("script");e.src=t,e.id="engagement-sdk-bundle";let r=document.querySelector("[nonce]");r&&e.setAttribute("nonce",r.nonce||r.getAttribute("nonce")),document.getElementsByTagName("head")[0].appendChild(e)}}(["https://cdn.amplitude.com/engagement-browser/prod/index.min.js.gz"]))})()};!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/2.31.4",e)})),d}(l,r):l[h].apply(this,r)}}}(window,"_amplitude")}();
|
|
1
|
+
!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;t<g.length;t++)i(e,g[t],!1);for(var r=0;r<m.length;r++)i(e,m[r],!0)};r.invoked=!0;var a=t.createElement("script");a.type="text/javascript",a.integrity="sha384-eKjjMSmjoiCFWGODFo7CqLuAaRppAYW5eucGRfzo6B6yhBE98Iwqir5bwcx+/7Fj",a.crossOrigin="anonymous",a.async=!0,a.src="https://cdn.amplitude.com/libs/analytics-browser-gtm-2.32.0-min.js.gz",a.onload=function(){e.amplitudeGTM.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var l=t.getElementsByTagName("script")[0];l.parentNode.insertBefore(a,l);for(var c=function(){return this._q=[],this},u=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],h=0;h<u.length;h++)n(c,u[h]);r.Identify=c;for(var d=function(){return this._q=[],this},p=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setReceipt","setReceiptSig","setCurrency","setEventProperties"],f=0;f<p.length;f++)n(d,p[f]);r.Revenue=d;var g=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset","extendSession"],m=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];o(r),r.createInstance=function(e){return r._iq[e]={_q:[]},o(r._iq[e]),r._iq[e]},e.amplitudeGTM=r,e.amplitude||(e.amplitude=e.amplitudeGTM)}}(window,document);var e=function(e){var t=function(){return t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},t.apply(this,arguments)};function r(e,t,r,n){return new(r||(r=Promise))(function(s,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function n(e,t){var r,n,s,i,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>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]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}var s=function(){var e=this;return{name:"@amplitude/plugin-page-view-v1-enrichment-browser",type:"enrichment",setup:function(e){return r(this,void 0,void 0,function(){return n(this,function(t){return e.loggerProvider.log("Installing @amplitude/plugin-page-view-v1-enrichment-browser."),[2]})})},execute:function(s){return r(e,void 0,void 0,function(){var e,r,i,o,a,l;return n(this,function(n){return"[Amplitude] Page Viewed"==s.event_type&&(e=s.event_properties||{},r=e["[Amplitude] Page Domain"],i=e["[Amplitude] Page Location"],o=e["[Amplitude] Page Path"],a=e["[Amplitude] Page Title"],l=e["[Amplitude] Page URL"],(s=t(t({},s),{event_type:"Page View",event_properties:t(t({},s.event_properties),{page_domain:null!=r?r:"",page_location:null!=i?i:"",page_path:null!=o?o:"",page_title:null!=a?a:"",page_url:null!=l?l:""})})).event_properties&&(delete s.event_properties["[Amplitude] Page Domain"],delete s.event_properties["[Amplitude] Page Location"],delete s.event_properties["[Amplitude] Page Path"],delete s.event_properties["[Amplitude] Page Title"],delete s.event_properties["[Amplitude] Page URL"])),[2,s]})})}}};return e.pageViewV1EnrichmentPlugin=s,e.plugin=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({}),t=function(e){var t=function(){return t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},t.apply(this,arguments)};function r(e,t,r,n){return new(r||(r=Promise))(function(s,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function n(e,t){var r,n,s,i,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>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]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={exports:{}};!function(e,t){!function(r,n){var s="function",i="undefined",o="object",a="string",l="model",c="name",u="type",h="vendor",d="version",p="architecture",f="console",g="mobile",m="tablet",y="smarttv",v="wearable",w="embedded",b="Amazon",S="Apple",C="ASUS",I="BlackBerry",x="Browser",k="Chrome",O="Firefox",E="Google",A="Huawei",R="LG",M="Microsoft",P="Motorola",T="Opera",N="Samsung",_="Sharp",D="Sony",L="Xiaomi",F="Zebra",B="Facebook",U=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},j=function(e,t){return typeof e===a&&-1!==z(t).indexOf(z(e))},z=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===i?e:e.substring(0,350)},V=function(e,t){for(var r,i,a,l,c,u,h=0;h<t.length&&!c;){var d=t[h],p=t[h+1];for(r=i=0;r<d.length&&!c;)if(c=d[r++].exec(e))for(a=0;a<p.length;a++)u=c[++i],typeof(l=p[a])===o&&l.length>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}},G=function(e,t){for(var r in t)if(typeof t[r]===o&&t[r].length>0){for(var s=0;s<t[r].length;s++)if(j(t[r][s],e))return"?"===r?n:r}else if(j(t[r],e))return"?"===r?n:r;return e},Z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Y={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,d],[/opios[\/ ]+([\w\.]+)/i],[d,[c,T+" Mini"]],[/\bopr\/([\w\.]+)/i],[d,[c,T]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[c,"UC"+x]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[d,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+x],d],[/\bfocus\/([\w\.]+)/i],[d,[c,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[d,[c,T+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[c,T+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[c,"MIUI "+x]],[/fxios\/([-\w\.]+)/i],[d,[c,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+x]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+x],d],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,B],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[c,k+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,k+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[c,"Android "+x]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,d],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[d,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[d,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[d,G,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[c,O+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,d],[/(cobalt)\/([\w\.]+)/i],[c,[d,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,z]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",z]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[h,N],[u,m]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[h,N],[u,g]],[/((ipod|iphone)\d+,\d+)/i],[l,[h,S],[u,g]],[/(ipad\d+,\d+)/i],[l,[h,S],[u,m]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[h,S],[u,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[h,S],[u,m]],[/(macintosh);/i],[l,[h,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[h,A],[u,m]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[h,A],[u,g]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[h,L],[u,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[h,L],[u,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[h,"OPPO"],[u,g]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[h,"Vivo"],[u,g]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[h,"Realme"],[u,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[h,P],[u,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[h,P],[u,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[h,R],[u,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[h,R],[u,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[h,"Lenovo"],[u,m]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[h,"Nokia"],[u,g]],[/(pixel c)\b/i],[l,[h,E],[u,m]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[h,E],[u,g]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[h,D],[u,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[h,D],[u,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[h,"OnePlus"],[u,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[h,b],[u,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[h,b],[u,g]],[/(playbook);[-\w\),; ]+(rim)/i],[l,h,[u,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[h,I],[u,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[h,C],[u,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[h,C],[u,g]],[/(nexus 9)/i],[l,[h,"HTC"],[u,m]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[l,/_/g," "],[u,g]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[h,"Acer"],[u,m]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[h,"Meizu"],[u,g]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[h,_],[u,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,l,[u,g]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,l,[u,m]],[/(surface duo)/i],[l,[h,M],[u,m]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[h,"Fairphone"],[u,g]],[/(u304aa)/i],[l,[h,"AT&T"],[u,g]],[/\bsie-(\w*)/i],[l,[h,"Siemens"],[u,g]],[/\b(rct\w+) b/i],[l,[h,"RCA"],[u,m]],[/\b(venue[\d ]{2,7}) b/i],[l,[h,"Dell"],[u,m]],[/\b(q(?:mv|ta)\w+) b/i],[l,[h,"Verizon"],[u,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[h,"Barnes & Noble"],[u,m]],[/\b(tm\d{3}\w+) b/i],[l,[h,"NuVision"],[u,m]],[/\b(k88) b/i],[l,[h,"ZTE"],[u,m]],[/\b(nx\d{3}j) b/i],[l,[h,"ZTE"],[u,g]],[/\b(gen\d{3}) b.+49h/i],[l,[h,"Swiss"],[u,g]],[/\b(zur\d{3}) b/i],[l,[h,"Swiss"],[u,m]],[/\b((zeki)?tb.*\b) b/i],[l,[h,"Zeki"],[u,m]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],l,[u,m]],[/\b(ns-?\w{0,9}) b/i],[l,[h,"Insignia"],[u,m]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[h,"NextBook"],[u,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],l,[u,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],l,[u,g]],[/\b(ph-1) /i],[l,[h,"Essential"],[u,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[h,"Envizen"],[u,m]],[/\b(trio[-\w\. ]+) b/i],[l,[h,"MachSpeed"],[u,m]],[/\btu_(1491) b/i],[l,[h,"Rotor"],[u,m]],[/(shield[\w ]+) b/i],[l,[h,"Nvidia"],[u,m]],[/(sprint) (\w+)/i],[h,l,[u,g]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[h,M],[u,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[h,F],[u,m]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[h,F],[u,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,l,[u,f]],[/droid.+; (shield) bui/i],[l,[h,"Nvidia"],[u,f]],[/(playstation [345portablevi]+)/i],[l,[h,D],[u,f]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[h,M],[u,f]],[/smart-tv.+(samsung)/i],[h,[u,y]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[h,N],[u,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,R],[u,y]],[/(apple) ?tv/i],[h,[l,S+" TV"],[u,y]],[/crkey/i],[[l,k+"cast"],[h,E],[u,y]],[/droid.+aft(\w)( bui|\))/i],[l,[h,b],[u,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[h,_],[u,y]],[/(bravia[\w ]+)( bui|\))/i],[l,[h,D],[u,y]],[/(mitv-\w{5}) bui/i],[l,[h,L],[u,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,W],[l,W],[u,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[u,y]],[/((pebble))app/i],[h,l,[u,v]],[/droid.+; (glass) \d/i],[l,[h,E],[u,v]],[/droid.+; (wt63?0{2,3})\)/i],[l,[h,F],[u,v]],[/(quest( 2)?)/i],[l,[h,B],[u,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[u,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[u,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[u,m]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[u,m]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[u,g]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[c,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[d,G,Z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[d,G,Z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[d,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,d],[/\(bb(10);/i],[d,[c,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[c,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[c,k+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],d],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,d],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,d]]},q=function(e,t){if(typeof e===o&&(t=e,e=n),!(this instanceof q))return new q(e,t).getResult();var s=e||(typeof r!==i&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),f=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(Y,t):Y;return this.getBrowser=function(){var e,t={};return t[c]=n,t[d]=n,V.call(t,s,f.browser),t.major=typeof(e=t.version)===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n,t},this.getCPU=function(){var e={};return e[p]=n,V.call(e,s,f.cpu),e},this.getDevice=function(){var e={};return e[h]=n,e[l]=n,e[u]=n,V.call(e,s,f.device),e},this.getEngine=function(){var e={};return e[c]=n,e[d]=n,V.call(e,s,f.engine),e},this.getOS=function(){var e={};return e[c]=n,e[d]=n,V.call(e,s,f.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return s},this.setUA=function(e){return s=typeof e===a&&e.length>350?W(e,350):e,this},this.setUA(s),this};q.VERSION="0.7.33",q.BROWSER=U([c,d,"major"]),q.CPU=U([p]),q.DEVICE=U([l,h,u,f,g,y,m,v,w]),q.ENGINE=q.OS=U([c,d]),e.exports&&(t=e.exports=q),t.UAParser=q;var K=typeof r!==i&&(r.jQuery||r.Zepto);if(K&&!K.ua){var J=new q;K.ua=J.getResult(),K.ua.get=function(){return J.getUA()},K.ua.set=function(e){J.setUA(e);var t=J.getResult();for(var r in t)K.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;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},i.apply(this,arguments)};function o(e,t,r,n){return new(r||(r=Promise))(function(s,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function a(e,t){var r,n,s,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((s=(s=i.trys).length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(6===a[0]&&i.label<s[1]){i.label=s[1],s=a;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(a);break}s[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function l(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function u(e,t,r){if(r||2===arguments.length)for(var n,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(n||(n={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(s||(s={}));var h,d="".concat("AMP","_unsent"),p="$default_instance",f="https://api2.amplitude.com/2/httpapi";!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(h||(h={}));var g,m=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},y=u([],c(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),v=function(e){var t,r=m();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,v)}(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,u([],c(n.entries()),!1).map(function(e){var t=c(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(y[n]):y[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;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Verbose||console.log("".concat(b,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Warn||console.warn("".concat(b,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Error||console.error("".concat(b,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Debug||console.log("".concat(b,"[Debug]: ").concat(e.join(" ")))},e}(),C=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:p,logLevel:g.Warn,loggerProvider:new S,offline:!1,optOut:!1,serverUrl:f,serverZone:"US",useBatch:!1}},I=function(){function e(e){var t,r,n,s;this._optOut=!1;var i=C();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:i.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||i.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||i.flushQueueSize,this.instanceName=e.instanceName||i.instanceName,this.loggerProvider=e.loggerProvider||i.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:i.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:i.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:i.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||i.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(s=e.useBatch)&&void 0!==s?s:i.useBatch,this.loggerProvider.enable(this.logLevel);var o=k(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),x=function(e,t){return"EU"===e?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":f},k=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=C().serverZone),void 0===r&&(r=C().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:C().serverZone;return{serverZone:n,serverUrl:x(n,r)}},O=function(e,t,r,n,s){return void 0===s&&(s=null),function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var a=r(),l=a.logger,c=a.logLevel;if(c&&c<g.Debug||!c||!l)return e.apply(s,i);var u,h={type:"invoke public method",name:t,args:i,stacktrace:(u=1,void 0===u&&(u=0),((new Error).stack||"").split("\n").slice(2+u).map(function(e){return e.trim()})),time:{start:(new Date).toISOString()},states:{}};n&&h.states&&(h.states.before=n());var d=e.apply(s,i);return d&&d.promise?d.promise.then(function(){n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))}):(n&&h.states&&(h.states.after=n()),h.time&&(h.time.end=(new Date).toISOString()),l.debug(JSON.stringify(h,null,2))),d}},E=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:A(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),A=function(){return"undefined"!=typeof navigator&&(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}(),M=function(){return M=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},M.apply(this,arguments)};function P(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function T(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}"function"==typeof SuppressedError&&SuppressedError;var N=function(e,t){var r,n,s=typeof e;if(s!==typeof t)return!1;try{for(var i=P(["string","number","boolean","undefined"]),o=i.next();!o.done;o=i.next())if(o.value===s)return e===t}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(!a||!l){var c=Object.keys(e).sort(),u=Object.keys(t).sort();if(!N(c,u))return!1;var h=!0;return Object.keys(e).forEach(function(r){N(e[r],t[r])||(h=!1)}),h}for(var d=0;d<e.length;d++)if(!N(e[d],t[d]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var _,D=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=M({},this.identity.userProperties),r=M(M({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,s,i,o,a,l=r.userProperties||{};try{for(var c=P(Object.entries(e)),u=c.next();!u.done;u=c.next()){var h=T(u.value,2),d=h[0],p=h[1];switch(d){case"$set":try{for(var f=(s=void 0,P(Object.entries(p))),g=f.next();!g.done;g=f.next()){var m=T(g.value,2),y=m[0],v=m[1];l[y]=v}}catch(e){s={error:e}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(s)throw s.error}}break;case"$unset":try{for(var w=(o=void 0,P(Object.keys(p))),b=w.next();!b.done;b=w.next())delete l[y=b.value]}catch(e){o={error:e}}finally{try{b&&!b.done&&(a=w.return)&&a.call(w)}finally{if(o)throw o.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return M({},this.identity)},e.prototype.setIdentity=function(e){var t=M({},this.identity);this.identity=M({},e),N(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,F=function(){function e(){this.identityStore=new D,this.eventBridge=new R,this.applicationContextProvider=new E}return e.getInstance=function(t){return L.analyticsConnectorInstances||(L.analyticsConnectorInstances={}),L.analyticsConnectorInstances[t]||(L.analyticsConnectorInstances[t]=new e),L.analyticsConnectorInstances[t]},e}(),B=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t},U=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,s,i,o,a,l,c,u,d,p,f,g,m,y,v,w,b,S,C,I;if("object"!=typeof e)return null;var x=e.code||0,k=this.buildStatus(x);switch(k){case h.Success:return{status:k,statusCode:x,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case h.Invalid:return{status:k,statusCode:x,body:{error:null!==(s=e.error)&&void 0!==s?s:"",missingField:null!==(i=e.missing_field)&&void 0!==i?i:"",eventsWithInvalidFields:null!==(o=e.events_with_invalid_fields)&&void 0!==o?o:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(c=e.eps_threshold)&&void 0!==c?c:0,exceededDailyQuotaDevices:null!==(u=e.exceeded_daily_quota_devices)&&void 0!==u?u:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(g=e.throttled_events)&&void 0!==g?g:[]}};case h.PayloadTooLarge:return{status:k,statusCode:x,body:{error:null!==(m=e.error)&&void 0!==m?m:""}};case h.RateLimit:return{status:k,statusCode:x,body:{error:null!==(y=e.error)&&void 0!==y?y:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(w=e.throttled_devices)&&void 0!==w?w:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(S=e.exceeded_daily_quota_devices)&&void 0!==S?S:{},exceededDailyQuotaUsers:null!==(C=e.exceeded_daily_quota_users)&&void 0!==C?C:{},throttledEvents:null!==(I=e.throttled_events)&&void 0!==I?I:[]}};case h.Timeout:default:return{status:k,statusCode:x}}},e.prototype.buildStatus=function(e){return function(e){return e>=200&&e<300}(e)?h.Success:429===e?h.RateLimit:413===e?h.PayloadTooLarge:408===e?h.Timeout:e>=400&&e<500?h.Invalid:e>=500?h.Failed:h.Unknown},e}(),j=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.send=function(e,t){return o(this,void 0,void 0,function(){var r,n,s;return a(this,function(i){switch(i.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=i.sent()).text()];case 2:s=i.sent();try{return[2,this.buildResponse(JSON.parse(s))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}})})},t}(U),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}(),W=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new z(e,t)}return e.prototype.subscribe=function(e,t,r){var n=v(),s={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(s),"all"===t?this.subscribeAll(s):this.subscribeWaitForRemote(s,t.timeout),n},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return o(this,void 0,void 0,function(){var e,t=this;return a(this,function(r){switch(r.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise||(this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null})),this.fetchPromise},e.prototype.subscribeAll=function(e){return o(this,void 0,void 0,function(){var t,r,n,s=this;return a(this,function(i){switch(i.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){s.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),s.sendCallback(e,t,"remote"),s.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=i.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return i.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return o(this,void 0,void 0,function(){var r,n;return a(this,function(s){switch(s.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),s.label=1;case 1:return s.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=s.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[3,5];case 3:return s.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(n=s.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),o(this,void 0,void 0,function(){var r,n,s,i,o,l,c=this;return a(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},s=function(n){var s,o,l,u,h;return a(this,function(a){switch(a.label){case 0:s=new AbortController,o=setTimeout(function(){return s.abort()},t),a.label=1;case 1:return a.trys.push([1,7,8,9]),[4,fetch(i.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:s.signal})];case 2:return(l=a.sent()).ok?[3,4]:[4,l.text()];case 3:return u=a.sent(),i.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(l.status,": ").concat(u)),[3,6];case 4:return[4,l.json()];case 5:return[2,{value:{remoteConfig:a.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(h=a.sent())instanceof Error&&"AbortError"===h.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: "),h),[3,9];case 8:return clearTimeout(o),[7];case 9:return n<e-1?[4,new Promise(function(e){return setTimeout(e,c.getJitterDelay(r))})]:[3,11];case 10:a.sent(),a.label=11;case 11:return[2]}})},i=this,o=0,u.label=1;case 1:return o<e?[5,s(o)]:[3,4];case 2:if("object"==typeof(l=u.sent()))return[2,l.value];u.label=3;case 3:return o++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}();!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(_||(_={}));var V,G="[Amplitude]",Z="".concat(G," Session Replay ID"),Y=_.US,q={enabled:!0},K="".concat(G," Session Replay Debug"),J="amp-mask";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision"}(V||(V={}));var $=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}(),X="medium",H=function(e,t,r){switch(t){case"light":if("input"!==e)return!0;var n=r?function(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?t.toLowerCase():null}(r):"";return!(!n||!["password","hidden","email","tel"].includes(n)&&!r.autocomplete.startsWith("cc-"));case"medium":case"conservative":return!0;default:return H(e,X,r)}},Q=function(e,t){return function(r,n){return function(e,t,r){var n,s,i;if(void 0===t&&(t={defaultMaskLevel:X}),r){if(r.closest("."+J))return!0;var o=(null!==(n=t.maskSelector)&&void 0!==n?n:[]).some(function(e){return r.closest(e)});if(o)return!0;if(r.closest(".amp-unmask"))return!1;var a=(null!==(s=t.unmaskSelector)&&void 0!==s?s:[]).some(function(e){return r.closest(e)});if(a)return!1}return H(e,null!==(i=t.defaultMaskLevel)&&void 0!==i?i:X,r)}(e,t,n)?r.replace(/[^\s]/g,"*"):r}},ee=function(e,t){return t||(e===_.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===_.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},te=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},re=function(e,t){var r,n;try{for(var s=l(t),i=s.next();!i.done;i=s.next()){var o=i.value,a=te(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},ne=function(){return o(void 0,void 0,void 0,function(){var e,t,r,n,s,i,o;return a(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/1024):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:""}]}})})},se=function(e){var t=i({},e),r=t.apiKey;return t.apiKey="****".concat(r.substring(r.length-4)),t},ie=function(){return{flushMaxRetries:2,logLevel:g.Warn,loggerProvider:new S,transportProvider:new j}},oe=function(e){function t(t,r){var n,s,o,a,l,c,u=this,h=ie();if((u=e.call(this,i(i({transportProvider:h.transportProvider,loggerProvider:new $(r.loggerProvider||h.loggerProvider)},r),{apiKey:t}))||this).flushMaxRetries=void 0!==r.flushMaxRetries&&r.flushMaxRetries<=h.flushMaxRetries?r.flushMaxRetries:h.flushMaxRetries,u.apiKey=t,u.sampleRate=r.sampleRate||0,u.serverZone=r.serverZone||Y,u.configServerUrl=r.configServerUrl,u.trackServerUrl=r.trackServerUrl,u.shouldInlineStylesheet=r.shouldInlineStylesheet,u.version=r.version,u.performanceConfig=r.performanceConfig||q,u.storeType=null!==(n=r.storeType)&&void 0!==n?n:"idb",u.applyBackgroundColorToBlockedElements=null!==(s=r.applyBackgroundColorToBlockedElements)&&void 0!==s&&s,u.enableUrlChangePolling=null!==(o=r.enableUrlChangePolling)&&void 0!==o&&o,u.urlChangePollingInterval=null!==(a=r.urlChangePollingInterval)&&void 0!==a?a:1e3,u.captureDocumentTitle=null!==(l=r.captureDocumentTitle)&&void 0!==l&&l,r.privacyConfig&&(u.privacyConfig=r.privacyConfig),r.interactionConfig&&(u.interactionConfig=r.interactionConfig,u.interactionConfig.ugcFilterRules&&function(e){if(!e.every(function(e){return"string"==typeof e.selector&&"string"==typeof e.replacement}))throw new Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every(function(e){return"string"==typeof(t=e.selector)&&""!==t.trim()&&!!/^\/|^https?:\/\/[^\s]+$/.test(t);var t}))throw new Error("ugcFilterRules must be an array of objects with valid globs")}(u.interactionConfig.ugcFilterRules)),r.debugMode&&(u.debugMode=r.debugMode),void 0!==r.useWebWorker)u.useWebWorker=r.useWebWorker;else{var d=r;void 0!==(null===(c=d.experimental)||void 0===c?void 0:c.useWebWorker)&&(u.useWebWorker=d.experimental.useWebWorker)}return r.omitElementTags&&(u.omitElementTags=r.omitElementTags),u}return r(t,e),t}(I),ae=(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))(ae||{}),le=(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))(le||{}),ce=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,r;return o(this,void 0,void 0,function(){var n,s,o,u,h,d,p,f,g,m,y,v,w,b,S,C,I,x=this;return a(this,function(a){switch(a.label){case 0:(n=i({},this.localConfig)).optOut=this.localConfig.optOut,n.captureEnabled=!0,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,new Promise(function(e,t){x.remoteConfigClient.subscribe("configs.sessionReplay","all",function(r,i){var o;if(x.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(i,":"),JSON.stringify(r,null,2)),r){var a=r,l=a.sr_sampling_config,c=a.sr_privacy_config,u=a.sr_targeting_config,h=null===(o=n.interactionConfig)||void 0===o?void 0:o.ugcFilterRules;n.interactionConfig=a.sr_interaction_config,n.interactionConfig&&h&&(n.interactionConfig.ugcFilterRules=h),n.loggingConfig=a.sr_logging_config,(l||c||u)&&(s={},l&&(s.sr_sampling_config=l),c&&(s.sr_privacy_config=c),u&&(s.sr_targeting_config=u)),e()}else t(new Error("No remote config received"))})})];case 2:return a.sent(),[3,4];case 3:return o=a.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",o),n.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:void 0}];case 4:if(!s)return[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:s}];if(u=s.sr_sampling_config,h=s.sr_privacy_config,d=s.sr_targeting_config,u&&Object.keys(u).length>0?(Object.prototype.hasOwnProperty.call(u,"capture_enabled")?n.captureEnabled=u.capture_enabled:n.captureEnabled=!1,Object.prototype.hasOwnProperty.call(u,"sample_rate")&&(n.sampleRate=u.sample_rate)):(n.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),h){p=null!==(e=n.privacyConfig)&&void 0!==e?e:{},f={defaultMaskLevel:null!==(r=null!==(t=h.defaultMaskLevel)&&void 0!==t?t:p.defaultMaskLevel)&&void 0!==r?r:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},g=function(e){var t,r,n,s,i,o,a,c,u,h={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=l(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=l(null!==(c=e.maskSelector)&&void 0!==c?c:[]),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=l(null!==(u=e.unmaskSelector)&&void 0!==u?u:[]),y=m.next();!y.done;y=m.next())h[y.value]="unmask"}catch(e){i={error:e}}finally{try{y&&!y.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}return h},m=i(i({},g(p)),g(h));try{for(y=l(Object.entries(m)),v=y.next();!v.done;v=y.next())w=c(v.value,2),b=w[0],"mask"===(S=w[1])?f.maskSelector.push(b):"block"===S?f.blockSelector.push(b):"unmask"===S&&f.unmaskSelector.push(b)}catch(e){C={error:e}}finally{try{v&&!v.done&&(I=y.return)&&I.call(y)}finally{if(C)throw C.error}}n.privacyConfig=(k=f,O=this.localConfig.loggerProvider,E=document.createDocumentFragment(),A=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),0!==(e=e.filter(function(e){try{E.querySelector(e)}catch(t){return O.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0})).length)return e},k.blockSelector=A(k.blockSelector),k.maskSelector=A(k.maskSelector),k.unmaskSelector=A(k.unmaskSelector),k)}return d&&Object.keys(d).length>0&&(n.targetingConfig=d),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:se(n)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:n,remoteConfig:s}]}var k,O,E,A})})},e}(),ue=function(e,t){return o(void 0,void 0,void 0,function(){var r,n;return a(this,function(s){return r=new oe(e,t),n=new W(e,r.loggerProvider,r.serverZone,t.configServerUrl),[2,new ce(n,r)]})})},he=Uint8Array,de=Uint16Array,pe=Uint32Array,fe=new he([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ge=new he([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),me=new he([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ye=function(e,t){for(var r=new de(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var s=new pe(r[30]);for(n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)s[i]=i-r[n]<<5|n;return[r,s]},ve=ye(fe,2),we=ve[0],be=ve[1];we[28]=258,be[258]=28;for(var Se=ye(ge,0)[1],Ce=new de(32768),Ie=0;Ie<32768;++Ie){var xe=(43690&Ie)>>>1|(21845&Ie)<<1;xe=(61680&(xe=(52428&xe)>>>2|(13107&xe)<<2))>>>4|(3855&xe)<<4,Ce[Ie]=((65280&xe)>>>8|(255&xe)<<8)>>>1}var ke=function(e,t,r){for(var n=e.length,s=0,i=new de(t);s<n;++s)++i[e[s]-1];var o,a=new de(t);for(s=0;s<t;++s)a[s]=a[s-1]+i[s-1]<<1;if(r){o=new de(1<<t);var l=15-t;for(s=0;s<n;++s)if(e[s])for(var c=s<<4|e[s],u=t-e[s],h=a[e[s]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)o[Ce[h]>>>l]=c}else for(o=new de(n),s=0;s<n;++s)o[s]=Ce[a[e[s]-1]++]>>>15-e[s];return o},Oe=new he(288);for(Ie=0;Ie<144;++Ie)Oe[Ie]=8;for(Ie=144;Ie<256;++Ie)Oe[Ie]=9;for(Ie=256;Ie<280;++Ie)Oe[Ie]=7;for(Ie=280;Ie<288;++Ie)Oe[Ie]=8;var Ee=new he(32);for(Ie=0;Ie<32;++Ie)Ee[Ie]=5;var Ae=ke(Oe,9,0),Re=ke(Ee,5,0),Me=function(e){return(e/8|0)+(7&e&&1)},Pe=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof de?de:e instanceof pe?pe:he)(r-t);return n.set(e.subarray(t,r)),n},Te=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8},Ne=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},_e=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var s=r.length,i=r.slice();if(!s)return[new he(0),0];if(1==s){var o=new he(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort(function(e,t){return e.f-t.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=s-1;)a=r[r[c].f<r[h].f?c++:h++],l=r[c!=u&&r[c].f<r[h].f?c++:h++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};var d=i[0].s;for(n=1;n<s;++n)i[n].s>d&&(d=i[n].s);var p=new de(d+1),f=De(r[u-1],p,0);if(f>t){n=0;var g=0,m=f-t,y=1<<m;for(i.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});n<s;++n){var v=i[n].s;if(!(p[v]>t))break;g+=y-(1<<f-p[v]),p[v]=t}for(g>>>=m;g>0;){var w=i[n].s;p[w]<t?g-=1<<t-p[w]++-1:++n}for(;n>=0&&g;--n){var b=i[n].s;p[b]==t&&(--p[b],++g)}f=t}return[new he(p),f]},De=function(e,t,r){return-1==e.s?Math.max(De(e.l,t,r+1),De(e.r,t,r+1)):t[e.s]=r},Le=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new de(++t),n=0,s=e[0],i=1,o=function(e){r[n++]=e},a=1;a<=t;++a)if(e[a]==s&&a!=t)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=e[a]}return[r.subarray(0,n),t]},Fe=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},Be=function(e,t,r){var n=r.length,s=Me(t+2);e[s]=255&n,e[s+1]=n>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var i=0;i<n;++i)e[s+i+4]=r[i];return 8*(s+4+n)},Ue=function(e,t,r,n,s,i,o,a,l,c,u){Te(t,u++,r),++s[256];for(var h=_e(s,15),d=h[0],p=h[1],f=_e(i,15),g=f[0],m=f[1],y=Le(d),v=y[0],w=y[1],b=Le(g),S=b[0],C=b[1],I=new de(19),x=0;x<v.length;++x)I[31&v[x]]++;for(x=0;x<S.length;++x)I[31&S[x]]++;for(var k=_e(I,7),O=k[0],E=k[1],A=19;A>4&&!O[me[A-1]];--A);var R,M,P,T,N=c+5<<3,_=Fe(s,Oe)+Fe(i,Ee)+o,D=Fe(s,d)+Fe(i,g)+o+14+3*A+Fe(I,O)+(2*I[16]+3*I[17]+7*I[18]);if(N<=_&&N<=D)return Be(t,u,e.subarray(l,l+c));if(Te(t,u,1+(D<_)),u+=2,D<_){R=ke(d,p,0),M=d,P=ke(g,m,0),T=g;var L=ke(O,E,0);for(Te(t,u,w-257),Te(t,u+5,C-1),Te(t,u+10,A-4),u+=14,x=0;x<A;++x)Te(t,u+3*x,O[me[x]]);u+=3*A;for(var F=[v,S],B=0;B<2;++B){var U=F[B];for(x=0;x<U.length;++x){var j=31&U[x];Te(t,u,L[j]),u+=O[j],j>15&&(Te(t,u,U[x]>>>5&127),u+=U[x]>>>12)}}}else R=Ae,M=Oe,P=Re,T=Ee;for(x=0;x<a;++x)if(n[x]>255){j=n[x]>>>18&31,Ne(t,u,R[j+257]),u+=M[j+257],j>7&&(Te(t,u,n[x]>>>23&31),u+=fe[j]);var z=31&n[x];Ne(t,u,P[z]),u+=T[z],z>3&&(Ne(t,u,n[x]>>>5&8191),u+=ge[z])}else Ne(t,u,R[n[x]]),u+=M[n[x]];return Ne(t,u,R[256]),u+M[256]},je=new pe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]);function ze(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,s=t,i=r.length,o=0;o!=i;){for(var a=Math.min(o+5552,i);o<a;++o)s+=n+=r[o];n%=65521,s%=65521}e=n,t=s},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n,s,i,o=function(e,t,r,n,s){return function(e,t,r,n,s,i){var o=e.length,a=new he(n+o+5*(1+Math.floor(o/7e3))+s),l=a.subarray(n,a.length-s),c=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var h=u+65535;h<o?c=Be(l,c,e.subarray(u,h)):(l[u]=i,c=Be(l,c,e.subarray(u,o)))}else{for(var d=je[t-1],p=d>>>13,f=8191&d,g=(1<<r)-1,m=new de(32768),y=new de(g+1),v=Math.ceil(r/3),w=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<w)&g},S=new pe(25e3),C=new de(288),I=new de(32),x=0,k=0,O=(u=0,0),E=0,A=0;u<o;++u){var R=b(u),M=32767&u,P=y[R];if(m[M]=P,y[R]=M,E<=u){var T=o-u;if((x>7e3||O>24576)&&T>423){c=Ue(e,l,0,S,C,I,k,O,A,u-A,c),O=x=k=0,A=u;for(var N=0;N<286;++N)C[N]=0;for(N=0;N<30;++N)I[N]=0}var _=2,D=0,L=f,F=M-P&32767;if(T>2&&R==b(u-F))for(var B=Math.min(p,T)-1,U=Math.min(32767,u),j=Math.min(258,T);F<=U&&--L&&M!=P;){if(e[u+_]==e[u+_-F]){for(var z=0;z<j&&e[u+z]==e[u+z-F];++z);if(z>_){if(_=z,D=F,z>B)break;var W=Math.min(F,z-2),V=0;for(N=0;N<W;++N){var G=u-F+N+32768&32767,Z=G-m[G]+32768&32767;Z>V&&(V=Z,P=G)}}}F+=(M=P)-(P=m[M])+32768&32767}if(D){S[O++]=268435456|be[_]<<18|Se[D];var Y=31&be[_],q=31&Se[D];k+=fe[Y]+ge[q],++C[257+Y],++I[q],E=u+_,++x}else S[O++]=e[u],++C[e[u]]}}c=Ue(e,l,i,S,C,I,k,O,A,u-A,c)}return Pe(a,0,n+Me(c)+s)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!s)}(e,t,2,4);return n=o,i=0==(s=t.level)?0:s<6?1:9==s?3:2,n[0]=120,n[1]=i<<6|(i?32-2*i:1),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(o,o.length-4,r.d()),o}var We=function(){function e(e,t,r,n){var s,i=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=(e=>{const t={...e,v:"v1"};return function(e){for(var t="",r=0;r<e.length;){var n=e[r++];t+=String.fromCharCode(n)}return t}(ze(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new he(e.length+(e.length>>>1)),n=0,s=function(e){r[n++]=e},i=0;i<t;++i){if(n+5>r.length){var o=new he(n+8+(t-i<<1));o.set(r),r=o}var a=e.charCodeAt(i);a<128?s(a):a<2048?(s(192|a>>>6),s(128|63&a)):a>55295&&a<57344?(s(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++i))>>>18),s(128|a>>>12&63),s(128|a>>>6&63),s(128|63&a)):(s(224|a>>>12),s(128|a>>>6&63),s(128|63&a))}return Pe(r,0,n)}(JSON.stringify(t))))})(e);return JSON.stringify(t)},this.addCompressedEventToManager=function(e,t){i.eventsManager&&i.deviceId&&i.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:i.deviceId})},this.addCompressedEvent=function(e,t){if(i.worker)try{i.worker.postMessage({event:e,sessionId:t})}catch(r){"DataCloneError"===r.name?i.worker.postMessage(JSON.stringify({event:e,sessionId:t})):i.config.loggerProvider.warn("Unexpected error while posting message to worker:",r)}else{var r=i.compressEvent(e);i.addCompressedEventToManager(r,t)}},this.terminate=function(){var e;null===(e=i.worker)||void 0===e||e.terminate()};var o=m();if(this.canUseIdleCallback=o&&"requestIdleCallback"in o,this.eventsManager=e,this.config=t,this.deviceId=r,this.timeout=(null===(s=t.performanceConfig)||void 0===s?void 0:s.timeout)||2e3,n){t.loggerProvider.log("Enabling web worker for compression");var a=new Worker(URL.createObjectURL(new Blob([n],{type:"application/javascript"})));a.onerror=function(e){t.loggerProvider.error(e)},a.onmessage=function(e){var t=e.data,r=t.compressedEvent,n=t.sessionId;i.addCompressedEventToManager(r,n)},this.worker=a}}return e.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(t){e.processQueue(t)},{timeout:this.timeout}))},e.prototype.enqueueEvent=function(e,t){var r;this.canUseIdleCallback&&(null===(r=this.config.performanceConfig)||void 0===r?void 0:r.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))},e.prototype.processQueue=function(e){for(var t=this;this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var r=this.taskQueue.shift();if(r){var n=r.event,s=r.sessionId;this.addCompressedEvent(n,s)}}this.taskQueue.length>0?requestIdleCallback(function(e){t.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e}(),Ve="Failed to store session replay events in IndexedDB",Ge="1.30.1",Ze=function(){function e(e){var t=e.trackServerUrl,r=e.loggerProvider,n=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=r,this.payloadBatcher=n||function(e){return e},this.trackServerUrl=t}return e.prototype.sendEventsList=function(e){this.addToQueue(i(i({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.filter(function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:"Session replay event batch rejected due to exceeded retry count"}),!1)}).forEach(function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout(function(){t.timeout=0,e.schedule(0)},t.timeout):e.schedule(0)})},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=setTimeout(function(){t.flush(!0).then(function(){t.queue.length>0&&t.schedule(e)})},e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),o(this,void 0,void 0,function(){var t,r,n=this;return a(this,function(s){switch(s.label){case 0:return t=[],r=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):r.push(e)}),this.queue=r,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),[4,Promise.all(t.map(function(t){return n.send(t,e)}))];case 1:return s.sent(),[2]}})})},e.prototype.send=function(e,t){var r,n;return void 0===t&&(t=!0),o(this,void 0,void 0,function(){var s,i,o,l,c,u,h,d,p,f,g,y,v;return a(this,function(a){switch(a.label){case 0:if(!(s=e.apiKey))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})];if(!(i=e.deviceId))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})];if(w=m(),o=(null==w?void 0:w.location)?w.location.href:"",l=Ge,c=e.sampleRate,u=new URLSearchParams({device_id:i,session_id:"".concat(e.sessionId),type:"".concat(e.type)}),h="".concat((null===(r=e.version)||void 0===r?void 0:r.type)||"standalone","/").concat((null===(n=e.version)||void 0===n?void 0:n.version)||l),0===(d=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];a.label=1;case 1:return a.trys.push([1,3,,4]),p={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(s),"X-Client-Version":l,"X-Client-Library":h,"X-Client-Url":o.substring(0,1e3),"X-Client-Sample-Rate":"".concat(c)},body:JSON.stringify(d),method:"POST"},f="".concat(ee(e.serverZone,this.trackServerUrl),"?").concat(u.toString()),[4,fetch(f,p)];case 2:if(null===(g=a.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)this.handleReponse(g.status,e);else{y="";try{y=JSON.stringify(g.body,null,2)}catch(e){}this.completeRequest({context:e,success:"".concat(g.status,": ").concat(y)})}return[3,4];case 3:return v=a.sent(),this.completeRequest({context:e,err:v}),[3,4];case 4:return[2]}var w})})},e.prototype.handleReponse=function(e,t){switch((new U).buildStatus(e)){case h.Success:this.handleSuccessResponse(t);break;case h.Failed:this.handleOtherResponse(t);break;default:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"})}},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/1024);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(t," KB")})},e.prototype.handleOtherResponse=function(e){this.addToQueue(i(i({},e),{timeout:e.attempts*this.retryTimeout}))},e.prototype.completeRequest=function(e){var t=e.context,r=e.err,n=e.success;t.onComplete(),r?this.loggerProvider.warn(r):n&&this.loggerProvider.log(n)},e}();const Ye=(e,t)=>t.some(t=>e instanceof t);let qe,Ke;const Je=new WeakMap,$e=new WeakMap,Xe=new WeakMap;let He={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return Je.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return tt(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Qe(e){He=e(He)}function et(e){return"function"==typeof e?function(e){return(Ke||(Ke=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(rt(this),t),tt(this.request)}:function(...t){return tt(e.apply(rt(this),t))}}(e):(e instanceof IDBTransaction&&function(e){if(Je.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)});Je.set(e,t)}(e),Ye(e,qe||(qe=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,He):e)}function tt(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(tt(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",s),e.addEventListener("error",i)});return Xe.set(t,e),t}(e);if($e.has(e))return $e.get(e);const t=et(e);return t!==e&&($e.set(e,t),Xe.set(t,e)),t}const rt=e=>Xe.get(e);function nt(e,t,{blocked:r,upgrade:n,blocking:s,terminated:i}={}){const o=indexedDB.open(e,t),a=tt(o);return n&&o.addEventListener("upgradeneeded",e=>{n(tt(o.result),e.oldVersion,e.newVersion,tt(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 st=["get","getKey","getAll","getAllKeys","count"],it=["put","add","delete","clear"],ot=new Map;function at(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(ot.get(t))return ot.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,s=it.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!s&&!st.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 ot.set(t,i),i}Qe(e=>({...e,get:(t,r,n)=>at(t,r)||e.get(t,r,n),has:(t,r)=>!!at(t,r)||e.has(t,r)}));const lt=["continue","continuePrimaryKey","advance"],ct={},ut=new WeakMap,ht=new WeakMap,dt={get(e,t){if(!lt.includes(t))return e[t];let r=ct[t];return r||(r=ct[t]=function(...e){ut.set(this,ht.get(this)[t](...e))}),r}};async function*pt(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const r=new Proxy(t,dt);for(ht.set(r,t),Xe.set(r,rt(t));t;)yield r,t=await(ut.get(r)||t.continue()),ut.delete(r)}function ft(e,t){return t===Symbol.asyncIterator&&Ye(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&Ye(e,[IDBIndex,IDBObjectStore])}Qe(e=>({...e,get:(t,r,n)=>ft(t,r)?pt:e.get(t,r,n),has:(t,r)=>ft(t,r)||e.has(t,r)}));var gt,mt=function(){function e(e){var t,r,n,s=this;this.minInterval=500,this.maxInterval=1e4,this.maxPersistedEventsSize=1e6,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var r=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}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(e){return e.length},e.prototype.getEventsArraySize=function(e){var t,r,n=0;try{for(var s=l(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}();!function(e){e.RECORDING="recording",e.SENT="sent"}(gt||(gt={}));var yt,vt,wt,bt="sessionCurrentSequence",St="sequencesToSend",Ct=function(){var e=m();return new Promise(function(t,r){if(!e)return r(new Error("Global scope not found"));if(!e.indexedDB)return r(new Error("Session Replay: cannot find indexedDB"));try{var n=e.indexedDB.open("keyval-store");n.onupgradeneeded=function(){1===n.result.version&&(n.result.close(),n.transaction&&n.transaction.abort(),e.indexedDB.deleteDatabase("keyval-store"),t())},n.onsuccess=function(){t(n.result)},n.onerror=function(){r(n.error)}}catch(e){r(e)}})},It=function(e){return o(void 0,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:return e.length>0?(t=e.splice(0,10),[4,Promise.all(t)]):[3,2];case 1:return r.sent(),[3,0];case 2:return[2]}})})},xt=function(e){var t,r;return e.objectStoreNames.contains(bt)||(r=e.createObjectStore(bt,{keyPath:"sessionId"})),e.objectStoreNames.contains(St)||(t=e.createObjectStore(St,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:r}},kt=function(e){return o(void 0,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return[4,nt(e,1,{upgrade:xt})];case 1:return[2,t.sent()]}})})},Ot=function(e){function t(t){var r=e.call(this,t)||this;return r.getSequencesToSend=function(){return o(r,void 0,void 0,function(){var e,t,r,n,s,i;return a(this,function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=o.sent(),o.label=2;case 2:return t?(r=t.value,n=r.sessionId,s=r.events,e.push({events:s,sequenceId:t.key,sessionId:n}),[4,t.continue()]):[3,4];case 3:return t=o.sent(),[3,2];case 4:return[2,e];case 5:return i=o.sent(),this.loggerProvider.warn("".concat(Ve,": ").concat(i)),[3,6];case 6:return[2,void 0]}})})},r.storeCurrentSequence=function(e){return o(r,void 0,void 0,function(){var t,r,n;return a(this,function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.db.get(bt,e)];case 1:return(t=s.sent())?[4,this.db.put(St,{sessionId:e,events:t.events})]:[2,void 0];case 2:return r=s.sent(),[4,this.db.put(bt,{sessionId:e,events:[]})];case 3:return s.sent(),[2,i(i({},t),{sessionId:e,sequenceId:r})];case 4:return n=s.sent(),this.loggerProvider.warn("".concat(Ve,": ").concat(n)),[3,5];case 5:return[2,void 0]}})})},r.addEventToCurrentSequence=function(e,t){return o(r,void 0,void 0,function(){var r,n,s,i,o,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,10,,11]),[4,(r=this.db.transaction(bt,"readwrite")).store.get(e)];case 1:return(n=a.sent())?[3,3]:[4,r.store.put({sessionId:e,events:[t]})];case 2:return a.sent(),[2];case 3:return s=void 0,this.shouldSplitEventsList(n.events,t)?(s=n.events,[4,r.store.put({sessionId:e,events:[t]})]):[3,5];case 4:return a.sent(),[3,7];case 5:return i=n.events.concat(t),[4,r.store.put({sessionId:e,events:i})];case 6:a.sent(),a.label=7;case 7:return[4,r.done];case 8:return a.sent(),s?[4,this.storeSendingEvents(e,s)]:[2,void 0];case 9:return(o=a.sent())?[2,{events:s,sessionId:e,sequenceId:o}]:[2,void 0];case 10:return l=a.sent(),this.loggerProvider.warn("".concat(Ve,": ").concat(l)),[3,11];case 11:return[2,void 0]}})})},r.storeSendingEvents=function(e,t){return o(r,void 0,void 0,function(){var r;return a(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.db.put(St,{sessionId:e,events:t})];case 1:return[2,n.sent()];case 2:return r=n.sent(),this.loggerProvider.warn("".concat(Ve,": ").concat(r)),[3,3];case 3:return[2,void 0]}})})},r.cleanUpSessionEventsStore=function(e,t){return o(r,void 0,void 0,function(){var e;return a(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(St,t)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),this.loggerProvider.warn("".concat(Ve,": ").concat(e)),[3,4];case 4:return[2]}})})},r.transitionFromKeyValStore=function(e){return o(r,void 0,void 0,function(){var t,r,n,s,i,l,h,p,f=this;return a(this,function(g){switch(g.label){case 0:return g.trys.push([0,6,,7]),[4,Ct()];case 1:if(!(t=g.sent()))return[2];r=function(e,t){return o(f,void 0,void 0,function(){var r,n,s=this;return a(this,function(i){switch(i.label){case 0:return r=t.sessionSequences,n=[],Object.keys(r).forEach(function(i){var l=parseInt(i,10),h=r[l];if(l===t.currentSequenceId){var d=h.events.map(function(t){return o(s,void 0,void 0,function(){return a(this,function(r){return[2,this.addEventToCurrentSequence(e,t)]})})});n.push.apply(n,u([],c(d),!1))}else h.status!==gt.SENT&&n.push(s.storeSendingEvents(e,h.events))}),[4,It(n)];case 1:return i.sent(),[2]}})})},n="".concat(d,"_").concat(this.apiKey.substring(0,10)),g.label=2;case 2:return g.trys.push([2,4,,5]),s=t.transaction("keyval").objectStore("keyval").getAll(n),i=new Promise(function(t){s.onsuccess=function(n){return o(f,void 0,void 0,function(){var s,i,o,l=this;return a(this,function(a){switch(a.label){case 0:return s=n&&n.target.result,(i=s&&s[0])?(o=[],Object.keys(i).forEach(function(t){var n=parseInt(t,10),s=i[n];if(e===n)o.push(r(n,s));else{var a=s.sessionSequences;Object.keys(a).forEach(function(e){var t=parseInt(e,10);a[t].status!==gt.SENT&&o.push(l.storeSendingEvents(n,a[t].events))})}}),[4,It(o)]):[3,2];case 1:a.sent(),a.label=2;case 2:return t(),[2]}})})}}),[4,i];case 3:return g.sent(),(l=m())&&l.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return h=g.sent(),this.loggerProvider.warn("Failed to transition session replay events from keyval to new store: ".concat(h)),[3,5];case 5:return[3,7];case 6:return p=g.sent(),this.loggerProvider.warn("Failed to access keyval store: ".concat(p,". For more information, visit: https://www.docs.developers.amplitude.com/session-replay/sdks/standalone/#indexeddb-best-practices")),[3,7];case 7:return[2]}})})},r.apiKey=t.apiKey,r.db=t.db,r}return r(t,e),t.new=function(e,r,n){return o(this,void 0,void 0,function(){var s,o,l,c,u;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),s="replay"===e?"":"_".concat(e),o="".concat(r.apiKey.substring(0,10),"_amp_session_replay_events").concat(s),[4,kt(o)];case 1:return l=a.sent(),[4,(c=new t(i(i({},r),{db:l}))).transitionFromKeyValStore(n)];case 2:return a.sent(),[2,c];case 3:return u=a.sent(),r.loggerProvider.warn("".concat(Ve,": ").concat(u)),[3,4];case 4:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return o(this,void 0,void 0,function(){var t,r,n,s,i,o,c;return a(this,function(a){switch(a.label){case 0:return e?[4,this.db.get("sessionCurrentSequence",e)]:[3,2];case 1:return(s=a.sent())?[2,[s]]:[2,void 0];case 2:t=[],a.label=3;case 3:return a.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:r=l.apply(void 0,[a.sent()]),n=r.next(),a.label=5;case 5:if(n.done)return[3,7];s=n.value,t.push(s),a.label=6;case 6:return n=r.next(),[3,5];case 7:return[3,10];case 8:return i=a.sent(),o={error:i},[3,10];case 9:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(o)throw o.error}return[7];case 10:return[2,t]}})})},t}(mt),Et=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t}return r(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,r=u([],c(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:r},this.resetCurrentSequence(e),{sequenceId:t,events:r,sessionId:e}},t.prototype.getSequencesToSend=function(){return o(this,void 0,void 0,function(){return a(this,function(e){return[2,Object.entries(this.finalizedSequences).map(function(e){var t=c(e,2),r=t[0],n=t[1],s=n.sessionId,i=n.events;return{sequenceId:Number(r),sessionId:s,events:i}})]})})},t.prototype.storeCurrentSequence=function(e){return o(this,void 0,void 0,function(){return a(this,function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return o(this,void 0,void 0,function(){var r;return a(this,function(n){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(r=this.addSequence(e)),this.sequences[e].push(t),[2,r]})})},t.prototype.storeSendingEvents=function(e,t){return o(this,void 0,void 0,function(){return a(this,function(r){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return o(this,void 0,void 0,function(){return a(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(mt),At=function(e){var t=e.config,r=e.sessionId,n=e.minInterval,s=e.maxInterval,l=e.type,c=e.payloadBatcher,u=e.storeType;return o(void 0,void 0,void 0,function(){function e(e){return void 0===e&&(e=!1),o(this,void 0,void 0,function(){return a(this,function(t){return[2,h.flush(e)]})})}var h,d,p,f,g,m,y,v,w;return a(this,function(b){switch(b.label){case 0:return h=new Ze(i(i({},t),{loggerProvider:t.loggerProvider,payloadBatcher:c})),d=function(){return new Et({loggerProvider:t.loggerProvider,maxInterval:s,minInterval:n})},p=function(){return o(void 0,void 0,void 0,function(){var e;return a(this,function(i){switch(i.label){case 0:return[4,Ot.new(l,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:s,apiKey:t.apiKey},r)];case 1:return e=i.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,null!=e?e:d()]}})})},"idb"!==u?[3,2]:[4,p()];case 1:return g=b.sent(),[3,3];case 2:g=d(),b.label=3;case 3:return f=g,m=function(e){var r=e.events,n=e.sessionId,s=e.deviceId,i=e.sequenceId;t.debugMode&&ne().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(){}),h.sendEventsList({events:r,sessionId:n,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:s,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:l,onComplete:function(){return o(void 0,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,f.cleanUpSessionEventsStore(n,i)];case 1:return e.sent(),[2]}})})}})},y=function(e){var r=e.sessionId,n=e.deviceId;f.storeCurrentSequence(r).then(function(e){e&&m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})}).catch(function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)})},v=function(e){var t=e.deviceId;return o(void 0,void 0,void 0,function(){var e;return a(this,function(r){switch(r.label){case 0:return[4,f.getSequencesToSend()];case 1:return(e=r.sent())&&e.forEach(function(e){m({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]}})})},w=function(e){var r=e.event,n=e.sessionId,s=e.deviceId;f.addEventToCurrentSequence(n,r.data).then(function(e){return e&&m({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:y,addEvent:w,sendStoredEvents:v,flush:e}]}})})},Rt=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=new Map;e.forEach(function(e){r.set(e.name,e.manager)}),this.managers=r}return e.prototype.sendStoredEvents=function(e){return o(this,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:return t=[],this.managers.forEach(function(r){t.push(r.sendStoredEvents(e))}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e.prototype.addEvent=function(e){var t,r=e.sessionId,n=e.event,s=e.deviceId;null===(t=this.managers.get(n.type))||void 0===t||t.addEvent({sessionId:r,event:n,deviceId:s})},e.prototype.sendCurrentSequenceEvents=function(e){var t=e.sessionId,r=e.deviceId;this.managers.forEach(function(e){e.sendCurrentSequenceEvents({sessionId:t,deviceId:r})})},e.prototype.flush=function(e){return o(this,void 0,void 0,function(){var t;return a(this,function(r){switch(r.label){case 0:return t=[],this.managers.forEach(function(r){t.push(r.flush(e))}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e}();function Mt(e,t){if(wt=new Date,e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var r={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};yt=i(i({},r),t),vt=function(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}(yt.root,r);var n=Pt(e,"all",function(){return Pt(e,"two",function(){return Pt(e,"one",function(){return Pt(e,"none")})})});if(n){var s=zt(Wt(n,e));return s.length>0&&(n=s[0]),Nt(n)}throw new Error("Selector was not found.")}function Pt(e,t,r){for(var n=null,s=[],i=e,o=0,a=function(){var e,a,h=(new Date).getTime()-wt.getTime();if(void 0!==yt.timeoutMs&&h>yt.timeoutMs)throw new Error("Timeout: Can't find a unique selector after ".concat(h,"ms"));var d=Bt(function(e){var t=e.getAttribute("id");return t&&yt.idName(t)?{name:"#"+CSS.escape(t),penalty:0}:null}(i))||Bt.apply(void 0,u([],c(function(e){return Array.from(e.attributes).filter(function(e){return yt.attr(e.name,e.value)}).map(function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}})}(i)),!1))||Bt.apply(void 0,u([],c(function(e){return Array.from(e.classList).filter(yt.className).map(function(e){return{name:"."+CSS.escape(e),penalty:1}})}(i)),!1))||Bt(function(e){var t=e.tagName.toLowerCase();return yt.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(Ft).map(function(e){return Lt(e,p)})));else if("two"==t)d=d.slice(0,1),p&&(d=d.concat(d.filter(Ft).map(function(e){return Lt(e,p)})));else if("one"==t){var f=c(d=d.slice(0,1),1)[0];p&&Ft(f)&&(d=[Lt(f,p)])}else"none"==t&&(d=[{name:"*",penalty:3}],p&&(d=[Lt(d[0],p)]));try{for(var g=(e=void 0,l(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>=yt.seedMinLength&&(n=Tt(s,r)))return"break";i=i.parentElement,o++};i&&"break"!==a(););return n||(n=Tt(s,r)),!n&&r?r():n}function Tt(e,t){var r,n,s=zt(jt(e));if(s.length>yt.threshold)return t?t():null;try{for(var i=l(s),o=i.next();!o.done;o=i.next()){var a=o.value;if(Dt(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 Nt(e){for(var t=e[0],r=t.name,n=1;n<e.length;n++){var s=e[n].level||0;r=t.level===s-1?"".concat(e[n].name," > ").concat(r):"".concat(e[n].name," ").concat(r),t=e[n]}return r}function _t(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function Dt(e){var t=Nt(e);switch(vt.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 Lt(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function Ft(e){return"html"!==e.name&&!e.name.startsWith("#")}function Bt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(Ut);return r.length>0?r:null}function Ut(e){return null!=e}function jt(e,t){var r,n,s,i,o,c;return void 0===t&&(t=[]),a(this,function(a){switch(a.label){case 0:if(!(e.length>0))return[3,9];a.label=1;case 1:a.trys.push([1,6,7,8]),r=l(e[0]),n=r.next(),a.label=2;case 2:return n.done?[3,5]:(s=n.value,[5,l(jt(e.slice(1,e.length),t.concat(s)))]);case 3:a.sent(),a.label=4;case 4:return n=r.next(),[3,2];case 5:return[3,8];case 6:return i=a.sent(),o={error:i},[3,8];case 7:try{n&&!n.done&&(c=r.return)&&c.call(r)}finally{if(o)throw o.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:a.sent(),a.label=11;case 11:return[2]}})}function zt(e){return u([],c(e),!1).sort(function(e,t){return _t(e)-_t(t)})}function Wt(e,t,r){var n,s,i;return void 0===r&&(r={counter:0,visited:new Map}),a(this,function(o){switch(o.label){case 0:if(!(e.length>2&&e.length>yt.optimizedMinLength))return[3,5];n=1,o.label=1;case 1:return n<e.length-1?r.counter>yt.maxNumberOfTries?[2]:(r.counter+=1,(s=u([],c(e),!1)).splice(n,1),i=Nt(s),r.visited.has(i)?[2]:Dt(s)&&function(e,t){return vt.querySelector(Nt(e))===t}(s,t)?[4,s]:[3,4]):[3,5];case 2:return o.sent(),r.visited.set(i,!0),[5,l(Wt(s,t,r))];case 3:o.sent(),o.label=4;case 4:return n++,[3,1];case 5:return[2]}})}var Vt=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}},Gt=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)}},Zt=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===le.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=Mt(g,a)}catch(e){r.logger.debug("error resolving selector from finder")}var y=re(c.href,o),v={x:d+r.scrollWatcher.currentScrollX,y:p+r.scrollWatcher.currentScrollY,selector:f,viewportHeight:u,viewportWidth:h,pageUrl:y,timestamp:Date.now(),type:"click"},w=s();w&&t.addEvent({sessionId:n,event:{type:"interaction",data:JSON.stringify(v)},deviceId:w})}}}}}},this.logger=e,this.scrollWatcher=t};function Yt(){var e=m();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function qt(){var e=m();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}var Kt=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=ee(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}return e.prototype.send=function(e,t){var r=this.context,n=r.sessionId,s=r.type,i=new URLSearchParams({device_id:e,session_id:String(n),type:String(s),api_key:this.apiKey}),o="".concat(this.basePageUrl,"?").concat(i.toString());this.sendBeacon(o,t)||this.sendXhr(o,t)},e}(),Jt=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=e(),o=m();o&&i&&r.transport.send(i,{version:1,events:[{maxScrollX:r._maxScrollX,maxScrollY:r._maxScrollY,maxScrollWidth:r._maxScrollWidth,maxScrollHeight:r._maxScrollHeight,viewportHeight:Yt(),viewportWidth:qt(),pageUrl:re(o.location.href,null!==(s=null===(n=r.config.interactionConfig)||void 0===n?void 0:n.ugcFilterRules)&&void 0!==s?s:[]),timestamp:r.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=qt(),this._maxScrollHeight=Yt(),this.config=t,this.transport=e}return e.default=function(t,r){return new e(new Kt(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=qt();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=Yt();this._maxScrollY=e.y;var i=e.y+s;i>this._maxScrollHeight&&(this._maxScrollHeight=i),this.timestamp=t}},e}(),$t=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))},Xt=new function(){var e=this;this.dbs={},this.createStore=function(t){return o(e,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,nt(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 o(e,void 0,void 0,function(){var e,r;return a(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_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 o(e,void 0,void 0,function(){var e,t,i,o;return a(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(),r.warn("Failed to get targeting match for session id ".concat(s,": ").concat(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 o(e,void 0,void 0,function(){var e,t,o;return a(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(),r.warn("Failed to store targeting match for session id ".concat(s,": ").concat(o)),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var r=t.loggerProvider,n=t.apiKey,s=t.currentSessionId;return o(e,void 0,void 0,function(){var e,t,i,o,l,c,u,h;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,8,,9]),[4,this.openOrCreateDB(n)];case 1:return e=a.sent(),t=String(s),[4,(i=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:o=a.sent(),l=0,a.label=3;case 3:return l<o.length?(c=o[l],u=Date.now()-c.lastUpdated,c.sessionId!==t&&u>1728e5?[4,i.store.delete(c.sessionId)]:[3,5]):[3,6];case 4:a.sent(),a.label=5;case 5:return l++,[3,3];case 6:return[4,i.done];case 7:return a.sent(),[3,9];case 8:return h=a.sent(),r.warn("Failed to clear old targeting matches for sessions: ".concat(h)),[3,9];case 9:return[2]}})})}},Ht=function(e){var t=e.sessionId,r=e.targetingConfig,n=e.loggerProvider,s=e.apiKey,l=e.targetingParams;return o(void 0,void 0,void 0,function(){var e,o,c,u;return a(this,function(a){switch(a.label){case 0:return[4,Xt.clearStoreOfOldSessions({loggerProvider:n,apiKey:s,currentSessionId:t})];case 1:return a.sent(),[4,Xt.getTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t})];case 2:if(!0===a.sent())return[2,!0];e=!0,a.label=3;case 3:return a.trys.push([3,6,,7]),[4,Promise.resolve().then(function(){return Hr})];case 4:return[4,(0,a.sent().evaluateTargeting)(i(i({},l),{flag:r,sessionId:t,apiKey:s,loggerProvider:n}))];case 5:return(o=a.sent())&&o.sr_targeting_config&&(e="on"===o.sr_targeting_config.key),Xt.storeTargetingMatchForSession({loggerProvider:n,apiKey:s,sessionId:t,targetingMatch:e}),[3,7];case 6:return c=a.sent(),u=c,n.warn(u.message),[3,7];case 7:return[2,e]}})})};function Qt(e){return void 0===e&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,r,n){var s,o,a,l=i(i({},e),n),c=l.ugcFilterRules||[],u=null!==(s=l.enablePolling)&&void 0!==s&&s,h=null!==(o=l.pollingInterval)&&void 0!==o?o:1e3,d=null!==(a=l.captureDocumentTitle)&&void 0!==a&&a;if(!r)return function(){};var p=void 0,f="__amplitude_url_tracking_patched__",g="__amplitude_url_tracking_reset__",m=function(){return r.location&&r.location.href||""},y=function(){var e=m();if(void 0===p||e!==p){p=e;var n=function(){var e=r.innerHeight,t=r.innerWidth,n=r.document,s=m(),i="";return d&&(i=(null==n?void 0:n.title)||""),{href:c.length>0?re(s,c):s,title:i,viewportHeight:e,viewportWidth:t,type:"url-change-event"}}();t(n)}},v=function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var s=e.apply(this,t);return r[g]||y(),s};return t[f]=!0,t},w=function(){y()};if(u){var b=r.setInterval(function(){y()},h);return y(),function(){b&&r.clearInterval(b)}}if(r.history){var S=r.history.pushState.bind(r.history),C=r.history.replaceState.bind(r.history);return r.history.pushState[f]||(r.history.pushState=v(S),r.history.replaceState=v(C)),r.addEventListener("popstate",y),r.addEventListener("hashchange",w),y(),function(){r[g]=!0,r.removeEventListener("popstate",y),r.removeEventListener("hashchange",w)}}return r.addEventListener("hashchange",w),y(),function(){r.removeEventListener("hashchange",w)}},options:e}}Qt();var er,tr,rr,nr=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,this.teardownEventListeners=function(t){var r=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(){e.recordEvents(!1)},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),o(e,void 0,void 0,function(){var e,i;return a(this,function(o){switch(o.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig){if(!r)return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.")}return this.lastTargetingParams=t,!this.config.targetingConfig||this.sessionTargetingMatch?[3,2]:((e=t.event)&&Object.values(s).includes(e.event_type)&&(e=void 0),i=this,[4,Ht({sessionId:this.identifiers.sessionId,targetingConfig:this.config.targetingConfig,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:e}})]);case 1:i.sessionTargetingMatch=o.sent(),this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:e,targetingParams:t},null,2)),o.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:o.sent(),o.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n=!0),o(e,void 0,void 0,function(){var e,s,o,l;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=void 0,(s=this.config)&&t!==V.METADATA?(e={config:se(s),version:Ge},n?[4,ne()]:[3,2]):[3,2];case 1:o=a.sent(),e=i(i({},o),e),a.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 l=a.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",l),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var t;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null===(t=e.networkObservers)||void 0===t||t.stop()}catch(t){var r=t;e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(r.toString()))}},this.loggerProvider=new $(new S)}return e.prototype.init=function(e,t){return w(this._init(e,t))},e.prototype._init=function(e,t){var r,n,s,i,l,h;return o(this,void 0,void 0,function(){var o,d,p,f,g,y,v,w,b,C,I,x,k,O,E,A,R;return a(this,function(a){switch(a.label){case 0:return this.loggerProvider=new $(t.loggerProvider||new S),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new $t({sessionId:t.sessionId,deviceId:t.deviceId}),o=this,[4,ue(e,t)];case 1:return o.joinedConfigGenerator=a.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:d=a.sent(),p=d.joinedConfig,f=d.localConfig,g=d.remoteConfig,this.config=p,this.setMetadata(t.sessionId,p,f,g,null===(r=t.version)||void 0===r?void 0:r.version,Ge,null===(n=t.version)||void 0===n?void 0:n.type),t.sessionId&&(null===(s=this.config.interactionConfig)||void 0===s?void 0:s.enabled)&&(y=Jt.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[y.send(this.getDeviceId.bind(this)).bind(y)],this.scrollHook=y.hook.bind(y),this.clickHandler=new Zt(this.loggerProvider,y)),v=[],"idb"!==(w=this.config.storeType)||(null===(i=m())||void 0===i?void 0:i.indexedDB)||(w="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(w," for event storage.")),a.label=3;case 3:return a.trys.push([3,5,,6]),[4,At({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:w})];case 4:return b=a.sent(),v.push({name:"replay",manager:b}),[3,6];case 5:return C=a.sent(),O=C,this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(O.toString())),[3,6];case 6:if(!(null===(l=this.config.interactionConfig)||void 0===l?void 0:l.enabled))return[3,10];I=this.config.interactionConfig.batch?Gt:Vt,a.label=7;case 7:return a.trys.push([7,9,,10]),[4,At({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!==(h=this.config.interactionConfig.trackEveryNms)&&void 0!==h?h:3e4,maxInterval:6e4,payloadBatcher:I,storeType:w})];case 8:return x=a.sent(),v.push({name:"interaction",manager:x}),[3,10];case 9:return k=a.sent(),O=k,this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(O.toString())),[3,10];case 10:return this.eventsManager=new(Rt.bind.apply(Rt,u([void 0],c(v),!1))),this.eventCompressor&&this.eventCompressor.terminate(),E=void 0,A=m(),this.config.useWebWorker&&A&&A.Worker?[4,Promise.resolve().then(function(){return Qr})]:[3,12];case 11:R=a.sent().compressionScript,E=R,a.label=12;case 12:return this.eventCompressor=new We(this.eventsManager,this.config,this.getDeviceId(),E),[4,this.initializeNetworkObservers()];case 13:return a.sent(),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:t.userProperties},!0)];case 14:return a.sent(),[2]}})})},e.prototype.setSessionId=function(e,t){return w(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,r){var n;return o(this,void 0,void 0,function(){var s,i,o;return a(this,function(a){switch(a.label){case 0:return this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(s=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(s),i=t||this.getDeviceId(),this.identifiers=new $t({sessionId:e,deviceId:i}),this.joinedConfigGenerator&&s?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2];case 1:o=a.sent().joinedConfig,this.config=o,a.label=2;case 2:return(null===(n=this.config)||void 0===n?void 0:n.targetingConfig)?[4,this.evaluateTargetingAndCapture({userProperties:null==r?void 0:r.userProperties},!1,!0)]:[3,4];case 3:return a.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:a.sent(),a.label=6;case 6:return[2]}})})},e.prototype.getSessionReplayProperties=function(){var e,t=this.config,r=this.identifiers;if(!t||!r)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var n=this.getShouldRecord(),s={};return n&&((e={})[Z]=r.sessionReplayId?r.sessionReplayId:null,s=e,t.debugMode&&(s[K]=JSON.stringify({appHash:B(t.apiKey).toString()}))),this.addCustomRRWebEvent(V.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=e||(null===(t=this.identifiers)||void 0===t?void 0:t.sessionId),n=this.getDeviceId();this.eventsManager&&r&&n&&this.eventsManager.sendCurrentSequenceEvents({sessionId:r,deviceId:n})},e.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),o(this,void 0,void 0,function(){var r;return a(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,n=!1,s="",i=!1;return this.config.targetingConfig?this.sessionTargetingMatch?(s="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(s),n=!0,i=!0):(s="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(s),n=!1,i=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,r=B(e.toString()),31*Math.abs(r)%1e6/1e6<t?(n=!0,i=!0):(s="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(s),n=!1,i=!1)),this.lastShouldRecordDecision!==n&&this.config.targetingConfig&&(this.addCustomRRWebEvent(V.TARGETING_DECISION,{message:s,sessionId:this.identifiers.sessionId,matched:i,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=n),n},e.prototype.getBlockSelectors=function(){var e,t,r,n=null!==(r=null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.blockSelector)&&void 0!==r?r:[];if(0!==n.length)return n},e.prototype.getMaskTextSelectors=function(){var e,t,r,n;return"conservative"===(null===(t=null===(e=this.config)||void 0===e?void 0:e.privacyConfig)||void 0===t?void 0:t.defaultMaskLevel)?"*":(null===(n=null===(r=this.config)||void 0===r?void 0:r.privacyConfig)||void 0===n?void 0:n.maskSelector)||void 0},e.prototype.getRecordingPlugins=function(e){var t,r,n,s,i,l;return o(this,void 0,void 0,function(){var o,c,u,h;return a(this,function(a){switch(a.label){case 0:o=[];try{c=Qt({ugcFilterRules:(null===(r=null===(t=this.config)||void 0===t?void 0:t.interactionConfig)||void 0===r?void 0:r.ugcFilterRules)||[],enablePolling:(null===(n=this.config)||void 0===n?void 0:n.enableUrlChangePolling)||!1,pollingInterval:null===(s=this.config)||void 0===s?void 0:s.urlChangePollingInterval,captureDocumentTitle:null===(i=this.config)||void 0===i?void 0:i.captureDocumentTitle}),o.push(c)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null===(l=null==e?void 0:e.console)||void 0===l?void 0:l.enabled))return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return Mh})];case 2:return u=a.sent().getRecordConsolePlugin,o.push(u({level:e.console.levels})),[3,4];case 3:return h=a.sent(),this.loggerProvider.warn("Failed to load console plugin:",h),[3,4];case 4:return[2,o.length>0?o:void 0]}})})},e.prototype.getRecordFunction=function(){return o(this,void 0,void 0,function(){var e,t;return a(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 VS})];case 2:return e=r.sent().record,this.recordFunction=e,[2,e];case 3:return t=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",t),[2,null];case 4:return[2]}})})},e.prototype.recordEvents=function(e){var t,r,n,s,i,l,c;return void 0===e&&(e=!0),o(this,void 0,void 0,function(){var o,u,h,d,p,f,g,m,y,v,w,b,S,C=this;return a(this,function(a){switch(a.label){case 0:return o=this.config,u=this.getShouldRecord(),h=null===(t=this.identifiers)||void 0===t?void 0:t.sessionId,u&&h&&o?(this.stopRecordingEvents(),[4,this.getRecordFunction()]):[2];case 1:return(d=a.sent())?[4,this.initializeNetworkObservers()]:[2];case 2:a.sent(),null===(r=this.networkObservers)||void 0===r||r.start(function(e){C.addCustomRRWebEvent(V.FETCH_REQUEST,e)}),p=o.privacyConfig,f=o.interactionConfig,g=o.loggingConfig,m=(null==f?void 0:f.enabled)?{mouseInteraction:this.eventsManager&&(null===(n=this.clickHandler)||void 0===n?void 0:n.createHook({eventsManager:this.eventsManager,sessionId:h,deviceIdFn:this.getDeviceId.bind(this),mirror:d.mirror,ugcFilterRules:null!==(s=f.ugcFilterRules)&&void 0!==s?s:[],performanceOptions:null===(i=o.performanceConfig)||void 0===i?void 0:i.interaction})),scroll:this.scrollHook}:{},y=(null==f?void 0:f.enabled)&&f.ugcFilterRules?f.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(h,".")),a.label=3;case 3:return a.trys.push([3,5,,6]),v=this,w=d,S={emit:function(e){if(C.shouldOptOut())return C.loggerProvider.log("Opting session ".concat(h," out of recording due to optOut config.")),C.stopRecordingEvents(),void C.sendEvents();e.type===ae.Meta&&(e.data.href=re(e.data.href,y)),C.eventCompressor&&C.eventCompressor.enqueueEvent(e,h)},inlineStylesheet:o.shouldInlineStylesheet,hooks:m,maskAllInputs:!0,maskTextClass:J,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:o.applyBackgroundColorToBlockedElements,maskInputFn:Q("input",p),maskTextFn:Q("text",p),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:null===(l=o.omitElementTags)||void 0===l?void 0:l.script,comment:null===(c=o.omitElementTags)||void 0===c?void 0:c.comment},errorHandler:function(e){var t=e;if(t.message.includes("insertRule")&&t.message.includes("CSSStyleSheet"))throw t;if(t._external_)throw t;return C.loggerProvider.warn("Error while capturing replay: ",t.toString()),!0}},[4,this.getRecordingPlugins(g)];case 4:return v.recordCancelCallback=w.apply(void 0,[(S.plugins=a.sent(),S)]),this.addCustomRRWebEvent(V.DEBUG_INFO),e&&this.addCustomRRWebEvent(V.METADATA,this.metadata),[3,6];case 5:return b=a.sent(),this.loggerProvider.warn("Failed to initialize session replay:",b),[3,6];case 6:return[2]}})})},e.prototype.getDeviceId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.deviceId},e.prototype.getSessionId=function(){var e;return null===(e=this.identifiers)||void 0===e?void 0:e.sessionId},e.prototype.flush=function(e){var t;return void 0===e&&(e=!1),o(this,void 0,void 0,function(){return a(this,function(r){return[2,null===(t=this.eventsManager)||void 0===t?void 0:t.flush(e)]})})},e.prototype.shutdown=function(){this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},e.prototype.mapSDKType=function(e){return"plugin"===e?"@amplitude/plugin-session-replay-browser":"segment"===e?"@amplitude/segment-session-replay-plugin":null},e.prototype.setMetadata=function(e,t,r,n,s,i,o){var a=(null==e?void 0:e.toString())?B(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 o(this,void 0,void 0,function(){var n,s;return a(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 ZS})];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}(),sr=function(e){return function(){var t=e.config||ie();return{logger:t.loggerProvider,logLevel:t.logLevel}}},ir=function(){var e=new nr;return{init:O(e.init.bind(e),"init",sr(e)),evaluateTargetingAndCapture:O(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",sr(e)),setSessionId:O(e.setSessionId.bind(e),"setSessionId",sr(e)),getSessionId:O(e.getSessionId.bind(e),"getSessionId",sr(e)),getSessionReplayProperties:O(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",sr(e)),flush:O(e.flush.bind(e),"flush",sr(e)),shutdown:O(e.shutdown.bind(e),"shutdown",sr(e))}}(),or=ir.init,ar=ir.setSessionId,lr=ir.getSessionId,cr=ir.getSessionReplayProperties,ur=ir.flush,hr=ir.shutdown,dr=ir.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"}(er||(er={})),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"}(tr||(tr={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(rr||(rr={}));const pr=[er.SET,er.SET_ONCE,er.ADD,er.APPEND,er.PREPEND,er.POSTINSERT],fr="1.25.0";class gr{constructor(e){this.name=gr.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:ur,getSessionId:lr,getSessionReplayProperties:cr,init:or,setSessionId:ar,shutdown:hr,evaluateTargetingAndCapture:dr},this.options=Object.assign({forceSessionTracking:!1},e),this.srInitOptions=this.options}setup(e,t){var r,n,s,i,a,l,c,u;return o(this,void 0,void 0,function*(){try{null==e||e.loggerProvider.log(`Installing @amplitude/plugin-session-replay, version ${fr}.`),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 o=(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===(a=this.options.privacyConfig)||void 0===a?void 0:a.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:fr},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:o,omitElementTags:this.options.omitElementTags,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval},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 o(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 o(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;return o(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 r=null===(t=this.config)||void 0===t?void 0:t.sessionId;if(r&&r!==this.sessionReplay.getSessionId()&&(yield this.sessionReplay.setSessionId(r).promise),r&&r===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(pr.includes(r)){const n=e.user_properties&&e.user_properties[r];t=Object.assign(Object.assign({},t),n)}}),t})(e)),yield this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:t});const r=this.sessionReplay.getSessionReplayProperties();e.event_properties=Object.assign(Object.assign({},e.event_properties),r)}}return Promise.resolve(e)}catch(t){return null===(r=this.config)||void 0===r||r.loggerProvider.error(`Session Replay: Failed to enrich event due to ${t.message}`),Promise.resolve(e)}})}teardown(){var e;return o(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()}}gr.pluginName="@amplitude/plugin-session-replay-browser";const mr=e=>new gr(e);var yr=function(e,t){return yr=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])},yr(e,t)},vr=function(){return vr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},vr.apply(this,arguments)};function wr(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}"function"==typeof SuppressedError&&SuppressedError;var br="is not",Sr="contains",Cr="does not contain",Ir="less",xr="less or equal",kr="greater",Or="greater or equal",Er="version less",Ar="version less or equal",Rr="version greater",Mr="version greater or equal",Pr="set is",Tr="set is not",Nr="set contains",_r="set does not contain",Dr="set contains any",Lr="set does not contain any",Fr=-862048943,Br=461845907,Ur=function(e,t){var r=e,n=t;return r=Math.imul(r,Fr),r=zr(r,15),r=Math.imul(r,Br),n=zr(n^=r,13),(n=Math.imul(n,5))+-430675100|0},jr=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,(t=Math.imul(t,-1028477387))^t>>>16},zr=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},Wr=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 Vr(r)},Vr=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Gr=function(e,t){var r,n;if(t&&0!==t.length){try{for(var s=wr(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}},Zr="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),Yr=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(Zr).exec(t);if(r){var n=Number(r[1]),s=Number(r[2]);if(!isNaN(n)&&!isNaN(s))return new e(n,s,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),qr=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,s={},i={context:e,result:s};try{for(var o=wr(t),a=o.next();!a.done;a=o.next()){var l=a.value,c=this.evaluateFlag(i,l);c&&(s[l.key]=c)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},e.prototype.evaluateFlag=function(e,t){var r,n,s;try{for(var i=wr(t.segments),o=i.next();!o.done;o=i.next()){var a=o.value;if(s=this.evaluateSegment(e,t,a)){var l=vr(vr(vr({},t.metadata),a.metadata),s.metadata);s=vr(vr({},s),{metadata:l});break}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s},e.prototype.evaluateSegment=function(e,t,r){var n,s,i,o;if(!r.conditions)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0;try{for(var a=wr(r.conditions),l=a.next();!l.done;l=a.next()){var c,u=l.value,h=!0;try{for(var d=(i=void 0,wr(u)),p=d.next();!p.done;p=d.next()){var f=p.value;if(!(h=this.matchCondition(e,f)))break}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}if(h)return void 0!==(c=this.bucket(e,r))?t.variants[c]:void 0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=a.return)&&s.call(a)}finally{if(n)throw n.error}}},e.prototype.matchCondition=function(e,t){var r=Gr(e,t.selector);if(r){if(this.isSetOperator(t.op)){var n=this.coerceStringArray(r);return!!n&&this.matchSet(n,t.op,t.values)}var s=this.coerceString(r);return void 0!==s&&this.matchString(s,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return function(e,t){void 0===t&&(t=0);for(var r=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var s=e.charCodeAt(n);s<128?t[r++]=s:s<2048?(t[r++]=s>>6|192,t[r++]=63&s|128):55296==(64512&s)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++n)),t[r++]=s>>18|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128,t[r++]=63&s|128):(t[r++]=s>>12|224,t[r++]=s>>6&63|128,t[r++]=63&s|128)}return Uint8Array.from(t)}(e),n=r.length,s=n>>2,i=t,o=0;o<s;o++){var a=Wr(r,o<<2);i=Ur(a,i)}var l=s<<2,c=0;switch(n-l){case 3:c^=r[l+2]<<16,c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Fr),c=zr(c,15),i^=c=Math.imul(c,Br);break;case 2:c^=r[l+1]<<8,c^=r[l],c=Math.imul(c,Fr),c=zr(c,15),i^=c=Math.imul(c,Br);break;case 1:c^=r[l],c=Math.imul(c,Fr),c=zr(c,15),i^=c=Math.imul(c,Br)}return jr(i^=n)>>>0}(e)},e.prototype.bucket=function(e,t){var r,n,s,i;if(!t.bucket)return t.variant;var o=this.coerceString(Gr(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=wr(t.bucket.allocations),d=h.next();!d.done;d=h.next()){var p=d.value,f=p.range[0],g=p.range[1];if(c>=f&&c<g)try{for(var m=(s=void 0,wr(p.distributions)),y=m.next();!y.done;y=m.next()){var v=y.value,w=v.range[0],b=v.range[1];if(u>=w&&u<b)return v.variant}}catch(e){s={error:e}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(s)throw s.error}}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case"is":case Sr:case Ir:case xr:case kr:case Or:case Er:case Ar:case Rr:case Mr:case Pr:case Nr:case Dr:return r;case br:case Cr:case _r:case Lr:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case Pr:return this.setEquals(e,r);case Tr:return!this.setEquals(e,r);case Nr:return this.matchesSetContainsAll(e,r);case _r:return!this.matchesSetContainsAll(e,r);case Dr:return this.matchesSetContainsAny(e,r);case Lr:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case"is":return this.matchesIs(e,r);case br:return!this.matchesIs(e,r);case Sr:return this.matchesContains(e,r);case Cr:return!this.matchesContains(e,r);case Ir:case xr:case kr:case Or:return this.matchesComparable(e,t,r,function(e){return n.parseNumber(e)},this.comparator);case Er:case Ar:case Rr:case Mr:return this.matchesComparable(e,t,r,function(e){return Yr.parse(e)},this.versionComparator);case"regex match":return this.matchesRegex(e,r);case"regex does not match":return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some(function(e){return e.toLowerCase()===r})}return t.some(function(t){return e===t})},e.prototype.matchesContains=function(e,t){var r,n;try{for(var s=wr(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(e.toLowerCase().includes(o.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,s){var i=this,o=n(e),a=r.map(function(e){return n(e)}).filter(function(e){return void 0!==e});return void 0===o||0===a.length?r.some(function(r){return i.comparator(e,t,r)}):a.some(function(e){return s(o,t,e)})},e.prototype.comparator=function(e,t,r){switch(t){case Ir:case Er:return e<r;case xr:case Ar:return e<=r;case kr:case Rr:return e>r;case Or:case Mr:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case Ir:case Er:return n<0;case xr:case Ar:return n<=0;case kr:case Rr:return n>0;case Or:case Mr: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 Pr:case Tr:case Nr:case _r:case Dr:case Lr:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&function(e,t,r){if(r||2===arguments.length)for(var n,s=0,i=t.length;s<i;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);return e.concat(n||Array.prototype.slice.call(t))}([],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}(n),!1).every(function(e){return r.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var s=wr(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(!this.matchesIs(o,e))return!1}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var s=wr(t),i=s.next();!i.done;i=s.next()){var o=i.value;if(this.matchesIs(o,e))return!0}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},e}();"function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder&&new TextEncoder,Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=").forEach((e,t)=>t),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}yr(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 Kr,Jr=new function(){var e=this;this.dbs={},this.createStore=function(t){return o(e,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,nt(t,1,{upgrade:function(e){e.objectStoreNames.contains("eventTypesForSession")||e.createObjectStore("eventTypesForSession",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return o(e,void 0,void 0,function(){var e,r;return a(this,function(n){switch(n.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e="".concat(t.substring(0,10),"_amp_targeting"),[4,this.createStore(e)]);case 1:return r=n.sent(),this.dbs[t]=r,[2,r]}})})},this.updateEventListForSession=function(t){var r=t.sessionId,n=t.eventType,s=t.eventTime,l=t.loggerProvider,c=t.tx;return o(e,void 0,void 0,function(){var e,t,o,u,h,d,p,f,g;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),e=String(r),[4,c.store.get(e)];case 1:return t=a.sent(),o=t?t.eventTypes:{},u=o[n]||{},h=i(i({},o),((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 a.sent(),[2,h];case 3:return p=a.sent(),l.warn("Failed to store events for targeting ".concat(r,": ").concat(p)),[3,4];case 4:return[2,void 0]}})})},this.deleteOldSessionEventTypes=function(t){var r=t.currentSessionId,n=t.loggerProvider,s=t.tx;return o(e,void 0,void 0,function(){var e,t,i,o,l,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,6,,7]),e=String(r),[4,s.store.getAll()];case 1:t=a.sent(),i=0,a.label=2;case 2:return i<t.length?(o=t[i],l=Date.now()-o.lastUpdated,o.sessionId!==e&&l>1728e5?[4,s.store.delete(o.sessionId)]:[3,4]):[3,5];case 3:a.sent(),a.label=4;case 4:return i++,[3,2];case 5:return[3,7];case 6:return c=a.sent(),n.warn("Failed to clear old session event types for targeting: ".concat(c)),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var r=t.loggerProvider,n=t.sessionId,s=t.eventType,i=t.eventTime,l=t.apiKey;return o(e,void 0,void 0,function(){var e,t,o,c;return a(this,function(a){switch(a.label){case 0:return a.trys.push([0,5,,6]),[4,this.openOrCreateDB(l)];case 1:return e=a.sent(),(t=e.transaction("eventTypesForSession","readwrite"))?[4,this.updateEventListForSession({sessionId:n,tx:t,loggerProvider:r,eventType:s,eventTime:i})]:[2];case 2:return o=a.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:n,tx:t,loggerProvider:r})];case 3:return a.sent(),[4,t.done];case 4:return a.sent(),[2,o];case 5:return c=a.sent(),r.warn("Failed to store events for targeting ".concat(n,": ").concat(c)),[3,6];case 6:return[2,void 0]}})})}},$r=function(){var e=this;this.evaluateTargeting=function(t){var r=t.apiKey,n=t.loggerProvider,s=t.event,i=t.sessionId,l=t.userProperties,c=t.deviceId,u=t.flag;return o(e,void 0,void 0,function(){var e,t,o,h;return a(this,function(a){switch(a.label){case 0:return s&&s.time?[4,Jr.storeEventTypeForSession({loggerProvider:n,apiKey:r,sessionId:i,eventType:s.event_type,eventTime:s.time})]:[3,2];case 1:return t=a.sent(),[3,3];case 2:t=void 0,a.label=3;case 3:return o=(e=t)&&new Set(Object.keys(e)),h={session_id:i,event:s,event_types:o&&Array.from(o),user:{device_id:c,user_properties:l}},[2,this.evaluationEngine.evaluate(h,[u])]}})})},this.evaluationEngine=new qr},Xr=function(){var e=new $r;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}().evaluateTargeting,Hr=Object.freeze({__proto__:null,evaluateTargeting:Xr}),Qr=Object.freeze({__proto__:null,compressionScript:'var WebWorker=function(r){"use strict";var n=Uint8Array,e=Uint16Array,f=Uint32Array,t=new n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i=function(r,n){for(var t=new e(31),a=0;a<31;++a)t[a]=n+=1<<r[a-1];var o=new f(t[30]);for(a=1;a<30;++a)for(var i=t[a];i<t[a+1];++i)o[i]=i-t[a]<<5|a;return[t,o]},v=i(t,2),u=v[0],s=v[1];u[28]=258,s[258]=28;for(var l=i(a,0)[1],c=new e(32768),h=0;h<32768;++h){var g=(43690&h)>>>1|(21845&h)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,c[h]=((65280&g)>>>8|(255&g)<<8)>>>1}var w=function(r,n,f){for(var t=r.length,a=0,o=new e(n);a<t;++a)++o[r[a]-1];var i,v=new e(n);for(a=0;a<n;++a)v[a]=v[a-1]+o[a-1]<<1;if(f){i=new e(1<<n);var u=15-n;for(a=0;a<t;++a)if(r[a])for(var s=a<<4|r[a],l=n-r[a],h=v[r[a]-1]++<<l,g=h|(1<<l)-1;h<=g;++h)i[c[h]>>>u]=s}else for(i=new e(t),a=0;a<t;++a)i[a]=c[v[r[a]-1]++]>>>15-r[a];return i},d=new n(288);for(h=0;h<144;++h)d[h]=8;for(h=144;h<256;++h)d[h]=9;for(h=256;h<280;++h)d[h]=7;for(h=280;h<288;++h)d[h]=8;var m=new n(32);for(h=0;h<32;++h)m[h]=5;var y=w(d,9,0),M=w(m,5,0),p=function(r){return(r/8|0)+(7&r&&1)},b=function(r,t,a){(null==a||a>r.length)&&(a=r.length);var o=new(r instanceof e?e:r instanceof f?f:n)(a-t);return o.set(r.subarray(t,a)),o},C=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8},S=function(r,n,e){e<<=7&n;var f=n/8|0;r[f]|=e,r[f+1]|=e>>>8,r[f+2]|=e>>>16},x=function(r,f){for(var t=[],a=0;a<r.length;++a)r[a]&&t.push({s:a,f:r[a]});var o=t.length,i=t.slice();if(!o)return[new n(0),0];if(1==o){var v=new n(t[0].s+1);return v[t[0].s]=1,[v,1]}t.sort(function(r,n){return r.f-n.f}),t.push({s:-1,f:25001});var u=t[0],s=t[1],l=0,c=1,h=2;for(t[0]={s:-1,f:u.f+s.f,l:u,r:s};c!=o-1;)u=t[t[l].f<t[h].f?l++:h++],s=t[l!=c&&t[l].f<t[h].f?l++:h++],t[c++]={s:-1,f:u.f+s.f,l:u,r:s};var g=i[0].s;for(a=1;a<o;++a)i[a].s>g&&(g=i[a].s);var w=new e(g+1),d=A(t[c-1],w,0);if(d>f){a=0;var m=0,y=d-f,M=1<<y;for(i.sort(function(r,n){return w[n.s]-w[r.s]||r.f-n.f});a<o;++a){var p=i[a].s;if(!(w[p]>f))break;m+=M-(1<<d-w[p]),w[p]=f}for(m>>>=y;m>0;){var b=i[a].s;w[b]<f?m-=1<<f-w[b]++-1:++a}for(;a>=0&&m;--a){var C=i[a].s;w[C]==f&&(--w[C],++m)}d=f}return[new n(w),d]},A=function(r,n,e){return-1==r.s?Math.max(A(r.l,n,e+1),A(r.r,n,e+1)):n[r.s]=e},O=function(r){for(var n=r.length;n&&!r[--n];);for(var f=new e(++n),t=0,a=r[0],o=1,i=function(r){f[t++]=r},v=1;v<=n;++v)if(r[v]==a&&v!=n)++o;else{if(!a&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(a),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(a);o=1,a=r[v]}return[f.subarray(0,t),n]},T=function(r,n){for(var e=0,f=0;f<n.length;++f)e+=r[f]*n[f];return e},k=function(r,n,e){var f=e.length,t=p(n+2);r[t]=255&f,r[t+1]=f>>>8,r[t+2]=255^r[t],r[t+3]=255^r[t+1];for(var a=0;a<f;++a)r[t+a+4]=e[a];return 8*(t+4+f)},E=function(r,n,f,i,v,u,s,l,c,h,g){C(n,g++,f),++v[256];for(var p=x(v,15),b=p[0],A=p[1],E=x(u,15),J=E[0],N=E[1],U=O(b),D=U[0],I=U[1],W=O(J),_=W[0],j=W[1],P=new e(19),q=0;q<D.length;++q)P[31&D[q]]++;for(q=0;q<_.length;++q)P[31&_[q]]++;for(var z=x(P,7),B=z[0],F=z[1],G=19;G>4&&!B[o[G-1]];--G);var H,K,L,Q,R=h+5<<3,V=T(v,d)+T(u,m)+s,X=T(v,b)+T(u,J)+s+14+3*G+T(P,B)+(2*P[16]+3*P[17]+7*P[18]);if(R<=V&&R<=X)return k(n,g,r.subarray(c,c+h));if(C(n,g,1+(X<V)),g+=2,X<V){H=w(b,A,0),K=b,L=w(J,N,0),Q=J;var Y=w(B,F,0);C(n,g,I-257),C(n,g+5,j-1),C(n,g+10,G-4),g+=14;for(q=0;q<G;++q)C(n,g+3*q,B[o[q]]);g+=3*G;for(var Z=[D,_],$=0;$<2;++$){var rr=Z[$];for(q=0;q<rr.length;++q){var nr=31&rr[q];C(n,g,Y[nr]),g+=B[nr],nr>15&&(C(n,g,rr[q]>>>5&127),g+=rr[q]>>>12)}}}else H=y,K=d,L=M,Q=m;for(q=0;q<l;++q)if(i[q]>255){nr=i[q]>>>18&31;S(n,g,H[nr+257]),g+=K[nr+257],nr>7&&(C(n,g,i[q]>>>23&31),g+=t[nr]);var er=31&i[q];S(n,g,L[er]),g+=Q[er],er>3&&(S(n,g,i[q]>>>5&8191),g+=a[er])}else S(n,g,H[i[q]]),g+=K[i[q]];return S(n,g,H[256]),g+K[256]},J=new f([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),N=function(r,o,i,v,u){return function(r,o,i,v,u,c){var h=r.length,g=new n(v+h+5*(1+Math.floor(h/7e3))+u),w=g.subarray(v,g.length-u),d=0;if(!o||h<8)for(var m=0;m<=h;m+=65535){var y=m+65535;y<h?d=k(w,d,r.subarray(m,y)):(w[m]=c,d=k(w,d,r.subarray(m,h)))}else{for(var M=J[o-1],C=M>>>13,S=8191&M,x=(1<<i)-1,A=new e(32768),O=new e(x+1),T=Math.ceil(i/3),N=2*T,U=function(n){return(r[n]^r[n+1]<<T^r[n+2]<<N)&x},D=new f(25e3),I=new e(288),W=new e(32),_=0,j=0,P=(m=0,0),q=0,z=0;m<h;++m){var B=U(m),F=32767&m,G=O[B];if(A[F]=G,O[B]=F,q<=m){var H=h-m;if((_>7e3||P>24576)&&H>423){d=E(r,w,0,D,I,W,j,P,z,m-z,d),P=_=j=0,z=m;for(var K=0;K<286;++K)I[K]=0;for(K=0;K<30;++K)W[K]=0}var L=2,Q=0,R=S,V=F-G&32767;if(H>2&&B==U(m-V))for(var X=Math.min(C,H)-1,Y=Math.min(32767,m),Z=Math.min(258,H);V<=Y&&--R&&F!=G;){if(r[m+L]==r[m+L-V]){for(var $=0;$<Z&&r[m+$]==r[m+$-V];++$);if($>L){if(L=$,Q=V,$>X)break;var rr=Math.min(V,$-2),nr=0;for(K=0;K<rr;++K){var er=m-V+K+32768&32767,fr=er-A[er]+32768&32767;fr>nr&&(nr=fr,G=er)}}}V+=(F=G)-(G=A[F])+32768&32767}if(Q){D[P++]=268435456|s[L]<<18|l[Q];var tr=31&s[L],ar=31&l[Q];j+=t[tr]+a[ar],++I[257+tr],++W[ar],q=m+L,++_}else D[P++]=r[m],++I[r[m]]}}d=E(r,w,c,D,I,W,j,P,z,m-z,d)}return b(g,0,v+p(d)+u)}(r,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+o.mem,i,v,!u)};function U(r,n){void 0===n&&(n={});var e=function(){var r=1,n=0;return{p:function(e){for(var f=r,t=n,a=e.length,o=0;o!=a;){for(var i=Math.min(o+5552,a);o<i;++o)t+=f+=e[o];f%=65521,t%=65521}r=f,n=t},d:function(){return(r>>>8<<16|(255&n)<<8|n>>>8)+2*((255&r)<<23)}}}();e.p(r);var f,t,a,o=N(r,n,2,4);return f=o,t=n.level,a=0==t?0:t<6?1:9==t?3:2,f[0]=120,f[1]=a<<6|(a?32-2*a:1),function(r,n,e){for(;e;++n)r[n]=e,e>>>=8}(o,o.length-4,e.d()),o}const D=r=>{const e={...r,v:"v1"};return function(r,n){var e="";if(!n&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(r);for(var f=0;f<r.length;){var t=r[f++];t<128||n?e+=String.fromCharCode(t):t<224?e+=String.fromCharCode((31&t)<<6|63&r[f++]):t<240?e+=String.fromCharCode((15&t)<<12|(63&r[f++])<<6|63&r[f++]):(t=((15&t)<<18|(63&r[f++])<<12|(63&r[f++])<<6|63&r[f++])-65536,e+=String.fromCharCode(55296|t>>10,56320|1023&t))}return e}(U(function(r,e){var f=r.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(r);for(var t=new n(r.length+(r.length>>>1)),a=0,o=function(r){t[a++]=r},i=0;i<f;++i){if(a+5>t.length){var v=new n(a+8+(f-i<<1));v.set(t),t=v}var u=r.charCodeAt(i);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&r.charCodeAt(++i))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return b(t,0,a)}(JSON.stringify(e))),!0)};onmessage=r=>{const{event:n,sessionId:e}="string"==typeof r.data?JSON.parse(r.data):r.data,f=JSON.stringify(D(n));postMessage({compressedEvent:f,sessionId:e})};const I=onmessage;return r.compressionOnMessage=I,Object.defineProperty(r,"__esModule",{value:!0}),r}({});\n'}),en=Object.defineProperty,tn=(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),rn=Object.defineProperty,nn=(e,t,r)=>((e,t,r)=>t in e?rn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),sn=Object.defineProperty,on=(e,t,r)=>((e,t,r)=>t in e?sn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const an={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ln={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},cn={};function un(e){if(cn[e])return cn[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 an?an[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 ln?ln[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 cn[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?cn[e]=i:r}catch{return r}}const hn={};function dn(e,t,r){var n;const s=`${e}.${String(r)}`;if(hn[s])return hn[s].call(t);const i=un(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(hn[s]=o,o.call(t)):t[r]}const pn=function(e){return dn("Node",e,"parentNode")},fn=function(e){return e&&"host"in e?dn("ShadowRoot",e,"host"):null},gn=function(e){return e&&"shadowRoot"in e?dn("Element",e,"shadowRoot"):null};function mn(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&mn(pn(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&mn(pn(e),t,r)}var yn={exports:{}},vn=String,wn=function(){return{isColorSupported:!1,reset:vn,bold:vn,dim:vn,italic:vn,underline:vn,inverse:vn,hidden:vn,strikethrough:vn,black:vn,red:vn,green:vn,yellow:vn,blue:vn,magenta:vn,cyan:vn,white:vn,gray:vn,bgBlack:vn,bgRed:vn,bgGreen:vn,bgYellow:vn,bgBlue:vn,bgMagenta:vn,bgCyan:vn,bgWhite:vn}};yn.exports=wn(),yn.exports.createColors=wn;var bn=yn.exports;const Sn=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Cn=bn,In=Sn,xn=class e extends Error{constructor(t,r,n,s,i,o){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Cn.isColorSupported),In&&e&&(t=In(t));let r,n,s=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,s.length),a=String(o).length;if(e){let{bold:e,gray:t,red:s}=Cn.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(i,o).map((e,t)=>{let s=i+1+t,o=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(o)+e+"\n "+t+r("^")}return" "+n(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var kn=xn;xn.default=xn;var On={};On.isClean=Symbol("isClean"),On.my=Symbol("my");const En={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let An=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return En[r];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[r])return i.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((o=r)[0].toUpperCase()+o.slice(1));this[s]?n=this[s](i,e):i.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var o;return void 0===n&&(n=En[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Rn=An;An.default=An;let Mn=Rn;function Pn(e,t){new Mn(t).stringify(e)}var Tn=Pn;Pn.default=Pn;let{isClean:Nn,my:_n}=On,Dn=kn,Ln=Rn,Fn=Tn;function Bn(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>Bn(e,r)):("object"===i&&null!==s&&(s=Bn(s)),r[n]=s)}return r}let Un=class{constructor(e={}){this.raws={},this[Nn]=!1,this[_n]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Bn(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 Dn(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[Nn]){this[Nn]=!1;let e=this;for(;e=e.parent;)e[Nn]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Ln).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Fn){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var jn=Un;Un.default=Un;let zn=jn,Wn=class extends zn{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Vn=Wn;Wn.default=Wn;var Gn={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}};let{SourceMapConsumer:Zn,SourceMapGenerator:Yn}=Sn,{existsSync:qn,readFileSync:Kn}=Sn,{dirname:Jn,join:$n}=Sn,Xn=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Jn(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Zn(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=Jn(e),qn(e))return this.mapFile=e,Kn(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Zn)return Yn.fromSourceMap(t).toString();if(t instanceof Yn)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=$n(Jn(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Hn=Xn;Xn.default=Xn;let{SourceMapConsumer:Qn,SourceMapGenerator:es}=Sn,{fileURLToPath:ts,pathToFileURL:rs}=Sn,{isAbsolute:ns,resolve:ss}=Sn,{nanoid:is}=Gn,os=Sn,as=kn,ls=Hn,cs=Symbol("fromOffsetCache"),us=Boolean(Qn&&es),hs=Boolean(ss&&ns),ds=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!hs||/^\w+:\/\//.test(t.from)||ns(t.from)?this.file=t.from:this.file=ss(t.from)),hs&&us){let e=new ls(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+is(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;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);i=e.line,o=e.col}else i=n.line,o=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return s=a?new as(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new as(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(rs&&(s.input.url=rs(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[cs])r=this[cs];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[cs]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ss(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,i,o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=o.originalPositionFor({column:n,line:r})),i=ns(a.source)?rs(a.source):new URL(a.source,this.map.consumer().sourceRoot||rs(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:i.toString()};if("file:"===i.protocol){if(!ts)throw new Error("file: protocol is not available in this PostCSS build");l.file=ts(i)}let c=o.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var ps=ds;ds.default=ds,os&&os.registerInput&&os.registerInput(ds);let{SourceMapConsumer:fs,SourceMapGenerator:gs}=Sn,{dirname:ms,relative:ys,resolve:vs,sep:ws}=Sn,{pathToFileURL:bs}=Sn,Ss=ps,Cs=Boolean(fs&&gs),Is=Boolean(ms&&vs&&ys&&ws);var xs=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||ms(e.file);!1===this.mapOpts.sourcesContent?(t=new fs(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Is&&Cs&&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=gs.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new gs({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new gs({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=o.match(/\n/g),e?(r+=e.length,t=o.lastIndexOf("\n"),n=o.length-t):n+=o.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?ms(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=ms(vs(r,this.mapOpts.annotation)));let n=ys(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Ss(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(bs){let t=bs(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;"\\"===ws&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let ks=jn,Os=class extends ks{constructor(e){super(e),this.type="comment"}};var Es=Os;Os.default=Os;let As,Rs,Ms,Ps,{isClean:Ts,my:Ns}=On,_s=Vn,Ds=Es,Ls=jn;function Fs(e){return e.map(e=>(e.nodes&&(e.nodes=Fs(e.nodes)),delete e.source,e))}function Bs(e){if(e[Ts]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Bs(t)}let Us=class e extends Ls{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Fs(As(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new _s(t)]}else if(t.selector)t=[new Rs(t)];else if(t.name)t=[new Ms(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Ds(t)]}return t.map(t=>(t[Ns]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Ts]&&Bs(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Us.registerParse=e=>{As=e},Us.registerRule=e=>{Rs=e},Us.registerAtRule=e=>{Ms=e},Us.registerRoot=e=>{Ps=e};var js=Us;Us.default=Us,Us.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ms.prototype):"rule"===e.type?Object.setPrototypeOf(e,Rs.prototype):"decl"===e.type?Object.setPrototypeOf(e,_s.prototype):"comment"===e.type?Object.setPrototypeOf(e,Ds.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ps.prototype),e[Ns]=!0,e.nodes&&e.nodes.forEach(e=>{Us.rebuild(e)})};let zs,Ws,Vs=js,Gs=class extends Vs{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new zs(new Ws,this,e).stringify()}};Gs.registerLazyResult=e=>{zs=e},Gs.registerProcessor=e=>{Ws=e};var Zs=Gs;Gs.default=Gs;let Ys={};var qs=function(e){Ys[e]||(Ys[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Ks=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Js=Ks;Ks.default=Ks;let $s=Js,Xs=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new $s(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Hs=Xs;Xs.default=Xs;const Qs="'".charCodeAt(0),ei='"'.charCodeAt(0),ti="\\".charCodeAt(0),ri="/".charCodeAt(0),ni="\n".charCodeAt(0),si=" ".charCodeAt(0),ii="\f".charCodeAt(0),oi="\t".charCodeAt(0),ai="\r".charCodeAt(0),li="[".charCodeAt(0),ci="]".charCodeAt(0),ui="(".charCodeAt(0),hi=")".charCodeAt(0),di="{".charCodeAt(0),pi="}".charCodeAt(0),fi=";".charCodeAt(0),gi="*".charCodeAt(0),mi=":".charCodeAt(0),yi="@".charCodeAt(0),vi=/[\t\n\f\r "#'()/;[\\\]{}]/g,wi=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,bi=/.[\r\n"'(/\\]/,Si=/[\da-f]/i;let Ci=js,Ii=class extends Ci{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var xi=Ii;Ii.default=Ii,Ci.registerAtRule(Ii);let ki,Oi,Ei=js,Ai=class extends Ei{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new ki(new Oi,this,e).stringify()}};Ai.registerLazyResult=e=>{ki=e},Ai.registerProcessor=e=>{Oi=e};var Ri=Ai;Ai.default=Ai,Ei.registerRoot(Ai);let Mi={comma:e=>Mi.split(e,[","],!0),space:e=>Mi.split(e,[" ","\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}};var Pi=Mi;Mi.default=Mi;let Ti=js,Ni=Pi,_i=class extends Ti{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Ni.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Di=_i;_i.default=_i,Ti.registerRule(_i);let Li=Vn,Fi=Es,Bi=xi,Ui=Ri,ji=Di;const zi={empty:!0,space:!0};let Wi=js,Vi=class{constructor(e){this.input=e,this.root=new Ui,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Bi;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),i&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),o&&(s.nodes=[],this.current=s)}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 Fi;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=function(e,t={}){let r,n,s,i,o,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],y=[];function v(t){throw e.error("Unclosed "+t,g)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&g>=f},nextToken:function(e){if(y.length)return y.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case ni:case si:case oi:case ai:case ii:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===si||r===ni||r===oi||r===ai||r===ii);h=["space",d.slice(g,n)],g=n-1;break;case li:case ci:case di:case pi:case mi:case fi:case hi:{let e=String.fromCharCode(r);h=[e,e,g];break}case ui:if(c=m.length?m.pop()[1]:"",u=d.charCodeAt(g+1),"url"===c&&u!==Qs&&u!==ei&&u!==si&&u!==ni&&u!==oi&&u!==ii&&u!==ai){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===ti;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),i=d.slice(g,n+1),-1===n||bi.test(i)?h=["(","(",g]:(h=["brackets",i,g,n],g=n);break;case Qs:case ei:s=r===Qs?"'":'"',n=g;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=g+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===ti;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case yi:vi.lastIndex=g+1,vi.test(d),n=0===vi.lastIndex?d.length-1:vi.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case ti:for(n=g,o=!0;d.charCodeAt(n+1)===ti;)n+=1,o=!o;if(r=d.charCodeAt(n+1),o&&r!==ri&&r!==si&&r!==ni&&r!==oi&&r!==ai&&r!==ii&&(n+=1,Si.test(d.charAt(n)))){for(;Si.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===si&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===ri&&d.charCodeAt(g+1)===gi?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(wi.lastIndex=g+1,wi.test(d),n=0===wi.lastIndex?d.length-1:wi.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}}(this.input)}decl(e,t){let r=new Li;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,o=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=o.map(e=>e[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new ji;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,o,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],i=s[0],"space"!==i||e!==l-1||n?"comment"===i?(a=r[e-1]?r[e-1][0]:"empty",o=r[e+1]?r[e+1][0]:"empty",zi[a]||zi[o]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new ji;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Gi=ps;function Zi(e,t){let r=new Gi(e,t),n=new Vi(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var Yi=Zi;Zi.default=Zi,Wi.registerParse(Zi);let{isClean:qi,my:Ki}=On,Ji=xs,$i=Tn,Xi=js,Hi=Zs,Qi=qs,eo=Hs,to=Yi,ro=Ri;const no={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},so={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},io={Once:!0,postcssPlugin:!0,prepare:!0};function oo(e){return"object"==typeof e&&"function"==typeof e.then}function ao(e){let t=!1,r=no[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function lo(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ao(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function co(e){return e[qi]=!1,e.nodes&&e.nodes.forEach(e=>co(e)),e}let uo={},ho=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof eo)s=co(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=to;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[Ki]&&Xi.rebuild(s)}else s=co(r);this.result=new eo(t,s,n),this.helpers={...uo,postcss:uo,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(!so[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!io[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(oo(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qi];){e[qi]=!0;let t=[lo(e)];for(;t.length>0;){let e=this.visitTick(t);if(oo(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return oo(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=$i;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Ji(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(oo(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qi];)e[qi]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Qi("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(oo(s))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[s,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=s;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[qi])return n[qi]=!0,void e.push(lo(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[qi]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[qi]=!0;let t=ao(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[qi]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};ho.registerPostcss=e=>{uo=e};var po=ho;ho.default=ho,ro.registerLazyResult(ho),Hi.registerLazyResult(ho);let fo=xs,go=Tn,mo=qs,yo=Yi;const vo=Hs;let wo=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=go;this.result=new vo(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let o=new fo(s,n,this._opts,t);if(o.isMap()){let[e,t]=o.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else o.clearAnnotation(),this.result.css=o.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||mo("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=yo;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var bo=wo;wo.default=wo;let So=bo,Co=po,Io=Zs,xo=Ri,ko=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Co(this,e,t):new So(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Oo=ko;ko.default=ko,xo.registerProcessor(ko),Io.registerProcessor(ko);let Eo=Vn,Ao=Hn,Ro=Es,Mo=xi,Po=ps,To=Ri,No=Di;function _o(e,t){if(Array.isArray(e))return e.map(e=>_o(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Po.prototype};r.map&&(r.map={...r.map,__proto__:Ao.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>_o(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new To(n);if("decl"===n.type)return new Eo(n);if("rule"===n.type)return new No(n);if("comment"===n.type)return new Ro(n);if("atrule"===n.type)return new Mo(n);throw new Error("Unknown node type: "+e.type)}var Do=_o;_o.default=_o;let Lo=kn,Fo=Vn,Bo=po,Uo=js,jo=Oo,zo=Tn,Wo=Do,Vo=Zs,Go=Js,Zo=Es,Yo=xi,qo=Hs,Ko=ps,Jo=Yi,$o=Pi,Xo=Di,Ho=Ri,Qo=jn;function ea(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new jo(e)}ea.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new jo).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return ea([s(r)]).process(e,t)},s},ea.stringify=zo,ea.parse=Jo,ea.fromJSON=Wo,ea.list=$o,ea.comment=e=>new Zo(e),ea.atRule=e=>new Yo(e),ea.decl=e=>new Fo(e),ea.rule=e=>new Xo(e),ea.root=e=>new Ho(e),ea.document=e=>new Vo(e),ea.CssSyntaxError=Lo,ea.Declaration=Fo,ea.Container=Uo,ea.Processor=jo,ea.Document=Vo,ea.Comment=Zo,ea.Warning=Go,ea.AtRule=Yo,ea.Result=qo,ea.Input=Ko,ea.Rule=Xo,ea.Root=Ho,ea.Node=Qo,Bo.registerPostcss(ea);var ta=ea;ea.default=ea;const ra=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(ta);ra.stringify,ra.fromJSON,ra.plugin,ra.parse,ra.list,ra.document,ra.comment,ra.atRule,ra.rule,ra.decl,ra.root,ra.CssSyntaxError,ra.Declaration,ra.Container,ra.Processor,ra.Document,ra.Comment,ra.Warning,ra.AtRule,ra.Result,ra.Input,ra.Rule,ra.Root,ra.Node;var na=Object.defineProperty,sa=(e,t,r)=>((e,t,r)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);var ia={exports:{}},oa=String,aa=function(){return{isColorSupported:!1,reset:oa,bold:oa,dim:oa,italic:oa,underline:oa,inverse:oa,hidden:oa,strikethrough:oa,black:oa,red:oa,green:oa,yellow:oa,blue:oa,magenta:oa,cyan:oa,white:oa,gray:oa,bgBlack:oa,bgRed:oa,bgGreen:oa,bgYellow:oa,bgBlue:oa,bgMagenta:oa,bgCyan:oa,bgWhite:oa}};ia.exports=aa(),ia.exports.createColors=aa;var la=ia.exports;const ca=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let ua=la,ha=ca,da=class e extends Error{constructor(t,r,n,s,i,o){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=ua.isColorSupported),ha&&e&&(t=ha(t));let r,n,s=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,s.length),a=String(o).length;if(e){let{bold:e,gray:t,red:s}=ua.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(i,o).map((e,t)=>{let s=i+1+t,o=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(o)+e+"\n "+t+r("^")}return" "+n(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var pa=da;da.default=da;var fa={};fa.isClean=Symbol("isClean"),fa.my=Symbol("my");const ga={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let ma=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return ga[r];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[r])return i.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((o=r)[0].toUpperCase()+o.slice(1));this[s]?n=this[s](i,e):i.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var o;return void 0===n&&(n=ga[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var ya=ma;ma.default=ma;let va=ya;function wa(e,t){new va(t).stringify(e)}var ba=wa;wa.default=wa;let{isClean:Sa,my:Ca}=fa,Ia=pa,xa=ya,ka=ba;function Oa(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>Oa(e,r)):("object"===i&&null!==s&&(s=Oa(s)),r[n]=s)}return r}let Ea=class{constructor(e={}){this.raws={},this[Sa]=!1,this[Ca]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Oa(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 Ia(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[Sa]){this[Sa]=!1;let e=this;for(;e=e.parent;)e[Sa]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new xa).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ka){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var Aa=Ea;Ea.default=Ea;let Ra=Aa,Ma=class extends Ra{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Pa=Ma;Ma.default=Ma;var Ta={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}};let{SourceMapConsumer:Na,SourceMapGenerator:_a}=ca,{existsSync:Da,readFileSync:La}=ca,{dirname:Fa,join:Ba}=ca,Ua=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Fa(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Na(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=Fa(e),Da(e))return this.mapFile=e,La(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Na)return _a.fromSourceMap(t).toString();if(t instanceof _a)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Ba(Fa(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var ja=Ua;Ua.default=Ua;let{SourceMapConsumer:za,SourceMapGenerator:Wa}=ca,{fileURLToPath:Va,pathToFileURL:Ga}=ca,{isAbsolute:Za,resolve:Ya}=ca,{nanoid:qa}=Ta,Ka=ca,Ja=pa,$a=ja,Xa=Symbol("fromOffsetCache"),Ha=Boolean(za&&Wa),Qa=Boolean(Ya&&Za),el=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Qa||/^\w+:\/\//.test(t.from)||Za(t.from)?this.file=t.from:this.file=Ya(t.from)),Qa&&Ha){let e=new $a(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+qa(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;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);i=e.line,o=e.col}else i=n.line,o=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return s=a?new Ja(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new Ja(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(Ga&&(s.input.url=Ga(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Xa])r=this[Xa];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[Xa]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Ya(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,i,o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=o.originalPositionFor({column:n,line:r})),i=Za(a.source)?Ga(a.source):new URL(a.source,this.map.consumer().sourceRoot||Ga(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:i.toString()};if("file:"===i.protocol){if(!Va)throw new Error("file: protocol is not available in this PostCSS build");l.file=Va(i)}let c=o.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var tl=el;el.default=el,Ka&&Ka.registerInput&&Ka.registerInput(el);let{SourceMapConsumer:rl,SourceMapGenerator:nl}=ca,{dirname:sl,relative:il,resolve:ol,sep:al}=ca,{pathToFileURL:ll}=ca,cl=tl,ul=Boolean(rl&&nl),hl=Boolean(sl&&ol&&il&&al);var dl=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||sl(e.file);!1===this.mapOpts.sourcesContent?(t=new rl(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),hl&&ul&&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=nl.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new nl({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new nl({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=o.match(/\n/g),e?(r+=e.length,t=o.lastIndexOf("\n"),n=o.length-t):n+=o.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?sl(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=sl(ol(r,this.mapOpts.annotation)));let n=il(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new cl(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(ll){let t=ll(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;"\\"===al&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let pl=Aa,fl=class extends pl{constructor(e){super(e),this.type="comment"}};var gl=fl;fl.default=fl;let ml,yl,vl,wl,{isClean:bl,my:Sl}=fa,Cl=Pa,Il=gl,xl=Aa;function kl(e){return e.map(e=>(e.nodes&&(e.nodes=kl(e.nodes)),delete e.source,e))}function Ol(e){if(e[bl]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ol(t)}let El=class e extends xl{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=kl(ml(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Cl(t)]}else if(t.selector)t=[new yl(t)];else if(t.name)t=[new vl(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Il(t)]}return t.map(t=>(t[Sl]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[bl]&&Ol(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};El.registerParse=e=>{ml=e},El.registerRule=e=>{yl=e},El.registerAtRule=e=>{vl=e},El.registerRoot=e=>{wl=e};var Al=El;El.default=El,El.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,vl.prototype):"rule"===e.type?Object.setPrototypeOf(e,yl.prototype):"decl"===e.type?Object.setPrototypeOf(e,Cl.prototype):"comment"===e.type?Object.setPrototypeOf(e,Il.prototype):"root"===e.type&&Object.setPrototypeOf(e,wl.prototype),e[Sl]=!0,e.nodes&&e.nodes.forEach(e=>{El.rebuild(e)})};let Rl,Ml,Pl=Al,Tl=class extends Pl{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Rl(new Ml,this,e).stringify()}};Tl.registerLazyResult=e=>{Rl=e},Tl.registerProcessor=e=>{Ml=e};var Nl=Tl;Tl.default=Tl;let _l={};var Dl=function(e){_l[e]||(_l[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Ll=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Fl=Ll;Ll.default=Ll;let Bl=Fl,Ul=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Bl(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var jl=Ul;Ul.default=Ul;const zl="'".charCodeAt(0),Wl='"'.charCodeAt(0),Vl="\\".charCodeAt(0),Gl="/".charCodeAt(0),Zl="\n".charCodeAt(0),Yl=" ".charCodeAt(0),ql="\f".charCodeAt(0),Kl="\t".charCodeAt(0),Jl="\r".charCodeAt(0),$l="[".charCodeAt(0),Xl="]".charCodeAt(0),Hl="(".charCodeAt(0),Ql=")".charCodeAt(0),ec="{".charCodeAt(0),tc="}".charCodeAt(0),rc=";".charCodeAt(0),nc="*".charCodeAt(0),sc=":".charCodeAt(0),ic="@".charCodeAt(0),oc=/[\t\n\f\r "#'()/;[\\\]{}]/g,ac=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,lc=/.[\r\n"'(/\\]/,cc=/[\da-f]/i;let uc=Al,hc=class extends uc{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var dc=hc;hc.default=hc,uc.registerAtRule(hc);let pc,fc,gc=Al,mc=class extends gc{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new pc(new fc,this,e).stringify()}};mc.registerLazyResult=e=>{pc=e},mc.registerProcessor=e=>{fc=e};var yc=mc;mc.default=mc,gc.registerRoot(mc);let vc={comma:e=>vc.split(e,[","],!0),space:e=>vc.split(e,[" ","\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}};var wc=vc;vc.default=vc;let bc=Al,Sc=wc,Cc=class extends bc{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Sc.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Ic=Cc;Cc.default=Cc,bc.registerRule(Cc);let xc=Pa,kc=gl,Oc=dc,Ec=yc,Ac=Ic;const Rc={empty:!0,space:!0};let Mc=Al,Pc=class{constructor(e){this.input=e,this.root=new Ec,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Oc;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),i&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),o&&(s.nodes=[],this.current=s)}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 kc;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=function(e,t={}){let r,n,s,i,o,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],y=[];function v(t){throw e.error("Unclosed "+t,g)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&g>=f},nextToken:function(e){if(y.length)return y.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case Zl:case Yl:case Kl:case Jl:case ql:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===Yl||r===Zl||r===Kl||r===Jl||r===ql);h=["space",d.slice(g,n)],g=n-1;break;case $l:case Xl:case ec:case tc:case sc:case rc:case Ql:{let e=String.fromCharCode(r);h=[e,e,g];break}case Hl:if(c=m.length?m.pop()[1]:"",u=d.charCodeAt(g+1),"url"===c&&u!==zl&&u!==Wl&&u!==Yl&&u!==Zl&&u!==Kl&&u!==ql&&u!==Jl){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===Vl;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),i=d.slice(g,n+1),-1===n||lc.test(i)?h=["(","(",g]:(h=["brackets",i,g,n],g=n);break;case zl:case Wl:s=r===zl?"'":'"',n=g;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=g+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===Vl;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case ic:oc.lastIndex=g+1,oc.test(d),n=0===oc.lastIndex?d.length-1:oc.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case Vl:for(n=g,o=!0;d.charCodeAt(n+1)===Vl;)n+=1,o=!o;if(r=d.charCodeAt(n+1),o&&r!==Gl&&r!==Yl&&r!==Zl&&r!==Kl&&r!==Jl&&r!==ql&&(n+=1,cc.test(d.charAt(n)))){for(;cc.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===Yl&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===Gl&&d.charCodeAt(g+1)===nc?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(ac.lastIndex=g+1,ac.test(d),n=0===ac.lastIndex?d.length-1:ac.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}}(this.input)}decl(e,t){let r=new xc;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,o=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=o.map(e=>e[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Ac;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,o,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],i=s[0],"space"!==i||e!==l-1||n?"comment"===i?(a=r[e-1]?r[e-1][0]:"empty",o=r[e+1]?r[e+1][0]:"empty",Rc[a]||Rc[o]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new Ac;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Tc=tl;function Nc(e,t){let r=new Tc(e,t),n=new Pc(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var _c=Nc;Nc.default=Nc,Mc.registerParse(Nc);let{isClean:Dc,my:Lc}=fa,Fc=dl,Bc=ba,Uc=Al,jc=Nl,zc=Dl,Wc=jl,Vc=_c,Gc=yc;const Zc={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Yc={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},qc={Once:!0,postcssPlugin:!0,prepare:!0};function Kc(e){return"object"==typeof e&&"function"==typeof e.then}function Jc(e){let t=!1,r=Zc[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function $c(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Jc(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Xc(e){return e[Dc]=!1,e.nodes&&e.nodes.forEach(e=>Xc(e)),e}let Hc={},Qc=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof Wc)s=Xc(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=Vc;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[Lc]&&Uc.rebuild(s)}else s=Xc(r);this.result=new Wc(t,s,n),this.helpers={...Hc,postcss:Hc,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(!Yc[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!qc[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(Kc(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Dc];){e[Dc]=!0;let t=[$c(e)];for(;t.length>0;){let e=this.visitTick(t);if(Kc(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return Kc(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=Bc;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Fc(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(Kc(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Dc];)e[Dc]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||zc("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(Kc(s))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[s,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=s;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[Dc])return n[Dc]=!0,void e.push($c(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[Dc]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Dc]=!0;let t=Jc(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[Dc]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Qc.registerPostcss=e=>{Hc=e};var eu=Qc;Qc.default=Qc,Gc.registerLazyResult(Qc),jc.registerLazyResult(Qc);let tu=dl,ru=ba,nu=Dl,su=_c;const iu=jl;let ou=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=ru;this.result=new iu(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let o=new tu(s,n,this._opts,t);if(o.isMap()){let[e,t]=o.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else o.clearAnnotation(),this.result.css=o.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||nu("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=su;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var au=ou;ou.default=ou;let lu=au,cu=eu,uu=Nl,hu=yc,du=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new cu(this,e,t):new lu(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var pu=du;du.default=du,hu.registerProcessor(du),uu.registerProcessor(du);let fu=Pa,gu=ja,mu=gl,yu=dc,vu=tl,wu=yc,bu=Ic;function Su(e,t){if(Array.isArray(e))return e.map(e=>Su(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:vu.prototype};r.map&&(r.map={...r.map,__proto__:gu.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Su(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new wu(n);if("decl"===n.type)return new fu(n);if("rule"===n.type)return new bu(n);if("comment"===n.type)return new mu(n);if("atrule"===n.type)return new yu(n);throw new Error("Unknown node type: "+e.type)}var Cu=Su;Su.default=Su;let Iu=pa,xu=Pa,ku=eu,Ou=Al,Eu=pu,Au=ba,Ru=Cu,Mu=Nl,Pu=Fl,Tu=gl,Nu=dc,_u=jl,Du=tl,Lu=_c,Fu=wc,Bu=Ic,Uu=yc,ju=Aa;function zu(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Eu(e)}zu.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new Eu).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return zu([s(r)]).process(e,t)},s},zu.stringify=Au,zu.parse=Lu,zu.fromJSON=Ru,zu.list=Fu,zu.comment=e=>new Tu(e),zu.atRule=e=>new Nu(e),zu.decl=e=>new xu(e),zu.rule=e=>new Bu(e),zu.root=e=>new Uu(e),zu.document=e=>new Mu(e),zu.CssSyntaxError=Iu,zu.Declaration=xu,zu.Container=Ou,zu.Processor=Eu,zu.Document=Mu,zu.Comment=Tu,zu.Warning=Pu,zu.AtRule=Nu,zu.Result=_u,zu.Input=Du,zu.Rule=Bu,zu.Root=Uu,zu.Node=ju,ku.registerPostcss(zu);var Wu=zu;zu.default=zu;const Vu=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(Wu);Vu.stringify,Vu.fromJSON,Vu.plugin,Vu.parse,Vu.list,Vu.document,Vu.comment,Vu.atRule,Vu.rule,Vu.decl,Vu.root,Vu.CssSyntaxError,Vu.Declaration,Vu.Container,Vu.Processor,Vu.Document,Vu.Comment,Vu.Warning,Vu.AtRule,Vu.Result,Vu.Input,Vu.Rule,Vu.Root,Vu.Node;class Gu{constructor(...e){sa(this,"parentElement",null),sa(this,"parentNode",null),sa(this,"ownerDocument"),sa(this,"firstChild",null),sa(this,"lastChild",null),sa(this,"previousSibling",null),sa(this,"nextSibling",null),sa(this,"ELEMENT_NODE",1),sa(this,"TEXT_NODE",3),sa(this,"nodeType"),sa(this,"nodeName"),sa(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 Gu))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 Zu={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Yu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},qu={};function Ku(e){if(qu[e])return qu[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 Zu?Zu[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 Yu?Yu[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 qu[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?qu[e]=i:r}catch{return r}}const Ju={};function $u(e,t,r){var n;const s=`${e}.${String(r)}`;if(Ju[s])return Ju[s].call(t);const i=Ku(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(Ju[s]=o,o.call(t)):t[r]}const Xu={};function Hu(e,t,r){const n=`${e}.${String(r)}`;if(Xu[n])return Xu[n].bind(t);const s=Ku(e)[r];return"function"!=typeof s?t[r]:(Xu[n]=s,s.bind(t))}const Qu=function(e){return $u("Node",e,"parentNode")},eh=function(e){return $u("Node",e,"parentElement")},th=function(e,t){return Hu("Node",e,"contains")(t)},rh=function(e){return Hu("Node",e,"getRootNode")()},nh=function(e){return e&&"host"in e?$u("ShadowRoot",e,"host"):null},sh=function(e){return e&&"shadowRoot"in e?$u("Element",e,"shadowRoot"):null},ih="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 oh={map:{},getId:()=>(console.error(ih),-1),getNode:()=>(console.error(ih),null),removeNodeFromMap(){console.error(ih)},has:()=>(console.error(ih),!1),reset(){console.error(ih)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(oh=new Proxy(oh,{get:(e,t,r)=>("map"===t&&console.error(ih),Reflect.get(e,t,r))}));let ah=Date.now;function lh(e){return e?e.nodeType===e.ELEMENT_NODE?e:eh(e):null}function ch(e){var t;let r=null;return"getRootNode"in e&&(null==(t=rh(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&nh(rh(e))&&(r=nh(rh(e))),r}function uh(e){let t,r=e;for(;t=ch(r);)r=t;return r}function hh(e){const t=e.ownerDocument;if(!t)return!1;const r=uh(e);return th(t,r)}/[1-9][0-9]{12}/.test(Date.now().toString())||(ah=()=>(new Date).getTime());const dh=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){nn(this,"id",1),nn(this,"styleIDMap",new WeakMap),nn(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 oh},closestElementOfNode:lh,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:uh,getShadowHost:ch,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=eh(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=eh(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 Gu&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(sh(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&&(th(t,e)||hh(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&fn(e)||null;return Boolean(t&&"shadowRoot"in t&&gn(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=Qu(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))},isBlocked:function(e,t,r,n){if(!e)return!1;const s=lh(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(mn(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 ah},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:hh,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 ph="undefined"==typeof Uint8Array?[]:new Uint8Array(256),fh=0;fh<64;fh++)ph["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(fh)]=fh;var gh,mh;"undefined"!=typeof window&&window.Blob&&new Blob([Uint8Array.from(atob("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo="),e=>e.charCodeAt(0))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Kr=e.contentWindow)?void 0:Kr.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}new class{constructor(){on(this,"idNodeMap",new Map),on(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}},(mh=gh||(gh={}))[mh.NotStarted=0]="NotStarted",mh[mh.Running=1]="Running",mh[mh.Stopped=2]="Stopped";class yh{constructor(e){tn(this,"fileName"),tn(this,"functionName"),tn(this,"lineNumber"),tn(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 vh=/(^|@)\S+:\d+/,wh=/^\s*at .*(\S+:\d+|\(native\))/m,bh=/^(eval@)?(\[native code])?$/,Sh={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(wh)?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(wh)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const r=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=r?t.replace(r[0],""):t;const n=t.split(/\s+/).slice(1),s=this.extractLocation(r?r[1]:n.pop()),i=n.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0];return new yh({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(bh)},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 yh({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new yh({functionName:n,fileName:s[0],lineNumber:s[1],columnNumber:s[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[];for(let e=2,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new yh({fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[];for(let e=0,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new yh({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(vh)&&!e.match(/^Error created at/)},this).map(function(e){const t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new yh({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Ch(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,s=[];if(n.children&&n.children.length>0)for(let e=0;e<n.children.length;e++){const t=n.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===r&&s.push(t)}s.length>1&&(r+=`:eq(${s.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function Ih(e){return"[object Object]"===Object.prototype.toString.call(e)}function xh(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(Ih(e[n])&&xh(e[n],t-1))return!0;return!1}function kh(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!!(Ih(e)&&Object.keys(e).length>r.numOfKeysLimit)||("function"==typeof e||!(!Ih(e)||!xh(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]=Ch(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 Oh={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 Eh(e,t,r){const n=r?Object.assign({},Oh,r):Oh,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=Sh.parse(s).map(e=>e.toString()),o=[kh(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=[kh(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[kh("Uncaught (in promise)",n.stringifyOptions),kh(t.reason,n.stringifyOptions)]);const i=Sh.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]?dh.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=Sh.parse(new Error).map(e=>e.toString()).splice(1),i=("assert"===r?s.slice(1):s).map(e=>kh(e,n.stringifyOptions));o++,o<n.lengthThreshold?e({level:r,trace:t,payload:i}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[kh("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}const Ah="rrweb/console@1";var Rh,Mh=Object.freeze({__proto__:null,PLUGIN_NAME:Ah,getRecordConsolePlugin:e=>({name:Ah,observer:Eh,options:e})}),Ph=Object.defineProperty,Th=(e,t,r)=>((e,t,r)=>t in e?Ph(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Nh=Object.defineProperty,_h=(e,t,r)=>((e,t,r)=>t in e?Nh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Dh=(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))(Dh||{});const Lh={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Fh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Bh={};function Uh(e){if(Bh[e])return Bh[e];const t=function(e){var t,r;const n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in Lh?Lh[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 Fh?Fh[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 Bh[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?Bh[e]=i:r}catch{return r}}const jh={};function zh(e,t,r){var n;const s=`${e}.${String(r)}`;if(jh[s])return jh[s].call(t);const i=Uh(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(jh[s]=o,o.call(t)):t[r]}const Wh=function(e){return zh("Node",e,"childNodes")},Vh=function(e){return zh("Node",e,"parentNode")},Gh=function(e){return zh("Node",e,"parentElement")},Zh=function(e){return zh("Node",e,"textContent")},Yh=function(e){return e&&"host"in e?zh("ShadowRoot",e,"host"):null},qh=function(e){return e&&"shadowRoot"in e?zh("Element",e,"shadowRoot"):null};function Kh(e){return e.nodeType===e.ELEMENT_NODE}function Jh(e){const t=e&&"host"in e&&"mode"in e&&Yh(e)||null;return Boolean(t&&"shadowRoot"in t&&qh(t)===e)}function $h(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Xh(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=>Hh(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 Hh(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Xh(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?cd(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?cd(r,t):r}}class Qh{constructor(){_h(this,"idNodeMap",new Map),_h(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 ed({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:i}){let o=s||"";const a=n&&td(n);return(t[r.toLowerCase()]||a&&t[a])&&(o=i?i(o,e):"*".repeat(o.length)),o}function td(e){return e.toLowerCase()}const rd="__rrweb_original__";function nd(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?td(t):null}function sd(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 id=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,od=/^(?:[a-z+]+:)?\/\//i,ad=/^www\..*/i,ld=/^(data:)([^,]*),(.*)/i;function cd(e,t){return(e||"").replace(id,(e,r,n,s,i,o)=>{const a=n||i||o,l=r||s||"";if(!a)return e;if(od.test(a)||ad.test(a))return`url(${l}${a}${l})`;if(ld.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 ud(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}let hd=1;const dd=new RegExp("[^a-z0-9-_:]");function pd(){return hd++}let fd,gd;const md=/^[^ \t\n\r\u000c]+/,yd=/^[, \t\n\r\u000c]+/,vd=new WeakMap;function wd(e,t){return t&&""!==t.trim()?Sd(e,t):t}function bd(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Sd(e,t){let r=vd.get(e);if(r||(r=e.createElement("a"),vd.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Cd(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?wd(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(yd),!(r>=t.length);){let i=n(md);if(","===i.slice(-1))i=wd(e,i.substring(0,i.length-1)),s.push(i);else{let n="";i=wd(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?cd(n,Sd(e)):"object"===t&&"data"===r?wd(e,n):n:wd(e,n):n}function Id(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function xd(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&xd(Vh(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&xd(Vh(e),t,r)}function kd(e,t,r,n){let s;if(Kh(e)){if(s=e,!Wh(s).length)return!1}else{if(null===Gh(e))return!1;s=Gh(e)}try{if("string"==typeof t){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(xd(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 Od(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:h={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:g=!1,cssCaptured:m=!1,applyBackgroundColorToBlockedElements:y=!1}=t,v=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:Dh.Document,childNodes:[],compatMode:e.compatMode}:{type:Dh.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Dh.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:i,maskInputOptions:o={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:p,applyBackgroundColorToBlockedElements:f=!1}=t,g=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,s),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=td(e.tagName);return dd.test(t)?"div":t}(e);let y={};const v=e.attributes.length;for(let t=0;t<v;t++){const n=e.attributes[t];Id(m,n.name,n.value)||(y[n.name]=Cd(r,m,td(n.name),n.value))}if("link"===m&&i){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let n=null;t&&(n=Xh(t)),n&&(delete y.rel,delete y.href,y._cssText=n)}if("style"===m&&e.sheet){let t=Xh(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=ud(e,r);const o=t.length/e.length;for(let a=1;a<n.length;a++)if(n[a].textContent&&"string"==typeof n[a].textContent){const l=ud(n[a].textContent,r),c=100;let u=3;for(;u<l.length&&(l[u].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,u),1));u++);for(;u<l.length;u++){let h=l.substring(0,u),d=t.split(h),p=-1;if(2===d.length)p=d[0].length;else if(d.length>2&&""===d[0]&&""!==n[a-1].textContent)p=t.indexOf(h,1);else if(1===d.length){if(h=h.substring(0,h.length-1),d=t.split(h),d.length<=1)return s.push(e),s;u=c+1}else u===l.length-1&&(p=t.indexOf(h));if(d.length>=2&&u>c){const e=n[a-1].textContent;if(e&&"string"==typeof e){const r=ud(e).length;p=t.indexOf(h,r)}-1===p&&(p=d[0].length)}if(-1!==p){let a=Math.floor(p/o);for(;a>0&&a<e.length;){if(i+=1,i>50*n.length)return s.push(e),s;const l=ud(e.substring(0,a),r);if(l.length===p){s.push(e.substring(0,a)),e=e.substring(a),t=t.substring(p);break}l.length<p?a+=Math.max(1,Math.floor((p-l.length)/o)):a-=Math.max(1,Math.floor((l.length-p)*o))}break}}}}return s.push(e),s}(e,t).join("/* rr_split */")}(t,e)),y._cssText=t)}if("input"===m||"textarea"===m||"select"===m){const t=e.value,r=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=ed({element:e,type:nd(e),tagName:m,value:t,maskInputOptions:o,maskInputFn:a}):r&&(y.checked=r)}if("option"===m&&(e.selected&&!o.select?y.selected=!0:delete y.selected),"dialog"===m&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),"canvas"===m&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let n=0;n<e.height;n+=50){const s=t.getImageData,i=rd in s?s[rd]:s;if(new Uint32Array(i.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height,t!==n.toDataURL(l.type,l.quality)&&(y.rr_dataURL=t)}if("img"===m&&c){fd||(fd=r.createElement("canvas"),gd=fd.getContext("2d"));const t=e,n=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{fd.width=t.naturalWidth,fd.height=t.naturalHeight,gd.drawImage(t,0,0),y.rr_dataURL=fd.toDataURL(l.type,l.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"===m||"video"===m){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(d||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),g){const{width:t,height:r}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${r}px`,...f?{rr_background_color:"lightgrey"}:{}}}let w;"iframe"!==m||h(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(w=!0)}catch(e){}return{type:Dh.Element,tagName:m,attributes:y,childNodes:[],isSVG:bd(e)||void 0,needBlock:g,rootId:p,isCustom:w}}(e,{doc:r,blockClass:s,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:g,rootId:v,applyBackgroundColorToBlockedElements:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:i}=t,o=Vh(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=Zh(e),c&&l&&(l=cd(l,Sd(t.doc)))),!c&&!u&&l&&r&&(l=n?n(l,Gh(e)):l.replace(/[\S]/g,"*")),{type:Dh.Text,textContent:l||"",rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:c,rootId:v,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:Dh.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:Dh.Comment,textContent:Zh(e)||"",rootId:v};default:return!1}}function Ed(e){return null==e?"":e.toLowerCase()}function Ad(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:I=!1,cssCaptured:x=!1,applyBackgroundColorToBlockedElements:k=!1}=t;let{needsMask:O}=t,{preserveWhiteSpace:E=!0}=t;O||(O=kd(e,o,a,void 0===O));const A=Od(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:O,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:x,applyBackgroundColorToBlockedElements:k});if(!A)return console.warn(e,"not serialized"),null;let R;R=n.hasNode(e)?n.getId(e):function(e,t){if(t.comment&&e.type===Dh.Comment)return!0;if(e.type===Dh.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"===sd(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ed(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ed(e.attributes.name)||"icon"===Ed(e.attributes.rel)||"apple-touch-icon"===Ed(e.attributes.rel)||"shortcut icon"===Ed(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ed(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ed(e.attributes.property).match(/^(og|twitter|fb):/)||Ed(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ed(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Ed(e.attributes.name)||"googlebot"===Ed(e.attributes.name)||"bingbot"===Ed(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Ed(e.attributes.name)||"generator"===Ed(e.attributes.name)||"framework"===Ed(e.attributes.name)||"publisher"===Ed(e.attributes.name)||"progid"===Ed(e.attributes.name)||Ed(e.attributes.property).match(/^article:/)||Ed(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Ed(e.attributes.name)||"yandex-verification"===Ed(e.attributes.name)||"csrf-token"===Ed(e.attributes.name)||"p:domain_verify"===Ed(e.attributes.name)||"verify-v1"===Ed(e.attributes.name)||"verification"===Ed(e.attributes.name)||"shopify-checkout-api-token"===Ed(e.attributes.name)))return!0}}return!1}(A,p)||!E&&A.type===Dh.Text&&!A.textContent.replace(/^\s+|\s+$/gm,"").length?-2:pd();const M=Object.assign(A,{id:R});if(n.add(e,M),-2===R)return null;y&&y(e);let P=!l;if(M.type===Dh.Element){P=P&&!M.needBlock,delete M.needBlock;const t=qh(e);t&&$h(t)&&(M.isShadowHost=!0)}if((M.type===Dh.Document||M.type===Dh.Element)&&P){p.headWhitespace&&M.type===Dh.Element&&"head"===M.tagName&&(E=!1);const t={doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:O,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1,applyBackgroundColorToBlockedElements:k};if(M.type===Dh.Element&&"textarea"===M.tagName&&void 0!==M.attributes.value);else{M.type===Dh.Element&&void 0!==M.attributes._cssText&&"string"==typeof M.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(Wh(e))){const e=Ad(r,t);e&&M.childNodes.push(e)}}let I=null;if(Kh(e)&&(I=qh(e)))for(const e of Array.from(Wh(I))){const r=Ad(e,t);r&&($h(I)&&(r.isShadow=!0),M.childNodes.push(r))}}const T=Vh(e);return T&&Jh(T)&&$h(T)&&(M.isShadow=!0),M.type===Dh.Element&&"iframe"===M.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&&v){const r=Ad(t,{doc:t,mirror:n,blockClass:s,blockSelector:i,needsMask:O,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});r&&v(e,r)}},w),M.type===Dh.Element&&"link"===M.tagName&&"string"==typeof M.attributes.rel&&("stylesheet"===M.attributes.rel||"preload"===M.attributes.rel&&"string"==typeof M.attributes.href&&"css"===sd(M.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(b){const t=Ad(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,needsMask:O,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&b(e,t)}},S),M}var Rd={exports:{}},Md=String,Pd=function(){return{isColorSupported:!1,reset:Md,bold:Md,dim:Md,italic:Md,underline:Md,inverse:Md,hidden:Md,strikethrough:Md,black:Md,red:Md,green:Md,yellow:Md,blue:Md,magenta:Md,cyan:Md,white:Md,gray:Md,bgBlack:Md,bgRed:Md,bgGreen:Md,bgYellow:Md,bgBlue:Md,bgMagenta:Md,bgCyan:Md,bgWhite:Md}};Rd.exports=Pd(),Rd.exports.createColors=Pd;var Td=Rd.exports;const Nd=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let _d=Td,Dd=Nd,Ld=class e extends Error{constructor(t,r,n,s,i,o){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=_d.isColorSupported),Dd&&e&&(t=Dd(t));let r,n,s=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,s.length),a=String(o).length;if(e){let{bold:e,gray:t,red:s}=_d.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(i,o).map((e,t)=>{let s=i+1+t,o=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(o)+e+"\n "+t+r("^")}return" "+n(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Fd=Ld;Ld.default=Ld;var Bd={};Bd.isClean=Symbol("isClean"),Bd.my=Symbol("my");const Ud={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let jd=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return Ud[r];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[r])return i.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((o=r)[0].toUpperCase()+o.slice(1));this[s]?n=this[s](i,e):i.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var o;return void 0===n&&(n=Ud[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var zd=jd;jd.default=jd;let Wd=zd;function Vd(e,t){new Wd(t).stringify(e)}var Gd=Vd;Vd.default=Vd;let{isClean:Zd,my:Yd}=Bd,qd=Fd,Kd=zd,Jd=Gd;function $d(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>$d(e,r)):("object"===i&&null!==s&&(s=$d(s)),r[n]=s)}return r}let Xd=class{constructor(e={}){this.raws={},this[Zd]=!1,this[Yd]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=$d(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 qd(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[Zd]){this[Zd]=!1;let e=this;for(;e=e.parent;)e[Zd]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Kd).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Jd){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var Hd=Xd;Xd.default=Xd;let Qd=Hd,ep=class extends Qd{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var tp=ep;ep.default=ep;var rp={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}};let{SourceMapConsumer:np,SourceMapGenerator:sp}=Nd,{existsSync:ip,readFileSync:op}=Nd,{dirname:ap,join:lp}=Nd,cp=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=ap(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new np(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=ap(e),ip(e))return this.mapFile=e,op(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof np)return sp.fromSourceMap(t).toString();if(t instanceof sp)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=lp(ap(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var up=cp;cp.default=cp;let{SourceMapConsumer:hp,SourceMapGenerator:dp}=Nd,{fileURLToPath:pp,pathToFileURL:fp}=Nd,{isAbsolute:gp,resolve:mp}=Nd,{nanoid:yp}=rp,vp=Nd,wp=Fd,bp=up,Sp=Symbol("fromOffsetCache"),Cp=Boolean(hp&&dp),Ip=Boolean(mp&&gp),xp=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Ip||/^\w+:\/\//.test(t.from)||gp(t.from)?this.file=t.from:this.file=mp(t.from)),Ip&&Cp){let e=new bp(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+yp(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;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);i=e.line,o=e.col}else i=n.line,o=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return s=a?new wp(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new wp(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(fp&&(s.input.url=fp(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[Sp])r=this[Sp];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[Sp]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:mp(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,i,o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=o.originalPositionFor({column:n,line:r})),i=gp(a.source)?fp(a.source):new URL(a.source,this.map.consumer().sourceRoot||fp(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:i.toString()};if("file:"===i.protocol){if(!pp)throw new Error("file: protocol is not available in this PostCSS build");l.file=pp(i)}let c=o.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var kp=xp;xp.default=xp,vp&&vp.registerInput&&vp.registerInput(xp);let{SourceMapConsumer:Op,SourceMapGenerator:Ep}=Nd,{dirname:Ap,relative:Rp,resolve:Mp,sep:Pp}=Nd,{pathToFileURL:Tp}=Nd,Np=kp,_p=Boolean(Op&&Ep),Dp=Boolean(Ap&&Mp&&Rp&&Pp);var Lp=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||Ap(e.file);!1===this.mapOpts.sourcesContent?(t=new Op(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Dp&&_p&&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=Ep.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Ep({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Ep({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=o.match(/\n/g),e?(r+=e.length,t=o.lastIndexOf("\n"),n=o.length-t):n+=o.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Ap(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Ap(Mp(r,this.mapOpts.annotation)));let n=Rp(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Np(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Tp){let t=Tp(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;"\\"===Pp&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Fp=Hd,Bp=class extends Fp{constructor(e){super(e),this.type="comment"}};var Up=Bp;Bp.default=Bp;let jp,zp,Wp,Vp,{isClean:Gp,my:Zp}=Bd,Yp=tp,qp=Up,Kp=Hd;function Jp(e){return e.map(e=>(e.nodes&&(e.nodes=Jp(e.nodes)),delete e.source,e))}function $p(e){if(e[Gp]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)$p(t)}let Xp=class e extends Kp{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Jp(jp(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Yp(t)]}else if(t.selector)t=[new zp(t)];else if(t.name)t=[new Wp(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new qp(t)]}return t.map(t=>(t[Zp]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Gp]&&$p(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Xp.registerParse=e=>{jp=e},Xp.registerRule=e=>{zp=e},Xp.registerAtRule=e=>{Wp=e},Xp.registerRoot=e=>{Vp=e};var Hp=Xp;Xp.default=Xp,Xp.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Wp.prototype):"rule"===e.type?Object.setPrototypeOf(e,zp.prototype):"decl"===e.type?Object.setPrototypeOf(e,Yp.prototype):"comment"===e.type?Object.setPrototypeOf(e,qp.prototype):"root"===e.type&&Object.setPrototypeOf(e,Vp.prototype),e[Zp]=!0,e.nodes&&e.nodes.forEach(e=>{Xp.rebuild(e)})};let Qp,ef,tf=Hp,rf=class extends tf{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Qp(new ef,this,e).stringify()}};rf.registerLazyResult=e=>{Qp=e},rf.registerProcessor=e=>{ef=e};var nf=rf;rf.default=rf;let sf={};var of=function(e){sf[e]||(sf[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let af=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var lf=af;af.default=af;let cf=lf,uf=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new cf(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var hf=uf;uf.default=uf;const df="'".charCodeAt(0),pf='"'.charCodeAt(0),ff="\\".charCodeAt(0),gf="/".charCodeAt(0),mf="\n".charCodeAt(0),yf=" ".charCodeAt(0),vf="\f".charCodeAt(0),wf="\t".charCodeAt(0),bf="\r".charCodeAt(0),Sf="[".charCodeAt(0),Cf="]".charCodeAt(0),If="(".charCodeAt(0),xf=")".charCodeAt(0),kf="{".charCodeAt(0),Of="}".charCodeAt(0),Ef=";".charCodeAt(0),Af="*".charCodeAt(0),Rf=":".charCodeAt(0),Mf="@".charCodeAt(0),Pf=/[\t\n\f\r "#'()/;[\\\]{}]/g,Tf=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Nf=/.[\r\n"'(/\\]/,_f=/[\da-f]/i;let Df=Hp,Lf=class extends Df{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Ff=Lf;Lf.default=Lf,Df.registerAtRule(Lf);let Bf,Uf,jf=Hp,zf=class extends jf{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Bf(new Uf,this,e).stringify()}};zf.registerLazyResult=e=>{Bf=e},zf.registerProcessor=e=>{Uf=e};var Wf=zf;zf.default=zf,jf.registerRoot(zf);let Vf={comma:e=>Vf.split(e,[","],!0),space:e=>Vf.split(e,[" ","\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}};var Gf=Vf;Vf.default=Vf;let Zf=Hp,Yf=Gf,qf=class extends Zf{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Yf.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Kf=qf;qf.default=qf,Zf.registerRule(qf);let Jf=tp,$f=Up,Xf=Ff,Hf=Wf,Qf=Kf;const eg={empty:!0,space:!0};let tg=Hp,rg=class{constructor(e){this.input=e,this.root=new Hf,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Xf;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),i&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),o&&(s.nodes=[],this.current=s)}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 $f;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=function(e,t={}){let r,n,s,i,o,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],y=[];function v(t){throw e.error("Unclosed "+t,g)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&g>=f},nextToken:function(e){if(y.length)return y.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case mf:case yf:case wf:case bf:case vf:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===yf||r===mf||r===wf||r===bf||r===vf);h=["space",d.slice(g,n)],g=n-1;break;case Sf:case Cf:case kf:case Of:case Rf:case Ef:case xf:{let e=String.fromCharCode(r);h=[e,e,g];break}case If:if(c=m.length?m.pop()[1]:"",u=d.charCodeAt(g+1),"url"===c&&u!==df&&u!==pf&&u!==yf&&u!==mf&&u!==wf&&u!==vf&&u!==bf){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===ff;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),i=d.slice(g,n+1),-1===n||Nf.test(i)?h=["(","(",g]:(h=["brackets",i,g,n],g=n);break;case df:case pf:s=r===df?"'":'"',n=g;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=g+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===ff;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case Mf:Pf.lastIndex=g+1,Pf.test(d),n=0===Pf.lastIndex?d.length-1:Pf.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case ff:for(n=g,o=!0;d.charCodeAt(n+1)===ff;)n+=1,o=!o;if(r=d.charCodeAt(n+1),o&&r!==gf&&r!==yf&&r!==mf&&r!==wf&&r!==bf&&r!==vf&&(n+=1,_f.test(d.charAt(n)))){for(;_f.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===yf&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===gf&&d.charCodeAt(g+1)===Af?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(Tf.lastIndex=g+1,Tf.test(d),n=0===Tf.lastIndex?d.length-1:Tf.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}}(this.input)}decl(e,t){let r=new Jf;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,o=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=o.map(e=>e[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Qf;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,o,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],i=s[0],"space"!==i||e!==l-1||n?"comment"===i?(a=r[e-1]?r[e-1][0]:"empty",o=r[e+1]?r[e+1][0]:"empty",eg[a]||eg[o]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new Qf;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},ng=kp;function sg(e,t){let r=new ng(e,t),n=new rg(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var ig=sg;sg.default=sg,tg.registerParse(sg);let{isClean:og,my:ag}=Bd,lg=Lp,cg=Gd,ug=Hp,hg=nf,dg=of,pg=hf,fg=ig,gg=Wf;const mg={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},yg={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},vg={Once:!0,postcssPlugin:!0,prepare:!0};function wg(e){return"object"==typeof e&&"function"==typeof e.then}function bg(e){let t=!1,r=mg[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function Sg(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:bg(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Cg(e){return e[og]=!1,e.nodes&&e.nodes.forEach(e=>Cg(e)),e}let Ig={},xg=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof pg)s=Cg(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=fg;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[ag]&&ug.rebuild(s)}else s=Cg(r);this.result=new pg(t,s,n),this.helpers={...Ig,postcss:Ig,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(!yg[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!vg[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(wg(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[og];){e[og]=!0;let t=[Sg(e)];for(;t.length>0;){let e=this.visitTick(t);if(wg(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return wg(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=cg;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new lg(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(wg(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[og];)e[og]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||dg("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(wg(s))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[s,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=s;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[og])return n[og]=!0,void e.push(Sg(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[og]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[og]=!0;let t=bg(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[og]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};xg.registerPostcss=e=>{Ig=e};var kg=xg;xg.default=xg,gg.registerLazyResult(xg),hg.registerLazyResult(xg);let Og=Lp,Eg=Gd,Ag=of,Rg=ig;const Mg=hf;let Pg=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=Eg;this.result=new Mg(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let o=new Og(s,n,this._opts,t);if(o.isMap()){let[e,t]=o.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else o.clearAnnotation(),this.result.css=o.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||Ag("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=Rg;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Tg=Pg;Pg.default=Pg;let Ng=Tg,_g=kg,Dg=nf,Lg=Wf,Fg=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new _g(this,e,t):new Ng(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Bg=Fg;Fg.default=Fg,Lg.registerProcessor(Fg),Dg.registerProcessor(Fg);let Ug=tp,jg=up,zg=Up,Wg=Ff,Vg=kp,Gg=Wf,Zg=Kf;function Yg(e,t){if(Array.isArray(e))return e.map(e=>Yg(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Vg.prototype};r.map&&(r.map={...r.map,__proto__:jg.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Yg(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Gg(n);if("decl"===n.type)return new Ug(n);if("rule"===n.type)return new Zg(n);if("comment"===n.type)return new zg(n);if("atrule"===n.type)return new Wg(n);throw new Error("Unknown node type: "+e.type)}var qg=Yg;Yg.default=Yg;let Kg=Fd,Jg=tp,$g=kg,Xg=Hp,Hg=Bg,Qg=Gd,em=qg,tm=nf,rm=lf,nm=Up,sm=Ff,im=hf,om=kp,am=ig,lm=Gf,cm=Kf,um=Wf,hm=Hd;function dm(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Hg(e)}dm.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new Hg).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return dm([s(r)]).process(e,t)},s},dm.stringify=Qg,dm.parse=am,dm.fromJSON=em,dm.list=lm,dm.comment=e=>new nm(e),dm.atRule=e=>new sm(e),dm.decl=e=>new Jg(e),dm.rule=e=>new cm(e),dm.root=e=>new um(e),dm.document=e=>new tm(e),dm.CssSyntaxError=Kg,dm.Declaration=Jg,dm.Container=Xg,dm.Processor=Hg,dm.Document=tm,dm.Comment=nm,dm.Warning=rm,dm.AtRule=sm,dm.Result=im,dm.Input=om,dm.Rule=cm,dm.Root=um,dm.Node=hm,$g.registerPostcss(dm);var pm=dm;dm.default=dm;const fm=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(pm);fm.stringify,fm.fromJSON,fm.plugin,fm.parse,fm.list,fm.document,fm.comment,fm.atRule,fm.rule,fm.decl,fm.root,fm.CssSyntaxError,fm.Declaration,fm.Container,fm.Processor,fm.Document,fm.Comment,fm.Warning,fm.AtRule,fm.Result,fm.Input,fm.Rule,fm.Root,fm.Node;var gm=Object.defineProperty,mm=(e,t,r)=>((e,t,r)=>t in e?gm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);var ym={exports:{}},vm=String,wm=function(){return{isColorSupported:!1,reset:vm,bold:vm,dim:vm,italic:vm,underline:vm,inverse:vm,hidden:vm,strikethrough:vm,black:vm,red:vm,green:vm,yellow:vm,blue:vm,magenta:vm,cyan:vm,white:vm,gray:vm,bgBlack:vm,bgRed:vm,bgGreen:vm,bgYellow:vm,bgBlue:vm,bgMagenta:vm,bgCyan:vm,bgWhite:vm}};ym.exports=wm(),ym.exports.createColors=wm;var bm=ym.exports;const Sm=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Cm=bm,Im=Sm,xm=class e extends Error{constructor(t,r,n,s,i,o){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),s&&(this.source=s),o&&(this.plugin=o),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Cm.isColorSupported),Im&&e&&(t=Im(t));let r,n,s=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,s.length),a=String(o).length;if(e){let{bold:e,gray:t,red:s}=Cm.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(i,o).map((e,t)=>{let s=i+1+t,o=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(o)+e+"\n "+t+r("^")}return" "+n(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var km=xm;xm.default=xm;var Om={};Om.isClean=Symbol("isClean"),Om.my=Symbol("my");const Em={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Am=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],i=this.raw(s,"before");i&&this.builder(i),this.stringify(s,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return Em[r];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[r])return i.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((o=r)[0].toUpperCase()+o.slice(1));this[s]?n=this[s](i,e):i.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var o;return void 0===n&&(n=Em[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Rm=Am;Am.default=Am;let Mm=Rm;function Pm(e,t){new Mm(t).stringify(e)}var Tm=Pm;Pm.default=Pm;let{isClean:Nm,my:_m}=Om,Dm=km,Lm=Rm,Fm=Tm;function Bm(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],i=typeof s;"parent"===n&&"object"===i?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>Bm(e,r)):("object"===i&&null!==s&&(s=Bm(s)),r[n]=s)}return r}let Um=class{constructor(e={}){this.raws={},this[Nm]=!1,this[_m]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Bm(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 Dm(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[Nm]){this[Nm]=!1;let e=this;for(;e=e.parent;)e[Nm]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Lm).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let i=t.get(n.input);null==i&&(i=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:i,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Fm){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var jm=Um;Um.default=Um;let zm=jm,Wm=class extends zm{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Vm=Wm;Wm.default=Wm;var Gm={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}};let{SourceMapConsumer:Zm,SourceMapGenerator:Ym}=Sm,{existsSync:qm,readFileSync:Km}=Sm,{dirname:Jm,join:$m}=Sm,Xm=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Jm(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Zm(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=Jm(e),qm(e))return this.mapFile=e,Km(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Zm)return Ym.fromSourceMap(t).toString();if(t instanceof Ym)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=$m(Jm(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Hm=Xm;Xm.default=Xm;let{SourceMapConsumer:Qm,SourceMapGenerator:ey}=Sm,{fileURLToPath:ty,pathToFileURL:ry}=Sm,{isAbsolute:ny,resolve:sy}=Sm,{nanoid:iy}=Gm,oy=Sm,ay=km,ly=Hm,cy=Symbol("fromOffsetCache"),uy=Boolean(Qm&&ey),hy=Boolean(sy&&ny),dy=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!hy||/^\w+:\/\//.test(t.from)||ny(t.from)?this.file=t.from:this.file=sy(t.from)),hy&&uy){let e=new ly(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+iy(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,i,o;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);i=e.line,o=e.col}else i=n.line,o=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,i,o);return s=a?new ay(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new ay(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,n.plugin),s.input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(ry&&(s.input.url=ry(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[cy])r=this[cy];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[cy]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:sy(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,i,o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=o.originalPositionFor({column:n,line:r})),i=ny(a.source)?ry(a.source):new URL(a.source,this.map.consumer().sourceRoot||ry(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:i.toString()};if("file:"===i.protocol){if(!ty)throw new Error("file: protocol is not available in this PostCSS build");l.file=ty(i)}let c=o.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var py=dy;dy.default=dy,oy&&oy.registerInput&&oy.registerInput(dy);let{SourceMapConsumer:fy,SourceMapGenerator:gy}=Sm,{dirname:my,relative:yy,resolve:vy,sep:wy}=Sm,{pathToFileURL:by}=Sm,Sy=py,Cy=Boolean(fy&&gy),Iy=Boolean(my&&vy&&yy&&wy);var xy=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||my(e.file);!1===this.mapOpts.sourcesContent?(t=new fy(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Iy&&Cy&&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=gy.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new gy({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new gy({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,a,l)=>{if(this.css+=o,a&&"end"!==l&&(i.generated.line=r,i.generated.column=n-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=o.match(/\n/g),e?(r+=e.length,t=o.lastIndexOf("\n"),n=o.length-t):n+=o.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?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=r,i.generated.column=n-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=r,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?my(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=my(vy(r,this.mapOpts.annotation)));let n=yy(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Sy(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(by){let t=by(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;"\\"===wy&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let ky=jm,Oy=class extends ky{constructor(e){super(e),this.type="comment"}};var Ey=Oy;Oy.default=Oy;let Ay,Ry,My,Py,{isClean:Ty,my:Ny}=Om,_y=Vm,Dy=Ey,Ly=jm;function Fy(e){return e.map(e=>(e.nodes&&(e.nodes=Fy(e.nodes)),delete e.source,e))}function By(e){if(e[Ty]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)By(t)}let Uy=class e extends Ly{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",i=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+i.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Fy(Ay(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new _y(t)]}else if(t.selector)t=[new Ry(t)];else if(t.name)t=[new My(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Dy(t)]}return t.map(t=>(t[Ny]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Ty]&&By(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Uy.registerParse=e=>{Ay=e},Uy.registerRule=e=>{Ry=e},Uy.registerAtRule=e=>{My=e},Uy.registerRoot=e=>{Py=e};var jy=Uy;Uy.default=Uy,Uy.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,My.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ry.prototype):"decl"===e.type?Object.setPrototypeOf(e,_y.prototype):"comment"===e.type?Object.setPrototypeOf(e,Dy.prototype):"root"===e.type&&Object.setPrototypeOf(e,Py.prototype),e[Ny]=!0,e.nodes&&e.nodes.forEach(e=>{Uy.rebuild(e)})};let zy,Wy,Vy=jy,Gy=class extends Vy{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new zy(new Wy,this,e).stringify()}};Gy.registerLazyResult=e=>{zy=e},Gy.registerProcessor=e=>{Wy=e};var Zy=Gy;Gy.default=Gy;let Yy={};var qy=function(e){Yy[e]||(Yy[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Ky=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Jy=Ky;Ky.default=Ky;let $y=Jy,Xy=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new $y(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Hy=Xy;Xy.default=Xy;const Qy="'".charCodeAt(0),ev='"'.charCodeAt(0),tv="\\".charCodeAt(0),rv="/".charCodeAt(0),nv="\n".charCodeAt(0),sv=" ".charCodeAt(0),iv="\f".charCodeAt(0),ov="\t".charCodeAt(0),av="\r".charCodeAt(0),lv="[".charCodeAt(0),cv="]".charCodeAt(0),uv="(".charCodeAt(0),hv=")".charCodeAt(0),dv="{".charCodeAt(0),pv="}".charCodeAt(0),fv=";".charCodeAt(0),gv="*".charCodeAt(0),mv=":".charCodeAt(0),yv="@".charCodeAt(0),vv=/[\t\n\f\r "#'()/;[\\\]{}]/g,wv=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,bv=/.[\r\n"'(/\\]/,Sv=/[\da-f]/i;let Cv=jy,Iv=class extends Cv{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var xv=Iv;Iv.default=Iv,Cv.registerAtRule(Iv);let kv,Ov,Ev=jy,Av=class extends Ev{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new kv(new Ov,this,e).stringify()}};Av.registerLazyResult=e=>{kv=e},Av.registerProcessor=e=>{Ov=e};var Rv=Av;Av.default=Av,Ev.registerRoot(Av);let Mv={comma:e=>Mv.split(e,[","],!0),space:e=>Mv.split(e,[" ","\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}};var Pv=Mv;Mv.default=Mv;let Tv=jy,Nv=Pv,_v=class extends Tv{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Nv.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Dv=_v;_v.default=_v,Tv.registerRule(_v);let Lv=Vm,Fv=Ey,Bv=xv,Uv=Rv,jv=Dv;const zv={empty:!0,space:!0};let Wv=jy,Vv=class{constructor(e){this.input=e,this.root=new Uv,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Bv;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let i=!1,o=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),i&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),o&&(s.nodes=[],this.current=s)}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 Fv;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=function(e,t={}){let r,n,s,i,o,a,l,c,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],y=[];function v(t){throw e.error("Unclosed "+t,g)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&g>=f},nextToken:function(e){if(y.length)return y.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(g),r){case nv:case sv:case ov:case av:case iv:n=g;do{n+=1,r=d.charCodeAt(n)}while(r===sv||r===nv||r===ov||r===av||r===iv);h=["space",d.slice(g,n)],g=n-1;break;case lv:case cv:case dv:case pv:case mv:case fv:case hv:{let e=String.fromCharCode(r);h=[e,e,g];break}case uv:if(c=m.length?m.pop()[1]:"",u=d.charCodeAt(g+1),"url"===c&&u!==Qy&&u!==ev&&u!==sv&&u!==nv&&u!==ov&&u!==iv&&u!==av){n=g;do{if(a=!1,n=d.indexOf(")",n+1),-1===n){if(p||t){n=g;break}v("bracket")}for(l=n;d.charCodeAt(l-1)===tv;)l-=1,a=!a}while(a);h=["brackets",d.slice(g,n+1),g,n],g=n}else n=d.indexOf(")",g+1),i=d.slice(g,n+1),-1===n||bv.test(i)?h=["(","(",g]:(h=["brackets",i,g,n],g=n);break;case Qy:case ev:s=r===Qy?"'":'"',n=g;do{if(a=!1,n=d.indexOf(s,n+1),-1===n){if(p||t){n=g+1;break}v("string")}for(l=n;d.charCodeAt(l-1)===tv;)l-=1,a=!a}while(a);h=["string",d.slice(g,n+1),g,n],g=n;break;case yv:vv.lastIndex=g+1,vv.test(d),n=0===vv.lastIndex?d.length-1:vv.lastIndex-2,h=["at-word",d.slice(g,n+1),g,n],g=n;break;case tv:for(n=g,o=!0;d.charCodeAt(n+1)===tv;)n+=1,o=!o;if(r=d.charCodeAt(n+1),o&&r!==rv&&r!==sv&&r!==nv&&r!==ov&&r!==av&&r!==iv&&(n+=1,Sv.test(d.charAt(n)))){for(;Sv.test(d.charAt(n+1));)n+=1;d.charCodeAt(n+1)===sv&&(n+=1)}h=["word",d.slice(g,n+1),g,n],g=n;break;default:r===rv&&d.charCodeAt(g+1)===gv?(n=d.indexOf("*/",g+2)+1,0===n&&(p||t?n=d.length:v("comment")),h=["comment",d.slice(g,n+1),g,n],g=n):(wv.lastIndex=g+1,wv.test(d),n=0===wv.lastIndex?d.length-1:wv.lastIndex-2,h=["word",d.slice(g,n+1),g,n],m.push(h),g=n)}return g++,h},position:function(){return g}}}(this.input)}decl(e,t){let r=new Lv;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i,o=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=o.map(e=>e[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new jv;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,o,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],i=s[0],"space"!==i||e!==l-1||n?"comment"===i?(a=r[e-1]?r[e-1][0]:"empty",o=r[e+1]?r[e+1][0]:"empty",zv[a]||zv[o]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new jv;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Gv=py;function Zv(e,t){let r=new Gv(e,t),n=new Vv(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var Yv=Zv;Zv.default=Zv,Wv.registerParse(Zv);let{isClean:qv,my:Kv}=Om,Jv=xy,$v=Tm,Xv=jy,Hv=Zy,Qv=qy,ew=Hy,tw=Yv,rw=Rv;const nw={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},sw={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},iw={Once:!0,postcssPlugin:!0,prepare:!0};function ow(e){return"object"==typeof e&&"function"==typeof e.then}function aw(e){let t=!1,r=nw[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function lw(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:aw(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function cw(e){return e[qv]=!1,e.nodes&&e.nodes.forEach(e=>cw(e)),e}let uw={},hw=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof ew)s=cw(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=tw;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[Kv]&&Xv.rebuild(s)}else s=cw(r);this.result=new ew(t,s,n),this.helpers={...uw,postcss:uw,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(!sw[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!iw[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(ow(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qv];){e[qv]=!0;let t=[lw(e)];for(;t.length>0;){let e=this.visitTick(t);if(ow(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return ow(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=$v;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Jv(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(ow(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qv];)e[qv]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Qv("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(ow(s))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[s,i]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=s;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[qv])return n[qv]=!0,void e.push(lw(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[qv]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[qv]=!0;let t=aw(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[qv]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};hw.registerPostcss=e=>{uw=e};var dw=hw;hw.default=hw,rw.registerLazyResult(hw),Hv.registerLazyResult(hw);let pw=xy,fw=Tm,gw=qy,mw=Yv;const yw=Hy;let vw=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=fw;this.result=new yw(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let o=new pw(s,n,this._opts,t);if(o.isMap()){let[e,t]=o.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else o.clearAnnotation(),this.result.css=o.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||gw("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=mw;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var ww=vw;vw.default=vw;let bw=ww,Sw=dw,Cw=Zy,Iw=Rv,xw=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Sw(this,e,t):new bw(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var kw=xw;xw.default=xw,Iw.registerProcessor(xw),Cw.registerProcessor(xw);let Ow=Vm,Ew=Hm,Aw=Ey,Rw=xv,Mw=py,Pw=Rv,Tw=Dv;function Nw(e,t){if(Array.isArray(e))return e.map(e=>Nw(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Mw.prototype};r.map&&(r.map={...r.map,__proto__:Ew.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Nw(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Pw(n);if("decl"===n.type)return new Ow(n);if("rule"===n.type)return new Tw(n);if("comment"===n.type)return new Aw(n);if("atrule"===n.type)return new Rw(n);throw new Error("Unknown node type: "+e.type)}var _w=Nw;Nw.default=Nw;let Dw=km,Lw=Vm,Fw=dw,Bw=jy,Uw=kw,jw=Tm,zw=_w,Ww=Zy,Vw=Jy,Gw=Ey,Zw=xv,Yw=Hy,qw=py,Kw=Yv,Jw=Pv,$w=Dv,Xw=Rv,Hw=jm;function Qw(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Uw(e)}Qw.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new Uw).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return Qw([s(r)]).process(e,t)},s},Qw.stringify=jw,Qw.parse=Kw,Qw.fromJSON=zw,Qw.list=Jw,Qw.comment=e=>new Gw(e),Qw.atRule=e=>new Zw(e),Qw.decl=e=>new Lw(e),Qw.rule=e=>new $w(e),Qw.root=e=>new Xw(e),Qw.document=e=>new Ww(e),Qw.CssSyntaxError=Dw,Qw.Declaration=Lw,Qw.Container=Bw,Qw.Processor=Uw,Qw.Document=Ww,Qw.Comment=Gw,Qw.Warning=Vw,Qw.AtRule=Zw,Qw.Result=Yw,Qw.Input=qw,Qw.Rule=$w,Qw.Root=Xw,Qw.Node=Hw,Fw.registerPostcss(Qw);var eb=Qw;Qw.default=Qw;const tb=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(eb);tb.stringify,tb.fromJSON,tb.plugin,tb.parse,tb.list,tb.document,tb.comment,tb.atRule,tb.rule,tb.decl,tb.root,tb.CssSyntaxError,tb.Declaration,tb.Container,tb.Processor,tb.Document,tb.Comment,tb.Warning,tb.AtRule,tb.Result,tb.Input,tb.Rule,tb.Root,tb.Node;class rb{constructor(...e){mm(this,"parentElement",null),mm(this,"parentNode",null),mm(this,"ownerDocument"),mm(this,"firstChild",null),mm(this,"lastChild",null),mm(this,"previousSibling",null),mm(this,"nextSibling",null),mm(this,"ELEMENT_NODE",1),mm(this,"TEXT_NODE",3),mm(this,"nodeType"),mm(this,"nodeName"),mm(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 rb))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 nb={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},sb={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ib={};function ob(e){if(ib[e])return ib[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 nb?nb[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 sb?sb[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 ib[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?ib[e]=i:r}catch{return r}}const ab={};function lb(e,t,r){var n;const s=`${e}.${String(r)}`;if(ab[s])return ab[s].call(t);const i=ob(e),o=null==(n=Object.getOwnPropertyDescriptor(i,r))?void 0:n.get;return o?(ab[s]=o,o.call(t)):t[r]}const cb={};function ub(e,t,r){const n=`${e}.${String(r)}`;if(cb[n])return cb[n].bind(t);const s=ob(e)[r];return"function"!=typeof s?t[r]:(cb[n]=s,s.bind(t))}function hb(){return ob("MutationObserver").constructor}const db=function(e){return lb("Node",e,"childNodes")},pb=function(e){return lb("Node",e,"parentNode")},fb=function(e){return lb("Node",e,"parentElement")},gb=function(e){return lb("Node",e,"textContent")},mb=function(e,t){return ub("Node",e,"contains")(t)},yb=function(e){return ub("Node",e,"getRootNode")()},vb=function(e){return e&&"host"in e?lb("ShadowRoot",e,"host"):null},wb=function(e){return e&&"shadowRoot"in e?lb("Element",e,"shadowRoot"):null};function bb(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Sb="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 Cb={map:{},getId:()=>(console.error(Sb),-1),getNode:()=>(console.error(Sb),null),removeNodeFromMap(){console.error(Sb)},has:()=>(console.error(Sb),!1),reset(){console.error(Sb)}};function Ib(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 xb(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)}}),()=>xb(e,t,i||{},!0)}function kb(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&&(Cb=new Proxy(Cb,{get:(e,t,r)=>("map"===t&&console.error(Sb),Reflect.get(e,t,r))}));let Ob=Date.now;function Eb(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=fb(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=fb(i.body))?void 0:n.scrollTop)||(null==(s=null==i?void 0:i.body)?void 0:s.scrollTop)||0}}function Ab(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Rb(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Mb(e){return e?e.nodeType===e.ELEMENT_NODE?e:fb(e):null}function Pb(e,t,r,n){if(!e)return!1;const s=Mb(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(xd(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 Tb(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function Nb(e,t){if(Jh(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=pb(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Nb(n,t))}function _b(e){return Boolean(e.changedTouches)}function Db(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Lb(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Fb(e){return!!e&&(e instanceof rb&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(wb(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ob=()=>(new Date).getTime());class Bb{constructor(){Th(this,"id",1),Th(this,"styleIDMap",new WeakMap),Th(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 Ub(e){var t;let r=null;return"getRootNode"in e&&(null==(t=yb(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vb(yb(e))&&(r=vb(yb(e))),r}function jb(e){const t=e.ownerDocument;return!!t&&(mb(t,e)||function(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=Ub(r);)r=t;return r}(e);return mb(t,r)}(e))}var zb=(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))(zb||{}),Wb=(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))(Wb||{}),Vb=(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))(Vb||{}),Gb=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Gb||{}),Zb=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Zb||{}),Yb=(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))(Yb||{}),qb=(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))(qb||{});function Kb(e){return"__ln"in e}class Jb{constructor(){Th(this,"length",0),Th(this,"head",null),Th(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Kb(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Kb(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const $b=(e,t)=>`${e}@${t}`;class Xb{constructor(){Th(this,"frozen",!1),Th(this,"locked",!1),Th(this,"texts",[]),Th(this,"attributes",[]),Th(this,"attributeMap",new WeakMap),Th(this,"removes",[]),Th(this,"mapRemoves",[]),Th(this,"movedMap",{}),Th(this,"addedSet",new Set),Th(this,"movedSet",new Set),Th(this,"droppedSet",new Set),Th(this,"removesSubTreeCache",new Set),Th(this,"mutationCb"),Th(this,"blockClass"),Th(this,"blockSelector"),Th(this,"maskTextClass"),Th(this,"maskTextSelector"),Th(this,"inlineStylesheet"),Th(this,"maskInputOptions"),Th(this,"maskTextFn"),Th(this,"maskInputFn"),Th(this,"keepIframeSrcFn"),Th(this,"recordCanvas"),Th(this,"inlineImages"),Th(this,"slimDOMOptions"),Th(this,"dataURLOptions"),Th(this,"doc"),Th(this,"mirror"),Th(this,"iframeManager"),Th(this,"stylesheetManager"),Th(this,"shadowDomManager"),Th(this,"canvasManager"),Th(this,"processedNodeManager"),Th(this,"unattachedDoc"),Th(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Th(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Jb,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=pb(s);if(!i||!jb(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=Jh(i)?this.mirror.getId(Ub(s)):this.mirror.getId(i),l=n(s);if(-1===a||-1===l)return r.addNode(s);const c=Ad(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=>{Db(e,this.mirror)&&this.iframeManager.addIframe(e),Lb(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Fb(s)&&this.shadowDomManager.addShadowRoot(wb(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)Qb(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(pb(e))||s(e);for(const e of this.addedSet)eS(this.droppedSet,e)||Qb(this.removesSubTreeCache,e,this.mirror)?eS(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(pb(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(pb(r.value));if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,n=pb(t);if(n&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=vb(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=pb(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(o.texts.length||o.attributes.length||o.removes.length||o.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(o))}),Th(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(db(e),e=>gb(e)||"").join("");t.attributes.value=ed({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:nd(e),value:r,maskInputFn:this.maskInputFn})}),Th(this,"processMutation",e=>{if(!Tb(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=gb(e.target);Pb(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:kd(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Mb(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=nd(t);n=ed({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:n,maskInputFn:this.maskInputFn})}if(Pb(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"),!Id(t.tagName,r))if(s.attributes[r]=Cd(this.doc,td(t.tagName),td(r),n),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),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(Pb(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=Jh(e.target)?this.mirror.getId(vb(e.target)):this.mirror.getId(e.target);Pb(e.target,this.blockClass,this.blockSelector,!1)||Tb(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Hb(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Nb(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[$b(r,n)]?Hb(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!Jh(e.target)||!$h(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),db(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Th(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Tb(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[$b(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Pb(e,this.blockClass,this.blockSelector,!1)||(db(e).forEach(e=>this.genAdds(e)),Fb(e)&&db(wb(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Hb(e,t){e.delete(t),db(t).forEach(t=>Hb(e,t))}function Qb(e,t,r){return 0!==e.size&&function(e,t){const r=pb(t);return!!r&&e.has(r)}(e,t)}function eS(e,t){return 0!==e.size&&tS(e,t)}function tS(e,t){const r=pb(t);return!!r&&(!!e.has(r)||tS(e,r))}let rS;const nS=e=>rS?(...t)=>{try{return e(...t)}catch(e){if(rS&&!0===rS(e))return;throw e}}:e;function sS(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}const iS=[];function oS(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function aS(e,t){const r=new Xb;iS.push(r),r.init(e);const n=new(hb())(nS(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function lS({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:i}){const o=nS(Ib(nS(i=>{const o=oS(i);if(!o||Pb(o,n,s,!0))return;const a=r.getId(o);if(o===t&&t.defaultView){const r=Eb(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 bb("scroll",o,t)}const cS=["INPUT","TEXTAREA","SELECT"],uS=new WeakMap;function hS(e){return function(e,t){if(gS("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||gS("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||gS("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||gS("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 dS(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function pS({mirror:e,stylesheetManager:t},r){var n,s,i;let o=null;o="#document"===r.nodeName?e.getId(r):e.getId(vb(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}}),nS(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function fS(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=aS(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=Ib(nS(t=>{const r=Date.now()-o;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],o=null}),i),c=nS(Ib(nS(e=>{const t=oS(e),{clientX:r,clientY:s}=_b(e)?e.changedTouches[0]:e;o||(o=Ob()),a.push({x:r,y:s,id:n.getId(t),timeOffset:Ob()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Wb.Drag:e instanceof MouseEvent?Wb.MouseMove:Wb.TouchMove)}),s,{trailing:!1})),u=[bb("mousemove",c,r),bb("touchmove",c,r),bb("drag",c,r)];return nS(()=>{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(Vb).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]).forEach(i=>{let o=td(i);const c=(t=>i=>{const o=oS(i);if(Pb(o,n,s,!0))return;let a=null,c=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=Gb.Mouse;break;case"touch":a=Gb.Touch;break;case"pen":a=Gb.Pen}a===Gb.Touch?Vb[t]===Vb.MouseDown?c="TouchStart":Vb[t]===Vb.MouseUp&&(c="TouchEnd"):Gb.Pen}else _b(i)&&(a=Gb.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Gb.Touch||c.startsWith("Mouse")&&a===Gb.Mouse)&&(a=null)):Vb[t]===Vb.Click&&(a=l,l=null);const u=_b(i)?i.changedTouches[0]:i;if(!u)return;const h=r.getId(o),{clientX:d,clientY:p}=u;nS(e)({type:Vb[c],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(i);if(window.PointerEvent)switch(Vb[i]){case Vb.MouseDown:case Vb.MouseUp:o=o.replace("mouse","pointer");break;case Vb.TouchStart:case Vb.TouchEnd:return}a.push(bb(o,c,t))}),nS(()=>{a.forEach(e=>e())})}(e),o=lS(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,n=-1;return bb("resize",nS(Ib(nS(()=>{const t=Ab(),s=Rb();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=oS(e);const c=e.isTrusted,h=r&&r.tagName;if(r&&"OPTION"===h&&(r=fb(r)),!r||!h||cS.indexOf(h)<0||Pb(r,n,s,!0))return;if(r.classList.contains(i)||o&&r.matches(o))return;let p=r.value,f=!1;const g=nd(r)||"";"radio"===g||"checkbox"===g?f=r.checked:(a[h.toLowerCase()]||a[g])&&(p=ed({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=uS.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){uS.set(t,n);const s=r.getId(t);nS(e)({...n,id:s})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>bb(e,nS(h),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push(...m.map(e=>xb(e[0],e[1],{set(){nS(h)({target:this,isTrusted:!1})}},!1,f))),nS(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:i}){const o=nS(i=>Ib(nS(s=>{const o=oS(s);if(!o||Pb(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=[bb("play",o(Yb.Play),i),bb("pause",o(Yb.Pause),i),bb("seeked",o(Yb.Seeked),i),bb("volumechange",o(Yb.VolumeChange),i),bb("ratechange",o(Yb.RateChange),i)];return nS(()=>{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:nS((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=dS(s,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:a}]}),sS(()=>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:nS((n,s,i)=>{const[o]=i,{id:a,styleId:l}=dS(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:o}]}),sS(()=>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:nS((n,s,i)=>{const[o]=i,{id:a,styleId:l}=dS(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:nS((n,s,i)=>{const[o]=i,{id:a,styleId:l}=dS(s,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:o}),n.apply(s,i)})}));const l={};mS("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(mS("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),mS("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),mS("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:nS((n,s,i)=>{const[o,a]=i,{id:l,styleId:c}=dS(s.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:o,index:[...hS(s),a||0]}]}),n.apply(s,i)})}),s.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:nS((n,s,i)=>{const[o]=i,{id:a,styleId:l}=dS(s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...hS(s),o]}]}),n.apply(s,i)})})}),nS(()=>{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=pS(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:nS((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}=dS(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:hS(o.parentRule)}),s.apply(o,a)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:nS((s,i,a)=>{var l;const[c]=a;if(r.has(c))return o.apply(i,[c]);const{id:u,styleId:h}=dS(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:hS(i.parentRule)}),s.apply(i,a)})}),nS(()=>{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=kb(t.fonts,"add",function(t){return function(r){return setTimeout(nS(()=>{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),nS(()=>{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=nS(()=>{const e=t.getSelection();if(!e||o&&(null==e?void 0:e.isCollapsed))return;o=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const i=e.getRangeAt(t),{startContainer:o,startOffset:l,endContainer:c,endOffset:u}=i;Pb(o,n,s,!0)||Pb(c,n,s,!0)||a.push({start:r.getId(o),startOffset:l,end:r.getId(c),endOffset:u})}i({ranges:a})});return a(),bb("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?kb(r.customElements,"define",function(e){return function(r,n,s){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,s])}}):()=>{}}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,r,t.options));return nS(()=>{iS.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 gS(e){return void 0!==window[e]}function mS(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class yS{constructor(e){Th(this,"iframeIdToRemoteIdMap",new WeakMap),Th(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 vS{constructor(e){Th(this,"iframes",new WeakMap),Th(this,"crossOriginIframeMap",new WeakMap),Th(this,"crossOriginIframeMirror",new yS(pd)),Th(this,"crossOriginIframeStyleMirror"),Th(this,"crossOriginIframeRootIdMap",new WeakMap),Th(this,"mirror"),Th(this,"mutationCb"),Th(this,"wrappedEmit"),Th(this,"loadListener"),Th(this,"stylesheetManager"),Th(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new yS(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case zb.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:zb.IncrementalSnapshot,data:{source:Wb.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case zb.Meta:case zb.Load:case zb.DomContentLoaded:return!1;case zb.Plugin:return t;case zb.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case zb.IncrementalSnapshot:switch(t.data.source){case Wb.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 Wb.Drag:case Wb.TouchMove:case Wb.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Wb.ViewportResize:return!1;case Wb.MediaInteraction:case Wb.MouseInteraction:case Wb.Scroll:case Wb.CanvasMutation:case Wb.Input:return this.replaceIds(t.data,e,["id"]),t;case Wb.StyleSheetRule:case Wb.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Wb.Font:return t;case Wb.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Wb.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===qb.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class wS{constructor(e){Th(this,"shadowDoms",new WeakSet),Th(this,"mutationCb"),Th(this,"scrollCb"),Th(this,"bypassOptions"),Th(this,"mirror"),Th(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(!$h(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=aS({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(lS({...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(vb(e))),this.restoreHandlers.push(pS({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(kb(e.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n),i=wb(this);return i&&jb(this)&&r.addShadowRoot(i,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var bS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",SS="undefined"==typeof Uint8Array?[]:new Uint8Array(256),CS=0;CS<64;CS++)SS[bS.charCodeAt(CS)]=CS;const IS=new Map,xS=(e,t,r)=>{if(!e||!ES(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=IS.get(e);return r||(r=new Map,IS.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 kS(e,t,r){if(e instanceof Array)return e.map(e=>kS(e,t,r));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),n=r.length,s="";for(t=0;t<n;t+=3)s+=bS[r[t]>>2],s+=bS[(3&r[t])<<4|r[t+1]>>4],s+=bS[(15&r[t+1])<<2|r[t+2]>>6],s+=bS[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:[kS(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:[kS(e.data,t,r),e.width,e.height]}:ES(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:xS(e,t,r)}:e}const OS=(e,t,r)=>e.map(e=>kS(e,t,r)),ES=(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 AS(e,t,r,n){const s=[];try{const i=kb(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...i){if(!Pb(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 RS(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=kb(e,l,function(e){return function(...o){const a=e.apply(this,o);if(xS(a,i,this),"tagName"in this.canvas&&!Pb(this.canvas,n,s,!0)){const e=OS(o,i,this),n={type:t,property:l,args:e};r(this.canvas,n)}return a}});o.push(a)}catch{const n=xb(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});o.push(n)}return o}const MS="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",PS="undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0)))(MS)],{type:"text/javascript;charset=utf-8"});function TS(e){let t;try{if(t=PS&&(window.URL||window.webkitURL).createObjectURL(PS),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch(t){return new Worker("data:text/javascript;base64,"+MS,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class NS{constructor(e){Th(this,"pendingCanvasMutations",new Map),Th(this,"rafStamps",{latestId:0,invokeId:null}),Th(this,"mirror"),Th(this,"mutationCb"),Th(this,"resetObservers"),Th(this,"frozen",!1),Th(this,"locked",!1),Th(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=AS(t,r,n,!0),o=new Map,a=new TS;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:Zb["2D"],commands:[{property:"clearRect",args:[0,0,s,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const l=1e3/e;let c,u=0;const h=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Pb(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=AS(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=kb(t.CanvasRenderingContext2D.prototype,o,function(s){return function(...i){return Pb(this.canvas,r,n,!0)||setTimeout(()=>{const r=OS(i,t,this);e(this.canvas,{type:Zb["2D"],property:o,args:r})},0),s.apply(this,i)}});s.push(i)}catch{const r=xb(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:Zb["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(...RS(t.WebGLRenderingContext.prototype,Zb.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&s.push(...RS(t.WebGL2RenderingContext.prototype,Zb.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 _S{constructor(e){Th(this,"trackedLinkElements",new WeakSet),Th(this,"mutationCb"),Th(this,"adoptedStyleSheetCb"),Th(this,"styleMirror",new Bb),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},n=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,r)=>({rule:Hh(e,t.href),index:r}))})),r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class DS{constructor(){Th(this,"nodeMap",new WeakMap),Th(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 LS,FS,BS,US=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Rh=e.contentWindow)?void 0:Rh.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const jS=new Qh;function zS(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,hooks:m,packFn:y,sampling:v={},dataURLOptions:w={},mousemoveWait:b,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:k=!1,collectFonts:O=!1,inlineImages:E=!1,plugins:A,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:M=new Set([]),errorHandler:P,applyBackgroundColorToBlockedElements:T=!1}=e;rS=P;const N=!I||window.parent===window;let _=!1;if(!N)try{window.parent.document&&(_=!1)}catch(e){_=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!_)return()=>{};void 0!==b&&void 0===v.mousemove&&(v.mousemove=b),jS.reset();const D=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==d?d:{password:!0},L=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let F;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let B=0;const U=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!_&&(e=y(e)),e};LS=(e,s)=>{var i;const o=e;if(o.timestamp=Ob(),!(null==(i=iS[0])?void 0:i.isFrozen())||o.type===zb.FullSnapshot||o.type===zb.IncrementalSnapshot&&o.data.source===Wb.Mutation||iS.forEach(e=>e.unfreeze()),N)null==t||t(U(o),s);else if(_){const e={type:"rrweb",event:U(o),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(o.type===zb.FullSnapshot)F=o,B=0;else if(o.type===zb.IncrementalSnapshot){if(o.data.source===Wb.Mutation&&o.data.isAttachIframe)return;B++;const e=n&&B>=n,t=r&&o.timestamp-F.timestamp>r;(e||t)&&FS(!0)}};const j=e=>{LS({type:zb.IncrementalSnapshot,data:{source:Wb.Mutation,...e}})},z=e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.Scroll,...e}}),W=e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.CanvasMutation,...e}}),V=new _S({mutationCb:j,adoptedStyleSheetCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.AdoptedStyleSheet,...e}})}),G=new vS({mirror:jS,mutationCb:j,stylesheetManager:V,recordCrossOriginIframes:I,wrappedEmit:LS});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:jS,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const Z=new DS;BS=new NS({recordCanvas:C,mutationCb:W,win:window,blockClass:s,blockSelector:i,mirror:jS,sampling:v.canvas,dataURLOptions:w});const Y=new wS({mutationCb:j,scrollCb:z,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:f,recordCanvas:C,inlineImages:E,sampling:v,slimDOMOptions:L,iframeManager:G,stylesheetManager:V,canvasManager:BS,keepIframeSrcFn:R,processedNodeManager:Z},mirror:jS});FS=(e=!1)=>{if(!S)return;LS({type:zb.Meta,data:{href:window.location.href,width:Rb(),height:Ab()}},e),V.reset(),Y.init(),iS.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new Qh,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,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S=()=>!1,applyBackgroundColorToBlockedElements:C=!1}=t||{};return Ad(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,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:C})}(document,{mirror:jS,blockClass:s,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:D,maskTextFn:g,maskInputFn:f,slimDOM:L,dataURLOptions:w,recordCanvas:C,inlineImages:E,applyBackgroundColorToBlockedElements:T,onSerialize:e=>{Db(e,jS)&&G.addIframe(e),Lb(e,jS)&&V.trackLinkElement(e),Fb(e)&&Y.addShadowRoot(wb(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),Y.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");LS({type:zb.FullSnapshot,data:{node:t,initialOffset:Eb(window)}},e),iS.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,jS.getId(document))};try{const e=[],t=e=>{var t;return nS(fS)({mutationCb:j,mousemoveCb:(e,t)=>LS({type:zb.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.MouseInteraction,...e}}),scrollCb:z,viewportResizeCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.ViewportResize,...e}}),inputCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.Input,...e}}),mediaInteractionCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.MediaInteraction,...e}}),styleSheetRuleCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.StyleSheetRule,...e}}),styleDeclarationCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>LS({type:zb.IncrementalSnapshot,data:{source:Wb.Font,...e}}),selectionCb:e=>{LS({type:zb.IncrementalSnapshot,data:{source:Wb.Selection,...e}})},customElementCb:e=>{LS({type:zb.IncrementalSnapshot,data:{source:Wb.CustomElement,...e}})},blockClass:s,ignoreClass:o,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:u,sampling:v,recordDOM:S,recordCanvas:C,inlineImages:E,userTriggeredOnInput:k,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:R,blockSelector:i,slimDOMOptions:L,dataURLOptions:w,mirror:jS,iframeManager:G,stylesheetManager:V,shadowDomManager:Y,processedNodeManager:Z,canvasManager:BS,ignoreCSSAttributes:M,plugins:(null==(t=null==A?void 0:A.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>LS({type:zb.Plugin,data:{plugin:e.name,payload:t}})})))||[]},m)};G.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{FS(),e.push(t(document)),US=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(bb("DOMContentLoaded",()=>{LS({type:zb.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&r()})),e.push(bb("load",()=>{LS({type:zb.Load,data:{}}),"load"===x&&r()},window))),()=>{e.forEach(e=>e()),Z.destroy(),US=!1,rS=void 0}}catch(e){console.warn(e)}}var WS;zS.addCustomEvent=(e,t)=>{if(!US)throw new Error("please add custom event after start recording");LS({type:zb.Custom,data:{tag:e,payload:t}})},zS.freezePage=()=>{iS.forEach(e=>e.freeze())},zS.takeFullSnapshot=e=>{if(!US)throw new Error("please take full snapshot after start recording");FS(e)},zS.mirror=jS,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(WS||(WS={}));var VS=Object.freeze({__proto__:null,record:zS}),GS=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e){this.eventCallback=e,this.observeFetch()},e.prototype.stop=function(){var e;null===(e=this.fetchObserver)||void 0===e||e.call(this),this.fetchObserver=null,this.eventCallback=void 0},e.prototype.notifyEvent=function(e){var t;null===(t=this.eventCallback)||void 0===t||t.call(this,e)},e.prototype.observeFetch=function(){var e=this,t=m();if(t){var r=t.fetch;r&&(t.fetch=function(t,n){return o(e,void 0,void 0,function(){var e,s,i,o,l,c,u;return a(this,function(a){switch(a.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},a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r(t,n)];case 2:return i=a.sent(),c=Date.now(),s.status=i.status,s.duration=c-e,o={},i.headers.forEach(function(e,t){o[t]=e}),s.responseHeaders=o,this.notifyEvent(s),[2,i];case 3:throw l=a.sent(),c=Date.now(),s.duration=c-e,u=l,s.error={name:u.name||"UnknownError",message:u.message||"An unknown error occurred"},this.notifyEvent(s),l;case 4:return[2]}})})},this.fetchObserver=function(){t.fetch=r})}},e}(),ZS=Object.freeze({__proto__:null,NetworkObservers:GS});return e.SessionReplayPlugin=gr,e.plugin=mr,e.sessionReplayPlugin=mr,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<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},n.apply(this,arguments)};function s(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function 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<e.length;f++)if(!o(e[f],t[f]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var a=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=n({},this.identity.userProperties),r=n(n({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,o,a,l,c,u=r.userProperties||{};try{for(var h=s(Object.entries(e)),d=h.next();!d.done;d=h.next()){var p=i(d.value,2),f=p[0],g=p[1];switch(f){case"$set":try{for(var m=(o=void 0,s(Object.entries(g))),y=m.next();!y.done;y=m.next()){var v=i(y.value,2),w=v[0],b=v[1];u[w]=b}}catch(e){o={error:e}}finally{try{y&&!y.done&&(a=m.return)&&a.call(m)}finally{if(o)throw o.error}}break;case"$unset":try{for(var S=(l=void 0,s(Object.keys(g))),C=S.next();!C.done;C=S.next()){delete u[w=C.value]}}catch(e){l={error:e}}finally{try{C&&!C.done&&(c=S.return)&&c.call(S)}finally{if(l)throw l.error}}break;case"$clearAll":u={}}}}catch(e){t={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}return r.userProperties=u,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return n({},this.identity)},e.prototype.setIdentity=function(e){var t=n({},this.identity);this.identity=n({},e),o(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),l=typeof globalThis<"u"?globalThis:typeof window<"u"?window:self,c=function(){function t(){this.identityStore=new a,this.eventBridge=new r,this.applicationContextProvider=new e}return t.getInstance=function(e){return l.analyticsConnectorInstances||(l.analyticsConnectorInstances={}),l.analyticsConnectorInstances[e]||(l.analyticsConnectorInstances[e]=new t),l.analyticsConnectorInstances[e]},t}(),u=["boot"];window.engagement=function(e){var t,r,n,s,i,o,a;let l=window.engagement,h={_q:null!=(t=null==l?void 0:l._q)?t:[],_configuration:{apiKey:null!=(n=null==(r=null==l?void 0:l._configuration)?void 0:r.apiKey)?n:"",serverUrl:null==(s=null==l?void 0:l._configuration)?void 0:s.serverUrl,serverZone:null!=(o=null==(i=null==l?void 0:l._configuration)?void 0:i.serverZone)?o:"US",options:{...null==(a=null==l?void 0:l._configuration)?void 0:a.options}},_sentry:void 0,init(t,r){var n,s,i;h._configuration.apiKey?console.log("Engagement SDK has already been initialized. Ignoring additional init call."):(h._configuration={...h._configuration,...r,apiKey:t,options:{...h._configuration.options,...null==r?void 0:r.options}},null!=(s=null==(n=h._configuration)?void 0:n.options)&&s.logger&&h._configuration.options.logger.enable(null!=(i=h._configuration.options.logLevel)?i:2),e())},plugin(e){let t=h.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,{options:{logLevel:r.logLevel},...e,serverZone:r.serverZone}),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:[{track:e=>{n.track(e)}}]}),o.addIdentityListener(e=>{window.engagement._setUserProperties(e.userProperties)})},execute:async e=>(window.engagement.forwardEvent(e),e)}}},d=h;return new Proxy(h,{get:function(e,t){return t in d?d[t]:"then"!==t?"gs"===t?new Proxy({},{get:function(e,r){return function(){let e=Array.from(arguments),n=`${t}.${r}`;e.unshift(n),h._q.push(e)}}}):u.includes(t)?function(){let e=Array.prototype.slice.call(arguments);return new Promise((r,n)=>{e.unshift(t,r,n),h._q.push(e)})}:function(){let e=Array.prototype.slice.call(arguments);e.unshift(t),h._q.push(e)}:void 0}})}(()=>function(e){for(let t of e){let e=document.createElement("script");e.src=t,e.id="engagement-sdk-bundle";let r=document.querySelector("[nonce]");r&&e.setAttribute("nonce",r.nonce||r.getAttribute("nonce")),document.getElementsByTagName("head")[0].appendChild(e)}}(["https://cdn.amplitude.com/engagement-browser/prod/index.min.js.gz"]))})()};!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/2.32.0",e)})),d}(l,r):l[h].apply(this,r)}}}(window,"_amplitude")}();
|
|
2
2
|
//# sourceMappingURL=analytics-browser-gtm-wrapper.min.js.map
|