!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).singlefile={})}(this,(function(e){"use strict";const t="single-file-load-image",n="single-file-image-loaded",r=globalThis.browser,a=(e,t,n)=>globalThis.addEventListener(e,t,n),o=e=>globalThis.dispatchEvent(e),s=globalThis.CustomEvent,i=globalThis.document,l=globalThis.Document;let c;if(c=window._singleFile_fontFaces?window._singleFile_fontFaces:window._singleFile_fontFaces=new Map,i instanceof l&&r&&r.runtime&&r.runtime.getURL){a("single-file-new-font-face",(e=>{const t=e.detail,n=Object.assign({},t);delete n.src,c.set(JSON.stringify(n),t)})),a("single-file-delete-font",(e=>{const t=e.detail,n=Object.assign({},t);delete n.src,c.delete(JSON.stringify(n))})),a("single-file-clear-fonts",(()=>c=new Map));let e=i.createElement("script");e.src="data:,("+function(){"undefined"==typeof globalThis&&(window.globalThis=window);const e=globalThis.document,t=globalThis.console,n=e=>globalThis.dispatchEvent(e),r=globalThis.CustomEvent,a=globalThis.FileReader,o=globalThis.Blob,s=t&&t.warn&&((...e)=>t.warn(...e))||(()=>{}),i="single-file-new-font-face",l="single-file-delete-font",c="single-file-clear-fonts",u={family:"font-family",style:"font-style",weight:"font-weight",stretch:"font-stretch",unicodeRange:"unicode-range",variant:"font-variant",featureSettings:"font-feature-settings"};if(globalThis.FontFace){const t=globalThis.FontFace;let a;globalThis.FontFace=function(){return a||(s("SingleFile is hooking the FontFace constructor, document.fonts.delete and document.fonts.clear to handle dynamically loaded fonts."),a=!0),h(...arguments).then((e=>n(new r(i,{detail:e})))),new t(...arguments)},globalThis.FontFace.toString=function(){return"function FontFace() { [native code] }"};const o=e.fonts.delete;e.fonts.delete=function(t){return h(t.family).then((e=>n(new r(l,{detail:e})))),o.call(e.fonts,t)},e.fonts.delete.toString=function(){return"function delete() { [native code] }"};const u=e.fonts.clear;e.fonts.clear=function(){return n(new r(c)),u.call(e.fonts)},e.fonts.clear.toString=function(){return"function clear() { [native code] }"}}async function h(e,t,n){const r={};return r["font-family"]=e,r.src=t,n&&Object.keys(n).forEach((e=>{u[e]&&(r[u[e]]=n[e])})),new Promise((e=>{if(r.src instanceof ArrayBuffer){const t=new a;t.readAsDataURL(new o([r.src])),t.addEventListener("load",(()=>{r.src="url("+t.result+")",e(r)}))}else e(r)}))}}.toString()+")()",(i.documentElement||i).appendChild(e),e.remove(),e=i.createElement("script"),e.src=r.runtime.getURL("/dist/web/hooks/hooks-frames-web.js"),e.async=!1,(i.documentElement||i).appendChild(e),e.remove()}function u(){return Array.from(c.values())}function h(e){e.loadDeferredImagesBlockCookies&&o(new s("single-file-block-cookies-start")),e.loadDeferredImagesBlockStorage&&o(new s("single-file-block-storage-start")),e.loadDeferredImagesKeepZoomLevel?o(new s("single-file-load-deferred-images-keep-zoom-level-start")):o(new s("single-file-load-deferred-images-start"))}function d(e){e.loadDeferredImagesBlockCookies&&o(new s("single-file-block-cookies-end")),e.loadDeferredImagesBlockStorage&&o(new s("single-file-block-storage-end")),e.loadDeferredImagesKeepZoomLevel?o(new s("single-file-load-deferred-images-keep-zoom-level-end")):o(new s("single-file-load-deferred-images-end"))}function p(e){e.loadDeferredImagesKeepZoomLevel?o(new s("single-file-load-deferred-images-keep-zoom-level-reset")):o(new s("single-file-load-deferred-images-reset"))}var m=Object.freeze({__proto__:null,getFontsData:u,loadDeferredImagesStart:h,loadDeferredImagesEnd:d,loadDeferredImagesResetZoomLevel:p,LOAD_IMAGE_EVENT:t,IMAGE_LOADED_EVENT:n});const f=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig");function g(e){return e.replace(f,((e,t,n)=>{const r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)}))}var y=Object.freeze({__proto__:null,process:g});const b="single-file-on-before-capture",v="single-file-on-after-capture",k="data-single-file-removed-content",w="data-single-file-hidden-content",x="data-single-file-kept-content",S="data-single-file-hidden-frame",E="data-single-file-preserved-space-element",A="data-single-file-shadow-root-element",T="data-single-file-win-id",C="data-single-file-image",R="data-single-file-poster",_="data-single-file-canvas",I="data-single-file-import",L="data-single-file-movable-style",P="data-single-file-input-value",N="data-single-file-lazy-loaded-src",z="data-single-file-stylesheet",M="data-single-file-disabled-noscript",O="data-single-file-selected-content",D="data-single-file-async-script",U="*:not(base):not(link):not(meta):not(noscript):not(script):not(style):not(template):not(title)",F=["NOSCRIPT","DISABLED-NOSCRIPT","META","LINK","STYLE","TITLE","TEMPLATE","SOURCE","OBJECT","SCRIPT","HEAD"],B=/^'(.*?)'$/,q=/^"(.*?)"$/,j={regular:"400",normal:"400",bold:"700",bolder:"700",lighter:"100"},H="Page saved with SingleFile",W="Archive processed by SingleFile",V="single-file-ui-element",$=(e,t,n)=>globalThis.addEventListener(e,t,n);function Y(e){e.querySelectorAll("meta[http-equiv=refresh]").forEach((e=>{e.removeAttribute("http-equiv"),e.setAttribute("disabled-http-equiv","refresh")}))}function G(e,t,n){let r;return e.querySelectorAll("noscript:not([data-single-file-disabled-noscript])").forEach((e=>{e.setAttribute(M,e.textContent),e.textContent=""})),Y(e),e.head&&e.head.querySelectorAll(U).forEach((e=>e.hidden=!0)),e.querySelectorAll("svg foreignObject").forEach((e=>{const t=e.querySelectorAll("html > head > "+U+", html > body > "+U);t.length&&(Array.from(e.childNodes).forEach((e=>e.remove())),t.forEach((t=>e.appendChild(t))))})),t&&e.documentElement?(r=K(t,e,e.documentElement,n),n.moveStylesInHead&&e.querySelectorAll("body style, body ~ style").forEach((e=>{const n=t.getComputedStyle(e);n&&X(e,n)&&(e.setAttribute(L,""),r.markedElements.push(e))}))):r={canvases:[],images:[],posters:[],usedFonts:[],shadowRoots:[],imports:[],markedElements:[]},{canvases:r.canvases,fonts:u(),stylesheets:te(e),images:r.images,posters:r.posters,usedFonts:Array.from(r.usedFonts.values()),shadowRoots:r.shadowRoots,imports:r.imports,referrer:e.referrer,markedElements:r.markedElements}}function K(e,t,n,r,a={usedFonts:new Map,canvases:[],images:[],posters:[],shadowRoots:[],imports:[],markedElements:[]},o){const s=Array.from(n.childNodes).filter((t=>t instanceof e.HTMLElement||t instanceof e.SVGElement));return s.forEach((n=>{let s,i,l;if(!r.autoSaveExternalSave&&(r.removeHiddenElements||r.removeUnusedFonts||r.compressHTML)&&(l=e.getComputedStyle(n),n instanceof e.HTMLElement&&r.removeHiddenElements&&(i=(o||n.closest("html > head"))&&F.includes(n.tagName)||n.closest("details"),i||(s=o||X(n,l),s&&(n.setAttribute(w,""),a.markedElements.push(n)))),!s)){if(r.compressHTML&&l){const e=l.getPropertyValue("white-space");e&&e.startsWith("pre")&&(n.setAttribute(E,""),a.markedElements.push(n))}r.removeUnusedFonts&&(Q(l,r,a.usedFonts),Q(e.getComputedStyle(n,":first-letter"),r,a.usedFonts),Q(e.getComputedStyle(n,":before"),r,a.usedFonts),Q(e.getComputedStyle(n,":after"),r,a.usedFonts))}!function(e,t,n,r,a,o,s){if("CANVAS"==n.tagName)try{a.canvases.push({dataURI:n.toDataURL("image/png","")}),n.setAttribute(_,a.canvases.length-1),a.markedElements.push(n)}catch(e){}if("IMG"==n.tagName){const t={currentSrc:o?"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==":r.loadDeferredImages&&n.getAttribute(N)||n.currentSrc};if(a.images.push(t),n.setAttribute(C,a.images.length-1),a.markedElements.push(n),n.removeAttribute(N),s=s||e.getComputedStyle(n)){t.size=function(e,t,n){let r=t.naturalWidth,a=t.naturalHeight;if(!r&&!a){const o=null==t.getAttribute("style");let s,i,l,c,u,h,d,p,m=!1;if("content-box"==(n=n||e.getComputedStyle(t)).getPropertyValue("box-sizing")){const e=t.style.getPropertyValue("box-sizing"),n=t.style.getPropertyPriority("box-sizing"),r=t.clientWidth;t.style.setProperty("box-sizing","border-box","important"),m=t.clientWidth!=r,e?t.style.setProperty("box-sizing",e,n):t.style.removeProperty("box-sizing")}s=ne("padding-left",n),i=ne("padding-right",n),l=ne("padding-top",n),c=ne("padding-bottom",n),m?(u=ne("border-left-width",n),h=ne("border-right-width",n),d=ne("border-top-width",n),p=ne("border-bottom-width",n)):u=h=d=p=0,r=Math.max(0,t.clientWidth-s-i-u-h),a=Math.max(0,t.clientHeight-l-c-d-p),o&&t.removeAttribute("style")}return{pxWidth:r,pxHeight:a}}(e,n,s);const r=s.getPropertyValue("box-shadow"),a=s.getPropertyValue("background-image");r&&"none"!=r||a&&"none"!=a||!(t.size.pxWidth>1||t.size.pxHeight>1)||(t.replaceable=!0,t.backgroundColor=s.getPropertyValue("background-color"),t.objectFit=s.getPropertyValue("object-fit"),t.boxSizing=s.getPropertyValue("box-sizing"),t.objectPosition=s.getPropertyValue("object-position"))}}if("VIDEO"==n.tagName&&!n.poster){const e=t.createElement("canvas"),r=e.getContext("2d");e.width=n.clientWidth,e.height=n.clientHeight;try{r.drawImage(n,0,0,e.width,e.height),a.posters.push(e.toDataURL("image/png","")),n.setAttribute(R,a.posters.length-1),a.markedElements.push(n)}catch(e){}}"IFRAME"==n.tagName&&o&&r.removeHiddenElements&&(n.setAttribute(S,""),a.markedElements.push(n));"LINK"==n.tagName&&n.import&&n.import.documentElement&&(a.imports.push({content:re(n.import)}),n.setAttribute(I,a.imports.length-1),a.markedElements.push(n));"INPUT"==n.tagName&&("password"!=n.type&&(n.setAttribute(P,n.value),a.markedElements.push(n)),"radio"!=n.type&&"checkbox"!=n.type||(n.setAttribute(P,n.checked),a.markedElements.push(n)));"TEXTAREA"==n.tagName&&(n.setAttribute(P,n.value),a.markedElements.push(n));"SELECT"==n.tagName&&n.querySelectorAll("option").forEach((e=>{e.selected&&(e.setAttribute(P,""),a.markedElements.push(e))}));"SCRIPT"==n.tagName&&(n.async&&""!=n.getAttribute("async")&&"async"!=n.getAttribute("async")&&(n.setAttribute(D,""),a.markedElements.push(n)),n.textContent=n.textContent.replace(/<\/script>/gi,"<\\/script>"))}(e,t,n,r,a,s,l);const c=!(n instanceof e.SVGElement)&&J(n);if(c&&!n.classList.contains(V)){const o={};n.setAttribute(A,a.shadowRoots.length),a.markedElements.push(n),a.shadowRoots.push(o),K(e,t,c,r,a,s),o.content=c.innerHTML,o.delegatesFocus=c.delegatesFocus,o.mode=c.mode,c.adoptedStyleSheets&&c.adoptedStyleSheets.length&&(o.adoptedStyleSheets=Array.from(c.adoptedStyleSheets).map((e=>Array.from(e.cssRules).map((e=>e.cssText)).join("\n"))))}K(e,t,n,r,a,s),!r.autoSaveExternalSave&&r.removeHiddenElements&&o&&(i||""==n.getAttribute(x)?n.parentElement&&(n.parentElement.setAttribute(x,""),a.markedElements.push(n.parentElement)):s&&(n.setAttribute(k,""),a.markedElements.push(n)))})),a}function Q(e,t,n){if(e){const r=e.getPropertyValue("font-style")||"normal";e.getPropertyValue("font-family").split(",").forEach((a=>{if(a=Z(a),!t.loadedFonts||t.loadedFonts.find((e=>Z(e.family)==a&&e.style==r))){const t=oe(e.getPropertyValue("font-weight")),o=e.getPropertyValue("font-variant")||"normal",s=[a,t,r,o];n.set(JSON.stringify(s),[a,t,r,o])}}))}}function J(e){const t=globalThis.chrome;if(e.openOrClosedShadowRoot)return e.openOrClosedShadowRoot;if(!(t&&t.dom&&t.dom.openOrClosedShadowRoot))return e.shadowRoot;try{return t.dom.openOrClosedShadowRoot(e)}catch(t){return e.shadowRoot}}function Z(e=""){return ae(g(e.trim())).toLowerCase()}function X(e,t){let n=!1;if(t){const r=t.getPropertyValue("display"),a=t.getPropertyValue("opacity"),o=t.getPropertyValue("visibility");if(n="none"==r,!n&&("0"==a||"hidden"==o)&&e.getBoundingClientRect){const t=e.getBoundingClientRect();n=!t.width&&!t.height}}return Boolean(n)}function ee(e,t){if(e.querySelectorAll("[data-single-file-disabled-noscript]").forEach((e=>{e.textContent=e.getAttribute(M),e.removeAttribute(M)})),e.querySelectorAll("meta[disabled-http-equiv]").forEach((e=>{e.setAttribute("http-equiv",e.getAttribute("disabled-http-equiv")),e.removeAttribute("disabled-http-equiv")})),e.head&&e.head.querySelectorAll("*:not(base):not(link):not(meta):not(noscript):not(script):not(style):not(template):not(title)").forEach((e=>e.removeAttribute("hidden"))),!t){const n=[k,S,w,E,C,R,_,P,A,I,z,D];t=e.querySelectorAll(n.map((e=>"["+e+"]")).join(","))}t.forEach((e=>{e.removeAttribute(k),e.removeAttribute(w),e.removeAttribute(x),e.removeAttribute(S),e.removeAttribute(E),e.removeAttribute(C),e.removeAttribute(R),e.removeAttribute(_),e.removeAttribute(P),e.removeAttribute(A),e.removeAttribute(I),e.removeAttribute(z),e.removeAttribute(D),e.removeAttribute(L)}))}function te(e){if(e){const t=[];return e.querySelectorAll("style").forEach(((n,r)=>{try{const a=e.createElement("style");a.textContent=n.textContent,e.body.appendChild(a);const o=a.sheet;a.remove(),o&&o.cssRules.length==n.sheet.cssRules.length||(n.setAttribute(z,r),t[r]=Array.from(n.sheet.cssRules).map((e=>e.cssText)).join("\n"))}catch(e){}})),t}}function ne(e,t){if(t.getPropertyValue(e).endsWith("px"))return parseFloat(t.getPropertyValue(e))}function re(e){const t=e.doctype;let n="";return t&&(n=" "),n+e.documentElement.outerHTML}function ae(e){return(e=e.match(B)?e.replace(B,"$1"):e.replace(q,"$1")).trim()}function oe(e){return j[e.toLowerCase().trim()]||e}function se(e){return e.flat?e.flat():e.reduce(((e,t)=>e.concat(Array.isArray(t)?se(t):t)),[])}var ie=Object.freeze({__proto__:null,initUserScriptHandler:function(){$("single-file-user-script-init",(()=>globalThis._singleFile_waitForUserScript=async e=>{const t=new CustomEvent(e+"-request",{cancelable:!0}),n=new Promise((t=>$(e+"-response",t)));(e=>{globalThis.dispatchEvent(e)})(t),t.defaultPrevented&&await n}))},initDoc:Y,preProcessDoc:G,postProcessDoc:ee,serialize:re,removeQuotes:ae,flatten:se,getFontWeight:oe,normalizeFontFamily:Z,getShadowRoot:J,ON_BEFORE_CAPTURE_EVENT_NAME:b,ON_AFTER_CAPTURE_EVENT_NAME:v,WIN_ID_ATTRIBUTE_NAME:T,PRESERVED_SPACE_ELEMENT_ATTRIBUTE_NAME:E,REMOVED_CONTENT_ATTRIBUTE_NAME:k,HIDDEN_CONTENT_ATTRIBUTE_NAME:w,HIDDEN_FRAME_ATTRIBUTE_NAME:S,IMAGE_ATTRIBUTE_NAME:C,POSTER_ATTRIBUTE_NAME:R,CANVAS_ATTRIBUTE_NAME:_,INPUT_VALUE_ATTRIBUTE_NAME:P,SHADOW_ROOT_ATTRIBUTE_NAME:A,HTML_IMPORT_ATTRIBUTE_NAME:I,STYLE_ATTRIBUTE_NAME:L,LAZY_SRC_ATTRIBUTE_NAME:N,STYLESHEET_ATTRIBUTE_NAME:z,SELECTED_CONTENT_ATTRIBUTE_NAME:O,ASYNC_SCRIPT_ATTRIBUTE_NAME:D,COMMENT_HEADER:H,COMMENT_HEADER_LEGACY:W,SINGLE_FILE_UI_ELEMENT_CLASS:V});const le=N,ce=V,ue="attributes",he=globalThis.browser,de=globalThis.document,pe=globalThis.MutationObserver,me=(e,t,n)=>globalThis.addEventListener(e,t,n),fe=(e,t,n)=>globalThis.removeEventListener(e,t,n),ge=new Map;let ye;async function be(e){if(de.documentElement){ge.clear();const r=Math.max(de.documentElement.scrollHeight-1.5*de.documentElement.clientHeight,0),a=Math.max(de.documentElement.scrollWidth-1.5*de.documentElement.clientWidth,0);if(globalThis.scrollY<=r&&globalThis.scrollX<=a)return function(e){return ye=0,new Promise((async r=>{let a;const o=new Set,s=new pe((async t=>{if((t=t.filter((e=>e.type==ue))).length){t.filter((e=>{if("src"==e.attributeName&&(e.target.setAttribute(le,e.target.src),e.target.addEventListener("load",l)),"src"==e.attributeName||"srcset"==e.attributeName||"SOURCE"==e.target.tagName)return!e.target.classList||!e.target.classList.contains(ce)})).length&&(a=!0,await we(s,e,d),o.size||await ke(s,e,d))}}));async function i(t){await Se("idleTimeout",(async()=>{a?ye<10&&(ye++,Ae("idleTimeout"),await i(Math.max(500,t/2))):(Ae("loadTimeout"),Ae("maxTimeout"),xe(s,e,d))}),t)}function l(e){const t=e.target;t.removeAttribute(le),t.removeEventListener("load",l)}async function c(t){a=!0,await we(s,e,d),await ke(s,e,d),t.detail&&o.add(t.detail)}async function u(t){await we(s,e,d),await ke(s,e,d),o.delete(t.detail),o.size||await ke(s,e,d)}function d(e){s.disconnect(),fe(t,c),fe(n,u),r(e)}await i(2*e.loadDeferredImagesMaxIdleTime),await we(s,e,d),s.observe(de,{subtree:!0,childList:!0,attributes:!0}),me(t,c),me(n,u),h(e)}))}(e)}}function ve(e){p(e)}async function ke(e,t,n){await Se("loadTimeout",(()=>xe(e,t,n)),t.loadDeferredImagesMaxIdleTime)}async function we(e,t,n){await Se("maxTimeout",(async()=>{await Ae("loadTimeout"),await xe(e,t,n)}),10*t.loadDeferredImagesMaxIdleTime)}async function xe(e,t,n){await Ae("idleTimeout"),d(t),await Se("endTimeout",(async()=>{await Ae("maxTimeout"),n()}),t.loadDeferredImagesMaxIdleTime/2),e.disconnect()}async function Se(e,t,n){if(he&&he.runtime&&he.runtime.sendMessage){if(!ge.get(e)||!ge.get(e).pending){const r={callback:t,pending:!0};ge.set(e,r);try{await he.runtime.sendMessage({method:"singlefile.lazyTimeout.setTimeout",type:e,delay:n})}catch(r){Ee(e,t,n)}r.pending=!1}}else Ee(e,t,n)}function Ee(e,t,n){const r=ge.get(e);r&&globalThis.clearTimeout(r),ge.set(e,t),globalThis.setTimeout(t,n)}async function Ae(e){if(he&&he.runtime&&he.runtime.sendMessage)try{await he.runtime.sendMessage({method:"singlefile.lazyTimeout.clearTimeout",type:e})}catch(t){Te(e)}else Te(e)}function Te(e){const t=ge.get(e);ge.delete(e),t&&globalThis.clearTimeout(t)}he&&he.runtime&&he.runtime.onMessage&&he.runtime.onMessage.addListener&&he.runtime.onMessage.addListener((e=>{if("singlefile.lazyTimeout.onTimeout"==e.method){const t=ge.get(e.type);if(t){ge.delete(e.type);try{t.callback()}catch(t){Te(e.type)}}}}));var Ce=Object.freeze({__proto__:null,process:be,resetZoomLevel:ve});const Re={ON_BEFORE_CAPTURE_EVENT_NAME:b,ON_AFTER_CAPTURE_EVENT_NAME:v,WIN_ID_ATTRIBUTE_NAME:T,preProcessDoc:G,serialize:re,postProcessDoc:ee,getShadowRoot:J},_e="__frameTree__::",Ie='iframe, frame, object[type="text/html"][data]',Le="singlefile.frameTree.initRequest",Pe="singlefile.frameTree.ackInitRequest",Ne="singlefile.frameTree.cleanupRequest",ze="singlefile.frameTree.initResponse",Me=5e3,Oe=".",De=globalThis.window==globalThis.top,Ue=globalThis.browser,Fe=globalThis.top,Be=globalThis.MessageChannel,qe=globalThis.document,je=new Map;let He;var We,Ve,$e;function Ye(){return globalThis.crypto.getRandomValues(new Uint32Array(32)).join("")}async function Ge(e){const t=e.sessionId,n=globalThis._singleFile_waitForUserScript;De||(He=globalThis.frameId=e.windowId),Je(qe,e.options,He,t),De||(e.options.userScriptEnabled&&n&&await n(Re.ON_BEFORE_CAPTURE_EVENT_NAME),tt({frames:[rt(qe,globalThis,He,e.options)],sessionId:t,requestedFrameId:qe.documentElement.dataset.requestedFrameId&&He}),e.options.userScriptEnabled&&n&&await n(Re.ON_AFTER_CAPTURE_EVENT_NAME),delete qe.documentElement.dataset.requestedFrameId)}function Ke(e){const t=e.sessionId;et(at(qe),e.windowId,t)}function Qe(e){e.frames.forEach((t=>Ze("responseTimeouts",e.sessionId,t.windowId)));const t=je.get(e.sessionId);if(t){e.requestedFrameId&&(t.requestedFrameId=e.requestedFrameId),e.frames.forEach((e=>{let n=t.frames.find((t=>e.windowId==t.windowId));n||(n={windowId:e.windowId},t.frames.push(n)),n.processed||(n.content=e.content,n.baseURI=e.baseURI,n.title=e.title,n.canvases=e.canvases,n.fonts=e.fonts,n.stylesheets=e.stylesheets,n.images=e.images,n.posters=e.posters,n.usedFonts=e.usedFonts,n.shadowRoots=e.shadowRoots,n.imports=e.imports,n.processed=e.processed)}));t.frames.filter((e=>!e.processed)).length||(t.frames=t.frames.sort(((e,t)=>t.windowId.split(Oe).length-e.windowId.split(Oe).length)),t.resolve&&(t.requestedFrameId&&t.frames.forEach((e=>{e.windowId==t.requestedFrameId&&(e.requestedFrame=!0)})),t.resolve(t.frames)))}}function Je(e,t,n,r){const a=at(e);!function(e,t,n,r,a){const o=[];let s;je.get(a)?s=je.get(a).requestTimeouts:(s={},je.set(a,{requestTimeouts:s}));t.forEach(((e,t)=>{const n=r+Oe+t;e.setAttribute(Re.WIN_ID_ATTRIBUTE_NAME,n),o.push({windowId:n})})),tt({frames:o,sessionId:a,requestedFrameId:e.documentElement.dataset.requestedFrameId&&r}),t.forEach(((e,t)=>{const o=r+Oe+t;try{nt(e.contentWindow,{method:Le,windowId:o,sessionId:a,options:n})}catch(e){}s[o]=globalThis.setTimeout((()=>tt({frames:[{windowId:o,processed:!0}],sessionId:a})),Me)})),delete e.documentElement.dataset.requestedFrameId}(e,a,t,n,r),a.length&&function(e,t,n,r,a){const o=[];t.forEach(((e,t)=>{const s=r+Oe+t;let i;try{i=e.contentDocument}catch(e){}if(i)try{const t=e.contentWindow;t.stop(),Ze("requestTimeouts",a,s),Je(i,n,s,a),o.push(rt(i,t,s,n))}catch(e){o.push({windowId:s,processed:!0})}})),tt({frames:o,sessionId:a,requestedFrameId:e.documentElement.dataset.requestedFrameId&&r}),delete e.documentElement.dataset.requestedFrameId}(e,a,t,n,r)}function Ze(e,t,n){const r=je.get(t);if(r&&r[e]){const t=r[e][n];t&&(globalThis.clearTimeout(t),delete r[e][n])}}function Xe(e,t){const n=je.get(e);n&&n.responseTimeouts&&(n.responseTimeouts[t]=globalThis.setTimeout((()=>tt({frames:[{windowId:t,processed:!0}],sessionId:e})),1e4))}function et(e,t,n){e.forEach(((e,r)=>{const a=t+Oe+r;e.removeAttribute(Re.WIN_ID_ATTRIBUTE_NAME);try{nt(e.contentWindow,{method:Ne,windowId:a,sessionId:n})}catch(e){}})),e.forEach(((e,r)=>{const a=t+Oe+r;let o;try{o=e.contentDocument}catch(e){}if(o)try{et(at(o),a,n)}catch(e){}}))}function tt(e){e.method=ze;try{Fe.singlefile.processors.frameTree.initResponse(e)}catch(t){nt(Fe,e,!0)}}function nt(e,t,n){if(e==Fe&&Ue&&Ue.runtime&&Ue.runtime.sendMessage)Ue.runtime.sendMessage(t);else if(n){const n=new Be;e.postMessage(_e+JSON.stringify({method:t.method,sessionId:t.sessionId}),"*",[n.port2]),n.port1.postMessage(t)}else e.postMessage(_e+JSON.stringify(t),"*")}function rt(e,t,n,r){const a=Re.preProcessDoc(e,t,r),o=Re.serialize(e);Re.postProcessDoc(e,a.markedElements);return{windowId:n,content:o,baseURI:e.baseURI.split("#")[0],title:e.title,canvases:a.canvases,fonts:a.fonts,stylesheets:a.stylesheets,images:a.images,posters:a.posters,usedFonts:a.usedFonts,shadowRoots:a.shadowRoots,imports:a.imports,processed:!0}}function at(e){let t=Array.from(e.querySelectorAll(Ie));return e.querySelectorAll("*").forEach((e=>{const n=Re.getShadowRoot(e);n&&(t=t.concat(...n.querySelectorAll(Ie)))})),t}De&&(He="0",Ue&&Ue.runtime&&Ue.runtime.onMessage&&Ue.runtime.onMessage.addListener&&Ue.runtime.onMessage.addListener((e=>e.method==ze?(Qe(e),Promise.resolve({})):e.method==Pe?(Ze("requestTimeouts",e.sessionId,e.windowId),Xe(e.sessionId,e.windowId),Promise.resolve({})):void 0))),We="message",Ve=async e=>{if("string"==typeof e.data&&e.data.startsWith(_e)){e.preventDefault(),e.stopPropagation();const t=JSON.parse(e.data.substring(_e.length));t.method==Le?(e.source&&nt(e.source,{method:Pe,windowId:t.windowId,sessionId:t.sessionId}),De||(globalThis.stop(),t.options.loadDeferredImages&&be(t.options),await Ge(t))):t.method==Pe?(Ze("requestTimeouts",t.sessionId,t.windowId),Xe(t.sessionId,t.windowId)):t.method==Ne?Ke(t):t.method==ze&&je.get(t.sessionId)&&(e.ports[0].onmessage=e=>Qe(e.data))}},$e=!0,globalThis.addEventListener(We,Ve,$e);var ot=Object.freeze({__proto__:null,getAsync:function(e){const t=Ye();return e=JSON.parse(JSON.stringify(e)),new Promise((n=>{je.set(t,{frames:[],requestTimeouts:{},responseTimeouts:{},resolve:e=>{e.sessionId=t,n(e)}}),Ge({windowId:He,sessionId:t,options:e})}))},getSync:function(e){const t=Ye();e=JSON.parse(JSON.stringify(e)),je.set(t,{frames:[],requestTimeouts:{},responseTimeouts:{}}),function(e){const t=e.sessionId,n=globalThis._singleFile_waitForUserScript;De||(He=globalThis.frameId=e.windowId);Je(qe,e.options,He,t),De||(e.options.userScriptEnabled&&n&&n(Re.ON_BEFORE_CAPTURE_EVENT_NAME),tt({frames:[rt(qe,globalThis,He,e.options)],sessionId:t,requestedFrameId:qe.documentElement.dataset.requestedFrameId&&He}),e.options.userScriptEnabled&&n&&n(Re.ON_AFTER_CAPTURE_EVENT_NAME),delete qe.documentElement.dataset.requestedFrameId)}({windowId:He,sessionId:t,options:e});const n=je.get(t).frames;return n.sessionId=t,n},cleanup:function(e){je.delete(e),Ke({windowId:He,sessionId:e,options:{sessionId:e}})},initResponse:Qe,TIMEOUT_INIT_REQUEST_MESSAGE:Me});const st=globalThis.browser,it=globalThis.document;if(it instanceof globalThis.Document){const e=it.createElement("script");e.async=!1,st&&st.runtime&&st.runtime.getURL&&(e.src=st.runtime.getURL("/dist/web/hooks/hooks-web.js"),e.async=!1),(it.documentElement||it).appendChild(e),e.remove()}var lt=Object.freeze({__proto__:null}),ct=Object.freeze({__proto__:null,frameTree:ot,hooks:lt,hooksFrames:m,lazy:Ce});const ut=/^'(.*?)'$/,ht=/^"(.*?)"$/,dt=["inherit","initial","unset"],pt=["caption","icon","menu","message-box","small-caption","status-bar"],mt=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"],ft=["normal","italic","oblique"],gt=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"],yt=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"],bt={splitBySpaces:function(e){return Et(e,[" ","\n","\t"])},split:Et,splitByCommas:function(e){return Et(e,[","],{last:!0})}},vt={isSize:function(e){return!isNaN(parseFloat(e))||-1!==e.indexOf("/")||-1!==yt.indexOf(e)}},kt="[parse-css-font] ";function wt(e){if("string"!=typeof e)throw new TypeError(kt+"Expected a string.");if(""===e)throw xt("Cannot parse an empty string.");if(-1!==pt.indexOf(e))return{system:e};const t={lineHeight:"normal",stretch:"normal",style:"normal",variant:"normal",weight:"normal"};let n=!1;const r=bt.splitBySpaces(e);let a=r.shift();for(;a;a=r.shift())if("normal"!==a&&-1===dt.indexOf(a))if(-1===mt.indexOf(a))if(-1===ft.indexOf(a))if(-1===gt.indexOf(a)){if(vt.isSize(a)){const e=bt.split(a,["/"]);if(t.size=e[0],e[1]?t.lineHeight=St(e[1]):"/"===r[0]&&(r.shift(),t.lineHeight=St(r.shift())),!r.length)throw xt("Missing required font-family.");return t.family=bt.splitByCommas(r.join(" ")).map(At),t}if("normal"!==t.variant)throw xt("Unknown or unsupported font token: "+t.variant);n||(t.variant=a)}else{if(n)continue;t.stretch=a}else{if(n)continue;t.style=a}else{if(n)continue;t.weight=a}else["style","variant","weight","stretch"].forEach((e=>{t[e]=a})),n=!0;throw xt("Missing required font-size.")}function xt(e){return new Error(kt+e)}function St(e){const t=parseFloat(e);return t.toString()===e?t:e}function Et(e,t,{last:n=!1}={}){if("string"!=typeof e)throw new TypeError("expected a string");if(!Array.isArray(t))throw new TypeError("expected a string array of separators");if("boolean"!=typeof n)throw new TypeError("expected a Boolean value for options.last");const r=[];let a="",o=!1,s=0,i=!1,l=!1;for(const n of e)i?l?l=!1:"\\"===n?l=!0:n===i&&(i=!1):'"'===n||"'"===n?i=n:"("===n?s+=1:")"===n?s>0&&(s-=1):0===s&&-1!==t.indexOf(n)&&(o=!0),o?(""!==a&&r.push(a.trim()),a="",o=!1):a+=n;return(n||""!==a)&&r.push(a.trim()),r}function At(e){return(e=e.match(ut)?e.replace(ut,"$1"):e.replace(ht,"$1")).trim()}var Tt=Object.freeze({__proto__:null,parse:wt});function Ct(e,t=0){const n=[{mode:"normal",character:null}],r=[];let a=0,o="",s=null,i=null,l=t,c=e;"("===e[0]&&")"===e[e.length-1]&&(c=e.substring(1,e.length-1),l++);for(let e=0;e0&&(n[e-1].after=r.before),void 0===r.type){if(e>0){if("media-feature-expression"===n[e-1].type){r.type="keyword";continue}if("not"===n[e-1].value||"only"===n[e-1].value){r.type="media-type";continue}if("and"===n[e-1].value){r.type="media-feature-expression";continue}"media-type"===n[e-1].type&&(n[e+1]?r.type="media-feature-expression"===n[e+1].type?"keyword":"media-feature-expression":r.type="media-feature-expression")}if(0===e){if(!n[e+1]){r.type="media-type";continue}if(n[e+1]&&("media-feature-expression"===n[e+1].type||"keyword"===n[e+1].type)){r.type="media-type";continue}if(n[e+2]){if("media-feature-expression"===n[e+2].type){r.type="media-type",n[e+1].type="keyword";continue}if("keyword"===n[e+2].type){r.type="keyword",n[e+1].type="media-type";continue}}if(n[e+3]&&"media-feature-expression"===n[e+3].type){r.type="keyword",n[e+1].type="media-type",n[e+2].type="keyword";continue}}}return n}function _t(e){const t=[];let n=0,r=0;const a=/^(\s*)url\s*\(/.exec(e);if(null!==a){let r=a[0].length,o=1;for(;o>0;){const t=e[r];"("===t&&o++,")"===t&&o--,r++}t.unshift(new Lt({type:"url",value:e.substring(0,r).trim(),sourceIndex:a[1].length,before:a[1],after:/^(\s*)/.exec(e.substring(r))[1]})),n=r}for(let a=n;a0?this.nodes[this.nodes.length-1].after:""),void 0===this.before&&(this.before=this.nodes.length>0?this.nodes[0].before:""),void 0===this.sourceIndex&&(this.sourceIndex=this.before.length),this.nodes.forEach((e=>{e.parent=this}))}function Lt(e){this.after=e.after,this.before=e.before,this.type=e.type,this.value=e.value,this.sourceIndex=e.sourceIndex}It.prototype=Object.create(Lt.prototype),It.constructor=Lt,It.prototype.walk=function(e,t){const n="string"==typeof e||e instanceof RegExp,r=n?t:e,a="string"==typeof e?new RegExp(e):e;for(let o=0;o{})){for(let t=0;t+()\],])/g,nn=/([^\\])\s+([}])/g,rn=/!important/g,an=/___PSEUDOCLASSCOLON___/g,on=/:/g,sn=/\s*(animation|animation-delay|animation-duration|transition|transition-delay|transition-duration):\s*([^;}]+)/gi,ln=/(^|\D)0?\.?0(m?s)/gi,cn=/\s*(flex|flex-basis):\s*([^;}]+)/gi,un=/\s+/,hn=/(hsla?)\(([^)]+)\)/g,dn=/(^\s+|\s+$)/g,pn=/:first-(line|letter)(\{|,)/gi,mn=/^(.*)(@charset)( "[^"]*";)/gi,fn=/^((\s*)(@charset)( [^;]+;\s*))+/gi,gn=/@(font-face|import|(?:-(?:atsc|khtml|moz|ms|o|wap|webkit)-)?keyframe|media|page|namespace)/gi,yn=/:(active|after|before|checked|disabled|empty|enabled|first-(?:child|of-type)|focus|hover|last-(?:child|of-type)|link|only-(?:child|of-type)|root|:selection|target|visited)/gi,bn=/^(.*)(@charset "[^"]*";)/g,vn=/^(\s*@charset [^;]+;\s*)+/g,kn=/:(lang|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|(?:-(?:atsc|khtml|moz|ms|o|wap|webkit)-)?any)\(/gi,wn=/([:,( ]\s*)(attr|color-stop|from|rgba|to|url|(?:-(?:atsc|khtml|moz|ms|o|wap|webkit)-)?(?:calc|max|min|(?:repeating-)?(?:linear|radial)-gradient)|-webkit-gradient)/gi,xn=/\s*\/\*/g,Sn=/\*\/\s*/g,En=/\band\(/gi,An=/([^:])not\(/gi,Tn=/\bor\(/gi,Cn=/([!{}:;>+([,])\s+/g,Rn=/;+\}/g,_n=/([0-9])\.0(ex|ch|r?em|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|g?rad|turn|m?s|k?Hz|dpi|dpcm|dppx|%| |;)/gi,In=/:0 0 0 0(;|\})/g,Ln=/:0 0 0(;|\})/g,Pn=/(transform-origin|webkit-transform-origin|moz-transform-origin|o-transform-origin|ms-transform-origin|box-shadow):0(;|\})/gi,Nn=/(:|\s)0+\.(\d+)/g,zn=/rgb\s*\(\s*([0-9,\s]+)\s*\)/gi,Mn=/(border|border-top|border-right|border-bottom|border-left|outline|background):none(;|\})/gi,On=/progid:DXImageTransform\.Microsoft\.Alpha\(Opacity=/gi,Dn=/\(([-A-Za-z]+):([0-9]+)\/([0-9]+)\)/g,Un=/___QUERY_FRACTION___/g,Fn=/;;+/g,Bn=/(:|\s)(#f00)(;|})/g,qn=/___PRESERVED_NEWLINE___/g,jn=/(:|\s)(#000080)(;|})/g,Hn=/(:|\s)(#808080)(;|})/g,Wn=/(:|\s)(#808000)(;|})/g,Vn=/(:|\s)(#800080)(;|})/g,$n=/(:|\s)(#c0c0c0)(;|})/g,Yn=/(:|\s)(#008080)(;|})/g,Gn=/(:|\s)(#ffa500)(;|})/g,Kn=/(:|\s)(#800000)(;|})/g;function Qn(e="",t=zt){const n=[],r=[];let a;const o=e;function s(t){e=e.replace(t,(e=>{const t=e.substring(0,1);if((e=e.slice(1,-1)).indexOf("___PRESERVE_CANDIDATE_COMMENT_")>=0)for(let t=0,r=n.length;t0&&"\\"!==e.charAt(u-1)&&(c=!0,")"!=l&&(u=e.indexOf(")",u)));if(a.push(e.substring(s,o.index)),c){let n=e.substring(i,u);const r=n.split(",");r.length>1&&";base64"==r[0].slice(-7)?n=n.replace(Ot,""):(n=n.replace(Dt," "),n=n.replace(Ot," "),n=n.replace(dn,"")),t.push(n);const o="url(___PRESERVED_TOKEN_"+(t.length-1)+"___)";a.push(o),s=u+1}else a.push(e.substring(o.index,n.lastIndex)),s=n.lastIndex}return a.push(e.substring(s)),a.join("")}(e,r),e=function(e,t){const n=[];let r,a=0;for(;;){const o=e.indexOf("/*",a);if(!(o>-1))break;if(r=e.indexOf("*/",o+2),!(r>-1)){r=-2;break}t.push(e.slice(o+2,r)),n.push(e.slice(a,o)),n.push("/*___PRESERVE_CANDIDATE_COMMENT_"+(t.length-1)+"___*/"),a=r+2}return n.push(e.slice(r+2)),n.join("")}(e,n),s(qt),s(jt);for(let a=0,o=n.length;a2&&">"===e.charAt(t-3)&&(r.push(""),e=e.replace(s,Nt+(r.length-1)+"___"))}e=e.replace(`/*${s}*/`,"")}else r.push("\\"),e=e.replace(s,Nt+(r.length-1)+"___"),a+=1,r.push(""),e=e.replace("___PRESERVE_CANDIDATE_COMMENT_"+a+"___",Nt+(r.length-1)+"___");else t.cuteComments?r.push(o.substring(1).replace(Wt,"\n")):t.uglyComments?r.push(o.substring(1).replace(Vt,"")):r.push(o),e=e.replace(s,Nt+(r.length-1)+"___")}if(t.expandVars){const t={};a=$t,e=e.replace(a,((e,n)=>(a=Yt,n.replace(a,((e,n,r)=>(n&&r&&(t[n]=r),""))),""))),a=Gt,e=e.replace(a,((e,n)=>t[n]||"none"))}if(e=e.replace(Ot," "),a=Kt,e=e.replace(a,((e,t)=>(r.push("calc("+t.replace(Qt,"").replace(Jt,"(").replace(Zt,")")+")"),Nt+(r.length-1)+"___"))),a=Xt,e=e.replace(a,((e,t)=>(r.push(t),"filter:progid:DXImageTransform.Microsoft.Matrix(___PRESERVED_TOKEN_"+(r.length-1)+"___);"))),a=en,e=(e=(e=(e=(e=e.replace(a,(e=>e.replace(on,"___PSEUDOCLASSCOLON___")))).replace(tn,"$1")).replace(nn,"$1$2")).replace(rn," !important")).replace(an,":"),a=sn,e=e.replace(a,((e,t,n)=>t+":"+(n=n.replace(ln,((e,t,n)=>(r.push("0"+n),t+Nt+(r.length-1)+"___")))))),a=cn,e=function(e,t){const n=Ft;let r,a=0;const o=(e,n)=>{"0"===(e=e.replace(Bt,"")).charAt(0)&&(t.push(e),r[n]=Nt+(t.length-1)+"___")};for(;;){let t=0;r="";let s=e.slice(a).search(n);if(s<0)break;a+=s,s=a;const i=e.length,l=[];for(;a{let a=n.split(un);return r.push(a.pop()),a.push(Nt+(r.length-1)+"___"),a=a.join(" "),`${t}:${a}`}))).replace(hn,((e,t,n)=>{const a=[];return n.split(",").forEach((e=>{"0%"===(e=e.replace(dn,""))?(r.push("0%"),a.push(Nt+(r.length-1)+"___")):a.push(e)})),t+"("+a.join(",")+")"})),r),e=e.replace(pn,((e,t,n)=>":first-"+t.toLowerCase()+" "+n)),e=t.cuteComments?(e=e.replace(xn,"___PRESERVED_NEWLINE___/*")).replace(Sn,"*/___PRESERVED_NEWLINE___"):e.replace(Sn,"*/"),a=mn,e=e.replace(a,((e,t,n,r)=>n.toLowerCase()+r+t)),a=fn,e=e.replace(a,((e,t,n,r,a)=>n+r.toLowerCase()+a)),a=gn,e=e.replace(a,((e,t)=>"@"+t.toLowerCase())),a=yn,e=(e=(e=e.replace(a,((e,t)=>":"+t.toLowerCase()))).replace(bn,"$2$1")).replace(vn,"$1"),a=kn,e=e.replace(a,((e,t)=>":"+t.toLowerCase()+"(")),a=wn,e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(a,((e,t,n)=>t+n.toLowerCase()))).replace(En,"and (")).replace(An,"$1not (")).replace(Tn,"or (")).replace(Cn,"$1")).replace(Rn,"}")).replace(_n,"$1$2")).replace(In,":0$1")).replace(Ln,":0$1"),a=Pn,e=(e=e.replace(a,((e,t,n)=>t.toLowerCase()+":0 0"+n))).replace(Nn,"$1.$2"),a=zn,e=e.replace(a,((e,t)=>{const n=t.split(",");let r="#";for(let e=0;e255&&(t=255),r+=t.toString(16)}return r})),e=function(e){const t=Ut,n=[];let r,a=0;for(;null!==(r=t.exec(e));)n.push(e.substring(a,r.index)),r[1]?n.push(r[1]+"#"+(r[2]+r[3]+r[4]+r[5]+r[6]+r[7])):r[2].toLowerCase()==r[3].toLowerCase()&&r[4].toLowerCase()==r[5].toLowerCase()&&r[6].toLowerCase()==r[7].toLowerCase()?n.push("#"+(r[3]+r[5]+r[7]).toLowerCase()):n.push("#"+(r[2]+r[3]+r[4]+r[5]+r[6]+r[7]).toLowerCase()),a=t.lastIndex=t.lastIndex-r[8].length;return n.push(e.substring(a)),n.join("")}(e),e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(Bn,"$1red$3")).replace(jn,"$1navy$3")).replace(Hn,"$1gray$3")).replace(Wn,"$1olive$3")).replace(Vn,"$1purple$3")).replace($n,"$1silver$3")).replace(Yn,"$1teal$3")).replace(Gn,"$1orange$3")).replace(Kn,"$1maroon$3"),a=Mn,e=(e=(e=(e=e.replace(a,((e,t,n)=>t.toLowerCase()+":0"+n))).replace(On,"alpha(opacity=")).replace(Dn,"($1:$2___QUERY_FRACTION___$3)")).replace(Un,"/"),t.maxLineLen>0){const n=[];let r=[];for(let a=0,o=e.length;at.maxLineLen&&(n.push(r.join("")),r=[])}r.length&&n.push(r.join("")),e=n.join("\n")}if(e=(e=e.replace(Fn,";")).replace(Qt,""),r.length>1e3)return o;for(let t=r.length-1;t>=0;t--)e=e.replace(Nt+t+"___",r[t],"g");return e=e.replace(qn,"\n")}var Jn=Object.freeze({__proto__:null,defaultOptions:zt,processString:Qn});function Zn(e){return{prev:null,next:null,data:e}}function Xn(e,t,n){var r;return null!==tr?(r=tr,tr=tr.cursor,r.prev=t,r.next=n,r.cursor=e.cursor):r={prev:t,next:n,cursor:e.cursor},e.cursor=r,r}function er(e){var t=e.cursor;e.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=tr,tr=t}var tr=null,nr=function(){this.cursor=null,this.head=null,this.tail=null};nr.createItem=Zn,nr.prototype.createItem=Zn,nr.prototype.updateCursors=function(e,t,n,r){for(var a=this.cursor;null!==a;)a.prev===e&&(a.prev=t),a.next===n&&(a.next=r),a=a.cursor},nr.prototype.getSize=function(){for(var e=0,t=this.head;t;)e++,t=t.next;return e},nr.prototype.fromArray=function(e){var t=null;this.head=null;for(var n=0;n100&&(c=o-60+3,o=58);for(var u=s;u<=i;u++)u>=0&&u0&&r[u].length>c?"…":"")+r[u].substr(c,98)+(r[u].length>c+100-1?"…":""));return[n(s,a),new Array(o+l+2).join("-")+"^",n(a,i)].filter(Boolean).join("\n")}var ir=function(e,t,n,r,a){var o=ar("SyntaxError",e);return o.source=t,o.offset=n,o.line=r,o.column=a,o.sourceFragment=function(e){return sr(o,isNaN(e)?0:e)},Object.defineProperty(o,"formattedMessage",{get:function(){return"Parse error: "+o.message+"\n"+sr(o,2)}}),o.parseError={offset:n,line:r,column:a},o},lr={EOF:0,Ident:1,Function:2,AtKeyword:3,Hash:4,String:5,BadString:6,Url:7,BadUrl:8,Delim:9,Number:10,Percentage:11,Dimension:12,WhiteSpace:13,CDO:14,CDC:15,Colon:16,Semicolon:17,Comma:18,LeftSquareBracket:19,RightSquareBracket:20,LeftParenthesis:21,RightParenthesis:22,LeftCurlyBracket:23,RightCurlyBracket:24,Comment:25},cr=Object.keys(lr).reduce((function(e,t){return e[lr[t]]=t,e}),{}),ur={TYPE:lr,NAME:cr};function hr(e){return e>=48&&e<=57}function dr(e){return e>=65&&e<=90}function pr(e){return e>=97&&e<=122}function mr(e){return dr(e)||pr(e)}function fr(e){return e>=128}function gr(e){return mr(e)||fr(e)||95===e}function yr(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e}function br(e){return 10===e||13===e||12===e}function vr(e){return br(e)||32===e||9===e}function kr(e,t){return 92===e&&(!br(t)&&0!==t)}var wr=new Array(128);Sr.Eof=128,Sr.WhiteSpace=130,Sr.Digit=131,Sr.NameStart=132,Sr.NonPrintable=133;for(var xr=0;xr=65&&e<=70||e>=97&&e<=102},isUppercaseLetter:dr,isLowercaseLetter:pr,isLetter:mr,isNonAscii:fr,isNameStart:gr,isName:function(e){return gr(e)||hr(e)||45===e},isNonPrintable:yr,isNewline:br,isWhiteSpace:vr,isValidEscape:kr,isIdentifierStart:function(e,t,n){return 45===e?gr(t)||45===t||kr(t,n):!!gr(e)||92===e&&kr(e,t)},isNumberStart:function(e,t,n){return 43===e||45===e?hr(t)?2:46===t&&hr(n)?3:0:46===e?hr(t)?2:0:hr(e)?1:0},isBOM:function(e){return 65279===e||65534===e?1:0},charCodeCategory:Sr},Ar=Er.isDigit,Tr=Er.isHexDigit,Cr=Er.isUppercaseLetter,Rr=Er.isName,_r=Er.isWhiteSpace,Ir=Er.isValidEscape;function Lr(e,t){return te.length)return!1;for(var a=t;a=0&&_r(e.charCodeAt(t));t--);return t+1},findWhiteSpaceEnd:function(e,t){for(;t>Wr:Br},lookupOffset:function(e){return(e+=this.tokenIndex)0?e>Wr,this.source,a)){case 1:break e;case 2:r++;break e;default:this.balance[n]===r&&(r=n),a=this.offsetAndType[r]&Hr}return r-this.tokenIndex},isBalanceEdge:function(e){return this.balance[this.tokenIndex]>Wr===qr;e++,t++);t>0&&this.skip(t)},skipSC:function(){for(;this.tokenType===qr||this.tokenType===jr;)this.next()},skip:function(e){var t=this.tokenIndex+e;t>Wr,this.tokenEnd=t&Hr):(this.tokenIndex=this.tokenCount,this.next())},next:function(){var e=this.tokenIndex+1;e>Wr,this.tokenEnd=e&Hr):(this.tokenIndex=this.tokenCount,this.eof=!0,this.tokenType=Br,this.tokenStart=this.tokenEnd=this.source.length)},forEachToken(e){for(var t=0,n=this.firstCharOffset;t>Wr,r,o,t)}},dump(){var e=new Array(this.tokenCount);return this.forEachToken(((t,n,r,a)=>{e[a]={idx:a,type:Ur[t],chunk:this.source.substring(n,r),balance:this.balance[a]}})),e}};var $r=Vr;function Yr(e){return e}function Gr(e,t,n,r){var a,o;switch(e.type){case"Group":a=function(e,t,n,r){var a=" "===e.combinator||r?e.combinator:" "+e.combinator+" ",o=e.terms.map((function(e){return Gr(e,t,n,r)})).join(a);return(e.explicit||n)&&(o=(r||","===o[0]?"[":"[ ")+o+(r?"]":" ]")),o}(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return Gr(e.term,t,n,r)+t(0===(o=e).min&&0===o.max?"*":0===o.min&&1===o.max?"?":1===o.min&&0===o.max?o.comma?"#":"+":1===o.min&&1===o.max?"":(o.comma?"#":"")+(o.min===o.max?"{"+o.min+"}":"{"+o.min+","+(0!==o.max?o.max:"")+"}"),e);case"Type":a="<"+e.name+(e.opts?t(function(e){if("Range"===e.type)return" ["+(null===e.min?"-∞":e.min)+","+(null===e.max?"∞":e.max)+"]";throw new Error("Unknown node type `"+e.type+"`")}(e.opts),e.opts):"")+">";break;case"Property":a="<'"+e.name+"'>";break;case"Keyword":a=e.name;break;case"AtKeyword":a="@"+e.name;break;case"Function":a=e.name+"(";break;case"String":case"Token":a=e.value;break;case"Comma":a=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(a,e)}var Kr=function(e,t){var n=Yr,r=!1,a=!1;return"function"==typeof t?n=t:t&&(r=Boolean(t.forceBraces),a=Boolean(t.compact),"function"==typeof t.decorate&&(n=t.decorate)),Gr(e,n,r,a)};const Qr={offset:0,line:1,column:1};function Jr(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?Zr(n):n:null}function Zr({offset:e,line:t,column:n},r){const a={offset:e,line:t,column:n};if(r){const e=r.split(/\n|\r\n?|\f/);a.offset+=r.length,a.line+=e.length-1,a.column=1===e.length?a.column+r.length:e.pop().length+1}return a}var Xr=function(e,t){const n=ar("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},ea=function(e,t,n,r){const a=ar("SyntaxMatchError",e),{css:o,mismatchOffset:s,mismatchLength:i,start:l,end:c}=function(e,t){const n=e.tokens,r=e.longestMatch,a=r1?(s=Jr(o||t,"end")||Zr(Qr,h),i=Zr(s)):(s=Jr(o,"start")||Zr(Jr(t,"start")||Qr,h.slice(0,l)),i=Jr(o,"end")||Zr(s,h.substr(l,c))),{css:h,mismatchOffset:l,mismatchLength:c,start:s,end:i}}(r,n);return a.rawMessage=e,a.syntax=t?Kr(t):"",a.css=o,a.mismatchOffset=s,a.mismatchLength=i,a.message=e+"\n syntax: "+a.syntax+"\n value: "+(o||"")+"\n --------"+new Array(a.mismatchOffset+1).join("-")+"^",Object.assign(a,l),a.loc={source:n&&n.loc&&n.loc.source||"",start:l,end:c},a},ta=Object.prototype.hasOwnProperty,na=Object.create(null),ra=Object.create(null);function aa(e,t){return t=t||0,e.length-t>=2&&45===e.charCodeAt(t)&&45===e.charCodeAt(t+1)}function oa(e,t){if(t=t||0,e.length-t>=3&&45===e.charCodeAt(t)&&45!==e.charCodeAt(t+1)){var n=e.indexOf("-",t+2);if(-1!==n)return e.substring(t,n+1)}return""}var sa={keyword:function(e){if(ta.call(na,e))return na[e];var t=e.toLowerCase();if(ta.call(na,t))return na[e]=na[t];var n=aa(t,0),r=n?"":oa(t,0);return na[e]=Object.freeze({basename:t.substr(r.length),name:t,vendor:r,prefix:r,custom:n})},property:function(e){if(ta.call(ra,e))return ra[e];var t=e,n=e[0];"/"===n?n="/"===e[1]?"//":"/":"_"!==n&&"*"!==n&&"$"!==n&&"#"!==n&&"+"!==n&&"&"!==n&&(n="");var r=aa(t,n.length);if(!r&&(t=t.toLowerCase(),ta.call(ra,t)))return ra[e]=ra[t];var a=r?"":oa(t,n.length),o=t.substr(0,n.length+a.length);return ra[e]=Object.freeze({basename:t.substr(o.length),name:t.substr(n.length),hack:n,vendor:a,prefix:o,custom:r})},isCustomProperty:aa,vendorPrefix:oa},ia="undefined"!=typeof Uint32Array?Uint32Array:Array,la=function(e,t){return null===e||e.length=e.length?void(h>Aa,l[c]=m,l[m++]=c;m0?6:0;if(!Ha(o))return 0;if(++a>6)return 0}return a}function Xa(e,t,n){if(!e)return 0;for(;Qa(n(t),63);){if(++e>6)return 0;t++}return t}var eo=Ca.isIdentifierStart,to=Ca.isHexDigit,no=Ca.isDigit,ro=Ca.cmpStr,ao=Ca.consumeNumber,oo=Ca.TYPE,so=["unset","initial","inherit"],io=["calc(","-moz-calc(","-webkit-calc("];function lo(e,t){return te.max)return!0}return!1}function mo(e,t){var n=e.index,r=0;do{if(r++,e.balance<=n)break}while(e=t(r));return r}function fo(e){return function(t,n,r){return null===t?0:t.type===oo.Function&&uo(t.value,io)?mo(t,n):e(t,n,r)}}function go(e){return function(t){return null===t||t.type!==e?0:1}}function yo(e){return function(t,n,r){if(null===t||t.type!==oo.Dimension)return 0;var a=ao(t.value,0);if(null!==e){var o=t.value.indexOf("\\",a),s=-1!==o&&ho(t.value,o)?t.value.substring(a,o):t.value.substr(a);if(!1===e.hasOwnProperty(s.toLowerCase()))return 0}return po(r,t.value,a)?0:1}}function bo(e){return"function"!=typeof e&&(e=function(){return 0}),function(t,n,r){return null!==t&&t.type===oo.Number&&0===Number(t.value)?1:e(t,n,r)}}var vo,ko={"ident-token":go(oo.Ident),"function-token":go(oo.Function),"at-keyword-token":go(oo.AtKeyword),"hash-token":go(oo.Hash),"string-token":go(oo.String),"bad-string-token":go(oo.BadString),"url-token":go(oo.Url),"bad-url-token":go(oo.BadUrl),"delim-token":go(oo.Delim),"number-token":go(oo.Number),"percentage-token":go(oo.Percentage),"dimension-token":go(oo.Dimension),"whitespace-token":go(oo.WhiteSpace),"CDO-token":go(oo.CDO),"CDC-token":go(oo.CDC),"colon-token":go(oo.Colon),"semicolon-token":go(oo.Semicolon),"comma-token":go(oo.Comma),"[-token":go(oo.LeftSquareBracket),"]-token":go(oo.RightSquareBracket),"(-token":go(oo.LeftParenthesis),")-token":go(oo.RightParenthesis),"{-token":go(oo.LeftCurlyBracket),"}-token":go(oo.RightCurlyBracket),string:go(oo.String),ident:go(oo.Ident),"custom-ident":function(e){if(null===e||e.type!==oo.Ident)return 0;var t=e.value.toLowerCase();return uo(t,so)||co(t,"default")?0:1},"custom-property-name":function(e){return null===e||e.type!==oo.Ident||45!==lo(e.value,0)||45!==lo(e.value,1)?0:1},"hex-color":function(e){if(null===e||e.type!==oo.Hash)return 0;var t=e.value.length;if(4!==t&&5!==t&&7!==t&&9!==t)return 0;for(var n=1;ne.index||e.balancee.index||e.balance=128||0===Ao[n])break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function _o(e){for(var t=e.pos;t57)break}return e.pos===t&&e.error("Expect a number"),e.substringToPos(t)}function Io(e){var t=e.str.indexOf("'",e.pos+1);return-1===t&&(e.pos=e.str.length,e.error("Expect an apostrophe")),e.substringToPos(t+1)}function Lo(e){var t,n=null;return e.eat(Eo),t=_o(e),44===e.charCode()?(e.pos++,125!==e.charCode()&&(n=_o(e))):n=t,e.eat(125),{min:Number(t),max:n?Number(n):0}}function Po(e,t){var n=function(e){var t=null,n=!1;switch(e.charCode()){case 42:e.pos++,t={min:0,max:0};break;case 43:e.pos++,t={min:1,max:0};break;case 63:e.pos++,t={min:0,max:1};break;case 35:e.pos++,n=!0,t=e.charCode()===Eo?Lo(e):{min:1,max:0};break;case Eo:t=Lo(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}(e);return null!==n?(n.term=t,n):t}function No(e){var t=e.peek();return""===t?null:{type:"Token",value:t}}function zo(e){var t,n=null;return e.eat(60),t=Ro(e),40===e.charCode()&&41===e.nextCharCode()&&(e.pos+=2,t+="()"),91===e.charCodeAt(e.findWsEnd(e.pos))&&(Co(e),n=function(e){var t=null,n=null,r=1;return e.eat(91),45===e.charCode()&&(e.peek(),r=-1),-1==r&&8734===e.charCode()?e.peek():t=r*Number(_o(e)),Co(e),e.eat(44),Co(e),8734===e.charCode()?e.peek():(r=1,45===e.charCode()&&(e.peek(),r=-1),n=r*Number(_o(e))),e.eat(93),null===t&&null===n?null:{type:"Range",min:t,max:n}}(e)),e.eat(62),Po(e,{type:"Type",name:t,opts:n})}function Mo(e,t){function n(e,t){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:!1}}for(t=Object.keys(t).sort((function(e,t){return To[e]-To[t]}));t.length>0;){for(var r=t.shift(),a=0,o=0;a1&&(e.splice(o,a-o,n(e.slice(o,a),r)),a=o+1),o=-1))}-1!==o&&t.length&&e.splice(o,a-o,n(e.slice(o,a),r))}return r}function Oo(e){for(var t,n=[],r={},a=null,o=e.pos;t=Do(e);)"Spaces"!==t.type&&("Combinator"===t.type?(null!==a&&"Combinator"!==a.type||(e.pos=o,e.error("Unexpected combinator")),r[t.value]=!0):null!==a&&"Combinator"!==a.type&&(r[" "]=!0,n.push({type:"Combinator",value:" "})),n.push(t),a=t,o=e.pos);return null!==a&&"Combinator"===a.type&&(e.pos-=o,e.error("Unexpected combinator")),{type:"Group",terms:n,combinator:Mo(n,r)||" ",disallowEmpty:!1,explicit:!1}}function Do(e){var t=e.charCode();if(t<128&&1===Ao[t])return function(e){var t;return t=Ro(e),40===e.charCode()?(e.pos++,{type:"Function",name:t}):Po(e,{type:"Keyword",name:t})}(e);switch(t){case 93:break;case 91:return Po(e,function(e){var t;return e.eat(91),t=Oo(e),e.eat(93),t.explicit=!0,33===e.charCode()&&(e.pos++,t.disallowEmpty=!0),t}(e));case 60:return 39===e.nextCharCode()?function(e){var t;return e.eat(60),e.eat(39),t=Ro(e),e.eat(39),e.eat(62),Po(e,{type:"Property",name:t})}(e):zo(e);case 124:return{type:"Combinator",value:e.substringToPos(124===e.nextCharCode()?e.pos+2:e.pos+1)};case 38:return e.pos++,e.eat(38),{type:"Combinator",value:"&&"};case 44:return e.pos++,{type:"Comma"};case 39:return Po(e,{type:"String",value:Io(e)});case 32:case 9:case 10:case 13:case 12:return{type:"Spaces",value:Co(e)};case 64:return(t=e.nextCharCode())<128&&1===Ao[t]?(e.pos++,{type:"AtKeyword",name:Ro(e)}):No(e);case 42:case 43:case 63:case 35:case 33:break;case Eo:if((t=e.nextCharCode())<48||t>57)return No(e);break;default:return No(e)}}function Uo(e){var t=new So(e),n=Oo(t);return t.pos!==e.length&&t.error("Unexpected input"),1===n.terms.length&&"Group"===n.terms[0].type&&(n=n.terms[0]),n}Uo("[a&&#|<'c'>*||e() f{2} /,(% g#{1,2} h{2,})]!");var Fo=Uo,Bo=function(){};function qo(e){return"function"==typeof e?e:Bo}var jo=function(e,t,n){var r=Bo,a=Bo;if("function"==typeof t?r=t:t&&(r=qo(t.enter),a=qo(t.leave)),r===Bo&&a===Bo)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");!function e(t){switch(r.call(n,t),t.type){case"Group":t.terms.forEach(e);break;case"Multiplier":e(t.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+t.type)}a.call(n,t)}(e)},Ho=new $r,Wo={decorator:function(e){var t=null,n={len:0,node:null},r=[n],a="";return{children:e.children,node:function(n){var r=t;t=n,e.node.call(this,n),t=r},chunk:function(e){a+=e,n.node!==t?r.push({len:e.length,node:t}):n.len+=e.length},result:function(){return Vo(a,r)}}}};function Vo(e,t){var n=[],r=0,a=0,o=t?t[a].node:null;for(Ca(e,Ho);!Ho.eof;){if(t)for(;a2&&40===e.charCodeAt(e.length-2)&&41===e.charCodeAt(e.length-1)}function Jo(e){return"Keyword"===e.type||"AtKeyword"===e.type||"Function"===e.type||"Type"===e.type&&Qo(e.name)}function Zo(e,t,n){switch(e){case" ":for(var r=$o,a=t.length-1;a>=0;a--){r=Ko(i=t[a],r,Yo)}return r;case"|":r=Yo;var o=null;for(a=t.length-1;a>=0;a--){if(Jo(i=t[a])&&(null===o&&a>0&&Jo(t[a-1])&&(r=Ko({type:"Enum",map:o=Object.create(null)},$o,r)),null!==o)){var s=(Qo(i.name)?i.name.slice(0,-1):i.name).toLowerCase();if(s in o==!1){o[s]=i;continue}}o=null,r=Ko(i,$o,r)}return r;case"&&":if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};for(r=Yo,a=t.length-1;a>=0;a--){var i=t[a];l=t.length>1?Zo(e,t.filter((function(e){return e!==i})),!1):$o,r=Ko(i,l,r)}return r;case"||":if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};for(r=n?$o:Yo,a=t.length-1;a>=0;a--){var l;i=t[a];l=t.length>1?Zo(e,t.filter((function(e){return e!==i})),!0):$o,r=Ko(i,l,r)}return r}}function Xo(e){if("function"==typeof e)return{type:"Generic",fn:e};switch(e.type){case"Group":var t=Zo(e.combinator,e.terms.map(Xo),!1);return e.disallowEmpty&&(t=Ko(t,Go,Yo)),t;case"Multiplier":return function(e){var t=$o,n=Xo(e.term);if(0===e.max)n=Ko(n,Go,Yo),(t=Ko(n,null,Yo)).then=Ko($o,$o,t),e.comma&&(t.then.else=Ko({type:"Comma",syntax:e},t,Yo));else for(var r=e.min||1;r<=e.max;r++)e.comma&&t!==$o&&(t=Ko({type:"Comma",syntax:e},t,Yo)),t=Ko(n,Ko($o,$o,t),Yo);if(0===e.min)t=Ko($o,$o,t);else for(r=0;r=65&&r<=90&&(r|=32),r!==t.charCodeAt(n))return!1}return!0}function ds(e){return null===e||(e.type===ls.Comma||e.type===ls.Function||e.type===ls.LeftParenthesis||e.type===ls.LeftSquareBracket||e.type===ls.LeftCurlyBracket||function(e){return e.type===ls.Delim&&"?"!==e.value}(e))}function ps(e){return null===e||(e.type===ls.RightParenthesis||e.type===ls.RightSquareBracket||e.type===ls.RightCurlyBracket||e.type===ls.Delim)}function ms(e,t,n){function r(){do{y++,g=yb&&(b=y)}function c(){v=2===v.type?v.prev:{type:3,syntax:u.syntax,token:v.token,prev:v},u=u.prev}var u=null,h=null,d=null,p=null,m=0,f=null,g=null,y=-1,b=0,v={type:0,syntax:null,token:null,prev:null};for(r();null===f&&++m<15e3;)switch(t.type){case"Match":if(null===h){if(null!==g&&(y!==e.length-1||"\\0"!==g.value&&"\\9"!==g.value)){t=ss;break}f=cs;break}if((t=h.nextState)===is){if(h.matchStack===v){t=ss;break}t=os}for(;h.syntaxStack!==u;)c();h=h.prev;break;case"Mismatch":if(null!==p&&!1!==p)(null===d||y>d.tokenIndex)&&(d=p,p=!1);else if(null===d){f="Mismatch";break}t=d.nextState,h=d.thenStack,u=d.syntaxStack,v=d.matchStack,y=d.tokenIndex,g=yy){for(;y":"<'"+t.name+"'>"));if(!1!==p&&null!==g&&"Type"===t.type)if("custom-ident"===t.name&&g.type===ls.Ident||"length"===t.name&&"0"===g.value){null===p&&(p=o(t,d)),t=ss;break}u={syntax:t.syntax,opts:t.syntax.opts||null!==u&&u.opts||null,prev:u},v={type:2,syntax:t.syntax,token:v.token,prev:v},t=A.match;break;case"Keyword":var T=t.name;if(null!==g){var C=g.value;if(-1!==C.indexOf("\\")&&(C=C.replace(/\\[09].*$/,"")),hs(C,T)){l(),t=os;break}}t=ss;break;case"AtKeyword":case"Function":if(null!==g&&hs(g.value,t.name)){l(),t=os;break}t=ss;break;case"Token":if(null!==g&&g.value===t.value){l(),t=os;break}t=ss;break;case"Comma":null!==g&&g.type===ls.Comma?ds(v.token)?t=ss:(l(),t=ps(g)?ss:os):t=ds(v.token)||ps(g)?os:ss;break;case"String":var R="";for(S=y;S=0}function Es(e){return Boolean(e)&&Ss(e.offset)&&Ss(e.line)&&Ss(e.column)}function As(e,t){return function(n,r){if(!n||n.constructor!==Object)return r(n,"Type of node should be an Object");for(var a in n){var o=!0;if(!1!==xs.call(n,a)){if("type"===a)n.type!==e&&r(n,"Wrong node type `"+n.type+"`, expected `"+e+"`");else if("loc"===a){if(null===n.loc)continue;if(n.loc&&n.loc.constructor===Object)if("string"!=typeof n.loc.source)a+=".source";else if(Es(n.loc.start)){if(Es(n.loc.end))continue;a+=".end"}else a+=".start";o=!1}else if(t.hasOwnProperty(a)){var s=0;for(o=!1;!o&&s");else{if(!Array.isArray(c))throw new Error("Wrong value `"+c+"` in `"+e+"."+o+"` structure definition");s.push("List")}}a[o]=s.join(" | ")}return{docs:a,check:As(e,r)}}var Cs=function(e){var t={};if(e.node)for(var n in e.node)if(xs.call(e.node,n)){var r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=Ts(n,r)}return t},Rs=Xr,_s=ea,Is=rs,Ls=fs,Ps=Cs,Ns=Is("inherit | initial | unset"),zs=Is("inherit | initial | unset | <-ms-legacy-expression>");function Ms(e,t,n){var r={};for(var a in e)e[a].syntax&&(r[a]=n?e[a].syntax:Kr(e[a].syntax,{compact:t}));return r}function Os(e,t,n){const r={};for(const[a,o]of Object.entries(e))r[a]={prelude:o.prelude&&(n?o.prelude.syntax:Kr(o.prelude.syntax,{compact:t})),descriptors:o.descriptors&&Ms(o.descriptors,t,n)};return r}function Ds(e,t,n){return{matched:e,iterations:n,error:t,getTrace:bs.getTrace,isType:bs.isType,isProperty:bs.isProperty,isKeyword:bs.isKeyword}}function Us(e,t,n,r){var a,o=function(e,t){return"string"==typeof e?Vo(e,null):t.generate(e,Wo)}(n,e.syntax);return function(e){for(var t=0;t(n[r]=this.createDescriptor(t.descriptors[r],"AtruleDescriptor",r,e),n)),{}):null})},addProperty_:function(e,t){t&&(this.properties[e]=this.createDescriptor(t,"Property",e))},addType_:function(e,t){t&&(this.types[e]=this.createDescriptor(t,"Type",e),t===ko["-ms-legacy-expression"]&&(this.valueCommonSyntax=zs))},checkAtruleName:function(e){if(!this.getAtrule(e))return new Rs("Unknown at-rule","@"+e)},checkAtrulePrelude:function(e,t){let n=this.checkAtruleName(e);if(n)return n;var r=this.getAtrule(e);return!r.prelude&&t?new SyntaxError("At-rule `@"+e+"` should not contain a prelude"):r.prelude&&!t?new SyntaxError("At-rule `@"+e+"` should contain a prelude"):void 0},checkAtruleDescriptorName:function(e,t){let n=this.checkAtruleName(e);if(n)return n;var r=this.getAtrule(e),a=sa.keyword(t);return r.descriptors?r.descriptors[a.name]||r.descriptors[a.basename]?void 0:new Rs("Unknown at-rule descriptor",t):new SyntaxError("At-rule `@"+e+"` has no known descriptors")},checkPropertyName:function(e){return sa.property(e).custom?new Error("Lexer matching doesn't applicable for custom properties"):this.getProperty(e)?void 0:new Rs("Unknown property",e)},matchAtrulePrelude:function(e,t){var n=this.checkAtrulePrelude(e,t);return n?Ds(null,n):t?Us(this,this.getAtrule(e).prelude,t,!1):Ds(null,null)},matchAtruleDescriptor:function(e,t,n){var r=this.checkAtruleDescriptorName(e,t);if(r)return Ds(null,r);var a=this.getAtrule(e),o=sa.keyword(t);return Us(this,a.descriptors[o.name]||a.descriptors[o.basename],n,!1)},matchDeclaration:function(e){return"Declaration"!==e.type?Ds(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)},matchProperty:function(e,t){var n=this.checkPropertyName(e);return n?Ds(null,n):Us(this,this.getProperty(e),t,!0)},matchType:function(e,t){var n=this.getType(e);return n?Us(this,n,t,!1):Ds(null,new Rs("Unknown type",e))},match:function(e,t){return"string"==typeof e||e&&e.type?("string"!=typeof e&&e.match||(e=this.createDescriptor(e,"Type","anonymous")),Us(this,e,t,!1)):Ds(null,new Rs("Bad syntax"))},findValueFragments:function(e,t,n,r){return ws.matchFragments(this,t,this.matchProperty(e,t),n,r)},findDeclarationValueFragments:function(e,t,n){return ws.matchFragments(this,e.value,this.matchDeclaration(e),t,n)},findAllFragments:function(e,t,n){var r=[];return this.syntax.walk(e,{visit:"Declaration",enter:function(e){r.push.apply(r,this.findDeclarationValueFragments(e,t,n))}.bind(this)}),r},getAtrule:function(e,t=!0){var n=sa.keyword(e);return(n.vendor&&t?this.atrules[n.name]||this.atrules[n.basename]:this.atrules[n.name])||null},getAtrulePrelude:function(e,t=!0){const n=this.getAtrule(e,t);return n&&n.prelude||null},getAtruleDescriptor:function(e,t){return this.atrules.hasOwnProperty(e)&&this.atrules.declarators&&this.atrules[e].declarators[t]||null},getProperty:function(e,t=!0){var n=sa.property(e);return(n.vendor&&t?this.properties[n.name]||this.properties[n.basename]:this.properties[n.name])||null},getType:function(e){return this.types.hasOwnProperty(e)?this.types[e]:null},validate:function(){function e(r,a,o,s){if(o.hasOwnProperty(a))return o[a];o[a]=!1,null!==s.syntax&&jo(s.syntax,(function(s){if("Type"===s.type||"Property"===s.type){var i="Type"===s.type?r.types:r.properties,l="Type"===s.type?t:n;i.hasOwnProperty(s.name)&&!e(r,s.name,l,i[s.name])||(o[a]=!0)}}),this)}var t={},n={};for(var r in this.types)e(this,r,t,this.types[r]);for(var r in this.properties)e(this,r,n,this.properties[r]);return t=Object.keys(t).filter((function(e){return t[e]})),n=Object.keys(n).filter((function(e){return n[e]})),t.length||n.length?{types:t,properties:n}:null},dump:function(e,t){return{generic:this.generic,types:Ms(this.types,!t,e),properties:Ms(this.properties,!t,e),atrules:Os(this.atrules,!t,e)}},toString:function(){return JSON.stringify(this.dump())}};var Bs=Fs,qs={SyntaxError:wo,parse:Fo,generate:Kr,walk:jo},js=Ca.isBOM;var Hs=function(){this.lines=null,this.columns=null,this.linesAndColumnsComputed=!1};Hs.prototype={setSource:function(e,t,n,r){this.source=e,this.startOffset=void 0===t?0:t,this.startLine=void 0===n?1:n,this.startColumn=void 0===r?1:r,this.linesAndColumnsComputed=!1},ensureLinesAndColumnsComputed:function(){this.linesAndColumnsComputed||(!function(e,t){for(var n=t.length,r=la(e.lines,n),a=e.startLine,o=la(e.columns,n),s=e.startColumn,i=t.length>0?js(t.charCodeAt(0)):0;i",needPositions:!1,onParseError:Js,onParseErrorThrow:!1,parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Gs,createList:function(){return new rr},createSingleNodeList:function(e){return(new rr).appendData(e)},getFirstListNode:function(e){return e&&e.first()},getLastListNode:function(e){return e.last()},parseWithFallback:function(e,t){var n=this.scanner.tokenIndex;try{return e.call(this)}catch(e){if(this.onParseErrorThrow)throw e;var r=t.call(this,n);return this.onParseErrorThrow=!0,this.onParseError(e,r),this.onParseErrorThrow=!1,r}},lookupNonWSType:function(e){do{var t=this.scanner.lookupType(e++);if(t!==ei)return t}while(0!==t);return 0},eat:function(e){if(this.scanner.tokenType!==e){var t=this.scanner.tokenStart,n=Xs[e]+" is expected";switch(e){case ni:this.scanner.tokenType===ri||this.scanner.tokenType===ai?(t=this.scanner.tokenEnd-1,n="Identifier is expected but function found"):n="Identifier is expected";break;case oi:this.scanner.isDelim(35)&&(this.scanner.next(),t++,n="Name is expected");break;case si:this.scanner.tokenType===ii&&(t=this.scanner.tokenEnd,n="Percent sign is expected");break;default:this.scanner.source.charCodeAt(this.scanner.tokenStart)===e&&(t+=1)}this.error(n,t)}this.scanner.next()},consume:function(e){var t=this.scanner.getTokenValue();return this.eat(e),t},consumeFunctionName:function(){var e=this.scanner.source.substring(this.scanner.tokenStart,this.scanner.tokenEnd-1);return this.eat(ri),e},getLocation:function(e,t){return this.needPositions?this.locationMap.getLocationRange(e,t,this.filename):null},getLocationFromList:function(e){if(this.needPositions){var t=this.getFirstListNode(e),n=this.getLastListNode(e);return this.locationMap.getLocationRange(null!==t?t.loc.start.offset-this.locationMap.startOffset:this.scanner.tokenStart,null!==n?n.loc.end.offset-this.locationMap.startOffset:this.scanner.tokenStart,this.filename)}return null},error:function(e,t){var n=void 0!==t&&t",t.needPositions=Boolean(n.positions),t.onParseError="function"==typeof n.onParseError?n.onParseError:Js,t.onParseErrorThrow=!1,t.parseAtrulePrelude=!("parseAtrulePrelude"in n)||Boolean(n.parseAtrulePrelude),t.parseRulePrelude=!("parseRulePrelude"in n)||Boolean(n.parseRulePrelude),t.parseValue=!("parseValue"in n)||Boolean(n.parseValue),t.parseCustomProperty="parseCustomProperty"in n&&Boolean(n.parseCustomProperty),!t.context.hasOwnProperty(a))throw new Error("Unknown context `"+a+"`");return"function"==typeof o&&t.scanner.forEachToken(((n,r,a)=>{if(n===ti){const n=t.getLocation(r,a),s=Qs(e,a-2,a,"*/")?e.slice(r+2,a-2):e.slice(r+2,a);o(s,n)}})),r=t.context[a].call(t,n),t.scanner.eof||t.error(),r}},ui="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),hi=function(e){if(0<=e&&e>>=5)>0&&(t|=32),n+=hi(t)}while(r>0);return n};var pi=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function a(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function o(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function s(e){var n=e,r=a(e);if(r){if(!r.path)return e;n=r.path}for(var s,i=t.isAbsolute(n),l=n.split(/\/+/),c=0,u=l.length-1;u>=0;u--)"."===(s=l[u])?l.splice(u,1):".."===s?c++:c>0&&(""===s?(l.splice(u+1,c),c=0):(l.splice(u,2),c--));return""===(n=l.join("/"))&&(n=i?"/":"."),r?(r.path=n,o(r)):n}function i(e,t){""===e&&(e="."),""===t&&(t=".");var n=a(t),i=a(e);if(i&&(e=i.path||"/"),n&&!n.scheme)return i&&(n.scheme=i.scheme),o(n);if(n||t.match(r))return t;if(i&&!i.host&&!i.path)return i.host=t,o(i);var l="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return i?(i.path=l,o(i)):l}t.urlParse=a,t.urlGenerate=o,t.normalize=s,t.join=i,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var l=!("__proto__"in Object.create(null));function c(e){return e}function u(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function h(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=l?c:function(e){return u(e)?"$"+e:e},t.fromSetString=l?c:function(e){return u(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=h(e.source,t.source);return 0!==r||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)||n||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=e.generatedLine-t.generatedLine)?r:h(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||n||0!==(r=h(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:h(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=h(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:h(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var r=a(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var l=r.path.lastIndexOf("/");l>=0&&(r.path=r.path.substring(0,l+1))}t=i(o(r),t)}return s(t)}}));pi.getArg,pi.urlParse,pi.urlGenerate,pi.normalize,pi.join,pi.isAbsolute,pi.relative,pi.toSetString,pi.fromSetString,pi.compareByOriginalPositions,pi.compareByGeneratedPositionsDeflated,pi.compareByGeneratedPositionsInflated,pi.parseSourceMapInput,pi.computeSourceURL;var mi=Object.prototype.hasOwnProperty,fi="undefined"!=typeof Map;function gi(){this._array=[],this._set=fi?new Map:Object.create(null)}gi.fromArray=function(e,t){for(var n=new gi,r=0,a=e.length;r=0)return t}else{var n=pi.toSetString(e);if(mi.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},gi.prototype.at=function(e){if(e>=0&&er||a==r&&s>=o||pi.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},bi.prototype.toArray=function(){return this._sorted||(this._array.sort(pi.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};var vi=yi.ArraySet,ki={MappingList:bi}.MappingList;function wi(e){e||(e={}),this._file=pi.getArg(e,"file",null),this._sourceRoot=pi.getArg(e,"sourceRoot",null),this._skipValidation=pi.getArg(e,"skipValidation",!1),this._sources=new vi,this._names=new vi,this._mappings=new ki,this._sourcesContents=null}wi.prototype._version=3,wi.fromSourceMap=function(e){var t=e.sourceRoot,n=new wi({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=t&&(r.source=pi.relative(t,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r)})),e.sources.forEach((function(r){var a=r;null!==t&&(a=pi.relative(t,r)),n._sources.has(a)||n._sources.add(a);var o=e.sourceContentFor(r);null!=o&&n.setSourceContent(r,o)})),n},wi.prototype.addMapping=function(e){var t=pi.getArg(e,"generated"),n=pi.getArg(e,"original",null),r=pi.getArg(e,"source",null),a=pi.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,a),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=a&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:a})},wi.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=pi.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[pi.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[pi.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},wi.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}var a=this._sourceRoot;null!=a&&(r=pi.relative(a,r));var o=new vi,s=new vi;this._mappings.unsortedForEach((function(t){if(t.source===r&&null!=t.originalLine){var i=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=i.source&&(t.source=i.source,null!=n&&(t.source=pi.join(n,t.source)),null!=a&&(t.source=pi.relative(a,t.source)),t.originalLine=i.line,t.originalColumn=i.column,null!=i.name&&(t.name=i.name))}var l=t.source;null==l||o.has(l)||o.add(l);var c=t.name;null==c||s.has(c)||s.add(c)}),this),this._sources=o,this._names=s,e.sources.forEach((function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=pi.join(n,t)),null!=a&&(t=pi.relative(a,t)),this.setSourceContent(t,r))}),this)},wi.prototype._validateMapping=function(e,t,n,r){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},wi.prototype._serializeMappings=function(){for(var e,t,n,r,a=0,o=1,s=0,i=0,l=0,c=0,u="",h=this._mappings.toArray(),d=0,p=h.length;d0){if(!pi.compareByGeneratedPositionsInflated(t,h[d-1]))continue;e+=","}e+=di(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(r=this._sources.indexOf(t.source),e+=di(r-c),c=r,e+=di(t.originalLine-1-i),i=t.originalLine-1,e+=di(t.originalColumn-s),s=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=di(n-l),l=n)),u+=e}return u},wi.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=pi.relative(t,e));var n=pi.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)},wi.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},wi.prototype.toString=function(){return JSON.stringify(this.toJSON())};var xi={SourceMapGenerator:wi}.SourceMapGenerator,Si={Atrule:!0,Selector:!0,Declaration:!0},Ei=Object.prototype.hasOwnProperty;function Ai(e,t){var n=e.children,r=null;"function"!=typeof t?n.forEach(this.node,this):n.forEach((function(e){null!==r&&t.call(this,r),this.node(e),r=e}),this)}var Ti=function(e){function t(e){if(!Ei.call(n,e.type))throw new Error("Unknown node type: "+e.type);n[e.type].call(this,e)}var n={};if(e.node)for(var r in e.node)n[r]=e.node[r].generate;return function(e,n){var r="",a={children:Ai,node:t,chunk:function(e){r+=e},result:function(){return r}};return n&&("function"==typeof n.decorator&&(a=n.decorator(a)),n.sourceMap&&(a=function(e){var t=new xi,n=1,r=0,a={line:1,column:0},o={line:0,column:0},s=!1,i={line:1,column:0},l={generated:i},c=e.node;e.node=function(e){if(e.loc&&e.loc.start&&Si.hasOwnProperty(e.type)){var u=e.loc.start.line,h=e.loc.start.column-1;o.line===u&&o.column===h||(o.line=u,o.column=h,a.line=n,a.column=r,s&&(s=!1,a.line===i.line&&a.column===i.column||t.addMapping(l)),s=!0,t.addMapping({source:e.loc.source,original:o,generated:a}))}c.call(this,e),s&&Si.hasOwnProperty(e.type)&&(i.line=n,i.column=r)};var u=e.chunk;e.chunk=function(e){for(var t=0;te||c(t,n,r),h=Ri,d=Ri,p=n,m={break:a,skip:o,root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if("function"==typeof s)h=s;else if(s&&(h=_i(s.enter),d=_i(s.leave),s.reverse&&(p=r),s.visit)){if(i.hasOwnProperty(s.visit))p=s.reverse?l[s.visit]:i[s.visit];else if(!t.hasOwnProperty(s.visit))throw new Error("Bad value `"+s.visit+"` for `visit` option (should be: "+Object.keys(t).join(", ")+")");h=Ii(h,s.visit),d=Ii(d,s.visit)}if(h===Ri&&d===Ri)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");c(e)};return c.break=a,c.skip=o,c.find=function(e,t){var n=null;return c(e,(function(e,r,o){if(t.call(this,e,r,o))return n=e,a})),n},c.findLast=function(e,t){var n=null;return c(e,{reverse:!0,enter:function(e,r,o){if(t.call(this,e,r,o))return n=e,a}}),n},c.findAll=function(e,t){var n=[];return c(e,(function(e,r,a){t.call(this,e,r,a)&&n.push(e)})),n},c},Mi=function e(t){var n={};for(var r in t){var a=t[r];a&&(Array.isArray(a)||a instanceof rr?a=a.map(e):a.constructor===Object&&(a=e(a))),n[r]=a}return n};const Oi=Object.prototype.hasOwnProperty,Di={generic:!0,types:qi,atrules:{prelude:ji,descriptors:ji},properties:qi,parseContext:function(e,t){return Object.assign(e,t)},scope:function e(t,n){for(const r in n)Oi.call(n,r)&&(Ui(t[r])?e(t[r],Fi(n[r])):t[r]=Fi(n[r]));return t},atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]};function Ui(e){return e&&e.constructor===Object}function Fi(e){return Ui(e)?Object.assign({},e):e}function Bi(e,t){return"string"==typeof t&&/^\s*\|/.test(t)?"string"==typeof e?e+t:t.replace(/^\s*\|\s*/,""):t||null}function qi(e,t){if("string"==typeof t)return Bi(e,t);const n=Object.assign({},e);for(let r in t)Oi.call(t,r)&&(n[r]=Bi(Oi.call(e,r)?e[r]:void 0,t[r]));return n}function ji(e,t){const n=qi(e,t);return!Ui(n)||Object.keys(n).length?n:null}function Hi(e,t,n){for(const r in n)if(!1!==Oi.call(n,r))if(!0===n[r])r in t&&Oi.call(t,r)&&(e[r]=Fi(t[r]));else if(n[r])if("function"==typeof n[r]){const a=n[r];e[r]=a({},e[r]),e[r]=a(e[r]||{},t[r])}else if(Ui(n[r])){const a={};for(let t in e[r])a[t]=Hi({},e[r][t],n[r]);for(let e in t[r])a[e]=Hi(a[e]||{},t[r][e],n[r]);e[r]=a}else if(Array.isArray(n[r])){const a={},o=n[r].reduce((function(e,t){return e[t]=!0,e}),{});for(const[t,n]of Object.entries(e[r]||{}))a[t]={},n&&Hi(a[t],n,o);for(const e in t[r])Oi.call(t[r],e)&&(a[e]||(a[e]={}),t[r]&&t[r][e]&&Hi(a[e],t[r][e],o));e[r]=a}return e}var Wi=(e,t)=>Hi(e,t,Di);function Vi(e){var t=ci(e),n=zi(e),r=Ti(e),a=function(e){return{fromPlainObject:function(t){return e(t,{enter:function(e){e.children&&e.children instanceof rr==0&&(e.children=(new rr).fromArray(e.children))}}),t},toPlainObject:function(t){return e(t,{leave:function(e){e.children&&e.children instanceof rr&&(e.children=e.children.toArray())}}),t}}}(n),o={List:rr,SyntaxError:ir,TokenStream:$r,Lexer:Bs,vendorPrefix:sa.vendorPrefix,keyword:sa.keyword,property:sa.property,isCustomProperty:sa.isCustomProperty,definitionSyntax:qs,lexer:null,createLexer:function(e){return new Bs(e,o,o.lexer.structure)},tokenize:Ca,parse:t,walk:n,generate:r,find:n.find,findLast:n.findLast,findAll:n.findAll,clone:Mi,fromPlainObject:a.fromPlainObject,toPlainObject:a.toPlainObject,createSyntax:function(e){return Vi(Wi({},e))},fork:function(t){var n=Wi({},e);return Vi("function"==typeof t?t(n,Object.assign):Wi(n,t))}};return o.lexer=new Bs({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},o),o}var $i=function(e){return Vi(Wi({},e))},Yi={generic:!0,types:{"absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","alpha-value":"|","angle-percentage":"|","angular-color-hint":"","angular-color-stop":"&&?","angular-color-stop-list":"[ [, ]?]# , ","animateable-feature":"scroll-position|contents|",attachment:"scroll|fixed|local","attr()":"attr( ? [, ]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' ']'|'[' [|] ? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [? ]+ ? )","auto-track-list":"[? [|]]* ? [? [|]]* ?","baseline-position":"[first|last]? baseline","basic-shape":"||||","bg-image":"none|","bg-layer":"|| [/ ]?||||||||","bg-position":"[[left|center|right|top|bottom|]|[left|center|right|] [top|center|bottom|]|[center|[left|right] ?]&&[center|[top|bottom] ?]]","bg-size":"[|auto]{1,2}|cover|contain","blur()":"blur( )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( )","calc()":"calc( )","calc-sum":" [['+'|'-'] ]*","calc-product":" ['*' |'/' ]*","calc-value":"|||( )","cf-final-image":"|","cf-mixing-image":"?&&","circle()":"circle( []? [at ]? )","clamp()":"clamp( #{3} )","class-selector":"'.' ","clip-source":"",color:"||||||currentcolor|","color-stop":"|","color-stop-angle":"{1,2}","color-stop-length":"{1,2}","color-stop-list":"[ [, ]?]# , ",combinator:"'>'|'+'|'~'|['||']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[? * [ *]*]!","compound-selector-list":"#","complex-selector":" [? ]*","complex-selector-list":"#","conic-gradient()":"conic-gradient( [from ]? [at ]? , )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[|contents||||||counter( , <'list-style-type'>? )]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"","contrast()":"contrast( [] )","counter()":"counter( , ? )","counter-style":"|symbols( )","counter-style-name":"","counters()":"counters( , , ? )","cross-fade()":"cross-fade( , ? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( , , , )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( {2,3} ? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( , [first|start|last|first-except]? )|element( )","ellipse()":"ellipse( [{2}]? [at ]? )","ending-shape":"circle|ellipse","env()":"env( , ? )","explicit-track-list":"[? ]+ ?","family-name":"|+","feature-tag-value":" [|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":" '{' '}'","feature-value-block-list":"+","feature-value-declaration":" : + ;","feature-value-declaration-list":"","feature-value-name":"","fill-rule":"nonzero|evenodd","filter-function":"|||||||||","filter-function-list":"[|]+","final-bg-layer":"<'background-color'>|||| [/ ]?||||||||","fit-content()":"fit-content( [|] )","fixed-breadth":"","fixed-repeat":"repeat( [] , [? ]+ ? )","fixed-size":"|minmax( , )|minmax( , )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|","frequency-percentage":"|","general-enclosed":"[ )]|( )","generic-family":"serif|sans-serif|cursive|fantasy|monospace|-apple-system","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"|fill-box|stroke-box|view-box",gradient:"|||||<-legacy-gradient>","grayscale()":"grayscale( )","grid-line":"auto||[&&?]|[span&&[||]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( [/ ]? )|hsl( , , , ? )","hsla()":"hsla( [/ ]? )|hsla( , , , ? )",hue:"|","hue-rotate()":"hue-rotate( )",image:"||||||","image()":"image( ? [? , ?]! )","image-set()":"image-set( # )","image-set-option":"[|] ","image-src":"|","image-tags":"ltr|rtl","inflexible-breadth":"||min-content|max-content|auto","inset()":"inset( {1,4} [round <'border-radius'>]? )","invert()":"invert( )","keyframes-name":"|","keyframe-block":"# { }","keyframe-block-list":"+","keyframe-selector":"from|to|","leader()":"leader( )","leader-type":"dotted|solid|space|","length-percentage":"|","line-names":"'[' * ']'","line-name-list":"[|]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"|thin|medium|thick","linear-color-hint":"","linear-color-stop":" ?","linear-gradient()":"linear-gradient( [|to ]? , )","mask-layer":"|| [/ ]?||||||[|no-clip]||||","mask-position":"[|left|center|right] [|top|center|bottom]?","mask-reference":"none||","mask-source":"","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( #{6} )","matrix3d()":"matrix3d( #{16} )","max()":"max( # )","media-and":" [and ]+","media-condition":"|||","media-condition-without-or":"||","media-feature":"( [||] )","media-in-parens":"( )||","media-not":"not ","media-or":" [or ]+","media-query":"|[not|only]? [and ]?","media-query-list":"#","media-type":"","mf-boolean":"","mf-name":"","mf-plain":" : ","mf-range":" ['<'|'>']? '='? | ['<'|'>']? '='? | '<' '='? '<' '='? | '>' '='? '>' '='? ","mf-value":"|||","min()":"min( # )","minmax()":"minmax( [||min-content|max-content|auto] , [|||min-content|max-content|auto] )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|<-non-standard-color>","namespace-prefix":"","ns-prefix":"[|'*']? '|'","number-percentage":"|","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"|even|odd","opacity()":"opacity( [] )","overflow-position":"unsafe|safe","outline-radius":"|","page-body":"? [; ]?| ","page-margin-box":" '{' '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[#]?","page-selector":"+| *","path()":"path( [ ,]? )","paint()":"paint( , ? )","perspective()":"perspective( )","polygon()":"polygon( ? , [ ]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|] [top|center|bottom|]?|[[left|right] ]&&[[top|bottom] ]]","pseudo-class-selector":"':' |':' ')'","pseudo-element-selector":"':' ","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [||]? [at ]? , )","relative-selector":"? ","relative-selector-list":"#","relative-size":"larger|smaller","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-linear-gradient()":"repeating-linear-gradient( [|to ]? , )","repeating-radial-gradient()":"repeating-radial-gradient( [||]? [at ]? , )","rgb()":"rgb( {3} [/ ]? )|rgb( {3} [/ ]? )|rgb( #{3} , ? )|rgb( #{3} , ? )","rgba()":"rgba( {3} [/ ]? )|rgba( {3} [/ ]? )|rgba( #{3} , ? )|rgba( #{3} , ? )","rotate()":"rotate( [|] )","rotate3d()":"rotate3d( , , , [|] )","rotateX()":"rotateX( [|] )","rotateY()":"rotateY( [|] )","rotateZ()":"rotateZ( [|] )","saturate()":"saturate( )","scale()":"scale( , ? )","scale3d()":"scale3d( , , )","scaleX()":"scaleX( )","scaleY()":"scaleY( )","scaleZ()":"scaleZ( )","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"|closest-side|farthest-side","skew()":"skew( [|] , [|]? )","skewX()":"skewX( [|] )","skewY()":"skewY( [|] )","sepia()":"sepia( )",shadow:"inset?&&{2,4}&&?","shadow-t":"[{2,3}&&?]",shape:"rect( , , , )|rect( )","shape-box":"|margin-box","side-or-corner":"[left|right]||[top|bottom]","single-animation":"