@pokedemo/player 1.0.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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e,t=Object.defineProperty,s=(e,s,r)=>((e,s,r)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[s]=r)(e,"symbol"!=typeof s?s+"":s,r),r=Object.defineProperty,i=(e,t,s)=>((e,t,s)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s),n=(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))(n||{});function o(e){return e.nodeType===e.ELEMENT_NODE}class a{constructor(){i(this,"idNodeMap",new Map),i(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const s=t.id;this.idNodeMap.set(s,e),this.nodeMetaMap.set(e,t)}replace(e,t){const s=this.getNode(e);if(s){const e=this.nodeMetaMap.get(s);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function l(){return new a}function c(e,t){let s;try{s=new URL(e,t??window.location.href)}catch(i){return null}const r=s.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}const h=new RegExp(/(max|min)-device-(width|height)/.source,"g"),u={postcssPlugin:"postcss-custom-selectors",prepare:()=>({postcssPlugin:"postcss-custom-selectors",AtRule:function(e){e.params.match(h)&&(e.params=e.params.replace(h,"$1-$2"))}})},p={postcssPlugin:"postcss-hover-classes",prepare:function(){const e=[];return{Rule:function(t){-1===e.indexOf(t)&&(e.push(t),t.selectors.forEach(function(e){e.includes(":hover")&&(t.selector+=",\n"+e.replace(/:hover/g,".\\:hover"))}))}}}};function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function f(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),s}var m={exports:{}},g=String,y=function(){return{isColorSupported:!1,reset:g,bold:g,dim:g,italic:g,underline:g,inverse:g,hidden:g,strikethrough:g,black:g,red:g,green:g,yellow:g,blue:g,magenta:g,cyan:g,white:g,gray:g,bgBlack:g,bgRed:g,bgGreen:g,bgYellow:g,bgBlue:g,bgMagenta:g,bgCyan:g,bgWhite:g}};m.exports=y(),m.exports.createColors=y;var w=m.exports;const v=f(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let b=w,C=v,S=class e extends Error{constructor(t,s,r,i,n,o){super(t),this.name="CssSyntaxError",this.reason=t,n&&(this.file=n),i&&(this.source=i),o&&(this.plugin=o),void 0!==s&&void 0!==r&&("number"==typeof s?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.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=b.isColorSupported),C&&e&&(t=C(t));let s,r,i=t.split(/\r?\n/),n=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),a=String(o).length;if(e){let{bold:e,gray:t,red:i}=b.createColors(!0);s=t=>e(i(t)),r=e=>t(e)}else s=r=e=>e;return i.slice(n,o).map((e,t)=>{let i=n+1+t,o=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=r(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+r(o)+e+"\n "+t+s("^")}return" "+r(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var x=S;S.default=S;var E={};E.isClean=Symbol("isClean"),E.my=Symbol("my");const N={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let A=class{constructor(e){this.builder=e}atrule(e,t){let s="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?s+=e.raws.afterName:r&&(s+=" "),e.nodes)this.block(e,s+r);else{let i=(e.raws.between||"")+(t?";":"");this.builder(s+r+i,e)}}beforeAfter(e,t){let s;s="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 r=e.parent,i=0;for(;r&&"root"!==r.type;)i+=1,r=r.parent;if(s.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)s+=t}return s}block(e,t){let s,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),s=this.raw(e,"after")):s=this.raw(e,"after","emptyBody"),s&&this.builder(s),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let s=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],n=this.raw(i,"before");n&&this.builder(n),this.stringify(i,t!==r||s)}}comment(e){let t=this.raw(e,"left","commentLeft"),s=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+s+"*/",e)}decl(e,t){let s=this.raw(e,"between","colon"),r=e.prop+s+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,s){let r;if(s||(s=t),t&&(r=e.raws[t],void 0!==r))return r;let i=e.parent;if("before"===s){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return N[s];let n=e.root();if(n.rawCache||(n.rawCache={}),void 0!==n.rawCache[s])return n.rawCache[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let i="raw"+((o=s)[0].toUpperCase()+o.slice(1));this[i]?r=this[i](n,e):n.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var o;return void 0===r&&(r=N[s]),n.rawCache[s]=r,r}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 s;return e.walkComments(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}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(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.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(s=>{let r=s.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==s.raws.before){let e=s.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 s=e[t],r=e.raws[t];return r&&r.value===s?r.raw:s}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 I=A;A.default=A;let M=I;function T(e,t){new M(t).stringify(e)}var D=T;T.default=T;let{isClean:R,my:O}=E,k=x,P=I,F=D;function L(e,t){let s=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let i=e[r],n=typeof i;"parent"===r&&"object"===n?t&&(s[r]=t):"source"===r?s[r]=i:Array.isArray(i)?s[r]=i.map(e=>L(e,s)):("object"===n&&null!==i&&(i=L(i)),s[r]=i)}return s}let _=class{constructor(e={}){this.raws={},this[R]=!1,this[O]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let s of e[t])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}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=L(this);for(let s in e)t[s]=e[s];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:s,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:s.column,line:s.line},t)}return new k(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[R]){this[R]=!1;let e=this;for(;e=e.parent;)e[R]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let s=this.source.start;if(e.index)s=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(s=this.positionInside(r,t))}return s}positionInside(e,t){let s=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let n=0;n<e;n++)"\n"===s[n]?(r=1,i+=1):r+=1;return{column:r,line:i}}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},s=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 r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),s=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?s={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?s=this.positionInside(e.endIndex):e.index&&(s=this.positionInside(e.index+1));return(s.line<t.line||s.line===t.line&&s.column<=t.column)&&(s={column:t.column+1,line:t.line}),{end:s,start:t}}raw(e,t){return(new P).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,s=!1;for(let r of e)r===this?s=!0:s?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);s||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},r=null==t;t=t||new Map;let i=0;for(let n in this){if(!Object.prototype.hasOwnProperty.call(this,n))continue;if("parent"===n||"proxyCache"===n)continue;let e=this[n];if(Array.isArray(e))s[n]=e.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof e&&e.toJSON)s[n]=e.toJSON(null,t);else if("source"===n){let r=t.get(e.input);null==r&&(r=i,t.set(e.input,i),i++),s[n]={end:e.end,inputId:r,start:e.start}}else s[n]=e}return r&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=F){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,s){let r={node:this};for(let i in s)r[i]=s[i];return e.warn(t,r)}get proxyOf(){return this}};var B=_;_.default=_;let U=B,V=class extends U{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 j=V;V.default=V;var G={nanoid:(e=21)=>{let t="",s=e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:z,SourceMapGenerator:W}=v,{existsSync:Y,readFileSync:Z}=v,{dirname:X,join:J}=v;let H=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let s=t.map?t.map.prev:void 0,r=this.loadMap(t.from,s);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=X(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new z(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 s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let s=e.lastIndexOf(t.pop()),r=e.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,r)))}loadFile(e){if(this.root=X(e),Y(e))return this.mapFile=e,Z(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 z)return W.fromSourceMap(t).toString();if(t instanceof W)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let s=t(e);if(s){let e=this.loadFile(s);if(!e)throw new Error("Unable to load previous source map: "+s.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=J(X(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 K=H;H.default=H;let{SourceMapConsumer:$,SourceMapGenerator:Q}=v,{fileURLToPath:q,pathToFileURL:ee}=v,{isAbsolute:te,resolve:se}=v,{nanoid:re}=G,ie=v,ne=x,oe=K,ae=Symbol("fromOffsetCache"),le=Boolean($&&Q),ce=Boolean(se&&te),he=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&&(!ce||/^\w+:\/\//.test(t.from)||te(t.from)?this.file=t.from:this.file=se(t.from)),ce&&le){let e=new oe(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 "+re(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,r={}){let i,n,o;if(t&&"object"==typeof t){let e=t,r=s;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,s=r.col}else t=e.line,s=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);n=e.line,o=e.col}else n=r.line,o=r.column}else if(!s){let e=this.fromOffset(t);t=e.line,s=e.col}let a=this.origin(t,s,n,o);return i=a?new ne(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,r.plugin):new ne(e,void 0===n?t:{column:s,line:t},void 0===n?s:{column:o,line:n},this.css,this.file,r.plugin),i.input={column:s,endColumn:o,endLine:n,line:t,source:this.css},this.file&&(ee&&(i.input.url=ee(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,s;if(this[ae])s=this[ae];else{let e=this.css.split("\n");s=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)s[r]=t,t+=e[r].length+1;this[ae]=s}t=s[s.length-1];let r=0;if(e>=t)r=s.length-1;else{let t,i=s.length-2;for(;r<i;)if(t=r+(i-r>>1),e<s[t])i=t-1;else{if(!(e>=s[t+1])){r=t;break}r=t+1}}return{col:e-s[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:se(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,s,r){if(!this.map)return!1;let i,n,o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof s&&(i=o.originalPositionFor({column:r,line:s})),n=te(a.source)?ee(a.source):new URL(a.source,this.map.consumer().sourceRoot||ee(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:n.toString()};if("file:"===n.protocol){if(!q)throw new Error("file: protocol is not available in this PostCSS build");l.file=q(n)}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 ue=he;he.default=he,ie&&ie.registerInput&&ie.registerInput(he);let{SourceMapConsumer:pe,SourceMapGenerator:de}=v,{dirname:fe,relative:me,resolve:ge,sep:ye}=v,{pathToFileURL:we}=v,ve=ue,be=Boolean(pe&&de),Ce=Boolean(fe&&ge&&me&&ye);var Se=class{constructor(e,t,s,r){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=r,this.originalCSS=r,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,s=this.toUrl(this.path(e.file)),r=e.root||fe(e.file);!1===this.mapOpts.sourcesContent?(t=new pe(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,s,this.toUrl(this.path(r)))}}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(),Ce&&be&&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=de.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new de({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 de({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,r=1,i="<no source>",n={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&&(n.generated.line=s,n.generated.column=r-1,a.source&&a.source.start?(n.source=this.sourcePath(a),n.original.line=a.source.start.line,n.original.column=a.source.start.column-1,this.map.addMapping(n)):(n.source=i,n.original.line=1,n.original.column=0,this.map.addMapping(n))),e=o.match(/\n/g),e?(s+=e.length,t=o.lastIndexOf("\n"),r=o.length-t):r+=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?(n.source=this.sourcePath(a),n.original.line=a.source.end.line,n.original.column=a.source.end.column-1,n.generated.line=s,n.generated.column=r-2,this.map.addMapping(n)):(n.source=i,n.original.line=1,n.original.column=0,n.generated.line=s,n.generated.column=r-1,this.map.addMapping(n)))}})}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 s=this.opts.to?fe(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(s=fe(ge(s,this.mapOpts.annotation)));let r=me(s,e);return this.memoizedPaths.set(e,r),r}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 ve(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 s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,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(we){let t=we(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;"\\"===ye&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}};let xe=B,Ee=class extends xe{constructor(e){super(e),this.type="comment"}};var Ne=Ee;Ee.default=Ee;let Ae,Ie,Me,Te,{isClean:De,my:Re}=E,Oe=j,ke=Ne,Pe=B;function Fe(e){return e.map(e=>(e.nodes&&(e.nodes=Fe(e.nodes)),delete e.source,e))}function Le(e){if(e[De]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Le(t)}let _e=class e extends Pe{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,s,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[r]+=1;return delete this.indexes[r],s}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")?(...s)=>e[t](...s.map(e=>"function"==typeof e?(t,s)=>e(t.toProxy(),s):e)):"every"===t||"some"===t?s=>e[t]((e,...t)=>s(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,s)=>(e[t]===s||(e[t]=s,"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 s,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let n of i)this.proxyOf.nodes.splice(r+1,0,n);for(let n in this.indexes)s=this.indexes[n],r<s&&(this.indexes[n]=s+i.length);return this.markDirty(),this}insertBefore(e,t){let s,r=this.index(e),i=0===r&&"prepend",n=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let o of n)this.proxyOf.nodes.splice(r,0,o);for(let o in this.indexes)s=this.indexes[o],r<=s&&(this.indexes[o]=s+n.length);return this.markDirty(),this}normalize(t,s){if("string"==typeof t)t=Fe(Ae(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 Oe(t)]}else if(t.selector)t=[new Ie(t)];else if(t.name)t=[new Me(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new ke(t)]}return t.map(t=>(t[Re]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[De]&&Le(t),void 0===t.raws.before&&s&&void 0!==s.raws.before&&(t.raws.before=s.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 s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,s)=>{let r;try{r=e(t,s)}catch(i){throw t.addToError(i)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("atrule"===s.type&&e.test(s.name))return t(s,r)}):this.walk((s,r)=>{if("atrule"===s.type&&s.name===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("atrule"===e.type)return t(e,s)}))}walkComments(e){return this.walk((t,s)=>{if("comment"===t.type)return e(t,s)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("decl"===s.type&&e.test(s.prop))return t(s,r)}):this.walk((s,r)=>{if("decl"===s.type&&s.prop===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("decl"===e.type)return t(e,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("rule"===s.type&&e.test(s.selector))return t(s,r)}):this.walk((s,r)=>{if("rule"===s.type&&s.selector===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("rule"===e.type)return t(e,s)}))}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]}};_e.registerParse=e=>{Ae=e},_e.registerRule=e=>{Ie=e},_e.registerAtRule=e=>{Me=e},_e.registerRoot=e=>{Te=e};var Be=_e;_e.default=_e,_e.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Me.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ie.prototype):"decl"===e.type?Object.setPrototypeOf(e,Oe.prototype):"comment"===e.type?Object.setPrototypeOf(e,ke.prototype):"root"===e.type&&Object.setPrototypeOf(e,Te.prototype),e[Re]=!0,e.nodes&&e.nodes.forEach(e=>{_e.rebuild(e)})};let Ue,Ve,je=Be,Ge=class extends je{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ue(new Ve,this,e).stringify()}};Ge.registerLazyResult=e=>{Ue=e},Ge.registerProcessor=e=>{Ve=e};var ze=Ge;Ge.default=Ge;let We={};var Ye=function(e){We[e]||(We[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Ze=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 s in t)this[s]=t[s]}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 Xe=Ze;Ze.default=Ze;let Je=Xe,He=class{constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,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 s=new Je(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Ke=He;He.default=He;const $e="'".charCodeAt(0),Qe='"'.charCodeAt(0),qe="\\".charCodeAt(0),et="/".charCodeAt(0),tt="\n".charCodeAt(0),st=" ".charCodeAt(0),rt="\f".charCodeAt(0),it="\t".charCodeAt(0),nt="\r".charCodeAt(0),ot="[".charCodeAt(0),at="]".charCodeAt(0),lt="(".charCodeAt(0),ct=")".charCodeAt(0),ht="{".charCodeAt(0),ut="}".charCodeAt(0),pt=";".charCodeAt(0),dt="*".charCodeAt(0),ft=":".charCodeAt(0),mt="@".charCodeAt(0),gt=/[\t\n\f\r "#'()/;[\\\]{}]/g,yt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,wt=/.[\r\n"'(/\\]/,vt=/[\da-f]/i;let bt=Be,Ct=class extends bt{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 St=Ct;Ct.default=Ct,bt.registerAtRule(Ct);let xt,Et,Nt=Be,At=class extends Nt{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let r=super.normalize(e);if(t)if("prepend"===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let i of r)i.raws.before=t.raws.before;return r}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(e={}){return new xt(new Et,this,e).stringify()}};At.registerLazyResult=e=>{xt=e},At.registerProcessor=e=>{Et=e};var It=At;At.default=At,Nt.registerRoot(At);let Mt={comma:e=>Mt.split(e,[","],!0),space:e=>Mt.split(e,[" ","\n","\t"]),split(e,t,s){let r=[],i="",n=!1,o=0,a=!1,l="",c=!1;for(let h of e)c?c=!1:"\\"===h?c=!0:a?h===l&&(a=!1):'"'===h||"'"===h?(a=!0,l=h):"("===h?o+=1:")"===h?o>0&&(o-=1):0===o&&t.includes(h)&&(n=!0),n?(""!==i&&r.push(i.trim()),i="",n=!1):i+=h;return(s||""!==i)&&r.push(i.trim()),r}};var Tt=Mt;Mt.default=Mt;let Dt=Be,Rt=Tt,Ot=class extends Dt{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Rt.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}};var kt=Ot;Ot.default=Ot,Dt.registerRule(Ot);let Pt=j,Ft=function(e,t={}){let s,r,i,n,o,a,l,c,h,u,p=e.css.valueOf(),d=t.ignoreErrors,f=p.length,m=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(s=p.charCodeAt(m),s){case tt:case st:case it:case nt:case rt:r=m;do{r+=1,s=p.charCodeAt(r)}while(s===st||s===tt||s===it||s===nt||s===rt);u=["space",p.slice(m,r)],m=r-1;break;case ot:case at:case ht:case ut:case ft:case pt:case ct:{let e=String.fromCharCode(s);u=[e,e,m];break}case lt:if(c=g.length?g.pop()[1]:"",h=p.charCodeAt(m+1),"url"===c&&h!==$e&&h!==Qe&&h!==st&&h!==tt&&h!==it&&h!==rt&&h!==nt){r=m;do{if(a=!1,r=p.indexOf(")",r+1),-1===r){if(d||t){r=m;break}w("bracket")}for(l=r;p.charCodeAt(l-1)===qe;)l-=1,a=!a}while(a);u=["brackets",p.slice(m,r+1),m,r],m=r}else r=p.indexOf(")",m+1),n=p.slice(m,r+1),-1===r||wt.test(n)?u=["(","(",m]:(u=["brackets",n,m,r],m=r);break;case $e:case Qe:i=s===$e?"'":'"',r=m;do{if(a=!1,r=p.indexOf(i,r+1),-1===r){if(d||t){r=m+1;break}w("string")}for(l=r;p.charCodeAt(l-1)===qe;)l-=1,a=!a}while(a);u=["string",p.slice(m,r+1),m,r],m=r;break;case mt:gt.lastIndex=m+1,gt.test(p),r=0===gt.lastIndex?p.length-1:gt.lastIndex-2,u=["at-word",p.slice(m,r+1),m,r],m=r;break;case qe:for(r=m,o=!0;p.charCodeAt(r+1)===qe;)r+=1,o=!o;if(s=p.charCodeAt(r+1),o&&s!==et&&s!==st&&s!==tt&&s!==it&&s!==nt&&s!==rt&&(r+=1,vt.test(p.charAt(r)))){for(;vt.test(p.charAt(r+1));)r+=1;p.charCodeAt(r+1)===st&&(r+=1)}u=["word",p.slice(m,r+1),m,r],m=r;break;default:s===et&&p.charCodeAt(m+1)===dt?(r=p.indexOf("*/",m+2)+1,0===r&&(d||t?r=p.length:w("comment")),u=["comment",p.slice(m,r+1),m,r],m=r):(yt.lastIndex=m+1,yt.test(p),r=0===yt.lastIndex?p.length-1:yt.lastIndex-2,u=["word",p.slice(m,r+1),m,r],g.push(u),m=r)}return m++,u},position:function(){return m}}},Lt=Ne,_t=St,Bt=It,Ut=kt;const Vt={empty:!0,space:!0};let jt=Be,Gt=class{constructor(e){this.input=e,this.root=new Bt,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,s,r,i=new _t;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let n=!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){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,s=a[r];s&&"space"===s[0];)s=a[--r];s&&(i.source.end=this.getPosition(s[3]||s[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){n=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),n&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),o&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,r=0;for(let i=t-1;i>=0&&(s=e[i],"space"===s[0]||(r+=1,2!==r));i--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(e){let t,s,r,i=0;for(let[n,o]of e.entries()){if(t=o,s=t[0],"("===s&&(i+=1),")"===s&&(i-=1),0===i&&":"===s){if(r){if("word"===r[0]&&"progid"===r[1])continue;return n}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Lt;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let s=e[1].slice(2,-2);if(/^\s*$/.test(s))t.text="",t.raws.left=s,t.raws.right="";else{let e=s.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Ft(this.input)}decl(e,t){let s=new Pt;this.init(s,e[0][2]);let r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),s.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],r=s[3]||s[2];if(r)return r}}(e)),s.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),s.raws.before+=e.shift()[1];for(s.source.start=this.getPosition(e[0][2]),s.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;s.prop+=e.shift()[1]}for(s.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){s.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),s.raws.between+=r[1]}"_"!==s.prop[0]&&"*"!==s.prop[0]||(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let n,o=[];for(;e.length&&(n=e[0][0],"space"===n||"comment"===n);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(r=e[a],"!important"===r[1].toLowerCase()){s.important=!0;let t=this.stringFrom(e,a);t=this.spacesFromEnd(e)+t," !important"!==t&&(s.raws.important=t);break}if("important"===r[1].toLowerCase()){let t=e.slice(0),r="";for(let e=a;e>0;e--){let s=t[e][0];if(0===r.trim().indexOf("!")&&"space"!==s)break;r=t.pop()[1]+r}0===r.trim().indexOf("!")&&(s.important=!0,s.raws.important=r,e=t)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=o.map(e=>e[1]).join(""),o=[]),this.raw(s,"value",o.concat(e),t),s.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 Ut;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,s=null,r=!1,i=null,n=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(s=l[0],a.push(l),"("===s||"["===s)i||(i=l),n.push("("===s?")":"]");else if(o&&r&&"{"===s)i||(i=l),n.push("}");else if(0===n.length){if(";"===s){if(r)return void this.decl(a,o);break}if("{"===s)return void this.rule(a);if("}"===s){this.tokenizer.back(a.pop()),t=!0;break}":"===s&&(r=!0)}else s===n[n.length-1]&&(n.pop(),0===n.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),n.length>0&&this.unclosedBracket(i),t&&r){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,s,r){let i,n,o,a,l=s.length,c="",h=!0;for(let u=0;u<l;u+=1)i=s[u],n=i[0],"space"!==n||u!==l-1||r?"comment"===n?(a=s[u-1]?s[u-1][0]:"empty",o=s[u+1]?s[u+1][0]:"empty",Vt[a]||Vt[o]||","===c.slice(-1)?h=!1:c+=i[1]):c+=i[1]:h=!1;if(!h){let r=s.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new Ut;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let r=t;r<e.length;r++)s+=e[r][1];return e.splice(t,e.length-t),s}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})}},zt=ue;function Wt(e,t){let s=new zt(e,t),r=new Gt(s);try{r.parse()}catch(i){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===i.name&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?i.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(i.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),i}return r.root}var Yt=Wt;Wt.default=Wt,jt.registerParse(Wt);let{isClean:Zt,my:Xt}=E,Jt=Se,Ht=D,Kt=Be,$t=ze,Qt=Ye,qt=Ke,es=Yt,ts=It;const ss={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},rs={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},is={Once:!0,postcssPlugin:!0,prepare:!0};function ns(e){return"object"==typeof e&&"function"==typeof e.then}function os(e){let t=!1,s=ss[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,0,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,0,s+"Exit"]:[s,s+"Exit"]}function as(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:os(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ls(e){return e[Zt]=!1,e.nodes&&e.nodes.forEach(e=>ls(e)),e}let cs={},hs=class e{constructor(t,s,r){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof s||null===s||"root"!==s.type&&"document"!==s.type)if(s instanceof e||s instanceof qt)i=ls(s.root),s.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let e=es;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{i=e(s,r)}catch(n){this.processed=!0,this.error=n}i&&!i[Xt]&&Kt.rebuild(i)}else i=ls(s);this.result=new qt(t,i,r),this.helpers={...cs,postcss:cs,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 s=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let e=s.postcssPlugin,t=s.postcssVersion,r=this.result.processor.version,i=t.split("."),n=r.split(".");(i[0]!==n[0]||parseInt(i[1])>parseInt(n[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=s.postcssPlugin,e.setMessage()}catch(r){console&&console.error&&console.error(r)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if("object"==typeof t)for(let s in t){if(!rs[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!is[s])if("object"==typeof t[s])for(let r in t[s])e(t,"*"===r?s:s+"-"+r.toLowerCase(),t[s][r]);else"function"==typeof t[s]&&e(t,s,t[s])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let s=0;s<this.plugins.length;s++){let t=this.plugins[s],r=this.runOnRoot(t);if(ns(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Zt];){e[Zt]=!0;let s=[as(e)];for(;s.length>0;){let e=this.visitTick(s);if(ns(e))try{await e}catch(t){let e=s[s.length-1].node;throw this.handleError(t,e)}}}if(this.listeners.OnceExit)for(let[s,r]of this.listeners.OnceExit){this.result.lastPlugin=s;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(t){throw this.handleError(t)}}}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 ns(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(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Ht;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new Jt(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(ns(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Zt];)e[Zt]=!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||Qt("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,i]of e){let e;this.result.lastPlugin=r;try{e=i(t,this.helpers)}catch(s){throw this.handleError(s,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(ns(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:r}=t;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,i]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(s.toProxy(),this.helpers)}catch(n){throw this.handleError(n,s)}}if(0!==t.iterator){let r,i=t.iterator;for(;r=s.nodes[s.indexes[i]];)if(s.indexes[i]+=1,!r[Zt])return r[Zt]=!0,void e.push(as(r));t.iterator=0,delete s.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(s.nodes&&s.nodes.length&&(s[Zt]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Zt]=!0;let t=os(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[Zt]||this.walkSync(e)});else{let t=this.listeners[s];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"}};hs.registerPostcss=e=>{cs=e};var us=hs;hs.default=hs,ts.registerLazyResult(hs),$t.registerLazyResult(hs);let ps=Se,ds=D,fs=Ye,ms=Yt;const gs=Ke;let ys=class{constructor(e,t,s){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=s,this._map=void 0;let i=ds;this.result=new gs(this._processor,r,this._opts),this.result.css=t;let n=this;Object.defineProperty(this.result,"root",{get:()=>n.root});let o=new ps(i,r,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||fs("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=ms;try{e=t(this._css,this._opts)}catch(s){this.error=s}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var ws=ys;ys.default=ys;let vs=ws,bs=us,Cs=ze,Ss=It,xs=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)t.push(s);else if("function"==typeof s)t.push(s);else{if("object"!=typeof s||!s.parse&&!s.stringify)throw new Error(s+" 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 bs(this,e,t):new vs(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Es=xs;xs.default=xs,Ss.registerProcessor(xs),Cs.registerProcessor(xs);let Ns=j,As=K,Is=Ne,Ms=St,Ts=ue,Ds=It,Rs=kt;function Os(e,t){if(Array.isArray(e))return e.map(e=>Os(e));let{inputs:s,...r}=e;if(s){t=[];for(let e of s){let s={...e,__proto__:Ts.prototype};s.map&&(s.map={...s.map,__proto__:As.prototype}),t.push(s)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>Os(e,t))),r.source){let{inputId:e,...s}=r.source;r.source=s,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new Ds(r);if("decl"===r.type)return new Ns(r);if("rule"===r.type)return new Rs(r);if("comment"===r.type)return new Is(r);if("atrule"===r.type)return new Ms(r);throw new Error("Unknown node type: "+e.type)}var ks=Os;Os.default=Os;let Ps=x,Fs=j,Ls=us,_s=Be,Bs=Es,Us=D,Vs=ks,js=ze,Gs=Xe,zs=Ne,Ws=St,Ys=Ke,Zs=ue,Xs=Yt,Js=Tt,Hs=kt,Ks=It,$s=B;function Qs(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Bs(e)}Qs.plugin=function(e,t){let s,r=!1;function i(...s){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...s);return i.postcssPlugin=e,i.postcssVersion=(new Bs).version,i}return Object.defineProperty(i,"postcss",{get:()=>(s||(s=i()),s)}),i.process=function(e,t,s){return Qs([i(s)]).process(e,t)},i},Qs.stringify=Us,Qs.parse=Xs,Qs.fromJSON=Vs,Qs.list=Js,Qs.comment=e=>new zs(e),Qs.atRule=e=>new Ws(e),Qs.decl=e=>new Fs(e),Qs.rule=e=>new Hs(e),Qs.root=e=>new Ks(e),Qs.document=e=>new js(e),Qs.CssSyntaxError=Ps,Qs.Declaration=Fs,Qs.Container=_s,Qs.Processor=Bs,Qs.Document=js,Qs.Comment=zs,Qs.Warning=Gs,Qs.AtRule=Ws,Qs.Result=Ys,Qs.Input=Zs,Qs.Rule=Hs,Qs.Root=Ks,Qs.Node=$s,Ls.registerPostcss(Qs);var qs=Qs;Qs.default=Qs;const er=d(qs);er.stringify,er.fromJSON,er.plugin,er.parse,er.list,er.document,er.comment,er.atRule,er.rule,er.decl,er.root,er.CssSyntaxError,er.Declaration,er.Container,er.Processor,er.Document,er.Comment,er.Warning,er.AtRule,er.Result,er.Input,er.Rule,er.Root,er.Node;const tr={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function sr(e,t){const s=null==t?void 0:t.stylesWithHoverClass.get(e);if(s)return s;let r=e;try{r=er([u,p]).process(e).css}catch(i){console.warn("Failed to adapt css for replay",i)}return null==t||t.stylesWithHoverClass.set(e,r),r}function rr(){return{stylesWithHoverClass:new Map}}function ir(e,t,s,r){const{doc:i,hackCss:o,cache:a}=r;e.childNodes.length?function(e,t,s,r){const i=[];for(const c of e.childNodes)c.type===n.Text&&i.push(c);const o=t.split("/* rr_split */");for(;o.length>1&&o.length>i.length;)o.splice(-2,2,o.slice(-2).join(""));let a="";s&&(a=sr(o.join(""),r));let l=0;for(let n=0;n<i.length&&n!==o.length;n++){const e=i[n];if(s)if(n<o.length-1){let t=l,s=o[n+1].length;s=Math.min(s,30);let r=!1;for(;s>2;s--){const e=o[n+1].substring(0,s),i=a.substring(l).indexOf(e);if(r=-1!==i,r){t+=i;break}}r||(t+=o[n].length),e.textContent=a.substring(l,t),l=t}else e.textContent=a.substring(l);else e.textContent=o[n]}}(e,s,o,a):(o&&(s=sr(s,a)),t.appendChild(i.createTextNode(s)))}function nr(e,t){var s;const{doc:r,hackCss:i,cache:o}=t;switch(e.type){case n.Document:return r.implementation.createDocument(null,"",null);case n.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case n.Element:{const i=function(e){let t=tr[e.tagName]?tr[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);let n;e.isSVG?n=r.createElementNS("http://www.w3.org/2000/svg",i):(e.isCustom&&(null==(s=r.defaultView)?void 0:s.customElements)&&!r.defaultView.customElements.get(e.tagName)&&r.defaultView.customElements.define(e.tagName,class extends r.defaultView.HTMLElement{}),n=r.createElement(i));const o={};for(const s in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,s))continue;let l=e.attributes[s];if(("option"!==i||"selected"!==s||!1!==l)&&null!==l)if(!0===l&&(l=""),s.startsWith("rr_"))o[s]=l;else{if("string"!=typeof l);else{if("style"===i&&"_cssText"===s){ir(e,n,l,t);continue}if("textarea"===i&&"value"===s){n.appendChild(r.createTextNode(l)),e.childNodes=[];continue}}try{if(e.isSVG&&"xlink:href"===s)n.setAttributeNS("http://www.w3.org/1999/xlink",s,l.toString());else if("onload"===s||"onclick"===s||"onmouse"===s.substring(0,7))n.setAttribute("_"+s,l.toString());else{if("meta"===i&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===s){n.setAttribute("csp-content",l.toString());continue}"link"===i&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===i&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===c(e.attributes.href)||("img"===i&&e.attributes.srcset&&e.attributes.rr_dataURL?n.setAttribute("rrweb-original-srcset",e.attributes.srcset):n.setAttribute(s,l.toString()))}}catch(a){}}}for(const t in o){const s=o[t];if("canvas"===i&&"rr_dataURL"===t){const e=r.createElement("img");e.onload=()=>{const t=n.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=s.toString(),n.RRNodeType&&(n.rr_dataURL=s.toString())}else if("img"===i&&"rr_dataURL"===t){const t=n;t.currentSrc.startsWith("data:")||(t.setAttribute("rrweb-original-src",e.attributes.src),t.src=s.toString())}if("rr_width"===t)n.style.setProperty("width",s.toString());else if("rr_height"===t)n.style.setProperty("height",s.toString());else if("rr_mediaCurrentTime"===t&&"number"==typeof s)n.currentTime=s;else if("rr_mediaState"===t)switch(s){case"played":n.play().catch(e=>console.warn("media playback error",e));break;case"paused":n.pause()}else"rr_mediaPlaybackRate"===t&&"number"==typeof s?n.playbackRate=s:"rr_mediaMuted"===t&&"boolean"==typeof s?n.muted=s:"rr_mediaLoop"===t&&"boolean"==typeof s?n.loop=s:"rr_mediaVolume"===t&&"number"==typeof s?n.volume=s:"rr_open_mode"===t&&n.setAttribute("rr_open_mode",s)}if(e.isShadowHost)if(n.shadowRoot)for(;n.shadowRoot.firstChild;)n.shadowRoot.removeChild(n.shadowRoot.firstChild);else n.attachShadow({mode:"open"});return n}case n.Text:return e.isStyle&&i?r.createTextNode(sr(e.textContent,o)):r.createTextNode(e.textContent);case n.CDATA:return r.createCDATASection(e.textContent);case n.Comment:return r.createComment(e.textContent);default:return null}}function or(e,t){const{doc:s,mirror:r,skipChild:i=!1,hackCss:a=!0,afterAppend:l,cache:c}=t;if(r.has(e.id)){const t=r.getNode(e.id),s=r.getMeta(t);if(u=e,(h=s)&&u&&h.type===u.type&&(h.type===n.Document?h.compatMode===u.compatMode:h.type===n.DocumentType?h.name===u.name&&h.publicId===u.publicId&&h.systemId===u.systemId:h.type===n.Comment||h.type===n.Text||h.type===n.CDATA?h.textContent===u.textContent:h.type===n.Element&&h.tagName===u.tagName&&JSON.stringify(h.attributes)===JSON.stringify(u.attributes)&&h.isSVG===u.isSVG&&h.needBlock===u.needBlock))return r.getNode(e.id)}var h,u;let p=nr(e,{doc:s,hackCss:a,cache:c});if(!p)return null;if(e.rootId&&r.getNode(e.rootId)!==s&&r.replace(e.rootId,s),e.type===n.Document&&(s.close(),s.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==n.DocumentType&&(e.childNodes[0].type===n.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),p=s),r.add(p,e),(e.type===n.Document||e.type===n.Element)&&!i)for(const d of e.childNodes){const t=or(d,{doc:s,mirror:r,skipChild:!1,hackCss:a,afterAppend:l,cache:c});if(t){if(d.isShadow&&o(p)&&p.shadowRoot)p.shadowRoot.appendChild(t);else if(e.type===n.Document&&d.type==n.Element){const e=t;let s=null;e.childNodes.forEach(e=>{"BODY"===e.nodeName&&(s=e)}),s?(e.removeChild(s),p.appendChild(t),e.appendChild(s)):p.appendChild(t)}else p.appendChild(t);l&&l(t,d.id)}else console.warn("Failed to rebuild",d)}return p}function ar(e,t){const{doc:s,onVisit:r,hackCss:i=!0,afterAppend:o,cache:l,mirror:c=new a}=t,h=or(e,{doc:s,mirror:c,skipChild:!1,hackCss:i,afterAppend:o,cache:l});return function(e,t){function s(e){t(e)}for(const r of e.getIds())e.has(r)&&s(e.getNode(r))}(c,e=>{r&&r(e),function(e,t){const s=t.getMeta(e);if((null==s?void 0:s.type)!==n.Element)return;const r=e;for(const i in s.attributes){if(!Object.prototype.hasOwnProperty.call(s.attributes,i)||!i.startsWith("rr_"))continue;const e=s.attributes[i];"rr_scrollLeft"===i&&(r.scrollLeft=e),"rr_scrollTop"===i&&(r.scrollTop=e)}}(e,c)}),h}var lr=Object.defineProperty,cr=(e,t,s)=>((e,t,s)=>t in e?lr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s),hr=Object.defineProperty,ur=(e,t,s)=>((e,t,s)=>t in e?hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);let pr=class{constructor(){ur(this,"idNodeMap",new Map),ur(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const s=t.id;this.idNodeMap.set(s,e),this.nodeMetaMap.set(e,t)}replace(e,t){const s=this.getNode(e);if(s){const e=this.nodeMetaMap.get(s);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function dr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function fr(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),s}var mr={exports:{}},gr=String,yr=function(){return{isColorSupported:!1,reset:gr,bold:gr,dim:gr,italic:gr,underline:gr,inverse:gr,hidden:gr,strikethrough:gr,black:gr,red:gr,green:gr,yellow:gr,blue:gr,magenta:gr,cyan:gr,white:gr,gray:gr,bgBlack:gr,bgRed:gr,bgGreen:gr,bgYellow:gr,bgBlue:gr,bgMagenta:gr,bgCyan:gr,bgWhite:gr}};mr.exports=yr(),mr.exports.createColors=yr;var wr=mr.exports;const vr=fr(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let br=wr,Cr=vr,Sr=class e extends Error{constructor(t,s,r,i,n,o){super(t),this.name="CssSyntaxError",this.reason=t,n&&(this.file=n),i&&(this.source=i),o&&(this.plugin=o),void 0!==s&&void 0!==r&&("number"==typeof s?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.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=br.isColorSupported),Cr&&e&&(t=Cr(t));let s,r,i=t.split(/\r?\n/),n=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),a=String(o).length;if(e){let{bold:e,gray:t,red:i}=br.createColors(!0);s=t=>e(i(t)),r=e=>t(e)}else s=r=e=>e;return i.slice(n,o).map((e,t)=>{let i=n+1+t,o=" "+(" "+i).slice(-a)+" | ";if(i===this.line){let t=r(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+r(o)+e+"\n "+t+s("^")}return" "+r(o)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var xr=Sr;Sr.default=Sr;var Er={};Er.isClean=Symbol("isClean"),Er.my=Symbol("my");const Nr={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Ar=class{constructor(e){this.builder=e}atrule(e,t){let s="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?s+=e.raws.afterName:r&&(s+=" "),e.nodes)this.block(e,s+r);else{let i=(e.raws.between||"")+(t?";":"");this.builder(s+r+i,e)}}beforeAfter(e,t){let s;s="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 r=e.parent,i=0;for(;r&&"root"!==r.type;)i+=1,r=r.parent;if(s.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)s+=t}return s}block(e,t){let s,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),s=this.raw(e,"after")):s=this.raw(e,"after","emptyBody"),s&&this.builder(s),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let s=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],n=this.raw(i,"before");n&&this.builder(n),this.stringify(i,t!==r||s)}}comment(e){let t=this.raw(e,"left","commentLeft"),s=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+s+"*/",e)}decl(e,t){let s=this.raw(e,"between","colon"),r=e.prop+s+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,s){let r;if(s||(s=t),t&&(r=e.raws[t],void 0!==r))return r;let i=e.parent;if("before"===s){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return Nr[s];let n=e.root();if(n.rawCache||(n.rawCache={}),void 0!==n.rawCache[s])return n.rawCache[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let i="raw"+((o=s)[0].toUpperCase()+o.slice(1));this[i]?r=this[i](n,e):n.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var o;return void 0===r&&(r=Nr[s]),n.rawCache[s]=r,r}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 s;return e.walkComments(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}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(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.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(s=>{let r=s.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==s.raws.before){let e=s.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 s=e[t],r=e.raws[t];return r&&r.value===s?r.raw:s}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 Ir=Ar;Ar.default=Ar;let Mr=Ir;function Tr(e,t){new Mr(t).stringify(e)}var Dr=Tr;Tr.default=Tr;let{isClean:Rr,my:Or}=Er,kr=xr,Pr=Ir,Fr=Dr;function Lr(e,t){let s=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let i=e[r],n=typeof i;"parent"===r&&"object"===n?t&&(s[r]=t):"source"===r?s[r]=i:Array.isArray(i)?s[r]=i.map(e=>Lr(e,s)):("object"===n&&null!==i&&(i=Lr(i)),s[r]=i)}return s}let _r=class{constructor(e={}){this.raws={},this[Rr]=!1,this[Or]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let s of e[t])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}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=Lr(this);for(let s in e)t[s]=e[s];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:s,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:s.column,line:s.line},t)}return new kr(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[Rr]){this[Rr]=!1;let e=this;for(;e=e.parent;)e[Rr]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let s=this.source.start;if(e.index)s=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(s=this.positionInside(r,t))}return s}positionInside(e,t){let s=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let n=0;n<e;n++)"\n"===s[n]?(r=1,i+=1):r+=1;return{column:r,line:i}}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},s=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 r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),s=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?s={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?s=this.positionInside(e.endIndex):e.index&&(s=this.positionInside(e.index+1));return(s.line<t.line||s.line===t.line&&s.column<=t.column)&&(s={column:t.column+1,line:t.line}),{end:s,start:t}}raw(e,t){return(new Pr).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,s=!1;for(let r of e)r===this?s=!0:s?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);s||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},r=null==t;t=t||new Map;let i=0;for(let n in this){if(!Object.prototype.hasOwnProperty.call(this,n))continue;if("parent"===n||"proxyCache"===n)continue;let e=this[n];if(Array.isArray(e))s[n]=e.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof e&&e.toJSON)s[n]=e.toJSON(null,t);else if("source"===n){let r=t.get(e.input);null==r&&(r=i,t.set(e.input,i),i++),s[n]={end:e.end,inputId:r,start:e.start}}else s[n]=e}return r&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Fr){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,s){let r={node:this};for(let i in s)r[i]=s[i];return e.warn(t,r)}get proxyOf(){return this}};var Br=_r;_r.default=_r;let Ur=Br,Vr=class extends Ur{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 jr=Vr;Vr.default=Vr;var Gr={nanoid:(e=21)=>{let t="",s=e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:zr,SourceMapGenerator:Wr}=vr,{existsSync:Yr,readFileSync:Zr}=vr,{dirname:Xr,join:Jr}=vr;let Hr=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let s=t.map?t.map.prev:void 0,r=this.loadMap(t.from,s);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Xr(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new zr(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 s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let s=e.lastIndexOf(t.pop()),r=e.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,r)))}loadFile(e){if(this.root=Xr(e),Yr(e))return this.mapFile=e,Zr(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 zr)return Wr.fromSourceMap(t).toString();if(t instanceof Wr)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let s=t(e);if(s){let e=this.loadFile(s);if(!e)throw new Error("Unable to load previous source map: "+s.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Jr(Xr(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 Kr=Hr;Hr.default=Hr;let{SourceMapConsumer:$r,SourceMapGenerator:Qr}=vr,{fileURLToPath:qr,pathToFileURL:ei}=vr,{isAbsolute:ti,resolve:si}=vr,{nanoid:ri}=Gr,ii=vr,ni=xr,oi=Kr,ai=Symbol("fromOffsetCache"),li=Boolean($r&&Qr),ci=Boolean(si&&ti),hi=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&&(!ci||/^\w+:\/\//.test(t.from)||ti(t.from)?this.file=t.from:this.file=si(t.from)),ci&&li){let e=new oi(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 "+ri(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,r={}){let i,n,o;if(t&&"object"==typeof t){let e=t,r=s;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,s=r.col}else t=e.line,s=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);n=e.line,o=e.col}else n=r.line,o=r.column}else if(!s){let e=this.fromOffset(t);t=e.line,s=e.col}let a=this.origin(t,s,n,o);return i=a?new ni(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,r.plugin):new ni(e,void 0===n?t:{column:s,line:t},void 0===n?s:{column:o,line:n},this.css,this.file,r.plugin),i.input={column:s,endColumn:o,endLine:n,line:t,source:this.css},this.file&&(ei&&(i.input.url=ei(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,s;if(this[ai])s=this[ai];else{let e=this.css.split("\n");s=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)s[r]=t,t+=e[r].length+1;this[ai]=s}t=s[s.length-1];let r=0;if(e>=t)r=s.length-1;else{let t,i=s.length-2;for(;r<i;)if(t=r+(i-r>>1),e<s[t])i=t-1;else{if(!(e>=s[t+1])){r=t;break}r=t+1}}return{col:e-s[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:si(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,s,r){if(!this.map)return!1;let i,n,o=this.map.consumer(),a=o.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof s&&(i=o.originalPositionFor({column:r,line:s})),n=ti(a.source)?ei(a.source):new URL(a.source,this.map.consumer().sourceRoot||ei(this.map.mapFile));let l={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:n.toString()};if("file:"===n.protocol){if(!qr)throw new Error("file: protocol is not available in this PostCSS build");l.file=qr(n)}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 ui=hi;hi.default=hi,ii&&ii.registerInput&&ii.registerInput(hi);let{SourceMapConsumer:pi,SourceMapGenerator:di}=vr,{dirname:fi,relative:mi,resolve:gi,sep:yi}=vr,{pathToFileURL:wi}=vr,vi=ui,bi=Boolean(pi&&di),Ci=Boolean(fi&&gi&&mi&&yi);var Si=class{constructor(e,t,s,r){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=r,this.originalCSS=r,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,s=this.toUrl(this.path(e.file)),r=e.root||fi(e.file);!1===this.mapOpts.sourcesContent?(t=new pi(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,s,this.toUrl(this.path(r)))}}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(),Ci&&bi&&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=di.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new di({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 di({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,r=1,i="<no source>",n={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&&(n.generated.line=s,n.generated.column=r-1,a.source&&a.source.start?(n.source=this.sourcePath(a),n.original.line=a.source.start.line,n.original.column=a.source.start.column-1,this.map.addMapping(n)):(n.source=i,n.original.line=1,n.original.column=0,this.map.addMapping(n))),e=o.match(/\n/g),e?(s+=e.length,t=o.lastIndexOf("\n"),r=o.length-t):r+=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?(n.source=this.sourcePath(a),n.original.line=a.source.end.line,n.original.column=a.source.end.column-1,n.generated.line=s,n.generated.column=r-2,this.map.addMapping(n)):(n.source=i,n.original.line=1,n.original.column=0,n.generated.line=s,n.generated.column=r-1,this.map.addMapping(n)))}})}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 s=this.opts.to?fi(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(s=fi(gi(s,this.mapOpts.annotation)));let r=mi(s,e);return this.memoizedPaths.set(e,r),r}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 vi(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 s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,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(wi){let t=wi(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;"\\"===yi&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}};let xi=Br,Ei=class extends xi{constructor(e){super(e),this.type="comment"}};var Ni=Ei;Ei.default=Ei;let Ai,Ii,Mi,Ti,{isClean:Di,my:Ri}=Er,Oi=jr,ki=Ni,Pi=Br;function Fi(e){return e.map(e=>(e.nodes&&(e.nodes=Fi(e.nodes)),delete e.source,e))}function Li(e){if(e[Di]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Li(t)}let _i=class e extends Pi{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,s,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[r]+=1;return delete this.indexes[r],s}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")?(...s)=>e[t](...s.map(e=>"function"==typeof e?(t,s)=>e(t.toProxy(),s):e)):"every"===t||"some"===t?s=>e[t]((e,...t)=>s(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,s)=>(e[t]===s||(e[t]=s,"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 s,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let n of i)this.proxyOf.nodes.splice(r+1,0,n);for(let n in this.indexes)s=this.indexes[n],r<s&&(this.indexes[n]=s+i.length);return this.markDirty(),this}insertBefore(e,t){let s,r=this.index(e),i=0===r&&"prepend",n=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let o of n)this.proxyOf.nodes.splice(r,0,o);for(let o in this.indexes)s=this.indexes[o],r<=s&&(this.indexes[o]=s+n.length);return this.markDirty(),this}normalize(t,s){if("string"==typeof t)t=Fi(Ai(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 Oi(t)]}else if(t.selector)t=[new Ii(t)];else if(t.name)t=[new Mi(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new ki(t)]}return t.map(t=>(t[Ri]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Di]&&Li(t),void 0===t.raws.before&&s&&void 0!==s.raws.before&&(t.raws.before=s.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 s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,s)=>{let r;try{r=e(t,s)}catch(i){throw t.addToError(i)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("atrule"===s.type&&e.test(s.name))return t(s,r)}):this.walk((s,r)=>{if("atrule"===s.type&&s.name===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("atrule"===e.type)return t(e,s)}))}walkComments(e){return this.walk((t,s)=>{if("comment"===t.type)return e(t,s)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("decl"===s.type&&e.test(s.prop))return t(s,r)}):this.walk((s,r)=>{if("decl"===s.type&&s.prop===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("decl"===e.type)return t(e,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("rule"===s.type&&e.test(s.selector))return t(s,r)}):this.walk((s,r)=>{if("rule"===s.type&&s.selector===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("rule"===e.type)return t(e,s)}))}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]}};_i.registerParse=e=>{Ai=e},_i.registerRule=e=>{Ii=e},_i.registerAtRule=e=>{Mi=e},_i.registerRoot=e=>{Ti=e};var Bi=_i;_i.default=_i,_i.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Mi.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ii.prototype):"decl"===e.type?Object.setPrototypeOf(e,Oi.prototype):"comment"===e.type?Object.setPrototypeOf(e,ki.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ti.prototype),e[Ri]=!0,e.nodes&&e.nodes.forEach(e=>{_i.rebuild(e)})};let Ui,Vi,ji=Bi,Gi=class extends ji{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ui(new Vi,this,e).stringify()}};Gi.registerLazyResult=e=>{Ui=e},Gi.registerProcessor=e=>{Vi=e};var zi=Gi;Gi.default=Gi;let Wi={};var Yi=function(e){Wi[e]||(Wi[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Zi=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 s in t)this[s]=t[s]}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 Xi=Zi;Zi.default=Zi;let Ji=Xi,Hi=class{constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,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 s=new Ji(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Ki=Hi;Hi.default=Hi;const $i="'".charCodeAt(0),Qi='"'.charCodeAt(0),qi="\\".charCodeAt(0),en="/".charCodeAt(0),tn="\n".charCodeAt(0),sn=" ".charCodeAt(0),rn="\f".charCodeAt(0),nn="\t".charCodeAt(0),on="\r".charCodeAt(0),an="[".charCodeAt(0),ln="]".charCodeAt(0),cn="(".charCodeAt(0),hn=")".charCodeAt(0),un="{".charCodeAt(0),pn="}".charCodeAt(0),dn=";".charCodeAt(0),fn="*".charCodeAt(0),mn=":".charCodeAt(0),gn="@".charCodeAt(0),yn=/[\t\n\f\r "#'()/;[\\\]{}]/g,wn=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,vn=/.[\r\n"'(/\\]/,bn=/[\da-f]/i;let Cn=Bi,Sn=class extends Cn{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 xn=Sn;Sn.default=Sn,Cn.registerAtRule(Sn);let En,Nn,An=Bi,In=class extends An{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let r=super.normalize(e);if(t)if("prepend"===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let i of r)i.raws.before=t.raws.before;return r}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(e={}){return new En(new Nn,this,e).stringify()}};In.registerLazyResult=e=>{En=e},In.registerProcessor=e=>{Nn=e};var Mn=In;In.default=In,An.registerRoot(In);let Tn={comma:e=>Tn.split(e,[","],!0),space:e=>Tn.split(e,[" ","\n","\t"]),split(e,t,s){let r=[],i="",n=!1,o=0,a=!1,l="",c=!1;for(let h of e)c?c=!1:"\\"===h?c=!0:a?h===l&&(a=!1):'"'===h||"'"===h?(a=!0,l=h):"("===h?o+=1:")"===h?o>0&&(o-=1):0===o&&t.includes(h)&&(n=!0),n?(""!==i&&r.push(i.trim()),i="",n=!1):i+=h;return(s||""!==i)&&r.push(i.trim()),r}};var Dn=Tn;Tn.default=Tn;let Rn=Bi,On=Dn,kn=class extends Rn{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return On.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}};var Pn=kn;kn.default=kn,Rn.registerRule(kn);let Fn=jr,Ln=function(e,t={}){let s,r,i,n,o,a,l,c,h,u,p=e.css.valueOf(),d=t.ignoreErrors,f=p.length,m=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(s=p.charCodeAt(m),s){case tn:case sn:case nn:case on:case rn:r=m;do{r+=1,s=p.charCodeAt(r)}while(s===sn||s===tn||s===nn||s===on||s===rn);u=["space",p.slice(m,r)],m=r-1;break;case an:case ln:case un:case pn:case mn:case dn:case hn:{let e=String.fromCharCode(s);u=[e,e,m];break}case cn:if(c=g.length?g.pop()[1]:"",h=p.charCodeAt(m+1),"url"===c&&h!==$i&&h!==Qi&&h!==sn&&h!==tn&&h!==nn&&h!==rn&&h!==on){r=m;do{if(a=!1,r=p.indexOf(")",r+1),-1===r){if(d||t){r=m;break}w("bracket")}for(l=r;p.charCodeAt(l-1)===qi;)l-=1,a=!a}while(a);u=["brackets",p.slice(m,r+1),m,r],m=r}else r=p.indexOf(")",m+1),n=p.slice(m,r+1),-1===r||vn.test(n)?u=["(","(",m]:(u=["brackets",n,m,r],m=r);break;case $i:case Qi:i=s===$i?"'":'"',r=m;do{if(a=!1,r=p.indexOf(i,r+1),-1===r){if(d||t){r=m+1;break}w("string")}for(l=r;p.charCodeAt(l-1)===qi;)l-=1,a=!a}while(a);u=["string",p.slice(m,r+1),m,r],m=r;break;case gn:yn.lastIndex=m+1,yn.test(p),r=0===yn.lastIndex?p.length-1:yn.lastIndex-2,u=["at-word",p.slice(m,r+1),m,r],m=r;break;case qi:for(r=m,o=!0;p.charCodeAt(r+1)===qi;)r+=1,o=!o;if(s=p.charCodeAt(r+1),o&&s!==en&&s!==sn&&s!==tn&&s!==nn&&s!==on&&s!==rn&&(r+=1,bn.test(p.charAt(r)))){for(;bn.test(p.charAt(r+1));)r+=1;p.charCodeAt(r+1)===sn&&(r+=1)}u=["word",p.slice(m,r+1),m,r],m=r;break;default:s===en&&p.charCodeAt(m+1)===fn?(r=p.indexOf("*/",m+2)+1,0===r&&(d||t?r=p.length:w("comment")),u=["comment",p.slice(m,r+1),m,r],m=r):(wn.lastIndex=m+1,wn.test(p),r=0===wn.lastIndex?p.length-1:wn.lastIndex-2,u=["word",p.slice(m,r+1),m,r],g.push(u),m=r)}return m++,u},position:function(){return m}}},_n=Ni,Bn=xn,Un=Mn,Vn=Pn;const jn={empty:!0,space:!0};let Gn=Bi,zn=class{constructor(e){this.input=e,this.root=new Un,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,s,r,i=new Bn;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let n=!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){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,s=a[r];s&&"space"===s[0];)s=a[--r];s&&(i.source.end=this.getPosition(s[3]||s[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){n=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),n&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),o&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,r=0;for(let i=t-1;i>=0&&(s=e[i],"space"===s[0]||(r+=1,2!==r));i--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(e){let t,s,r,i=0;for(let[n,o]of e.entries()){if(t=o,s=t[0],"("===s&&(i+=1),")"===s&&(i-=1),0===i&&":"===s){if(r){if("word"===r[0]&&"progid"===r[1])continue;return n}this.doubleColon(t)}r=t}return!1}comment(e){let t=new _n;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let s=e[1].slice(2,-2);if(/^\s*$/.test(s))t.text="",t.raws.left=s,t.raws.right="";else{let e=s.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Ln(this.input)}decl(e,t){let s=new Fn;this.init(s,e[0][2]);let r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),s.source.end=this.getPosition(i[3]||i[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],r=s[3]||s[2];if(r)return r}}(e)),s.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),s.raws.before+=e.shift()[1];for(s.source.start=this.getPosition(e[0][2]),s.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;s.prop+=e.shift()[1]}for(s.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){s.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),s.raws.between+=r[1]}"_"!==s.prop[0]&&"*"!==s.prop[0]||(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let n,o=[];for(;e.length&&(n=e[0][0],"space"===n||"comment"===n);)o.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(r=e[a],"!important"===r[1].toLowerCase()){s.important=!0;let t=this.stringFrom(e,a);t=this.spacesFromEnd(e)+t," !important"!==t&&(s.raws.important=t);break}if("important"===r[1].toLowerCase()){let t=e.slice(0),r="";for(let e=a;e>0;e--){let s=t[e][0];if(0===r.trim().indexOf("!")&&"space"!==s)break;r=t.pop()[1]+r}0===r.trim().indexOf("!")&&(s.important=!0,s.raws.important=r,e=t)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=o.map(e=>e[1]).join(""),o=[]),this.raw(s,"value",o.concat(e),t),s.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 Vn;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,s=null,r=!1,i=null,n=[],o=e[1].startsWith("--"),a=[],l=e;for(;l;){if(s=l[0],a.push(l),"("===s||"["===s)i||(i=l),n.push("("===s?")":"]");else if(o&&r&&"{"===s)i||(i=l),n.push("}");else if(0===n.length){if(";"===s){if(r)return void this.decl(a,o);break}if("{"===s)return void this.rule(a);if("}"===s){this.tokenizer.back(a.pop()),t=!0;break}":"===s&&(r=!0)}else s===n[n.length-1]&&(n.pop(),0===n.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),n.length>0&&this.unclosedBracket(i),t&&r){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,s,r){let i,n,o,a,l=s.length,c="",h=!0;for(let u=0;u<l;u+=1)i=s[u],n=i[0],"space"!==n||u!==l-1||r?"comment"===n?(a=s[u-1]?s[u-1][0]:"empty",o=s[u+1]?s[u+1][0]:"empty",jn[a]||jn[o]||","===c.slice(-1)?h=!1:c+=i[1]):c+=i[1]:h=!1;if(!h){let r=s.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new Vn;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let r=t;r<e.length;r++)s+=e[r][1];return e.splice(t,e.length-t),s}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})}},Wn=ui;function Yn(e,t){let s=new Wn(e,t),r=new zn(s);try{r.parse()}catch(i){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===i.name&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?i.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(i.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),i}return r.root}var Zn=Yn;Yn.default=Yn,Gn.registerParse(Yn);let{isClean:Xn,my:Jn}=Er,Hn=Si,Kn=Dr,$n=Bi,Qn=zi,qn=Yi,eo=Ki,to=Zn,so=Mn;const ro={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},io={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},no={Once:!0,postcssPlugin:!0,prepare:!0};function oo(e){return"object"==typeof e&&"function"==typeof e.then}function ao(e){let t=!1,s=ro[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,0,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,0,s+"Exit"]:[s,s+"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[Xn]=!1,e.nodes&&e.nodes.forEach(e=>co(e)),e}let ho={},uo=class e{constructor(t,s,r){let i;if(this.stringified=!1,this.processed=!1,"object"!=typeof s||null===s||"root"!==s.type&&"document"!==s.type)if(s instanceof e||s instanceof eo)i=co(s.root),s.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let e=to;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{i=e(s,r)}catch(n){this.processed=!0,this.error=n}i&&!i[Jn]&&$n.rebuild(i)}else i=co(s);this.result=new eo(t,i,r),this.helpers={...ho,postcss:ho,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 s=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let e=s.postcssPlugin,t=s.postcssVersion,r=this.result.processor.version,i=t.split("."),n=r.split(".");(i[0]!==n[0]||parseInt(i[1])>parseInt(n[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=s.postcssPlugin,e.setMessage()}catch(r){console&&console.error&&console.error(r)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if("object"==typeof t)for(let s in t){if(!io[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!no[s])if("object"==typeof t[s])for(let r in t[s])e(t,"*"===r?s:s+"-"+r.toLowerCase(),t[s][r]);else"function"==typeof t[s]&&e(t,s,t[s])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let s=0;s<this.plugins.length;s++){let t=this.plugins[s],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[Xn];){e[Xn]=!0;let s=[lo(e)];for(;s.length>0;){let e=this.visitTick(s);if(oo(e))try{await e}catch(t){let e=s[s.length-1].node;throw this.handleError(t,e)}}}if(this.listeners.OnceExit)for(let[s,r]of this.listeners.OnceExit){this.result.lastPlugin=s;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(t){throw this.handleError(t)}}}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(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Kn;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new Hn(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(oo(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Xn];)e[Xn]=!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||qn("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,i]of e){let e;this.result.lastPlugin=r;try{e=i(t,this.helpers)}catch(s){throw this.handleError(s,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(oo(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:r}=t;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,i]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return i(s.toProxy(),this.helpers)}catch(n){throw this.handleError(n,s)}}if(0!==t.iterator){let r,i=t.iterator;for(;r=s.nodes[s.indexes[i]];)if(s.indexes[i]+=1,!r[Xn])return r[Xn]=!0,void e.push(lo(r));t.iterator=0,delete s.indexes[i]}let i=t.events;for(;t.eventIndex<i.length;){let e=i[t.eventIndex];if(t.eventIndex+=1,0===e)return void(s.nodes&&s.nodes.length&&(s[Xn]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Xn]=!0;let t=ao(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[Xn]||this.walkSync(e)});else{let t=this.listeners[s];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"}};uo.registerPostcss=e=>{ho=e};var po=uo;uo.default=uo,so.registerLazyResult(uo),Qn.registerLazyResult(uo);let fo=Si,mo=Dr,go=Yi,yo=Zn;const wo=Ki;let vo=class{constructor(e,t,s){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=s,this._map=void 0;let i=mo;this.result=new wo(this._processor,r,this._opts),this.result.css=t;let n=this;Object.defineProperty(this.result,"root",{get:()=>n.root});let o=new fo(i,r,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||go("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(s){this.error=s}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var bo=vo;vo.default=vo;let Co=bo,So=po,xo=zi,Eo=Mn,No=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)t.push(s);else if("function"==typeof s)t.push(s);else{if("object"!=typeof s||!s.parse&&!s.stringify)throw new Error(s+" 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 So(this,e,t):new Co(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ao=No;No.default=No,Eo.registerProcessor(No),xo.registerProcessor(No);let Io=jr,Mo=Kr,To=Ni,Do=xn,Ro=ui,Oo=Mn,ko=Pn;function Po(e,t){if(Array.isArray(e))return e.map(e=>Po(e));let{inputs:s,...r}=e;if(s){t=[];for(let e of s){let s={...e,__proto__:Ro.prototype};s.map&&(s.map={...s.map,__proto__:Mo.prototype}),t.push(s)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>Po(e,t))),r.source){let{inputId:e,...s}=r.source;r.source=s,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new Oo(r);if("decl"===r.type)return new Io(r);if("rule"===r.type)return new ko(r);if("comment"===r.type)return new To(r);if("atrule"===r.type)return new Do(r);throw new Error("Unknown node type: "+e.type)}var Fo=Po;Po.default=Po;let Lo=xr,_o=jr,Bo=po,Uo=Bi,Vo=Ao,jo=Dr,Go=Fo,zo=zi,Wo=Xi,Yo=Ni,Zo=xn,Xo=Ki,Jo=ui,Ho=Zn,Ko=Dn,$o=Pn,Qo=Mn,qo=Br;function ea(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Vo(e)}ea.plugin=function(e,t){let s,r=!1;function i(...s){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...s);return i.postcssPlugin=e,i.postcssVersion=(new Vo).version,i}return Object.defineProperty(i,"postcss",{get:()=>(s||(s=i()),s)}),i.process=function(e,t,s){return ea([i(s)]).process(e,t)},i},ea.stringify=jo,ea.parse=Ho,ea.fromJSON=Go,ea.list=Ko,ea.comment=e=>new Yo(e),ea.atRule=e=>new Zo(e),ea.decl=e=>new _o(e),ea.rule=e=>new $o(e),ea.root=e=>new Qo(e),ea.document=e=>new zo(e),ea.CssSyntaxError=Lo,ea.Declaration=_o,ea.Container=Uo,ea.Processor=Vo,ea.Document=zo,ea.Comment=Yo,ea.Warning=Wo,ea.AtRule=Zo,ea.Result=Xo,ea.Input=Jo,ea.Rule=$o,ea.Root=Qo,ea.Node=qo,Bo.registerPostcss(ea);var ta=ea;ea.default=ea;const sa=dr(ta);sa.stringify,sa.fromJSON,sa.plugin,sa.parse,sa.list,sa.document,sa.comment,sa.atRule,sa.rule,sa.decl,sa.root,sa.CssSyntaxError,sa.Declaration,sa.Container,sa.Processor,sa.Document,sa.Comment,sa.Warning,sa.AtRule,sa.Result,sa.Input,sa.Rule,sa.Root,sa.Node;var ra=(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))(ra||{});function ia(e){const t=[];for(const s in e){const r=e[s];if("string"!=typeof r)continue;const i=ca(s);t.push(`${i}: ${r};`)}return t.join(" ")}const na=/-([a-z])/g,oa=/^--[a-zA-Z0-9-]+$/,aa=e=>oa.test(e)?e:e.replace(na,(e,t)=>t?t.toUpperCase():""),la=/\B([A-Z])/g,ca=e=>e.replace(la,"-$1").toLowerCase();class ha{constructor(...e){cr(this,"parentElement",null),cr(this,"parentNode",null),cr(this,"ownerDocument"),cr(this,"firstChild",null),cr(this,"lastChild",null),cr(this,"previousSibling",null),cr(this,"nextSibling",null),cr(this,"ELEMENT_NODE",1),cr(this,"TEXT_NODE",3),cr(this,"nodeType"),cr(this,"nodeName"),cr(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 ha))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"}}class ua extends ha{constructor(...e){super(e),cr(this,"nodeType",9),cr(this,"nodeName","#document"),cr(this,"compatMode","CSS1Compat"),cr(this,"RRNodeType",ra.Document),cr(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===ra.Element&&"HTML"===e.tagName)||null}get body(){var e;return(null==(e=this.documentElement)?void 0:e.childNodes.find(e=>e.RRNodeType===ra.Element&&"BODY"===e.tagName))||null}get head(){var e;return(null==(e=this.documentElement)?void 0:e.childNodes.find(e=>e.RRNodeType===ra.Element&&"HEAD"===e.tagName))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===ra.Element||t===ra.DocumentType)&&this.childNodes.some(e=>e.RRNodeType===t))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===ra.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const s=ba(this,e);return s.parentElement=null,s}insertBefore(e,t){const s=e.RRNodeType;if((s===ra.Element||s===ra.DocumentType)&&this.childNodes.some(e=>e.RRNodeType===s))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${s===ra.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const r=Ca(this,e,t);return r.parentElement=null,r}removeChild(e){return Sa(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'===e?t="-//W3C//DTD XHTML 1.0 Transitional//EN":'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'===e&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){const e=this.createDocumentType("html",t,"");this.open(),this.appendChild(e)}}createDocument(e,t,s){return new ua}createDocumentType(e,t,s){const r=new pa(e,t,s);return r.ownerDocument=this,r}createElement(e){const t=new da(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new ga(e);return t.ownerDocument=this,t}createComment(e){const t=new ya(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new wa(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}class pa extends ha{constructor(e,t,s){super(),cr(this,"nodeType",10),cr(this,"RRNodeType",ra.DocumentType),cr(this,"name"),cr(this,"publicId"),cr(this,"systemId"),cr(this,"textContent",null),this.name=e,this.publicId=t,this.systemId=s,this.nodeName=e}toString(){return"RRDocumentType"}}class da extends ha{constructor(e){super(),cr(this,"nodeType",1),cr(this,"RRNodeType",ra.Element),cr(this,"tagName"),cr(this,"attributes",{}),cr(this,"shadowRoot",null),cr(this,"scrollLeft"),cr(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(t=>e+=t.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new va(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?function(e){const t={},s=/:(.+)/;return e.replace(/\/\*.*?\*\//g,"").split(/;(?![^(]*\))/g).forEach(function(e){if(e){const r=e.split(s);r.length>1&&(t[aa(r[0].trim())]=r[1].trim())}}),t}(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(s,r,i)=>{if(t.test(s))return;const n=aa(s);r?e[n]=r:delete e[n],"important"===i&&(e[n]+=" !important"),this.attributes.style=ia(e)},e.removeProperty=s=>{if(t.test(s))return"";const r=aa(s),i=e[r]||"";return delete e[r],this.attributes.style=ia(e),i},e}getAttribute(e){return void 0===this.attributes[e]?null:this.attributes[e]}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,s){this.setAttribute(t,s)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return ba(this,e)}insertBefore(e,t){return Ca(this,e,t)}removeChild(e){return Sa(this,e)}attachShadow(e){const t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(const t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}}class fa extends da{constructor(){super(...arguments),cr(this,"currentTime"),cr(this,"volume"),cr(this,"paused"),cr(this,"muted"),cr(this,"playbackRate"),cr(this,"loop")}attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}class ma extends da{constructor(){super(...arguments),cr(this,"tagName","DIALOG"),cr(this,"nodeName","DIALOG")}get isModal(){return"modal"===this.getAttribute("rr_open_mode")}get open(){return null!==this.getAttribute("open")}close(){this.removeAttribute("open"),this.removeAttribute("rr_open_mode")}show(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","non-modal")}showModal(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","modal")}}class ga extends ha{constructor(e){super(),cr(this,"nodeType",3),cr(this,"nodeName","#text"),cr(this,"RRNodeType",ra.Text),cr(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class ya extends ha{constructor(e){super(),cr(this,"nodeType",8),cr(this,"nodeName","#comment"),cr(this,"RRNodeType",ra.Comment),cr(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class wa extends ha{constructor(e){super(),cr(this,"nodeName","#cdata-section"),cr(this,"nodeType",4),cr(this,"RRNodeType",ra.CDATA),cr(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class va{constructor(e,t){if(cr(this,"onChange"),cr(this,"classes",[]),cr(this,"add",(...e)=>{for(const t of e){const e=String(t);this.classes.indexOf(e)>=0||this.classes.push(e)}this.onChange&&this.onChange(this.classes.join(" "))}),cr(this,"remove",(...e)=>{this.classes=this.classes.filter(t=>-1===e.indexOf(t)),this.onChange&&this.onChange(this.classes.join(" "))}),e){const t=e.trim().split(/\s+/);this.classes.push(...t)}this.onChange=t}}function ba(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function Ca(e,t,s){if(!s)return ba(e,t);if(s.parentNode!==e)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return t===s||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=s.previousSibling,s.previousSibling=t,t.nextSibling=s,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function Sa(e,t){if(t.parentNode!==e)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var xa=(e=>(e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",e))(xa||{});const Ea={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Na={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};let Aa=null;function Ia(e,t,s,r=t.mirror||t.ownerDocument.mirror){e=function(e,t,s,r){var i;s.afterAppend&&!Aa&&(Aa=new WeakSet,setTimeout(()=>{Aa=null},0));if(!Da(e,t)){const n=Ta(t,s.mirror,r);null==(i=e.parentNode)||i.replaceChild(n,e),e=n}switch(t.RRNodeType){case ra.Document:if(!Ra(e,t,s.mirror,r)){const i=r.getMeta(t);i&&(s.mirror.removeNodeFromMap(e),e.close(),e.open(),s.mirror.add(e,i),null==Aa||Aa.add(e))}break;case ra.Element:{const i=e,n=t;switch(n.tagName){case"IFRAME":{const i=e.contentDocument;if(!i)break;Ia(i,t.contentDocument,s,r);break}}n.shadowRoot&&(i.shadowRoot||i.attachShadow({mode:"open"}),Ma(i.shadowRoot,n.shadowRoot,s,r)),function(e,t,s){const r=e.attributes,i=t.attributes;for(const o in i){const r=i[o],a=s.getMeta(t);if((null==a?void 0:a.isSVG)&&Ea[o])e.setAttributeNS(Ea[o],o,r);else if("CANVAS"===t.tagName&&"rr_dataURL"===o){const t=document.createElement("img");t.src=r,t.onload=()=>{const s=e.getContext("2d");s&&s.drawImage(t,0,0,t.width,t.height)}}else{if("IFRAME"===t.tagName&&"srcdoc"===o)continue;try{e.setAttribute(o,r)}catch(n){console.warn(n)}}}for(const{name:o}of Array.from(r))o in i||e.removeAttribute(o);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}(i,n,r);break}}return e}(e,t,s,r),Ma(e,t,s,r),function(e,t,s){var r;switch(t.RRNodeType){case ra.Document:{const e=t.scrollData;e&&s.applyScroll(e,!0);break}case ra.Element:{const r=e,n=t;switch(n.scrollData&&s.applyScroll(n.scrollData,!0),n.inputData&&s.applyInput(n.inputData),n.tagName){case"AUDIO":case"VIDEO":{const t=e,s=n;void 0!==s.paused&&(s.paused?t.pause():t.play()),void 0!==s.muted&&(t.muted=s.muted),void 0!==s.volume&&(t.volume=s.volume),void 0!==s.currentTime&&(t.currentTime=s.currentTime),void 0!==s.playbackRate&&(t.playbackRate=s.playbackRate),void 0!==s.loop&&(t.loop=s.loop);break}case"CANVAS":{const i=t;if(null!==i.rr_dataURL){const e=document.createElement("img");e.onload=()=>{const t=r.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=i.rr_dataURL}i.canvasMutations.forEach(t=>s.applyCanvas(t.event,t.mutation,e));break}case"STYLE":{const e=r.sheet;e&&t.rules.forEach(t=>s.applyStyleSheetMutation(t,e));break}case"DIALOG":{const e=r,t=n,s=e.open,o=e.matches("dialog:modal"),a=t.open,l=t.isModal,c=o!==l,h=s!==a;if((c||s&&h)&&e.close(),a&&(h||c))try{l?e.showModal():e.show()}catch(i){console.warn(i)}break}}break}case ra.Text:case ra.Comment:case ra.CDATA:e.textContent!==t.data&&(e.textContent=t.data)}(null==Aa?void 0:Aa.has(e))&&(Aa.delete(e),null==(r=s.afterAppend)||r.call(s,e,s.mirror.getId(e)))}(e,t,s)}function Ma(e,t,s,r){const i=Array.from(e.childNodes),n=t.childNodes;if(0===i.length&&0===n.length)return;let o,a,l=0,c=i.length-1,h=0,u=n.length-1,p=i[l],d=i[c],f=n[h],m=n[u];for(;l<=c&&h<=u;)if(void 0===p)p=i[++l];else if(void 0===d)d=i[--c];else if(Ra(p,f,s.mirror,r))p=i[++l],f=n[++h];else if(Ra(d,m,s.mirror,r))d=i[--c],m=n[--u];else if(Ra(p,m,s.mirror,r)){try{e.insertBefore(p,d.nextSibling)}catch(w){console.warn(w)}p=i[++l],m=n[--u]}else if(Ra(d,f,s.mirror,r)){try{e.insertBefore(d,p)}catch(w){console.warn(w)}d=i[--c],f=n[++h]}else{if(!o){o={};for(let e=l;e<=c;e++){const t=i[e];t&&s.mirror.hasNode(t)&&(o[s.mirror.getId(t)]=e)}}a=o[r.getId(f)];const t=i[a];if(void 0!==a&&t&&Ra(t,f,s.mirror,r)){try{e.insertBefore(t,p)}catch(w){console.warn(w)}i[a]=void 0}else{const t=Ta(f,s.mirror,r);"#document"===e.nodeName&&p&&(t.nodeType===t.DOCUMENT_TYPE_NODE&&p.nodeType===p.DOCUMENT_TYPE_NODE||t.nodeType===t.ELEMENT_NODE&&p.nodeType===p.ELEMENT_NODE)&&(e.removeChild(p),s.mirror.removeNodeFromMap(p),p=i[++l]);try{e.insertBefore(t,p||null)}catch(w){console.warn(w)}}f=n[++h]}if(l>c){const t=n[u+1];let i=null;for(t&&(i=s.mirror.getNode(r.getId(t)));h<=u;++h){const t=Ta(n[h],s.mirror,r);try{e.insertBefore(t,i)}catch(w){console.warn(w)}}}else if(h>u)for(;l<=c;l++){const t=i[l];if(t&&t.parentNode===e)try{e.removeChild(t),s.mirror.removeNodeFromMap(t)}catch(w){console.warn(w)}}let g=e.firstChild,y=t.firstChild;for(;null!==g&&null!==y;)Ia(g,y,s,r),g=g.nextSibling,y=y.nextSibling}function Ta(e,t,s){const r=s.getId(e),i=s.getMeta(e);let n=null;if(r>-1&&(n=t.getNode(r)),null!==n&&Da(n,e))return n;switch(e.RRNodeType){case ra.Document:n=new Document;break;case ra.DocumentType:n=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case ra.Element:{let t=e.tagName.toLowerCase();t=Na[t]||t,n=i&&"isSVG"in i&&(null==i?void 0:i.isSVG)?document.createElementNS(Ea.svg,t):document.createElement(e.tagName);break}case ra.Text:n=document.createTextNode(e.data);break;case ra.Comment:n=document.createComment(e.data);break;case ra.CDATA:n=document.createCDATASection(e.data)}i&&t.add(n,{...i});try{null==Aa||Aa.add(n)}catch(o){}return n}function Da(e,t){return e.nodeType===t.nodeType&&(e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName)}function Ra(e,t,s,r){const i=s.getId(e),n=r.getId(t);return-1!==i&&i===n&&Da(e,t)}class Oa extends ua{constructor(e){super(),cr(this,"UNSERIALIZED_STARTING_ID",-2),cr(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),cr(this,"mirror",new Ya),cr(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,t,s){return new Oa}createDocumentType(e,t,s){const r=new ka(e,t,s);return r.ownerDocument=this,r}createElement(e){const t=e.toUpperCase();let s;switch(t){case"AUDIO":case"VIDEO":s=new Fa(t);break;case"IFRAME":s=new Ua(t,this.mirror);break;case"CANVAS":s=new _a(t);break;case"STYLE":s=new Ba(t);break;case"DIALOG":s=new La(t);break;default:s=new Pa(t)}return s.ownerDocument=this,s}createComment(e){const t=new ja(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new Ga(e);return t.ownerDocument=this,t}createTextNode(e){const t=new Va(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const ka=pa;class Pa extends da{constructor(){super(...arguments),cr(this,"inputData",null),cr(this,"scrollData",null)}}class Fa extends fa{}class La extends ma{}class _a extends Pa{constructor(){super(...arguments),cr(this,"rr_dataURL",null),cr(this,"canvasMutations",[])}getContext(){return null}}class Ba extends Pa{constructor(){super(...arguments),cr(this,"rules",[])}}class Ua extends Pa{constructor(e,t){super(e),cr(this,"contentDocument",new Oa),this.contentDocument.mirror=t}}const Va=ga,ja=ya,Ga=wa;function za(e,t,s,r){let i;switch(e.nodeType){case xa.DOCUMENT_NODE:r&&"IFRAME"===r.nodeName?i=r.contentDocument:(i=t,i.compatMode=e.compatMode);break;case xa.DOCUMENT_TYPE_NODE:{const s=e;i=t.createDocumentType(s.name,s.publicId,s.systemId);break}case xa.ELEMENT_NODE:{const s=e,r=(n=s)instanceof HTMLFormElement?"FORM":n.tagName.toUpperCase();i=t.createElement(r);const o=i;for(const{name:e,value:t}of Array.from(s.attributes))o.attributes[e]=t;s.scrollLeft&&(o.scrollLeft=s.scrollLeft),s.scrollTop&&(o.scrollTop=s.scrollTop);break}case xa.TEXT_NODE:i=t.createTextNode(e.textContent||"");break;case xa.CDATA_SECTION_NODE:i=t.createCDATASection(e.data);break;case xa.COMMENT_NODE:i=t.createComment(e.textContent||"");break;case xa.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}var n;let o=s.getMeta(e);return t instanceof Oa&&(o||(o=Za(i,t.unserializedId),s.add(e,o)),t.mirror.add(i,{...o})),i}function Wa(e,t=function(){return new pr}(),s=new Oa){return function e(r,i){const n=za(r,s,t,i);if(null!==n)if("IFRAME"!==(null==i?void 0:i.nodeName)&&r.nodeType!==xa.DOCUMENT_FRAGMENT_NODE&&(null==i||i.appendChild(n),n.parentNode=i,n.parentElement=i),"IFRAME"===r.nodeName){const t=r.contentDocument;t&&e(t,n)}else r.nodeType!==xa.DOCUMENT_NODE&&r.nodeType!==xa.ELEMENT_NODE&&r.nodeType!==xa.DOCUMENT_FRAGMENT_NODE||(r.nodeType===xa.ELEMENT_NODE&&r.shadowRoot&&e(r.shadowRoot,n),r.childNodes.forEach(t=>e(t,n)))}(e,null),s}class Ya{constructor(){cr(this,"idNodeMap",new Map),cr(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const s=t.id;this.idNodeMap.set(s,e),this.nodeMetaMap.set(e,t)}replace(e,t){const s=this.getNode(e);if(s){const e=this.nodeMetaMap.get(s);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Za(e,t){switch(e.RRNodeType){case ra.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case ra.DocumentType:{const s=e;return{id:t,type:e.RRNodeType,name:s.name,publicId:s.publicId,systemId:s.systemId}}case ra.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case ra.Text:case ra.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case ra.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}const Xa={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ja={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ha={};function Ka(e){if(Ha[e])return Ha[e];const t=globalThis[e],s=t.prototype,r=e in Xa?Xa[e]:void 0,i=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(s,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),n=e in Ja?Ja[e]:void 0,o=Boolean(n&&n.every(e=>{var t;return"function"==typeof s[e]&&(null==(t=s[e])?void 0:t.toString().includes("[native code]"))}));if(i&&o&&!globalThis.Zone)return Ha[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const i=r.contentWindow;if(!i)return t.prototype;const n=i[e].prototype;return document.body.removeChild(r),n?Ha[e]=n:s}catch{return s}}const $a={};function Qa(e,t,s){var r;const i=`${e}.${String(s)}`;if($a[i])return $a[i].call(t);const n=Ka(e),o=null==(r=Object.getOwnPropertyDescriptor(n,s))?void 0:r.get;return o?($a[i]=o,o.call(t)):t[s]}const qa={};function el(e,t,s){const r=`${e}.${String(s)}`;if(qa[r])return qa[r].bind(t);const i=Ka(e)[s];return"function"!=typeof i?t[s]:(qa[r]=i,i.bind(t))}const tl={ownerDocument:function(e){return Qa("Node",e,"ownerDocument")},childNodes:function(e){return Qa("Node",e,"childNodes")},parentNode:function(e){return Qa("Node",e,"parentNode")},parentElement:function(e){return Qa("Node",e,"parentElement")},textContent:function(e){return Qa("Node",e,"textContent")},contains:function(e,t){return el("Node",e,"contains")(t)},getRootNode:function(e){return el("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Qa("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Qa("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Qa("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Qa("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ka("MutationObserver").constructor},patch:function(e,t,s){try{if(!(t in e))return()=>{};const r=e[t],i=s(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}},sl="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 rl={map:{},getId:()=>(console.error(sl),-1),getNode:()=>(console.error(sl),null),removeNodeFromMap(){console.error(sl)},has:()=>(console.error(sl),!1),reset(){console.error(sl)}};function il(e){const t={},s=(e,s)=>{const r={value:e,parent:s,children:[]};return t[e.node.id]=r,r},r=[];for(const i of e){const{nextId:e,parentId:n}=i;if(e&&e in t){const n=t[e];if(n.parent){const e=n.parent.children.indexOf(n);n.parent.children.splice(e,0,s(i,n.parent))}else{const e=r.indexOf(n);r.splice(e,0,s(i,null))}continue}if(n in t){const e=t[n];e.children.push(s(i,e));continue}r.push(s(i,null))}return r}function nl(e,t){t(e.value);for(let s=e.children.length-1;s>=0;s--)nl(e.children[s],t)}function ol(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function al(e,t){var s,r;const i=null==(r=null==(s=e.ownerDocument)?void 0:s.defaultView)?void 0:r.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const n=i.getBoundingClientRect(),o=al(i,t),a=n.height/i.clientHeight;return{x:n.x*o.relativeScale+o.x,y:n.y*o.relativeScale+o.y,relativeScale:a,absoluteScale:o.absoluteScale*a}}function ll(e){return!!e&&(e instanceof ha&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(tl.shadowRoot(e)))}function cl(e,t){const s=e[t[0]];return 1===t.length?s:cl(s.cssRules[t[1]].cssRules,t.slice(2))}function hl(e){const t=[...e],s=t.pop();return{positions:t,index:s}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(rl=new Proxy(rl,{get:(e,t,s)=>("map"===t&&console.error(sl),Reflect.get(e,t,s))})),Date.now().toString();class ul{constructor(){s(this,"id",1),s(this,"styleIDMap",new WeakMap),s(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 s;return s=void 0===t?this.id++:t,this.styleIDMap.set(e,s),this.idStyleMap.set(s,e),s}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}for(var pl=(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))(pl||{}),dl=(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))(dl||{}),fl=(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))(fl||{}),ml=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ml||{}),gl=(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))(gl||{}),yl=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(yl||{}),wl=(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))(wl||{}),vl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bl="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Cl=0;Cl<64;Cl++)bl[vl.charCodeAt(Cl)]=Cl;var Sl;"undefined"!=typeof window&&window.Blob&&new Blob([(Sl="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Uint8Array.from(atob(Sl),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],e=>2*e)[0]){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null==(e=t.contentWindow)?void 0:e.Array.from)||Array.from,document.body.removeChild(t)}}catch(sc){console.debug("Unable to override Array.from",sc)}function xl(e){return{all:e=e||new Map,on:function(t,s){var r=e.get(t);r?r.push(s):e.set(t,[s])},off:function(t,s){var r=e.get(t);r&&(s?r.splice(r.indexOf(s)>>>0,1):e.set(t,[]))},emit:function(t,s){var r=e.get(t);r&&r.slice().map(function(e){e(s)}),(r=e.get("*"))&&r.slice().map(function(e){e(t,s)})}}}l();const El=Object.freeze(Object.defineProperty({__proto__:null,default:xl},Symbol.toStringTag,{value:"Module"}));function Nl(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)return;const s=e.HTMLElement||e.Element,r={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:s.prototype.scroll||a,scrollIntoView:s.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;const n=(o=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(o)?1:0);var o;function a(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+n<e.scrollHeight:"X"===t?e.clientWidth+n<e.scrollWidth:void 0}function h(t,s){const r=e.getComputedStyle(t,null)["overflow"+s];return"auto"===r||"scroll"===r}function u(e){const t=c(e,"Y")&&h(e,"Y"),s=c(e,"X")&&h(e,"X");return t||s}function p(t){let s,r,n,o=(i()-t.startTime)/468;var a;o=o>1?1:o,a=o,s=.5*(1-Math.cos(Math.PI*a)),r=t.startX+(t.x-t.startX)*s,n=t.startY+(t.y-t.startY)*s,t.method.call(t.scrollable,r,n),r===t.x&&n===t.y||e.requestAnimationFrame(p.bind(e,t))}function d(s,n,o){let l,c,h,u;const d=i();s===t.body?(l=e,c=e.scrollX||e.pageXOffset,h=e.scrollY||e.pageYOffset,u=r.scroll):(l=s,c=s.scrollLeft,h=s.scrollTop,u=a),p({scrollable:l,method:u,startTime:d,startX:c,startY:h,x:n,y:o})}e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?d.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):r.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?r.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):d.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},s.prototype.scroll=s.prototype.scrollTo=function(){if(void 0===arguments[0])return;if(!0===l(arguments[0])){if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");return void r.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}const e=arguments[0].left,t=arguments[0].top;d.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)},s.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):r.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},s.prototype.scrollIntoView=function(){if(!0===l(arguments[0]))return void r.scrollIntoView.call(this,void 0===arguments[0]||arguments[0]);const s=function(e){for(;e!==t.body&&!1===u(e);)e=e.parentNode||e.host;return e}(this),i=s.getBoundingClientRect(),n=this.getBoundingClientRect();s!==t.body?(d.call(this,s,s.scrollLeft+n.left-i.left,s.scrollTop+n.top-i.top),"fixed"!==e.getComputedStyle(s).position&&e.scrollBy({left:i.left,top:i.top,behavior:"smooth"})):e.scrollBy({left:n.left,top:n.top,behavior:"smooth"})}}class Al{constructor(e=[],t){s(this,"timeOffset",0),s(this,"speed"),s(this,"actions"),s(this,"raf",null),s(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){const t=!0===this.raf;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const t=this.findActionIndex(e);this.actions.splice(t,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const e=this.actions[0];if(!(this.timeOffset>=e.delay))break;this.actions.shift(),e.doAction()}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(!0!==this.raf&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return null!==this.raf}findActionIndex(e){let t=0,s=this.actions.length-1;for(;t<=s;){const r=Math.floor((t+s)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r+1;s=r-1}}return t}}function Il(e,t){if(e.type===pl.IncrementalSnapshot&&e.data.source===dl.MouseMove&&e.data.positions&&e.data.positions.length){const s=e.data.positions[0].timeOffset,r=e.timestamp+s;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}function Ml(e,t){var s="function"==typeof Symbol&&e[Symbol.iterator];if(!s)return e;var r,i,n=s.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=n.next()).done;)o.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(i)throw i.error}}return o}var Tl,Dl;(Dl=Tl||(Tl={}))[Dl.NotStarted=0]="NotStarted",Dl[Dl.Running=1]="Running",Dl[Dl.Stopped=2]="Stopped";var Rl={type:"xstate.init"};function Ol(e){return void 0===e?[]:[].concat(e)}function kl(e){return{type:"xstate.assign",assignment:e}}function Pl(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function Fl(e){return function(t){return e===t}}function Ll(e){return"string"==typeof e?{type:e}:e}function _l(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Fl(e)}}function Bl(e,t,s){var r=t,i=!1;return[e.filter(function(e){if("xstate.assign"===e.type){i=!0;var t=Object.assign({},r);return"function"==typeof e.assignment?t=e.assignment(r,s):Object.keys(e.assignment).forEach(function(i){t[i]="function"==typeof e.assignment[i]?e.assignment[i](r,s):e.assignment[i]}),r=t,!1}return!0}),r,i]}function Ul(e,t){void 0===t&&(t={});var s=Ml(Bl(Ol(e.states[e.initial].entry).map(function(e){return Pl(e,t.actions)}),e.context,Rl),2),r=s[0],i=s[1],n={config:e,_options:t,initialState:{value:e.initial,actions:r,context:i,matches:Fl(e.initial)},transition:function(t,s){var r,i,o="string"==typeof t?{value:t,context:e.context}:t,a=o.value,l=o.context,c=Ll(s),h=e.states[a];if(h.on){var u=Ol(h.on[c.type]);try{for(var p=function(e){var t="function"==typeof Symbol&&Symbol.iterator,s=t&&e[t],r=0;if(s)return s.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(u),d=p.next();!d.done;d=p.next()){var f=d.value;if(void 0===f)return _l(a,l);var m="string"==typeof f?{target:f}:f,g=m.target,y=m.actions,w=void 0===y?[]:y,v=m.cond,b=void 0===v?function(){return!0}:v,C=void 0===g,S=null!=g?g:a,x=e.states[S];if(b(l,c)){var E=Ml(Bl((C?Ol(w):[].concat(h.exit,w,x.entry).filter(function(e){return e})).map(function(e){return Pl(e,n._options.actions)}),l,c),3),N=E[0],A=E[1],I=E[2],M=null!=g?g:a;return{value:M,context:A,actions:N,changed:g!==a||N.length>0||I,matches:Fl(M)}}}}catch(Dl){r={error:Dl}}finally{try{d&&!d.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}}return _l(a,l)}};return n}var Vl=function(e,t){return e.actions.forEach(function(s){var r=s.exec;return r&&r(e.context,t)})};function jl(e){var t=e.initialState,s=Tl.NotStarted,r=new Set,i={_machine:e,send:function(i){s===Tl.Running&&(t=e.transition(t,i),Vl(t,Ll(i)),r.forEach(function(e){return e(t)}))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(r){if(r){var n="object"==typeof r?r:{context:e.config.context,value:r};t={value:n.value,actions:[],context:n.context,matches:Fl(n.value)}}return s=Tl.Running,Vl(t,Rl),i},stop:function(){return s=Tl.Stopped,r.clear(),i},get state(){return t},get status(){return s}};return i}function Gl(e,{getCastFn:t,applyEventsSynchronously:s,emitter:r}){return jl(Ul({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:kl({lastPlayedEvent:(e,t)=>"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}),recordTimeOffset:kl((e,t)=>{let s=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(s=t.payload.timeOffset),{...e,timeOffset:s,baselineTime:e.events[0].timestamp+s}}),play(e){var i;const{timer:n,events:o,baselineTime:a,lastPlayedEvent:l}=e;n.clear();for(const t of o)Il(t,a);const c=function(e,t){for(let s=e.length-1;s>=0;s--){const r=e[s];if(r.type===pl.Meta&&r.timestamp<=t)return e.slice(s)}return e}(o,a);let h=null==l?void 0:l.timestamp;(null==l?void 0:l.type)===pl.IncrementalSnapshot&&l.data.source===dl.MouseMove&&(h=l.timestamp+(null==(i=l.data.positions[0])?void 0:i.timeOffset)),a<(h||0)&&r.emit(yl.PlayBack);const u=new Array;for(const s of c)if(!(h&&h<a&&(s.timestamp<=h||s===l)))if(s.timestamp<a)u.push(s);else{const e=t(s,!1);n.addAction({doAction:()=>{e()},delay:s.delay})}s(u),r.emit(yl.Flush),n.start()},pause(e){e.timer.clear()},resetLastPlayedEvent:kl(e=>({...e,lastPlayedEvent:null})),startLive:kl({baselineTime:(e,t)=>(e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now())}),addEvent:kl((e,s)=>{const{baselineTime:r,timer:i,events:n}=e;if("ADD_EVENT"===s.type){const{event:e}=s.payload;Il(e,r);let o=n.length-1;if(!n[o]||n[o].timestamp<=e.timestamp)n.push(e);else{let t=-1,s=0;for(;s<=o;){const t=Math.floor((s+o)/2);n[t].timestamp<=e.timestamp?s=t+1:o=t-1}-1===t&&(t=s),n.splice(t,0,e)}const a=e.timestamp<r,l=t(e,a);a?l():i.isActive()&&i.addAction({doAction:()=>{l()},delay:e.delay})}return{...e,events:n}})}}))}const zl=new Map;function Wl(e,t){let s=zl.get(e);return s||(s=new Map,zl.set(e,s)),s.has(t)||s.set(t,[]),s.get(t)}function Yl(e,t,s){return async r=>{if(r&&"object"==typeof r&&"rr_type"in r){if(s&&(s.isUnchanged=!1),"ImageBitmap"===r.rr_type&&"args"in r){const i=await Yl(e,t,s)(r.args);return await createImageBitmap.apply(null,i)}if("index"in r){if(s||null===t)return r;const{rr_type:e,index:i}=r;return Wl(t,e)[i]}if("args"in r){const{rr_type:i,args:n}=r;return new(0,window[i])(...await Promise.all(n.map(Yl(e,t,s))))}if("base64"in r)return function(e){var t,s,r,i,n,o=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var c=new ArrayBuffer(o),h=new Uint8Array(c);for(t=0;t<a;t+=4)s=bl[e.charCodeAt(t)],r=bl[e.charCodeAt(t+1)],i=bl[e.charCodeAt(t+2)],n=bl[e.charCodeAt(t+3)],h[l++]=s<<2|r>>4,h[l++]=(15&r)<<4|i>>2,h[l++]=(3&i)<<6|63&n;return c}(r.base64);if("src"in r){const t=e.get(r.src);if(t)return t;{const t=new Image;return t.src=r.src,e.set(r.src,t),t}}if("data"in r&&"Blob"===r.rr_type){const i=await Promise.all(r.data.map(Yl(e,t,s)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r)){return await Promise.all(r.map(Yl(e,t,s)))}return r}}const Zl=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];async function Xl({mutation:e,target:t,type:s,imageMap:r,errorHandler:i}){try{const i=function(e,t){try{return t===ml.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(s){return null}}(t,s);if(!i)return;if(e.setter)return void(i[e.property]=e.args[0]);const n=i[e.property],o=await Promise.all(e.args.map(Yl(r,i)));!function(e,t){if(!(null==t?void 0:t.constructor))return;const{name:s}=t.constructor;if(!Zl.includes(s))return;const r=Wl(e,s);r.includes(t)||r.push(t)}(i,n.apply(i,o))}catch(n){i(e,n)}}async function Jl({event:e,mutation:t,target:s,imageMap:r,canvasEventMap:i,errorHandler:n}){try{const o=i.get(e)||t,a="commands"in o?o.commands:[o];if([ml.WebGL,ml.WebGL2].includes(t.type)){for(let e=0;e<a.length;e++){const i=a[e];await Xl({mutation:i,type:t.type,target:s,imageMap:r,errorHandler:n})}return}await async function({event:e,mutations:t,target:s,imageMap:r,errorHandler:i}){const n=s.getContext("2d");if(!n)return void i(t[0],new Error("Canvas context is null"));const o=t.map(async e=>Promise.all(e.args.map(Yl(r,n))));(await Promise.all(o)).forEach((s,o)=>{const a=t[o];try{if(a.setter)return void(n[a.property]=a.args[0]);const t=n[a.property];"drawImage"===a.property&&"string"==typeof a.args[0]?(r.get(e),t.apply(n,a.args)):t.apply(n,s)}catch(l){i(a,l)}})}({event:e,mutations:a,target:s,imageMap:r,errorHandler:n})}catch(o){n(t,o)}}class Hl{constructor(e){s(this,"mediaMap",new Map),s(this,"warn"),s(this,"service"),s(this,"speedService"),s(this,"emitter"),s(this,"getCurrentTime"),s(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(yl.Start,this.start.bind(this)),this.emitter.on(yl.SkipStart,this.start.bind(this)),this.emitter.on(yl.Pause,this.pause.bind(this)),this.emitter.on(yl.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,s)=>{this.syncTargetWithState(s),e.pause&&s.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:s}){if(s.isPlaying){const r=(e-s.lastInteractionTimeOffset)/1e3*s.playbackRate,i="duration"in t&&t.duration;if(Number.isNaN(i))return void this.waitForMetadata(t);let n=s.currentTimeAtLastInteraction+r;t.loop&&!1!==i&&(n%=i),t.currentTime=n}else t.pause(),t.currentTime=s.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e))return;if(!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const t=this.mediaMap.get(e);t&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:s}){const r=this.mediaMap.get(e),{type:i,playbackRate:n,currentTime:o,muted:a,volume:l,loop:c}=s;return{isPlaying:i===gl.Play||i!==gl.Pause&&((null==r?void 0:r.isPlaying)||null!==e.getAttribute("autoplay")),currentTimeAtLastInteraction:o??(null==r?void 0:r.currentTimeAtLastInteraction)??0,lastInteractionTimeOffset:t,playbackRate:n??(null==r?void 0:r.playbackRate)??1,volume:l??(null==r?void 0:r.volume)??1,muted:a??(null==r?void 0:r.muted)??null===e.getAttribute("muted"),loop:c??(null==r?void 0:r.loop)??null===e.getAttribute("loop")}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:s,loop:r,volume:i,isPlaying:n}=t,o=this.service.state.matches("paused"),a=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==i&&(e.volume=i),e.muted=s,e.loop=r,e.playbackRate!==a&&(e.playbackRate=a),n&&!o?e.play():e.pause()}catch(l){this.warn(`Failed to replay media interactions: ${l.message||l}`)}}addMediaElements(e,t,s){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const r=e,i=s.getMeta(r);if(!i||!("attributes"in i))return;const n=this.service.state.matches("paused"),o=i.attributes;let a=!1;a=o.rr_mediaState?"played"===o.rr_mediaState:null!==r.getAttribute("autoplay"),a&&n&&r.pause();let l=1;"number"==typeof o.rr_mediaPlaybackRate&&(l=o.rr_mediaPlaybackRate);let c=!1;c="boolean"==typeof o.rr_mediaMuted?o.rr_mediaMuted:null!==r.getAttribute("muted");let h=!1;h="boolean"==typeof o.rr_mediaLoop?o.rr_mediaLoop:null!==r.getAttribute("loop");let u=1;"number"==typeof o.rr_mediaVolume&&(u=o.rr_mediaVolume);let p=0;"number"==typeof o.rr_mediaCurrentTime&&(p=o.rr_mediaCurrentTime),this.mediaMap.set(r,{isPlaying:a,currentTimeAtLastInteraction:p,lastInteractionTimeOffset:t,playbackRate:l,volume:u,muted:c,loop:h}),this.syncTargetWithState(r)}mediaMutation({target:e,timeOffset:t,mutation:s}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:s})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function Kl(e,t){if("DIALOG"!==e.nodeName||e instanceof ha)return;const s=e,r=s.open,i=r&&s.matches("dialog:modal"),n=s.getAttribute("rr_open_mode"),o="string"==typeof(null==t?void 0:t.attributes.open)||"string"==typeof s.getAttribute("open"),a="modal"===n;r&&!(i&&"non-modal"===n||!i&&a)||(s.isConnected?(r&&s.close(),o&&(a?s.showModal():s.show())):console.warn("dialog is not attached to the dom",s))}function $l(e,t){if("DIALOG"!==e.nodeName||e instanceof ha)return;const s=e;s.isConnected?null===t.attributes.open&&(s.removeAttribute("open"),s.removeAttribute("rr_open_mode")):console.warn("dialog is not attached to the dom",s)}const Ql=xl||El,ql="[replayer]",ec={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function tc(e){return e.type==pl.IncrementalSnapshot&&(e.data.source==dl.TouchMove||e.data.source==dl.MouseInteraction&&e.data.type==fl.TouchStart)}exports.Replayer=class{constructor(e,t){if(s(this,"wrapper"),s(this,"iframe"),s(this,"service"),s(this,"speedService"),s(this,"config"),s(this,"usingVirtualDom",!1),s(this,"virtualDom",new Oa),s(this,"mouse"),s(this,"mouseTail",null),s(this,"tailPositions",[]),s(this,"emitter",Ql()),s(this,"nextUserInteractionEvent"),s(this,"legacy_missingNodeRetryMap",{}),s(this,"cache",rr()),s(this,"imageMap",new Map),s(this,"canvasEventMap",new Map),s(this,"mirror",l()),s(this,"styleMirror",new ul),s(this,"mediaManager"),s(this,"firstFullSnapshot",null),s(this,"newDocumentQueue",[]),s(this,"mousePos",null),s(this,"touchActive",null),s(this,"lastMouseDownEvent",null),s(this,"lastHoveredRootNode"),s(this,"lastSelectionData",null),s(this,"constructedStyleMutations",[]),s(this,"adoptedStyleSheets",[]),s(this,"handleResize",e=>{this.iframe.style.display="inherit";for(const t of[this.mouseTail,this.iframe])t&&(t.setAttribute("width",String(e.width)),t.setAttribute("height",String(e.height)))}),s(this,"applyEventsSynchronously",e=>{for(const t of e){switch(t.type){case pl.DomContentLoaded:case pl.Load:case pl.Custom:continue;case pl.FullSnapshot:case pl.Meta:case pl.Plugin:case pl.IncrementalSnapshot:}this.getCastFn(t,!0)()}}),s(this,"getCastFn",(e,t=!1)=>{let s;switch(e.type){case pl.DomContentLoaded:case pl.Load:break;case pl.Custom:s=()=>{this.emitter.emit(yl.CustomEvent,e)};break;case pl.Meta:s=()=>this.emitter.emit(yl.Resize,{width:e.data.width,height:e.data.height});break;case pl.FullSnapshot:s=()=>{var s;if(this.firstFullSnapshot){if(this.firstFullSnapshot===e)return void(this.firstFullSnapshot=!0)}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(e,t),null==(s=this.iframe.contentWindow)||s.scrollTo(e.data.initialOffset)};break;case pl.IncrementalSnapshot:s=()=>{if(this.applyIncremental(e,t),!t&&(e===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const t of this.service.state.context.events)if(!(t.timestamp<=e.timestamp)&&this.isUserInteraction(t)){t.delay-e.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=t);break}if(this.nextUserInteractionEvent){const t=this.nextUserInteractionEvent.delay-e.delay,s={speed:Math.min(Math.round(t/5e3),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:s}),this.emitter.emit(yl.SkipStart,s)}}}}return()=>{s&&s();for(const s of this.config.plugins||[])s.handler&&s.handler(e,t,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:e}});const r=this.service.state.context.events.length-1;if(!this.config.liveMode&&e===this.service.state.context.events[r]){const t=()=>{r<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(yl.Finish))};let s=50;e.type===pl.IncrementalSnapshot&&e.data.source===dl.MouseMove&&e.data.positions.length&&(s+=Math.max(0,-e.data.positions[0].timeOffset)),setTimeout(t,s)}this.emitter.emit(yl.EventCast,e)}}),!(null==t?void 0:t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:1e4,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:ec,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(yl.Resize,this.handleResize),this.setupDom();for(const s of this.config.plugins||[])s.getMirror&&s.getMirror({nodeMirror:this.mirror});this.emitter.on(yl.Flush,()=>{if(this.usingVirtualDom){const s={mirror:this.mirror,applyCanvas:(e,t,s)=>{Jl({event:e,mutation:t,target:s,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(e,t)=>{e.source===dl.StyleSheetRule?this.applyStyleSheetRule(e,t):e.source===dl.StyleDeclaration&&this.applyStyleDeclaration(e,t)},afterAppend:(e,t)=>{for(const s of this.config.plugins||[])s.onBuild&&s.onBuild(e,{id:t,replayer:this})}};if(this.iframe.contentDocument)try{Ia(this.iframe.contentDocument,this.virtualDom,s,this.virtualDom.mirror)}catch(e){console.warn(e)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const e in this.legacy_missingNodeRetryMap)try{const t=this.legacy_missingNodeRetryMap[e],r=Ta(t.node,this.mirror,this.virtualDom.mirror);Ia(r,t.node,s,this.virtualDom.mirror),t.node=r}catch(t){this.warn(t)}this.constructedStyleMutations.forEach(e=>{this.applyStyleSheetMutation(e)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(e=>{this.applyAdoptedStyleSheet(e)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),!0===this.touchActive?this.mouse.classList.add("touch-active"):!1===this.touchActive&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[e,t]=this.lastMouseDownEvent;e.dispatchEvent(t)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(yl.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const i=new Al([],{speed:this.config.speed});this.service=Gl({events:e.map(e=>t&&t.unpackFn?t.unpackFn(e):e).sort((e,t)=>e.timestamp-t.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(e=>{this.emitter.emit(yl.StateChange,{player:e})}),this.speedService=jl(Ul({id:"speed",context:{normalSpeed:-1,timer:i},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(e,t)=>{"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:kl({normalSpeed:e=>e.timer.speed}),restoreSpeed:e=>{e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe(e=>{this.emitter.emit(yl.StateChange,{speed:e})}),this.mediaManager=new Hl({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const n=this.service.state.context.events.find(e=>e.type===pl.Meta),o=this.service.state.context.events.find(e=>e.type===pl.FullSnapshot);if(n){const{width:e,height:t}=n.data;setTimeout(()=>{this.emitter.emit(yl.Resize,{width:e,height:t})},0)}o&&setTimeout(()=>{var e;this.firstFullSnapshot||(this.firstFullSnapshot=o,this.rebuildFullSnapshot(o),null==(e=this.iframe.contentWindow)||e.scrollTo(o.data.initialOffset))},1),this.service.state.context.events.find(tc)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,s;this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null==(s=null==(t=this.iframe.contentDocument)?void 0:t.getElementsByTagName("html")[0])||s.classList.remove("rrweb-paused"),this.emitter.emit(yl.Start)}pause(e){var t,s;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null==(s=null==(t=this.iframe.contentDocument)?void 0:t.getElementsByTagName("html")[0])||s.classList.add("rrweb-paused"),this.emitter.emit(yl.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(yl.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(yl.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;tc(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=rr()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),!1!==this.config.mouseTail&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Nl(this.iframe.contentWindow,this.iframe.contentDocument),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)}(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const s=[],r=new Set,i=(t,i)=>{if("DIALOG"===t.nodeName&&r.add(t),this.collectIframeAndAttachDocument(s,t),this.mediaManager.isSupportedMediaElement(t)){const{events:s}=this.service.state.context;this.mediaManager.addMediaElements(t,e.timestamp-s[0].timestamp,this.mirror)}for(const e of this.config.plugins||[])e.onBuild&&e.onBuild(t,{id:i,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),ar(e.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror}),i(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:a,builtNode:l}of s)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(e=>e!==a);const{documentElement:n,head:o}=this.iframe.contentDocument;this.insertStyleRules(n,o),r.forEach(e=>Kl(e)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(yl.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var s;const r=(i=this.config.blockClass,[`.${i} { background: currentColor }`,"noscript { display: none !important; }"]).concat(this.config.insertStyleRules);var i;if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),r.length)if(this.usingVirtualDom){const s=this.virtualDom.createElement("style");this.virtualDom.mirror.add(s,Za(s,this.virtualDom.unserializedId)),e.insertBefore(s,t),s.rules.push({source:dl.StyleSheetRule,adds:r.map((e,t)=>({rule:e,index:t}))})}else{const i=document.createElement("style");e.insertBefore(i,t);for(let e=0;e<r.length;e++)null==(s=i.sheet)||s.insertRule(r[e],e)}}attachDocumentToIframe(e,t){const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,r=[],i=new Set,n=(e,n)=>{"DIALOG"===e.nodeName&&i.add(e),this.collectIframeAndAttachDocument(r,e);const o=s.getMeta(e);if((null==o?void 0:o.type)===wl.Element&&"HTML"===(null==o?void 0:o.tagName.toUpperCase())){const{documentElement:e,head:s}=t.contentDocument;this.insertStyleRules(e,s)}if(!this.usingVirtualDom)for(const t of this.config.plugins||[])t.onBuild&&t.onBuild(e,{id:n,replayer:this})};or(e.node,{doc:t.contentDocument,mirror:s,hackCss:!0,skipChild:!1,afterAppend:n,cache:this.cache}),n(t.contentDocument,e.node.id);for(const{mutationInQueue:o,builtNode:a}of r)this.attachDocumentToIframe(o,a),this.newDocumentQueue=this.newDocumentQueue.filter(e=>e!==o);i.forEach(e=>Kl(e))}collectIframeAndAttachDocument(e,t){if(ol(t,this.mirror)){const s=this.newDocumentQueue.find(e=>e.parentId===this.mirror.getId(t));s&&e.push({mutationInQueue:s,builtNode:t})}}waitForStylesheetLoad(){var e;const t=null==(e=this.iframe.contentDocument)?void 0:e.head;if(t){const e=new Set;let s,r=this.service.state;const i=()=>{r=this.service.state};this.emitter.on(yl.Start,i),this.emitter.on(yl.Pause,i);const n=()=>{this.emitter.off(yl.Start,i),this.emitter.off(yl.Pause,i)};t.querySelectorAll('link[rel="stylesheet"]').forEach(t=>{t.sheet||(e.add(t),t.addEventListener("load",()=>{e.delete(t),0===e.size&&-1!==s&&(r.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(yl.LoadStylesheetEnd),s&&clearTimeout(s),n())}))}),e.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(yl.LoadStylesheetStart),s=setTimeout(()=>{r.matches("playing")&&this.play(this.getCurrentTime()),s=-1,n()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const t of this.service.state.context.events)if(t.type===pl.IncrementalSnapshot&&t.data.source===dl.CanvasMutation){e.push(this.deserializeAndPreloadCanvasEvents(t.data,t));("commands"in t.data?t.data.commands:[t.data]).forEach(e=>{this.preloadImages(e,t)})}return Promise.all(e)}preloadImages(e,t){if("drawImage"===e.property&&"string"==typeof e.args[0]&&!this.imageMap.has(t)){const e=document.createElement("canvas"),t=e.getContext("2d"),s=null==t?void 0:t.createImageData(e.width,e.height);null==t||t.putImageData(s,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){const s={isUnchanged:!0};if("commands"in e){const r=await Promise.all(e.commands.map(async e=>{const t=await Promise.all(e.args.map(Yl(this.imageMap,null,s)));return{...e,args:t}}));!1===s.isUnchanged&&this.canvasEventMap.set(t,{...e,commands:r})}else{const r=await Promise.all(e.args.map(Yl(this.imageMap,null,s)));!1===s.isUnchanged&&this.canvasEventMap.set(t,{...e,args:r})}}}applyIncremental(e,t){var s,r,i;const{data:n}=e;switch(n.source){case dl.Mutation:try{this.applyMutation(n,t)}catch(o){this.warn(`Exception in mutation ${o.message||o}`,n)}break;case dl.Drag:case dl.TouchMove:case dl.MouseMove:if(t){const e=n.positions[n.positions.length-1];this.mousePos={x:e.x,y:e.y,id:e.id,debugData:n}}else n.positions.forEach(s=>{const r={doAction:()=>{this.moveAndHover(s.x,s.y,s.id,t,n)},delay:s.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(r)}),this.timer.addAction({doAction(){},delay:e.delay-(null==(s=n.positions[0])?void 0:s.timeOffset)});break;case dl.MouseInteraction:{if(-1===n.id)break;const e=new Event(fl[n.type].toLowerCase()),s=this.mirror.getNode(n.id);if(!s)return this.debugNodeNotFound(n,n.id);this.emitter.emit(yl.MouseInteraction,{type:n.type,target:s});const{triggerFocus:r}=this.config;switch(n.type){case fl.Blur:"blur"in s&&s.blur();break;case fl.Focus:r&&s.focus&&s.focus({preventScroll:!0});break;case fl.Click:case fl.TouchStart:case fl.TouchEnd:case fl.MouseDown:case fl.MouseUp:t?(n.type===fl.TouchStart?this.touchActive=!0:n.type===fl.TouchEnd&&(this.touchActive=!1),n.type===fl.MouseDown?this.lastMouseDownEvent=[s,e]:n.type===fl.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:n.x||0,y:n.y||0,id:n.id,debugData:n}):(n.type===fl.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(n.x||0,n.y||0,n.id,t,n),n.type===fl.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):n.type===fl.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):n.type===fl.TouchEnd?this.mouse.classList.remove("touch-active"):s.dispatchEvent(e));break;case fl.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:s.dispatchEvent(e)}break}case dl.Scroll:if(-1===n.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(n.id);if(!e)return this.debugNodeNotFound(n,n.id);e.scrollData=n;break}this.applyScroll(n,t);break;case dl.ViewportResize:this.emitter.emit(yl.Resize,{width:n.width,height:n.height});break;case dl.Input:if(-1===n.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(n.id);if(!e)return this.debugNodeNotFound(n,n.id);e.inputData=n;break}this.applyInput(n);break;case dl.MediaInteraction:{const t=this.usingVirtualDom?this.virtualDom.mirror.getNode(n.id):this.mirror.getNode(n.id);if(!t)return this.debugNodeNotFound(n,n.id);const s=t,{events:r}=this.service.state.context;this.mediaManager.mediaMutation({target:s,timeOffset:e.timestamp-r[0].timestamp,mutation:n});break}case dl.StyleSheetRule:case dl.StyleDeclaration:this.usingVirtualDom?n.styleId?this.constructedStyleMutations.push(n):n.id&&(null==(r=this.virtualDom.mirror.getNode(n.id))||r.rules.push(n)):this.applyStyleSheetMutation(n);break;case dl.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const t=this.virtualDom.mirror.getNode(n.id);if(!t)return this.debugNodeNotFound(n,n.id);t.canvasMutations.push({event:e,mutation:n})}else{const t=this.mirror.getNode(n.id);if(!t)return this.debugNodeNotFound(n,n.id);Jl({event:e,mutation:n,target:t,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break;case dl.Font:try{const e=new FontFace(n.family,n.buffer?new Uint8Array(JSON.parse(n.fontSource)):n.fontSource,n.descriptors);null==(i=this.iframe.contentDocument)||i.fonts.add(e)}catch(o){this.warn(o)}break;case dl.Selection:if(t){this.lastSelectionData=n;break}this.applySelection(n);break;case dl.AdoptedStyleSheet:this.usingVirtualDom?this.adoptedStyleSheets.push(n):this.applyAdoptedStyleSheet(n)}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,Wa(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const l in this.legacy_missingNodeRetryMap)try{const e=this.legacy_missingNodeRetryMap[l],t=za(e.node,this.virtualDom,this.mirror);t&&(e.node=t)}catch(a){this.warn(a)}const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(t=>!!s.getNode(t.id)||(this.warnNodeNotFound(e,t.id),!1)),e.removes.forEach(t=>{var r;const i=s.getNode(t.id);if(!i)return;let n=s.getNode(t.parentId);if(!n)return this.warnNodeNotFound(e,t.parentId);if(t.isShadow&&ll(n)&&(n=n.shadowRoot),s.removeNodeFromMap(i),n)try{n.removeChild(i),this.usingVirtualDom&&"#text"===i.nodeName&&"STYLE"===n.nodeName&&(null==(r=n.rules)?void 0:r.length)>0&&(n.rules=[])}catch(a){if(!(a instanceof DOMException))throw a;this.warn("parent could not remove child in mutation",n,i,e)}});const r={...this.legacy_missingNodeRetryMap},i=[],n=e=>{var t,n;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let o=s.getNode(e.parentId);if(!o)return e.node.type===wl.Document?this.newDocumentQueue.push(e):i.push(e);e.node.isShadow&&(ll(o)||o.attachShadow({mode:"open"}),o=o.shadowRoot);let a=null,l=null;if(e.previousId&&(a=s.getNode(e.previousId)),e.nextId&&(l=s.getNode(e.nextId)),(e=>{let t=null;return e.nextId&&(t=s.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t})(e))return i.push(e);if(e.node.rootId&&!s.getNode(e.node.rootId))return;const c=e.node.rootId?s.getNode(e.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(ol(o,s))return void this.attachDocumentToIframe(e,o);const h=(e,t)=>{if(!this.usingVirtualDom){Kl(e);for(const s of this.config.plugins||[])s.onBuild&&s.onBuild(e,{id:t,replayer:this})}},u=or(e.node,{doc:c,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:h});if(-1===e.previousId||-1===e.nextId)return void(r[e.node.id]={node:u,mutation:e});const p=s.getMeta(o);if(p&&p.type===wl.Element&&e.node.type===wl.Text){const e=Array.isArray(o.childNodes)?o.childNodes:Array.from(o.childNodes);if("textarea"===p.tagName)for(const t of e)t.nodeType===o.TEXT_NODE&&o.removeChild(t);else if("style"===p.tagName&&1===e.length)for(const t of e)t.nodeType!==o.TEXT_NODE||s.hasNode(t)||(u.textContent=t.textContent,o.removeChild(t))}else if((null==p?void 0:p.type)===wl.Document){const s=o;e.node.type===wl.DocumentType&&(null==(t=s.childNodes[0])?void 0:t.nodeType)===Node.DOCUMENT_TYPE_NODE&&s.removeChild(s.childNodes[0]),"HTML"===u.nodeName&&s.documentElement&&s.removeChild(s.documentElement)}if(a&&a.nextSibling&&a.nextSibling.parentNode?o.insertBefore(u,a.nextSibling):l&&l.parentNode?o.contains(l)?o.insertBefore(u,l):o.insertBefore(u,null):o.appendChild(u),h(u,e.node.id),this.usingVirtualDom&&"#text"===u.nodeName&&"STYLE"===o.nodeName&&(null==(n=o.rules)?void 0:n.length)>0&&(o.rules=[]),ol(u,this.mirror)){const e=this.mirror.getId(u),t=this.newDocumentQueue.find(t=>t.parentId===e);t&&(this.attachDocumentToIframe(t,u),this.newDocumentQueue=this.newDocumentQueue.filter(e=>e!==t))}(e.previousId||e.nextId)&&this.legacy_resolveMissingNode(r,o,u,e)};e.adds.forEach(e=>{n(e)});const o=Date.now();for(;i.length;){const e=il(i);if(i.length=0,Date.now()-o>500){this.warn("Timeout in the loop, please check the resolve tree data:",e);break}for(const t of e){s.getNode(t.value.parentId)?nl(t,e=>{n(e)}):this.debug("Drop resolve tree since there is no parent for the root node.",t)}}Object.keys(r).length&&Object.assign(this.legacy_missingNodeRetryMap,r),function(e){const t=new Set,s=[];for(let r=e.length;r--;){const i=e[r];t.has(i.id)||(s.push(i),t.add(i.id))}return s}(e.texts).forEach(t=>{var r;const i=s.getNode(t.id);if(!i){if(e.removes.find(e=>e.id===t.id))return;return this.warnNodeNotFound(e,t.id)}const n=i.parentElement;if(t.value&&n&&"STYLE"===n.tagName?i.textContent=sr(t.value,this.cache):i.textContent=t.value,this.usingVirtualDom){const e=i.parentNode;(null==(r=null==e?void 0:e.rules)?void 0:r.length)>0&&(e.rules=[])}}),e.attributes.forEach(t=>{var r;const i=s.getNode(t.id);if(!i){if(e.removes.find(e=>e.id===t.id))return;return this.warnNodeNotFound(e,t.id)}for(const e in t.attributes)if("string"==typeof e){const o=t.attributes[e];if(null===o)i.removeAttribute(e),"open"===e&&$l(i,t);else if("string"==typeof o)try{if("_cssText"===e&&("LINK"===i.nodeName||"STYLE"===i.nodeName))try{const e=s.getMeta(i),r=or({...e,attributes:{...e.attributes,...t.attributes}},{doc:i.ownerDocument,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(e.attributes,t.attributes);const n=i.nextSibling,o=i.parentNode;if(r&&o){o.removeChild(i),o.insertBefore(r,n),s.replace(t.id,r);break}}catch(n){}if("value"===e&&"TEXTAREA"===i.nodeName){const e=i;e.childNodes.forEach(t=>e.removeChild(t));const t=null==(r=i.ownerDocument)?void 0:r.createTextNode(o);t&&e.appendChild(t)}else i.setAttribute(e,o);"rr_open_mode"===e&&"DIALOG"===i.nodeName&&Kl(i,t)}catch(a){this.warn("An error occurred may due to the checkout feature.",a)}else if("style"===e){const e=o,t=i;for(const s in e)if(!1===e[s])t.style.removeProperty(s);else if(e[s]instanceof Array){const r=e[s];t.style.setProperty(s,r[0],r[1])}else{const r=e[s];t.style.setProperty(s,r)}}}})}applyScroll(e,t){var s,r;const i=this.mirror.getNode(e.id);if(!i)return this.debugNodeNotFound(e,e.id);const n=this.mirror.getMeta(i);if(i===this.iframe.contentDocument)null==(s=this.iframe.contentWindow)||s.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((null==n?void 0:n.type)===wl.Document)null==(r=i.defaultView)||r.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(o){}}applyInput(e){const t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(s){}}applySelection(e){try{const t=new Set,s=e.ranges.map(({start:e,startOffset:s,end:r,endOffset:i})=>{const n=this.mirror.getNode(e),o=this.mirror.getNode(r);if(!n||!o)return;const a=new Range;a.setStart(n,s),a.setEnd(o,i);const l=n.ownerDocument,c=null==l?void 0:l.getSelection();return c&&t.add(c),{range:a,selection:c}});t.forEach(e=>e.removeAllRanges()),s.forEach(e=>{var t;return e&&(null==(t=e.selection)?void 0:t.addRange(e.range))})}catch(t){}}applyStyleSheetMutation(e){var t;let s=null;e.styleId?s=this.styleMirror.getStyle(e.styleId):e.id&&(s=(null==(t=this.mirror.getNode(e.id))?void 0:t.sheet)||null),s&&(e.source===dl.StyleSheetRule?this.applyStyleSheetRule(e,s):e.source===dl.StyleDeclaration&&this.applyStyleDeclaration(e,s))}applyStyleSheetRule(e,t){var s,r,i,n;if(null==(s=e.adds)||s.forEach(({rule:e,index:s})=>{try{if(Array.isArray(s)){const{positions:r,index:i}=hl(s);cl(t.cssRules,r).insertRule(e,i)}else{const r=void 0===s?void 0:Math.min(s,t.cssRules.length);null==t||t.insertRule(e,r)}}catch(r){}}),null==(r=e.removes)||r.forEach(({index:e})=>{try{if(Array.isArray(e)){const{positions:s,index:r}=hl(e);cl(t.cssRules,s).deleteRule(r||0)}else null==t||t.deleteRule(e)}catch(s){}}),e.replace)try{null==(i=t.replace)||i.call(t,e.replace)}catch(o){}if(e.replaceSync)try{null==(n=t.replaceSync)||n.call(t,e.replaceSync)}catch(o){}}applyStyleDeclaration(e,t){if(e.set){cl(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority)}if(e.remove){cl(t.rules,e.index).style.removeProperty(e.remove.property)}}applyAdoptedStyleSheet(e){var t;const s=this.mirror.getNode(e.id);if(!s)return;null==(t=e.styles)||t.forEach(e=>{var t;let r=null,i=null;if(ll(s)?i=(null==(t=s.ownerDocument)?void 0:t.defaultView)||null:"#document"===s.nodeName&&(i=s.defaultView),i)try{r=new i.CSSStyleSheet,this.styleMirror.add(r,e.styleId),this.applyStyleSheetRule({source:dl.StyleSheetRule,adds:e.rules},r)}catch(n){}});let r=0;const i=(e,t)=>{const s=t.map(e=>this.styleMirror.getStyle(e)).filter(e=>null!==e);ll(e)?e.shadowRoot.adoptedStyleSheets=s:"#document"===e.nodeName&&(e.adoptedStyleSheets=s),s.length!==t.length&&r<10&&(setTimeout(()=>i(e,t),0+100*r),r++)};i(s,e.styleIds)}legacy_resolveMissingNode(e,t,s,r){const{previousId:i,nextId:n}=r,o=i&&e[i],a=n&&e[n];if(o){const{node:r,mutation:i}=o;t.insertBefore(r,s),delete e[i.node.id],delete this.legacy_missingNodeRetryMap[i.node.id],(i.previousId||i.nextId)&&this.legacy_resolveMissingNode(e,t,r,i)}if(a){const{node:r,mutation:i}=a;t.insertBefore(r,s.nextSibling),delete e[i.node.id],delete this.legacy_missingNodeRetryMap[i.node.id],(i.previousId||i.nextId)&&this.legacy_resolveMissingNode(e,t,r,i)}}moveAndHover(e,t,s,r,i){const n=this.mirror.getNode(s);if(!n)return this.debugNodeNotFound(i,s);const o=al(n,this.iframe),a=e*o.absoluteScale+o.x,l=t*o.absoluteScale+o.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${l}px`,r||this.drawMouseTail({x:a,y:l}),this.hoverElements(n)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:s,strokeStyle:r,duration:i}=!0===this.config.mouseTail?ec:Object.assign({},ec,this.config.mouseTail),n=()=>{if(!this.mouseTail)return;const e=this.mouseTail.getContext("2d");e&&this.tailPositions.length&&(e.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),e.beginPath(),e.lineWidth=s,e.lineCap=t,e.strokeStyle=r,e.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(t=>e.lineTo(t.x,t.y)),e.stroke())};this.tailPositions.push(e),n(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(t=>t!==e),n()},i/this.speedService.state.context.timer.speed)}hoverElements(e){var t;null==(t=this.lastHoveredRootNode||this.iframe.contentDocument)||t.querySelectorAll(".\\:hover").forEach(e=>{e.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let s=e;for(;s;)s.classList&&s.classList.add(":hover"),s=s.parentElement}isUserInteraction(e){return e.type===pl.IncrementalSnapshot&&(e.data.source>dl.Mutation&&e.data.source<=dl.Input)}backToNormal(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(yl.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(ql,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(ql,...e)}};
package/dist/vue.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@pokedemo/player"),t=require("vue");function r(e){return e instanceof Error?e:"string"==typeof e&&e?new Error(e):new Error("PokePlayer Vue failed")}const n=t.defineComponent({name:"PokePlayer",inheritAttrs:!0,props:{baseUrl:{type:String,required:!0},fetch:{type:Function,required:!1},autoplay:{type:Boolean,default:!1},injectCss:{type:Boolean,required:!1}},emits:["ready","error","start","pause","finish","step-change"],setup(n,{attrs:o,emit:a}){const s=t.ref(null),u=t.shallowRef(null),l=t.ref(!1);let c=[];function i(){const e=u.value;if(e){for(const e of c)e();c=[],e.destroy(),u.value=null}}function p(){const t=s.value;if(t){i();try{const s=new e.PokePlayer(t,function(){const e={source:{baseUrl:n.baseUrl}};return n.fetch&&(e.network={fetch:n.fetch}),void 0!==n.injectCss&&(e.ui={injectCss:n.injectCss}),e}());u.value=s,c=[(o=s).on("ready",()=>{a("ready"),n.autoplay&&u.value?.start().catch(e=>{a("error",r(e))})}),o.on("error",e=>{a("error",e)}),o.on("start",()=>{a("start")}),o.on("pause",(e,t)=>{a("pause",{stepIndex:e,step:t})}),o.on("finish",()=>{a("finish")}),o.on("stepChange",(e,t)=>{a("step-change",{stepIndex:e,step:t})})]}catch(l){a("error",r(l))}var o}}return t.onMounted(()=>{l.value=!0,p()}),t.onUnmounted(()=>{l.value=!1,i()}),t.watch(()=>[n.baseUrl,n.fetch,n.injectCss],()=>{l.value&&p()}),t.watch(()=>n.autoplay,e=>{e&&u.value?.start().catch(e=>{a("error",r(e))})}),()=>t.h("div",{...o,ref:e=>{s.value=e}})}});exports.PokePlayer=n,exports.createPokePlayerPlugin=function(e={}){const t=e.componentName?.trim()||"PokePlayer";return{install(e){e.component(t,n)}}};
package/dist/vue.d.ts ADDED
@@ -0,0 +1,75 @@
1
+ import * as vue from 'vue';
2
+ import { PropType, Plugin } from 'vue';
3
+ import { StepTimeBounds } from '@pokedemo/player';
4
+
5
+ type PokePlayerFetch = typeof globalThis.fetch;
6
+ type PokePlayerProps = {
7
+ baseUrl: string;
8
+ fetch?: PokePlayerFetch;
9
+ autoplay?: boolean;
10
+ injectCss?: boolean;
11
+ };
12
+ type PokePlayerReadyPayload = void;
13
+ type PokePlayerPausePayload = {
14
+ stepIndex: number;
15
+ step: StepTimeBounds;
16
+ };
17
+ type PokePlayerStepChangePayload = {
18
+ stepIndex: number;
19
+ step: StepTimeBounds | null;
20
+ };
21
+ type PokePlayerPluginOptions = {
22
+ componentName?: string;
23
+ };
24
+
25
+ declare const PokePlayer: vue.DefineComponent<vue.ExtractPropTypes<{
26
+ baseUrl: {
27
+ type: StringConstructor;
28
+ required: true;
29
+ };
30
+ fetch: {
31
+ type: PropType<PokePlayerFetch>;
32
+ required: false;
33
+ };
34
+ autoplay: {
35
+ type: BooleanConstructor;
36
+ default: boolean;
37
+ };
38
+ injectCss: {
39
+ type: PropType<boolean | undefined>;
40
+ required: false;
41
+ };
42
+ }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
43
+ [key: string]: any;
44
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("ready" | "error" | "start" | "pause" | "finish" | "step-change")[], "ready" | "error" | "start" | "pause" | "finish" | "step-change", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
45
+ baseUrl: {
46
+ type: StringConstructor;
47
+ required: true;
48
+ };
49
+ fetch: {
50
+ type: PropType<PokePlayerFetch>;
51
+ required: false;
52
+ };
53
+ autoplay: {
54
+ type: BooleanConstructor;
55
+ default: boolean;
56
+ };
57
+ injectCss: {
58
+ type: PropType<boolean | undefined>;
59
+ required: false;
60
+ };
61
+ }>> & Readonly<{
62
+ onReady?: ((...args: any[]) => any) | undefined;
63
+ onError?: ((...args: any[]) => any) | undefined;
64
+ onStart?: ((...args: any[]) => any) | undefined;
65
+ onPause?: ((...args: any[]) => any) | undefined;
66
+ onFinish?: ((...args: any[]) => any) | undefined;
67
+ "onStep-change"?: ((...args: any[]) => any) | undefined;
68
+ }>, {
69
+ autoplay: boolean;
70
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
71
+
72
+ declare function createPokePlayerPlugin(options?: PokePlayerPluginOptions): Plugin;
73
+
74
+ export { PokePlayer, createPokePlayerPlugin };
75
+ export type { PokePlayerFetch, PokePlayerPausePayload, PokePlayerPluginOptions, PokePlayerProps, PokePlayerReadyPayload, PokePlayerStepChangePayload };
package/dist/vue.js ADDED
@@ -0,0 +1 @@
1
+ import{PokePlayer as e}from"@pokedemo/player";import{defineComponent as t,ref as r,shallowRef as n,onMounted as o,onUnmounted as a,watch as s,h as u}from"vue";function i(e){return e instanceof Error?e:"string"==typeof e&&e?new Error(e):new Error("PokePlayer Vue failed")}const c=t({name:"PokePlayer",inheritAttrs:!0,props:{baseUrl:{type:String,required:!0},fetch:{type:Function,required:!1},autoplay:{type:Boolean,default:!1},injectCss:{type:Boolean,required:!1}},emits:["ready","error","start","pause","finish","step-change"],setup(t,{attrs:c,emit:l}){const p=r(null),f=n(null),y=r(!1);let h=[];function d(){const e=f.value;if(e){for(const e of h)e();h=[],e.destroy(),f.value=null}}function v(){const r=p.value;if(r){d();try{const n=new e(r,function(){const e={source:{baseUrl:t.baseUrl}};return t.fetch&&(e.network={fetch:t.fetch}),void 0!==t.injectCss&&(e.ui={injectCss:t.injectCss}),e}());f.value=n,function(e){h=[e.on("ready",()=>{l("ready"),t.autoplay&&f.value?.start().catch(e=>{l("error",i(e))})}),e.on("error",e=>{l("error",e)}),e.on("start",()=>{l("start")}),e.on("pause",(e,t)=>{l("pause",{stepIndex:e,step:t})}),e.on("finish",()=>{l("finish")}),e.on("stepChange",(e,t)=>{l("step-change",{stepIndex:e,step:t})})]}(n)}catch(n){l("error",i(n))}}}return o(()=>{y.value=!0,v()}),a(()=>{y.value=!1,d()}),s(()=>[t.baseUrl,t.fetch,t.injectCss],()=>{y.value&&v()}),s(()=>t.autoplay,e=>{e&&f.value?.start().catch(e=>{l("error",i(e))})}),()=>u("div",{...c,ref:e=>{p.value=e}})}});function l(e={}){const t=e.componentName?.trim()||"PokePlayer";return{install(e){e.component(t,c)}}}export{c as PokePlayer,l as createPokePlayerPlugin};