@sailfish-rrweb/replay 0.5.6 → 0.5.7
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.
- package/dist/replay.cjs +42 -42
- package/dist/replay.cjs.map +1 -1
- package/dist/replay.js +2679 -2639
- package/dist/replay.js.br +0 -0
- package/dist/replay.js.gz +0 -0
- package/dist/replay.js.map +1 -1
- package/dist/replay.umd.cjs +42 -42
- package/dist/replay.umd.cjs.map +1 -1
- package/dist/replay.umd.min.cjs +25 -25
- package/dist/replay.umd.min.cjs.map +3 -3
- package/dist/replay.umd.umd.cjs +25 -25
- package/dist/replay.umd.umd.cjs.map +3 -3
- package/dist/replay.umd.umd.min.cjs +25 -25
- package/dist/replay.umd.umd.min.cjs.map +3 -3
- package/package.json +4 -4
package/dist/replay.cjs
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
2
|
-
`+g+
|
|
3
|
-
`+v+
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Bn=Object.defineProperty,Un=(t,e,s)=>e in t?Bn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,b=(t,e,s)=>Un(t,typeof e!="symbol"?e+"":e,s),Wn=Object.defineProperty,jn=(t,e,s)=>e in t?Wn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Gs=(t,e,s)=>jn(t,typeof e!="symbol"?e+"":e,s),R=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(R||{});function Vn(t){return t.nodeType===t.ELEMENT_NODE}let Hr=class{constructor(){Gs(this,"idNodeMap",new Map),Gs(this,"nodeMetaMap",new WeakMap)}getId(t){var e;return t?((e=this.getMeta(t))==null?void 0:e.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(s=>this.removeNodeFromMap(s))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){const s=e.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,e)}replace(t,e){const s=this.getNode(t);if(s){const r=this.nodeMetaMap.get(s);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Jr(){return new Hr}function zn(t){return t.toLowerCase()}function Yn(t,e){return!t||!e||t.type!==e.type?!1:t.type===R.Document?t.compatMode===e.compatMode:t.type===R.DocumentType?t.name===e.name&&t.publicId===e.publicId&&t.systemId===e.systemId:t.type===R.Comment||t.type===R.Text||t.type===R.CDATA?t.textContent===e.textContent:t.type===R.Element?t.tagName===e.tagName&&JSON.stringify(t.attributes)===JSON.stringify(e.attributes)&&t.isSVG===e.isSVG&&t.needBlock===e.needBlock:!1}function Gn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Zn(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var s=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};s.prototype=e.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),s}var ys={exports:{}},x=String,$r=function(){return{isColorSupported:!1,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x,blackBright:x,redBright:x,greenBright:x,yellowBright:x,blueBright:x,magentaBright:x,cyanBright:x,whiteBright:x,bgBlackBright:x,bgRedBright:x,bgGreenBright:x,bgYellowBright:x,bgBlueBright:x,bgMagentaBright:x,bgCyanBright:x,bgWhiteBright:x}};ys.exports=$r();ys.exports.createColors=$r;var Xn=ys.exports;const Hn={},Jn=Object.freeze(Object.defineProperty({__proto__:null,default:Hn},Symbol.toStringTag,{value:"Module"})),j=Zn(Jn);let Zs=Xn,Xs=j,Bt=class Qr extends Error{constructor(e,s,r,i,o,a){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),typeof s<"u"&&typeof r<"u"&&(typeof s=="number"?(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,Qr)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let s=this.source;e==null&&(e=Zs.isColorSupported);let r=u=>u,i=u=>u,o=u=>u;if(e){let{bold:u,gray:h,red:p}=Zs.createColors(!0);i=m=>u(p(m)),r=m=>h(m),Xs&&(o=m=>Xs(m))}let a=s.split(/\r?\n/),n=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),l=String(c).length;return a.slice(n,c).map((u,h)=>{let p=n+1+h,m=" "+(" "+p).slice(-l)+" | ";if(p===this.line){if(u.length>160){let d=20,S=Math.max(0,this.column-d),f=Math.max(this.column+d,this.endColumn+d),w=u.slice(S,f),g=r(m.replace(/\d/g," "))+u.slice(0,Math.min(this.column-1,d-1)).replace(/[^\t]/g," ");return i(">")+r(m)+o(w)+`
|
|
2
|
+
`+g+i("^")}let v=r(m.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+r(m)+o(u)+`
|
|
3
|
+
`+v+i("^")}return" "+r(m)+o(u)}).join(`
|
|
4
4
|
`)}toString(){let e=this.showSourceCode();return e&&(e=`
|
|
5
5
|
|
|
6
6
|
`+e+`
|
|
7
|
-
`),this.name+": "+this.message+e}};var ws=Bt;Bt.default=Bt;const
|
|
7
|
+
`),this.name+": "+this.message+e}};var ws=Bt;Bt.default=Bt;const Hs={after:`
|
|
8
8
|
`,beforeClose:`
|
|
9
9
|
`,beforeComment:`
|
|
10
10
|
`,beforeDecl:`
|
|
11
11
|
`,beforeOpen:" ",beforeRule:`
|
|
12
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function
|
|
13
|
-
`)){let
|
|
14
|
-
`)&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawBeforeComment(t,e){let s;return t.walkComments(
|
|
15
|
-
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(e,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(t,e){let s;return t.walkDecls(
|
|
12
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function $n(t){return t[0].toUpperCase()+t.slice(1)}let Ut=class{constructor(t){this.builder=t}atrule(t,e){let s="@"+t.name,r=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?s+=t.raws.afterName:r&&(s+=" "),t.nodes)this.block(t,s+r);else{let i=(t.raws.between||"")+(e?";":"");this.builder(s+r+i,t)}}beforeAfter(t,e){let s;t.type==="decl"?s=this.raw(t,null,"beforeDecl"):t.type==="comment"?s=this.raw(t,null,"beforeComment"):e==="before"?s=this.raw(t,null,"beforeRule"):s=this.raw(t,null,"beforeClose");let r=t.parent,i=0;for(;r&&r.type!=="root";)i+=1,r=r.parent;if(s.includes(`
|
|
13
|
+
`)){let o=this.raw(t,null,"indent");if(o.length)for(let a=0;a<i;a++)s+=o}return s}block(t,e){let s=this.raw(t,"between","beforeOpen");this.builder(e+s+"{",t,"start");let r;t.nodes&&t.nodes.length?(this.body(t),r=this.raw(t,"after")):r=this.raw(t,"after","emptyBody"),r&&this.builder(r),this.builder("}",t,"end")}body(t){let e=t.nodes.length-1;for(;e>0&&t.nodes[e].type==="comment";)e-=1;let s=this.raw(t,"semicolon");for(let r=0;r<t.nodes.length;r++){let i=t.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,e!==r||s)}}comment(t){let e=this.raw(t,"left","commentLeft"),s=this.raw(t,"right","commentRight");this.builder("/*"+e+t.text+s+"*/",t)}decl(t,e){let s=this.raw(t,"between","colon"),r=t.prop+s+this.rawValue(t,"value");t.important&&(r+=t.raws.important||" !important"),e&&(r+=";"),this.builder(r,t)}document(t){this.body(t)}raw(t,e,s){let r;if(s||(s=e),e&&(r=t.raws[e],typeof r<"u"))return r;let i=t.parent;if(s==="before"&&(!i||i.type==="root"&&i.first===t||i&&i.type==="document"))return"";if(!i)return Hs[s];let o=t.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[s]<"u")return o.rawCache[s];if(s==="before"||s==="after")return this.beforeAfter(t,s);{let a="raw"+$n(s);this[a]?r=this[a](o,t):o.walk(n=>{if(r=n.raws[e],typeof r<"u")return!1})}return typeof r>"u"&&(r=Hs[s]),o.rawCache[s]=r,r}rawBeforeClose(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length>0&&typeof s.raws.after<"u")return e=s.raws.after,e.includes(`
|
|
14
|
+
`)&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawBeforeComment(t,e){let s;return t.walkComments(r=>{if(typeof r.raws.before<"u")return s=r.raws.before,s.includes(`
|
|
15
|
+
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(e,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(t,e){let s;return t.walkDecls(r=>{if(typeof r.raws.before<"u")return s=r.raws.before,s.includes(`
|
|
16
16
|
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(e,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(t){let e;return t.walk(s=>{if(s.type!=="decl"&&(e=s.raws.between,typeof e<"u"))return!1}),e}rawBeforeRule(t){let e;return t.walk(s=>{if(s.nodes&&(s.parent!==t||t.first!==s)&&typeof s.raws.before<"u")return e=s.raws.before,e.includes(`
|
|
17
|
-
`)&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawColon(t){let e;return t.walkDecls(s=>{if(typeof s.raws.between<"u")return e=s.raws.between.replace(/[^\s:]/g,""),!1}),e}rawEmptyBody(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length===0&&(e=s.raws.after,typeof e<"u"))return!1}),e}rawIndent(t){if(t.raws.indent)return t.raws.indent;let e;return t.walk(s=>{let
|
|
18
|
-
`);return e=
|
|
19
|
-
`?(s=1,
|
|
20
|
-
`?(e=1,s+=1):e+=1;return{column:e,line:s}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let e={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:e.column+1,line:e.line};if(t.word){let i="document"in this.source.input?this.source.input.document:this.source.input.css,n=i.slice(he(i,this.source.start),he(i,this.source.end)).indexOf(t.word);n!==-1&&(e=this.positionInside(n),s=this.positionInside(n+t.word.length))}else t.start?e={column:t.start.column,line:t.start.line}:t.index&&(e=this.positionInside(t.index)),t.end?s={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?s=this.positionInside(t.endIndex):t.index&&(s=this.positionInside(t.index+1));return(s.line<e.line||s.line===e.line&&s.column<=e.column)&&(s={column:e.column+1,line:e.line}),{end:s,start:e}}raw(t,e){return new Ko().raw(this,t,e)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let e=this,s=!1;for(let i of t)i===this?s=!0:s?(this.parent.insertAfter(e,i),e=i):this.parent.insertBefore(e,i);s||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,e){let s={},i=e==null;e=e||new Map;let n=0;for(let r in this){if(!Object.prototype.hasOwnProperty.call(this,r)||r==="parent"||r==="proxyCache")continue;let a=this[r];if(Array.isArray(a))s[r]=a.map(o=>typeof o=="object"&&o.toJSON?o.toJSON(null,e):o);else if(typeof a=="object"&&a.toJSON)s[r]=a.toJSON(null,e);else if(r==="source"){let o=e.get(a.input);o==null&&(o=n,e.set(a.input,n),n++),s[r]={end:a.end,inputId:o,start:a.start}}else s[r]=a}return i&&(s.inputs=[...e.keys()].map(r=>r.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=qo){t.stringify&&(t=t.stringify);let e="";return t(this,s=>{e+=s}),e}warn(t,e,s){let i={node:this};for(let n in s)i[n]=s[n];return t.warn(e,i)}};var mt=Vt;Vt.default=Vt;let tr=mt,zt=class extends tr{constructor(t){super(t),this.type="comment"}};var gt=zt;zt.default=zt;let sr=mt,Yt=class extends sr{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}};var yt=Yt;Yt.default=Yt;let Qi=gt,Ki=yt,ir=mt,{isClean:qi,my:en}=Re,bs,tn,sn,vs;function nn(t){return t.map(e=>(e.nodes&&(e.nodes=nn(e.nodes)),delete e.source,e))}function on(t){if(t[qi]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)on(e)}let X=class rn extends ir{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]}append(...e){for(let s of e){let i=this.normalize(s,this.last);for(let n of i)this.proxyOf.nodes.push(n)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let s=this.getIterator(),i,n;for(;this.indexes[s]<this.proxyOf.nodes.length&&(i=this.indexes[s],n=e(this.proxyOf.nodes[i],i),n!==!1);)this.indexes[s]+=1;return delete this.indexes[s],n}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,s){return s==="proxyOf"?e:e[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?(...i)=>e[s](...i.map(n=>typeof n=="function"?(r,a)=>n(r.toProxy(),a):n)):s==="every"||s==="some"?i=>e[s]((n,...r)=>i(n.toProxy(),...r)):s==="root"?()=>e.root().toProxy():s==="nodes"?e.nodes.map(i=>i.toProxy()):s==="first"||s==="last"?e[s].toProxy():e[s]:e[s]},set(e,s,i){return e[s]===i||(e[s]=i,(s==="name"||s==="params"||s==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,s){let i=this.index(e),n=this.normalize(s,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(let a of n)this.proxyOf.nodes.splice(i+1,0,a);let r;for(let a in this.indexes)r=this.indexes[a],i<r&&(this.indexes[a]=r+n.length);return this.markDirty(),this}insertBefore(e,s){let i=this.index(e),n=i===0?"prepend":!1,r=this.normalize(s,this.proxyOf.nodes[i],n).reverse();i=this.index(e);for(let o of r)this.proxyOf.nodes.splice(i,0,o);let a;for(let o in this.indexes)a=this.indexes[o],i<=a&&(this.indexes[o]=a+r.length);return this.markDirty(),this}normalize(e,s){if(typeof e=="string")e=nn(tn(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Ki(e)]}else if(e.selector||e.selectors)e=[new vs(e)];else if(e.name)e=[new bs(e)];else if(e.text)e=[new Qi(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[en]||rn.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[qi]&&on(i),i.raws||(i.raws={}),typeof i.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(i.raws.before=s.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let s of e){let i=this.normalize(s,this.first,"prepend").reverse();for(let n of i)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+i.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){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let s;for(let i in this.indexes)s=this.indexes[i],s>=e&&(this.indexes[i]=s-1);return this.markDirty(),this}replaceValues(e,s,i){return i||(i=s,s={}),this.walkDecls(n=>{s.props&&!s.props.includes(n.prop)||s.fast&&!n.value.includes(s.fast)||(n.value=n.value.replace(e,i))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((s,i)=>{let n;try{n=e(s,i)}catch(r){throw s.addToError(r)}return n!==!1&&s.walk&&(n=s.walk(e)),n})}walkAtRules(e,s){return s?e instanceof RegExp?this.walk((i,n)=>{if(i.type==="atrule"&&e.test(i.name))return s(i,n)}):this.walk((i,n)=>{if(i.type==="atrule"&&i.name===e)return s(i,n)}):(s=e,this.walk((i,n)=>{if(i.type==="atrule")return s(i,n)}))}walkComments(e){return this.walk((s,i)=>{if(s.type==="comment")return e(s,i)})}walkDecls(e,s){return s?e instanceof RegExp?this.walk((i,n)=>{if(i.type==="decl"&&e.test(i.prop))return s(i,n)}):this.walk((i,n)=>{if(i.type==="decl"&&i.prop===e)return s(i,n)}):(s=e,this.walk((i,n)=>{if(i.type==="decl")return s(i,n)}))}walkRules(e,s){return s?e instanceof RegExp?this.walk((i,n)=>{if(i.type==="rule"&&e.test(i.selector))return s(i,n)}):this.walk((i,n)=>{if(i.type==="rule"&&i.selector===e)return s(i,n)}):(s=e,this.walk((i,n)=>{if(i.type==="rule")return s(i,n)}))}};X.registerParse=t=>{tn=t};X.registerRule=t=>{vs=t};X.registerAtRule=t=>{bs=t};X.registerRoot=t=>{sn=t};var Q=X;X.default=X;X.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,bs.prototype):t.type==="rule"?Object.setPrototypeOf(t,vs.prototype):t.type==="decl"?Object.setPrototypeOf(t,Ki.prototype):t.type==="comment"?Object.setPrototypeOf(t,Qi.prototype):t.type==="root"&&Object.setPrototypeOf(t,sn.prototype),t[en]=!0,t.nodes&&t.nodes.forEach(e=>{X.rebuild(e)})};let an=Q,st=class extends an{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var Ss=st;st.default=st;an.registerAtRule(st);let nr=Q,ln,cn,xe=class extends nr{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new ln(new cn,this,t).stringify()}};xe.registerLazyResult=t=>{ln=t};xe.registerProcessor=t=>{cn=t};var xs=xe;xe.default=xe;let or="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",rr=(t=21)=>{let e="",s=t|0;for(;s--;)e+=or[Math.random()*64|0];return e};var ar={nanoid:rr};let{existsSync:lr,readFileSync:cr}=j,{dirname:Tt,join:ur}=j,{SourceMapConsumer:Js,SourceMapGenerator:Hs}=j;function hr(t){return Buffer?Buffer.from(t,"base64").toString():window.atob(t)}let Gt=class{constructor(t,e){if(e.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let s=e.map?e.map.prev:void 0,i=this.loadMap(e.from,s);!this.mapFile&&e.from&&(this.mapFile=e.from),this.mapFile&&(this.root=Tt(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Js(this.text)),this.consumerCache}decodeInline(t){let e=/^data:application\/json;charset=utf-?8;base64,/,s=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/,r=t.match(i)||t.match(n);if(r)return decodeURIComponent(t.substr(r[0].length));let a=t.match(e)||t.match(s);if(a)return hr(t.substr(a[0].length));let o=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let e=t.match(/\/\*\s*# sourceMappingURL=/g);if(!e)return;let s=t.lastIndexOf(e.pop()),i=t.indexOf("*/",s);s>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(s,i)))}loadFile(t){if(this.root=Tt(t),lr(t))return this.mapFile=t,cr(t,"utf-8").toString().trim()}loadMap(t,e){if(e===!1)return!1;if(e){if(typeof e=="string")return e;if(typeof e=="function"){let s=e(t);if(s){let i=this.loadFile(s);if(!i)throw new Error("Unable to load previous source map: "+s.toString());return i}}else{if(e instanceof Js)return Hs.fromSourceMap(e).toString();if(e instanceof Hs)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let s=this.annotation;return t&&(s=ur(Tt(t),s)),this.loadFile(s)}}}startWith(t,e){return t?t.substr(0,e.length)===e:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var un=Gt;Gt.default=Gt;let{nanoid:pr}=ar,{isAbsolute:Xt,resolve:Zt}=j,{SourceMapConsumer:dr,SourceMapGenerator:fr}=j,{fileURLToPath:Qs,pathToFileURL:Pe}=j,Ks=ws,mr=un,kt=j,Dt=Symbol("fromOffsetCache"),gr=!!(dr&&fr),qs=!!(Zt&&Xt),it=class{get from(){return this.file||this.id}constructor(t,e={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,e.document&&(this.document=e.document.toString()),e.from&&(!qs||/^\w+:\/\//.test(e.from)||Xt(e.from)?this.file=e.from:this.file=Zt(e.from)),qs&&gr){let s=new mr(this.css,e);if(s.text){this.map=s;let i=s.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+pr(6)+">"),this.map&&(this.map.file=this.from)}error(t,e,s,i={}){let n,r,a;if(e&&typeof e=="object"){let l=e,c=s;if(typeof l.offset=="number"){let u=this.fromOffset(l.offset);e=u.line,s=u.col}else e=l.line,s=l.column;if(typeof c.offset=="number"){let u=this.fromOffset(c.offset);r=u.line,n=u.col}else r=c.line,n=c.column}else if(!s){let l=this.fromOffset(e);e=l.line,s=l.col}let o=this.origin(e,s,r,n);return o?a=new Ks(t,o.endLine===void 0?o.line:{column:o.column,line:o.line},o.endLine===void 0?o.column:{column:o.endColumn,line:o.endLine},o.source,o.file,i.plugin):a=new Ks(t,r===void 0?e:{column:s,line:e},r===void 0?s:{column:n,line:r},this.css,this.file,i.plugin),a.input={column:s,endColumn:n,endLine:r,line:e,source:this.css},this.file&&(Pe&&(a.input.url=Pe(this.file).toString()),a.input.file=this.file),a}fromOffset(t){let e,s;if(this[Dt])s=this[Dt];else{let n=this.css.split(`
|
|
21
|
-
`)
|
|
22
|
-
`," "];return Ce.split(t,e)},split(t,e,s){let
|
|
17
|
+
`)&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawColon(t){let e;return t.walkDecls(s=>{if(typeof s.raws.between<"u")return e=s.raws.between.replace(/[^\s:]/g,""),!1}),e}rawEmptyBody(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length===0&&(e=s.raws.after,typeof e<"u"))return!1}),e}rawIndent(t){if(t.raws.indent)return t.raws.indent;let e;return t.walk(s=>{let r=s.parent;if(r&&r!==t&&r.parent&&r.parent===t&&typeof s.raws.before<"u"){let i=s.raws.before.split(`
|
|
18
|
+
`);return e=i[i.length-1],e=e.replace(/\S/g,""),!1}}),e}rawSemicolon(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length&&s.last.type==="decl"&&(e=s.raws.semicolon,typeof e<"u"))return!1}),e}rawValue(t,e){let s=t[e],r=t.raws[e];return r&&r.value===s?r.raw:s}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,e){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,e)}};var Kr=Ut;Ut.default=Ut;let Qn=Kr;function Wt(t,e){new Qn(e).stringify(t)}var ft=Wt;Wt.default=Wt;var Re={};Re.isClean=Symbol("isClean");Re.my=Symbol("my");let Kn=ws,qn=Kr,eo=ft,{isClean:pe,my:to}=Re;function jt(t,e){let s=new t.constructor;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||r==="proxyCache")continue;let i=t[r],o=typeof i;r==="parent"&&o==="object"?e&&(s[r]=e):r==="source"?s[r]=i:Array.isArray(i)?s[r]=i.map(a=>jt(a,s)):(o==="object"&&i!==null&&(i=jt(i)),s[r]=i)}return s}function Z(t,e){if(e&&typeof e.offset<"u")return e.offset;let s=1,r=1,i=0;for(let o=0;o<t.length;o++){if(r===e.line&&s===e.column){i=o;break}t[o]===`
|
|
19
|
+
`?(s=1,r+=1):s+=1}return i}let Vt=class{get proxyOf(){return this}constructor(t={}){this.raws={},this[pe]=!1,this[to]=!0;for(let e in t)if(e==="nodes"){this.nodes=[];for(let s of t[e])typeof s.clone=="function"?this.append(s.clone()):this.append(s)}else this[e]=t[e]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let e=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${e.input.from}:${e.start.line}:${e.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let e in t)this[e]=t[e];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let e=jt(this);for(let s in t)e[s]=t[s];return e}cloneAfter(t={}){let e=this.clone(t);return this.parent.insertAfter(this,e),e}cloneBefore(t={}){let e=this.clone(t);return this.parent.insertBefore(this,e),e}error(t,e={}){if(this.source){let{end:s,start:r}=this.rangeBy(e);return this.source.input.error(t,{column:r.column,line:r.line},{column:s.column,line:s.line},e)}return new Kn(t)}getProxyProcessor(){return{get(t,e){return e==="proxyOf"?t:e==="root"?()=>t.root().toProxy():t[e]},set(t,e,s){return t[e]===s||(t[e]=s,(e==="prop"||e==="value"||e==="name"||e==="params"||e==="important"||e==="text")&&t.markDirty()),!0}}}markClean(){this[pe]=!0}markDirty(){if(this[pe]){this[pe]=!1;let t=this;for(;t=t.parent;)t[pe]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let e=this.source.start;if(t.index)e=this.positionInside(t.index);else if(t.word){let s="document"in this.source.input?this.source.input.document:this.source.input.css,r=s.slice(Z(s,this.source.start),Z(s,this.source.end)).indexOf(t.word);r!==-1&&(e=this.positionInside(r))}return e}positionInside(t){let e=this.source.start.column,s=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,i=Z(r,this.source.start),o=i+t;for(let a=i;a<o;a++)r[a]===`
|
|
20
|
+
`?(e=1,s+=1):e+=1;return{column:e,line:s,offset:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let e="document"in this.source.input?this.source.input.document:this.source.input.css,s={column:this.source.start.column,line:this.source.start.line,offset:Z(e,this.source.start)},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:Z(e,this.source.end)+1}:{column:s.column+1,line:s.line,offset:s.offset+1};if(t.word){let i=e.slice(Z(e,this.source.start),Z(e,this.source.end)).indexOf(t.word);i!==-1&&(s=this.positionInside(i),r=this.positionInside(i+t.word.length))}else t.start?s={column:t.start.column,line:t.start.line,offset:Z(e,t.start)}:t.index&&(s=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line,offset:Z(e,t.end)}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<s.line||r.line===s.line&&r.column<=s.column)&&(r={column:s.column+1,line:s.line,offset:s.offset+1}),{end:r,start:s}}raw(t,e){return new qn().raw(this,t,e)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let e=this,s=!1;for(let r of t)r===this?s=!0:s?(this.parent.insertAfter(e,r),e=r):this.parent.insertBefore(e,r);s||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,e){let s={},r=e==null;e=e||new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))s[o]=a.map(n=>typeof n=="object"&&n.toJSON?n.toJSON(null,e):n);else if(typeof a=="object"&&a.toJSON)s[o]=a.toJSON(null,e);else if(o==="source"){if(a==null)continue;let n=e.get(a.input);n==null&&(n=i,e.set(a.input,i),i++),s[o]={end:a.end,inputId:n,start:a.start}}else s[o]=a}return r&&(s.inputs=[...e.keys()].map(o=>o.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=eo){t.stringify&&(t=t.stringify);let e="";return t(this,s=>{e+=s}),e}warn(t,e,s={}){let r={node:this};for(let i in s)r[i]=s[i];return t.warn(e,r)}};var mt=Vt;Vt.default=Vt;let so=mt,zt=class extends so{constructor(t){super(t),this.type="comment"}};var gt=zt;zt.default=zt;let ro=mt,Yt=class extends ro{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}};var yt=Yt;Yt.default=Yt;let qr=gt,ei=yt,io=mt,{isClean:ti,my:si}=Re,bs,ri,ii,vs;function ni(t){return t.map(e=>(e.nodes&&(e.nodes=ni(e.nodes)),delete e.source,e))}function oi(t){if(t[ti]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)oi(e)}let H=class ai extends io{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]}append(...e){for(let s of e){let r=this.normalize(s,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let s=this.getIterator(),r,i;for(;this.indexes[s]<this.proxyOf.nodes.length&&(r=this.indexes[s],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[s]+=1;return delete this.indexes[s],i}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,s){return s==="proxyOf"?e:e[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?(...r)=>e[s](...r.map(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):s==="every"||s==="some"?r=>e[s]((i,...o)=>r(i.toProxy(),...o)):s==="root"?()=>e.root().toProxy():s==="nodes"?e.nodes.map(r=>r.toProxy()):s==="first"||s==="last"?e[s].toProxy():e[s]:e[s]},set(e,s,r){return e[s]===r||(e[s]=r,(s==="name"||s==="params"||s==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,s){let r=this.index(e),i=this.normalize(s,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(e,s){let r=this.index(e),i=r===0?"prepend":!1,o=this.normalize(s,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let n of o)this.proxyOf.nodes.splice(r,0,n);let a;for(let n in this.indexes)a=this.indexes[n],r<=a&&(this.indexes[n]=a+o.length);return this.markDirty(),this}normalize(e,s){if(typeof e=="string")e=ni(ri(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new ei(e)]}else if(e.selector||e.selectors)e=[new vs(e)];else if(e.name)e=[new bs(e)];else if(e.text)e=[new qr(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[si]||ai.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[ti]&&oi(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(r.raws.before=s.raws.before.replace(/\S/g,"")),r.parent=this.proxyOf,r))}prepend(...e){e=e.reverse();for(let s of e){let r=this.normalize(s,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.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){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let s;for(let r in this.indexes)s=this.indexes[r],s>=e&&(this.indexes[r]=s-1);return this.markDirty(),this}replaceValues(e,s,r){return r||(r=s,s={}),this.walkDecls(i=>{s.props&&!s.props.includes(i.prop)||s.fast&&!i.value.includes(s.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((s,r)=>{let i;try{i=e(s,r)}catch(o){throw s.addToError(o)}return i!==!1&&s.walk&&(i=s.walk(e)),i})}walkAtRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return s(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="atrule")return s(r,i)}))}walkComments(e){return this.walk((s,r)=>{if(s.type==="comment")return e(s,r)})}walkDecls(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return s(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="decl")return s(r,i)}))}walkRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return s(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="rule")return s(r,i)}))}};H.registerParse=t=>{ri=t};H.registerRule=t=>{vs=t};H.registerAtRule=t=>{bs=t};H.registerRoot=t=>{ii=t};var q=H;H.default=H;H.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,bs.prototype):t.type==="rule"?Object.setPrototypeOf(t,vs.prototype):t.type==="decl"?Object.setPrototypeOf(t,ei.prototype):t.type==="comment"?Object.setPrototypeOf(t,qr.prototype):t.type==="root"&&Object.setPrototypeOf(t,ii.prototype),t[si]=!0,t.nodes&&t.nodes.forEach(e=>{H.rebuild(e)})};let li=q,st=class extends li{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var Ss=st;st.default=st;li.registerAtRule(st);let no=q,ci,ui,xe=class extends no{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new ci(new ui,this,t).stringify()}};xe.registerLazyResult=t=>{ci=t};xe.registerProcessor=t=>{ui=t};var xs=xe;xe.default=xe;let oo="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ao=(t=21)=>{let e="",s=t|0;for(;s--;)e+=oo[Math.random()*64|0];return e};var lo={nanoid:ao};let{existsSync:co,readFileSync:uo}=j,{dirname:Tt,join:ho}=j,{SourceMapConsumer:Js,SourceMapGenerator:$s}=j;function po(t){return Buffer?Buffer.from(t,"base64").toString():window.atob(t)}let Gt=class{constructor(t,e){if(e.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let s=e.map?e.map.prev:void 0,r=this.loadMap(e.from,s);!this.mapFile&&e.from&&(this.mapFile=e.from),this.mapFile&&(this.root=Tt(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Js(this.text)),this.consumerCache}decodeInline(t){let e=/^data:application\/json;charset=utf-?8;base64,/,s=/^data:application\/json;base64,/,r=/^data:application\/json;charset=utf-?8,/,i=/^data:application\/json,/,o=t.match(r)||t.match(i);if(o)return decodeURIComponent(t.substr(o[0].length));let a=t.match(e)||t.match(s);if(a)return po(t.substr(a[0].length));let n=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let e=t.match(/\/\*\s*# sourceMappingURL=/g);if(!e)return;let s=t.lastIndexOf(e.pop()),r=t.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(t.substring(s,r)))}loadFile(t){if(this.root=Tt(t),co(t))return this.mapFile=t,uo(t,"utf-8").toString().trim()}loadMap(t,e){if(e===!1)return!1;if(e){if(typeof e=="string")return e;if(typeof e=="function"){let s=e(t);if(s){let r=this.loadFile(s);if(!r)throw new Error("Unable to load previous source map: "+s.toString());return r}}else{if(e instanceof Js)return $s.fromSourceMap(e).toString();if(e instanceof $s)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let s=this.annotation;return t&&(s=ho(Tt(t),s)),this.loadFile(s)}}}startWith(t,e){return t?t.substr(0,e.length)===e:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var hi=Gt;Gt.default=Gt;let{nanoid:fo}=lo,{isAbsolute:Zt,resolve:Xt}=j,{SourceMapConsumer:mo,SourceMapGenerator:go}=j,{fileURLToPath:Qs,pathToFileURL:Pe}=j,Ks=ws,yo=hi,kt=j,Dt=Symbol("lineToIndexCache"),wo=!!(mo&&go),qs=!!(Xt&&Zt);function er(t){if(t[Dt])return t[Dt];let e=t.css.split(`
|
|
21
|
+
`),s=new Array(e.length),r=0;for(let i=0,o=e.length;i<o;i++)s[i]=r,r+=e[i].length+1;return t[Dt]=s,s}let rt=class{get from(){return this.file||this.id}constructor(t,e={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,e.document&&(this.document=e.document.toString()),e.from&&(!qs||/^\w+:\/\//.test(e.from)||Zt(e.from)?this.file=e.from:this.file=Xt(e.from)),qs&&wo){let s=new yo(this.css,e);if(s.text){this.map=s;let r=s.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+fo(6)+">"),this.map&&(this.map.file=this.from)}error(t,e,s,r={}){let i,o,a,n,c;if(e&&typeof e=="object"){let u=e,h=s;if(typeof u.offset=="number"){n=u.offset;let p=this.fromOffset(n);e=p.line,s=p.col}else e=u.line,s=u.column,n=this.fromLineAndColumn(e,s);if(typeof h.offset=="number"){a=h.offset;let p=this.fromOffset(a);o=p.line,i=p.col}else o=h.line,i=h.column,a=this.fromLineAndColumn(h.line,h.column)}else if(s)n=this.fromLineAndColumn(e,s);else{n=e;let u=this.fromOffset(n);e=u.line,s=u.col}let l=this.origin(e,s,o,i);return l?c=new Ks(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,r.plugin):c=new Ks(t,o===void 0?e:{column:s,line:e},o===void 0?s:{column:i,line:o},this.css,this.file,r.plugin),c.input={column:s,endColumn:i,endLine:o,endOffset:a,line:e,offset:n,source:this.css},this.file&&(Pe&&(c.input.url=Pe(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(t,e){return er(this)[t-1]+e-1}fromOffset(t){let e=er(this),s=e[e.length-1],r=0;if(t>=s)r=e.length-1;else{let i=e.length-2,o;for(;r<i;)if(o=r+(i-r>>1),t<e[o])i=o-1;else if(t>=e[o+1])r=o+1;else{r=o;break}}return{col:t-e[r]+1,line:r+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:Xt(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,e,s,r){if(!this.map)return!1;let i=this.map.consumer(),o=i.originalPositionFor({column:e,line:t});if(!o.source)return!1;let a;typeof s=="number"&&(a=i.originalPositionFor({column:r,line:s}));let n;Zt(o.source)?n=Pe(o.source):n=new URL(o.source,this.map.consumer().sourceRoot||Pe(this.map.mapFile));let c={column:o.column,endColumn:a&&a.column,endLine:a&&a.line,line:o.line,url:n.toString()};if(n.protocol==="file:")if(Qs)c.file=Qs(n);else throw new Error("file: protocol is not available in this PostCSS build");let l=i.sourceContentFor(o.source);return l&&(c.source=l),c}toJSON(){let t={};for(let e of["hasBOM","css","file","id"])this[e]!=null&&(t[e]=this[e]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}};var wt=rt;rt.default=rt;kt&&kt.registerInput&&kt.registerInput(rt);let pi=q,di,fi,ne=class extends pi{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,e,s){let r=super.normalize(t);if(e){if(s==="prepend")this.nodes.length>1?e.raws.before=this.nodes[1].raws.before:delete e.raws.before;else if(this.first!==e)for(let i of r)i.raws.before=e.raws.before}return r}removeChild(t,e){let s=this.index(t);return!e&&s===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(t)}toResult(t={}){return new di(new fi,this,t).stringify()}};ne.registerLazyResult=t=>{di=t};ne.registerProcessor=t=>{fi=t};var Oe=ne;ne.default=ne;pi.registerRoot(ne);let Ce={comma(t){return Ce.split(t,[","],!0)},space(t){let e=[" ",`
|
|
22
|
+
`," "];return Ce.split(t,e)},split(t,e,s){let r=[],i="",o=!1,a=0,n=!1,c="",l=!1;for(let u of t)l?l=!1:u==="\\"?l=!0:n?u===c&&(n=!1):u==='"'||u==="'"?(n=!0,c=u):u==="("?a+=1:u===")"?a>0&&(a-=1):a===0&&e.includes(u)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=u;return(s||i!=="")&&r.push(i.trim()),r}};var mi=Ce;Ce.default=Ce;let gi=q,bo=mi,it=class extends gi{get selectors(){return bo.comma(this.selector)}set selectors(t){let e=this.selector?this.selector.match(/,\s*/):null,s=e?e[0]:","+this.raw("between","beforeOpen");this.selector=t.join(s)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};var Cs=it;it.default=it;gi.registerRule(it);let vo=Ss,So=gt,xo=yt,Co=wt,Eo=hi,Mo=Oe,No=Cs;function Ee(t,e){if(Array.isArray(t))return t.map(i=>Ee(i));let{inputs:s,...r}=t;if(s){e=[];for(let i of s){let o={...i,__proto__:Co.prototype};o.map&&(o.map={...o.map,__proto__:Eo.prototype}),e.push(o)}}if(r.nodes&&(r.nodes=t.nodes.map(i=>Ee(i,e))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=e[i])}if(r.type==="root")return new Mo(r);if(r.type==="decl")return new xo(r);if(r.type==="rule")return new No(r);if(r.type==="comment")return new So(r);if(r.type==="atrule")return new vo(r);throw new Error("Unknown node type: "+t.type)}var To=Ee;Ee.default=Ee;let{dirname:Ke,relative:yi,resolve:wi,sep:bi}=j,{SourceMapConsumer:vi,SourceMapGenerator:qe}=j,{pathToFileURL:tr}=j,ko=wt,Do=!!(vi&&qe),Ro=!!(Ke&&wi&&yi&&bi),Oo=class{constructor(t,e,s,r){this.stringify=t,this.mapOpts=s.map||{},this.root=e,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 t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let e=`
|
|
23
23
|
`;this.css.includes(`\r
|
|
24
24
|
`)&&(e=`\r
|
|
25
|
-
`),this.css+=e+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let e=this.toUrl(this.path(t.file)),s=t.root||Ke(t.file),
|
|
26
|
-
`),e=a.length-n):e+=a.length,o&&l!=="start"){let c=o.parent||{raws:{}};(!(o.type==="decl"||o.type==="atrule"&&!o.nodes)||o!==c.last||c.raws.semicolon)&&(o.source&&o.source.end?(i.source=this.sourcePath(o),i.original.line=o.source.end.line,i.original.column=o.source.end.column-1,i.generated.line=t,i.generated.column=e-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=e-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(e=>e.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let e=this.memoizedPaths.get(t);if(e)return e;let s=this.opts.to?Ke(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(s=Ke(yn(s,this.mapOpts.annotation)));let i=gn(s,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let e=t.source.input.map;this.previousMaps.includes(e)||this.previousMaps.push(e)}});else{let t=new Nr(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(e=>{if(e.source){let s=e.source.input.from;if(s&&!t[s]){t[s]=!0;let i=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(i,e.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(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let e=this.memoizedFileURLs.get(t);if(e)return e;if(ei){let s=ei(t).toString();return this.memoizedFileURLs.set(t,s),s}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let e=this.memoizedURLs.get(t);if(e)return e;wn==="\\"&&(t=t.replace(/\\/g,"/"));let s=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,s),s}};var vn=Dr;const Rt=39,ti=34,Le=92,si=47,Fe=10,pe=32,_e=12,Be=9,Ue=13,Rr=91,Or=93,Ar=40,Ir=41,Pr=123,Lr=125,Fr=59,_r=42,Br=58,Ur=64,We=/[\t\n\f\r "#'()/;[\\\]{}]/g,je=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Wr=/.[\r\n"'(/\\]/,ii=/[\da-f]/i;var jr=function(t,e={}){let s=t.css.valueOf(),i=e.ignoreErrors,n,r,a,o,l,c,u,h,p,m,v=s.length,d=0,S=[],f=[];function w(){return d}function g(L){throw t.error("Unclosed "+L,d)}function E(){return f.length===0&&d>=v}function I(L){if(f.length)return f.pop();if(d>=v)return;let W=L?L.ignoreUnclosed:!1;switch(n=s.charCodeAt(d),n){case Fe:case pe:case Be:case Ue:case _e:{o=d;do o+=1,n=s.charCodeAt(o);while(n===pe||n===Fe||n===Be||n===Ue||n===_e);c=["space",s.slice(d,o)],d=o-1;break}case Rr:case Or:case Pr:case Lr:case Br:case Fr:case Ir:{let H=String.fromCharCode(n);c=[H,H,d];break}case Ar:{if(m=S.length?S.pop()[1]:"",p=s.charCodeAt(d+1),m==="url"&&p!==Rt&&p!==ti&&p!==pe&&p!==Fe&&p!==Be&&p!==_e&&p!==Ue){o=d;do{if(u=!1,o=s.indexOf(")",o+1),o===-1)if(i||W){o=d;break}else g("bracket");for(h=o;s.charCodeAt(h-1)===Le;)h-=1,u=!u}while(u);c=["brackets",s.slice(d,o+1),d,o],d=o}else o=s.indexOf(")",d+1),r=s.slice(d,o+1),o===-1||Wr.test(r)?c=["(","(",d]:(c=["brackets",r,d,o],d=o);break}case Rt:case ti:{l=n===Rt?"'":'"',o=d;do{if(u=!1,o=s.indexOf(l,o+1),o===-1)if(i||W){o=d+1;break}else g("string");for(h=o;s.charCodeAt(h-1)===Le;)h-=1,u=!u}while(u);c=["string",s.slice(d,o+1),d,o],d=o;break}case Ur:{We.lastIndex=d+1,We.test(s),We.lastIndex===0?o=s.length-1:o=We.lastIndex-2,c=["at-word",s.slice(d,o+1),d,o],d=o;break}case Le:{for(o=d,a=!0;s.charCodeAt(o+1)===Le;)o+=1,a=!a;if(n=s.charCodeAt(o+1),a&&n!==si&&n!==pe&&n!==Fe&&n!==Be&&n!==Ue&&n!==_e&&(o+=1,ii.test(s.charAt(o)))){for(;ii.test(s.charAt(o+1));)o+=1;s.charCodeAt(o+1)===pe&&(o+=1)}c=["word",s.slice(d,o+1),d,o],d=o;break}default:{n===si&&s.charCodeAt(d+1)===_r?(o=s.indexOf("*/",d+2)+1,o===0&&(i||W?o=s.length:g("comment")),c=["comment",s.slice(d,o+1),d,o],d=o):(je.lastIndex=d+1,je.test(s),je.lastIndex===0?o=s.length-1:o=je.lastIndex-2,c=["word",s.slice(d,o+1),d,o],S.push(c),d=o);break}}return d++,c}function B(L){f.push(L)}return{back:B,endOfFile:E,nextToken:I,position:w}};let Vr=Ss,zr=gt,Yr=yt,Gr=Oe,ni=Cs,Xr=jr;const oi={empty:!0,space:!0};function Zr(t){for(let e=t.length-1;e>=0;e--){let s=t[e],i=s[3]||s[2];if(i)return i}}let $r=class{constructor(t){this.input=t,this.root=new Gr,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let e=new Vr;e.name=t[1].slice(1),e.name===""&&this.unnamedAtrule(e,t),this.init(e,t[2]);let s,i,n,r=!1,a=!1,o=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),s=t[0],s==="("||s==="["?l.push(s==="("?")":"]"):s==="{"&&l.length>0?l.push("}"):s===l[l.length-1]&&l.pop(),l.length===0)if(s===";"){e.source.end=this.getPosition(t[2]),e.source.end.offset++,this.semicolon=!0;break}else if(s==="{"){a=!0;break}else if(s==="}"){if(o.length>0){for(n=o.length-1,i=o[n];i&&i[0]==="space";)i=o[--n];i&&(e.source.end=this.getPosition(i[3]||i[2]),e.source.end.offset++)}this.end(t);break}else o.push(t);else o.push(t);if(this.tokenizer.endOfFile()){r=!0;break}}e.raws.between=this.spacesAndCommentsFromEnd(o),o.length?(e.raws.afterName=this.spacesAndCommentsFromStart(o),this.raw(e,"params",o),r&&(t=o[o.length-1],e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++,this.spaces=e.raws.between,e.raws.between="")):(e.raws.afterName="",e.params=""),a&&(e.nodes=[],this.current=e)}checkMissedSemicolon(t){let e=this.colon(t);if(e===!1)return;let s=0,i;for(let n=e-1;n>=0&&(i=t[n],!(i[0]!=="space"&&(s+=1,s===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let e=0,s,i,n;for(let[r,a]of t.entries()){if(i=a,n=i[0],n==="("&&(e+=1),n===")"&&(e-=1),e===0&&n===":")if(!s)this.doubleColon(i);else{if(s[0]==="word"&&s[1]==="progid")continue;return r}s=i}return!1}comment(t){let e=new zr;this.init(e,t[2]),e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++;let s=t[1].slice(2,-2);if(/^\s*$/.test(s))e.text="",e.raws.left=s,e.raws.right="";else{let i=s.match(/^(\s*)([^]*\S)(\s*)$/);e.text=i[2],e.raws.left=i[1],e.raws.right=i[3]}}createTokenizer(){this.tokenizer=Xr(this.input)}decl(t,e){let s=new Yr;this.init(s,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),s.source.end=this.getPosition(i[3]||i[2]||Zr(t)),s.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),s.raws.before+=t.shift()[1];for(s.source.start=this.getPosition(t[0][2]),s.prop="";t.length;){let o=t[0][0];if(o===":"||o==="space"||o==="comment")break;s.prop+=t.shift()[1]}s.raws.between="";let n;for(;t.length;)if(n=t.shift(),n[0]===":"){s.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),s.raws.between+=n[1];(s.prop[0]==="_"||s.prop[0]==="*")&&(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let r=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)r.push(t.shift());this.precheckMissedSemicolon(t);for(let o=t.length-1;o>=0;o--){if(n=t[o],n[1].toLowerCase()==="!important"){s.important=!0;let l=this.stringFrom(t,o);l=this.spacesFromEnd(t)+l,l!==" !important"&&(s.raws.important=l);break}else if(n[1].toLowerCase()==="important"){let l=t.slice(0),c="";for(let u=o;u>0;u--){let h=l[u][0];if(c.trim().startsWith("!")&&h!=="space")break;c=l.pop()[1]+c}c.trim().startsWith("!")&&(s.important=!0,s.raws.important=c,t=l)}if(n[0]!=="space"&&n[0]!=="comment")break}t.some(o=>o[0]!=="space"&&o[0]!=="comment")&&(s.raws.between+=r.map(o=>o[1]).join(""),r=[]),this.raw(s,"value",r.concat(t),e),s.value.includes(":")&&!e&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let e=new ni;this.init(e,t[2]),e.selector="",e.raws.between="",this.current=e}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type==="rule"&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="",e.source.end=this.getPosition(t[2]),e.source.end.offset+=e.raws.ownSemicolon.length)}}getPosition(t){let e=this.input.fromOffset(t);return{column:e.col,line:e.line,offset:t}}init(t,e){this.current.push(t),t.source={input:this.input,start:this.getPosition(e)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let e=!1,s=null,i=!1,n=null,r=[],a=t[1].startsWith("--"),o=[],l=t;for(;l;){if(s=l[0],o.push(l),s==="("||s==="[")n||(n=l),r.push(s==="("?")":"]");else if(a&&i&&s==="{")n||(n=l),r.push("}");else if(r.length===0)if(s===";")if(i){this.decl(o,a);return}else break;else if(s==="{"){this.rule(o);return}else if(s==="}"){this.tokenizer.back(o.pop()),e=!0;break}else s===":"&&(i=!0);else s===r[r.length-1]&&(r.pop(),r.length===0&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(e=!0),r.length>0&&this.unclosedBracket(n),e&&i){if(!a)for(;o.length&&(l=o[o.length-1][0],!(l!=="space"&&l!=="comment"));)this.tokenizer.back(o.pop());this.decl(o,a)}else this.unknownWord(o)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,e,s,i){let n,r,a=s.length,o="",l=!0,c,u;for(let h=0;h<a;h+=1)n=s[h],r=n[0],r==="space"&&h===a-1&&!i?l=!1:r==="comment"?(u=s[h-1]?s[h-1][0]:"empty",c=s[h+1]?s[h+1][0]:"empty",!oi[u]&&!oi[c]?o.slice(-1)===","?l=!1:o+=n[1]:l=!1):o+=n[1];if(!l){let h=s.reduce((p,m)=>p+m[1],"");t.raws[e]={raw:h,value:o}}t[e]=o}rule(t){t.pop();let e=new ni;this.init(e,t[0][2]),e.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(e,"selector",t),this.current=e}spacesAndCommentsFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],!(e!=="space"&&e!=="comment"));)s=t.pop()[1]+s;return s}spacesAndCommentsFromStart(t){let e,s="";for(;t.length&&(e=t[0][0],!(e!=="space"&&e!=="comment"));)s+=t.shift()[1];return s}spacesFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],e==="space");)s=t.pop()[1]+s;return s}stringFrom(t,e){let s="";for(let i=e;i<t.length;i++)s+=t[i][1];return t.splice(e,t.length-e),s}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,e){throw this.input.error("At-rule without name",{offset:e[2]},{offset:e[2]+e[1].length})}};var Jr=$r;let Hr=Q,Qr=wt,Kr=Jr;function ot(t,e){let s=new Qr(t,e),i=new Kr(s);try{i.parse()}catch(n){throw process.env.NODE_ENV!=="production"&&n.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?n.message+=`
|
|
27
|
-
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(e.from)?
|
|
28
|
-
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(e.from)&&(
|
|
29
|
-
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),n}return i.root}var Es=ot;ot.default=ot;Hr.registerParse(ot);let $t=class{constructor(t,e={}){if(this.type="warning",this.text=t,e.node&&e.node.source){let s=e.node.rangeBy(e);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in e)this[s]=e[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 Sn=$t;$t.default=$t;let qr=Sn,Jt=class{get content(){return this.css}constructor(t,e,s){this.processor=t,this.messages=[],this.root=e,this.opts=s,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,e={}){e.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(e.plugin=this.lastPlugin.postcssPlugin);let s=new qr(t,e);return this.messages.push(s),s}warnings(){return this.messages.filter(t=>t.type==="warning")}};var Ms=Jt;Jt.default=Jt;let ri={};var xn=function(t){ri[t]||(ri[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))};let ea=Q,ta=xs,sa=vn,ia=Es,ai=Ms,na=Oe,oa=ft,{isClean:z,my:ra}=Re,aa=xn;const la={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ca={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},ua={Once:!0,postcssPlugin:!0,prepare:!0},ne=0;function de(t){return typeof t=="object"&&typeof t.then=="function"}function Cn(t){let e=!1,s=la[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[s,s+"-"+e,ne,s+"Exit",s+"Exit-"+e]:e?[s,s+"-"+e,s+"Exit",s+"Exit-"+e]:t.append?[s,ne,s+"Exit"]:[s,s+"Exit"]}function li(t){let e;return t.type==="document"?e=["Document",ne,"DocumentExit"]:t.type==="root"?e=["Root",ne,"RootExit"]:e=Cn(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function Ht(t){return t[z]=!1,t.nodes&&t.nodes.forEach(e=>Ht(e)),t}let Qt={},oe=class En{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"}constructor(e,s,i){this.stringified=!1,this.processed=!1;let n;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))n=Ht(s);else if(s instanceof En||s instanceof ai)n=Ht(s.root),s.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=s.map);else{let r=ia;i.syntax&&(r=i.syntax.parse),i.parser&&(r=i.parser),r.parse&&(r=r.parse);try{n=r(s,i)}catch(a){this.processed=!0,this.error=a}n&&!n[ra]&&ea.rebuild(n)}this.result=new ai(e,n,i),this.helpers={...Qt,postcss:Qt,result:this.result},this.plugins=this.processor.plugins.map(r=>typeof r=="object"&&r.prepare?{...r,...r.prepare(this.result)}:r)}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,s){let i=this.result.lastPlugin;try{if(s&&s.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=i.postcssPlugin,e.setMessage();else if(i.postcssVersion&&process.env.NODE_ENV!=="production"){let n=i.postcssPlugin,r=i.postcssVersion,a=this.result.processor.version,o=r.split("."),l=a.split(".");(o[0]!==l[0]||parseInt(o[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+a+", but "+n+" uses "+r+". Perhaps this is the source of the error below.")}}catch(n){console&&console.error&&console.error(n)}return e}prepareVisitors(){this.listeners={};let e=(s,i,n)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([s,n])};for(let s of this.plugins)if(typeof s=="object")for(let i in s){if(!ca[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ua[i])if(typeof s[i]=="object")for(let n in s[i])n==="*"?e(s,i,s[i][n]):e(s,i+"-"+n.toLowerCase(),s[i][n]);else typeof s[i]=="function"&&e(s,i,s[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let s=this.plugins[e],i=this.runOnRoot(s);if(de(i))try{await i}catch(n){throw this.handleError(n)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[z];){e[z]=!0;let s=[li(e)];for(;s.length>0;){let i=this.visitTick(s);if(de(i))try{await i}catch(n){let r=s[s.length-1].node;throw this.handleError(n,r)}}}if(this.listeners.OnceExit)for(let[s,i]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(e.type==="document"){let n=e.nodes.map(r=>i(r,this.helpers));await Promise.all(n)}else await i(e,this.helpers)}catch(n){throw this.handleError(n)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let s=this.result.root.nodes.map(i=>e.Once(i,this.helpers));return de(s[0])?Promise.all(s):s}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(s){throw this.handleError(s)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,s=oa;e.syntax&&(s=e.syntax.stringify),e.stringifier&&(s=e.stringifier),s.stringify&&(s=s.stringify);let i=new sa(s,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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){let s=this.runOnRoot(e);if(de(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[z];)e[z]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let s of e.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,s){return process.env.NODE_ENV!=="production"&&("from"in this.opts||aa("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,s)}toString(){return this.css}visitSync(e,s){for(let[i,n]of e){this.result.lastPlugin=i;let r;try{r=n(s,this.helpers)}catch(a){throw this.handleError(a,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if(de(r))throw this.getAsyncError()}}visitTick(e){let s=e[e.length-1],{node:i,visitors:n}=s;if(i.type!=="root"&&i.type!=="document"&&!i.parent){e.pop();return}if(n.length>0&&s.visitorIndex<n.length){let[a,o]=n[s.visitorIndex];s.visitorIndex+=1,s.visitorIndex===n.length&&(s.visitors=[],s.visitorIndex=0),this.result.lastPlugin=a;try{return o(i.toProxy(),this.helpers)}catch(l){throw this.handleError(l,i)}}if(s.iterator!==0){let a=s.iterator,o;for(;o=i.nodes[i.indexes[a]];)if(i.indexes[a]+=1,!o[z]){o[z]=!0,e.push(li(o));return}s.iterator=0,delete i.indexes[a]}let r=s.events;for(;s.eventIndex<r.length;){let a=r[s.eventIndex];if(s.eventIndex+=1,a===ne){i.nodes&&i.nodes.length&&(i[z]=!0,s.iterator=i.getIterator());return}else if(this.listeners[a]){s.visitors=this.listeners[a];return}}e.pop()}walkSync(e){e[z]=!0;let s=Cn(e);for(let i of s)if(i===ne)e.nodes&&e.each(n=>{n[z]||this.walkSync(n)});else{let n=this.listeners[i];if(n&&this.visitSync(n,e.toProxy()))return}}warnings(){return this.sync().warnings()}};oe.registerPostcss=t=>{Qt=t};var Mn=oe;oe.default=oe;na.registerLazyResult(oe);ta.registerLazyResult(oe);let ha=vn,pa=Es;const da=Ms;let fa=ft,ma=xn,Kt=class{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 t,e=pa;try{t=e(this._css,this._opts)}catch(s){this.error=s}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,e,s){e=e.toString(),this.stringified=!1,this._processor=t,this._css=e,this._opts=s,this._map=void 0;let i,n=fa;this.result=new da(this._processor,i,this._opts),this.result.css=e;let r=this;Object.defineProperty(this.result,"root",{get(){return r.root}});let a=new ha(n,i,this._opts,e);if(a.isMap()){let[o,l]=a.generate();o&&(this.result.css=o),l&&(this.result.map=l)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,e){return process.env.NODE_ENV!=="production"&&("from"in this._opts||ma("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(t,e)}toString(){return this._css}warnings(){return[]}};var ga=Kt;Kt.default=Kt;let ya=xs,wa=Mn,ba=ga,va=Oe,Me=class{constructor(t=[]){this.version="8.5.3",this.plugins=this.normalize(t)}normalize(t){let e=[];for(let s of t)if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),typeof s=="object"&&Array.isArray(s.plugins))e=e.concat(s.plugins);else if(typeof s=="object"&&s.postcssPlugin)e.push(s);else if(typeof s=="function")e.push(s);else if(typeof s=="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production")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.")}else throw new Error(s+" is not a PostCSS plugin");return e}process(t,e={}){return!this.plugins.length&&!e.parser&&!e.stringifier&&!e.syntax?new ba(this,t,e):new wa(this,t,e)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var Sa=Me;Me.default=Me;va.registerProcessor(Me);ya.registerProcessor(Me);let Nn=Ss,Tn=gt,xa=Q,Ca=ws,kn=yt,Dn=xs,Ea=Mr,Ma=wt,Na=Mn,Ta=fn,ka=mt,Da=Es,Ns=Sa,Ra=Ms,Rn=Oe,On=Cs,Oa=ft,Aa=Sn;function k(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Ns(t)}k.plugin=function(t,e){let s=!1;function i(...r){console&&console.warn&&!s&&(s=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
25
|
+
`),this.css+=e+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let e=this.toUrl(this.path(t.file)),s=t.root||Ke(t.file),r;this.mapOpts.sourcesContent===!1?(r=new vi(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,e,this.toUrl(this.path(s)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let e=this.root.nodes.length-1;e>=0;e--)t=this.root.nodes[e],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Ro&&Do&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=qe.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new qe({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 qe({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,e=1,s="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},i,o;this.stringify(this.root,(a,n,c)=>{if(this.css+=a,n&&c!=="end"&&(r.generated.line=t,r.generated.column=e-1,n.source&&n.source.start?(r.source=this.sourcePath(n),r.original.line=n.source.start.line,r.original.column=n.source.start.column-1,this.map.addMapping(r)):(r.source=s,r.original.line=1,r.original.column=0,this.map.addMapping(r))),o=a.match(/\n/g),o?(t+=o.length,i=a.lastIndexOf(`
|
|
26
|
+
`),e=a.length-i):e+=a.length,n&&c!=="start"){let l=n.parent||{raws:{}};(!(n.type==="decl"||n.type==="atrule"&&!n.nodes)||n!==l.last||l.raws.semicolon)&&(n.source&&n.source.end?(r.source=this.sourcePath(n),r.original.line=n.source.end.line,r.original.column=n.source.end.column-1,r.generated.line=t,r.generated.column=e-2,this.map.addMapping(r)):(r.source=s,r.original.line=1,r.original.column=0,r.generated.line=t,r.generated.column=e-1,this.map.addMapping(r)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(e=>e.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let e=this.memoizedPaths.get(t);if(e)return e;let s=this.opts.to?Ke(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(s=Ke(wi(s,this.mapOpts.annotation)));let r=yi(s,t);return this.memoizedPaths.set(t,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let e=t.source.input.map;this.previousMaps.includes(e)||this.previousMaps.push(e)}});else{let t=new ko(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(e=>{if(e.source){let s=e.source.input.from;if(s&&!t[s]){t[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,e.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(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let e=this.memoizedFileURLs.get(t);if(e)return e;if(tr){let s=tr(t).toString();return this.memoizedFileURLs.set(t,s),s}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let e=this.memoizedURLs.get(t);if(e)return e;bi==="\\"&&(t=t.replace(/\\/g,"/"));let s=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,s),s}};var Si=Oo;const Rt=39,sr=34,Le=92,rr=47,Fe=10,de=32,_e=12,Be=9,Ue=13,Ao=91,Io=93,Po=40,Lo=41,Fo=123,_o=125,Bo=59,Uo=42,Wo=58,jo=64,We=/[\t\n\f\r "#'()/;[\\\]{}]/g,je=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Vo=/.[\r\n"'(/\\]/,ir=/[\da-f]/i;var zo=function(t,e={}){let s=t.css.valueOf(),r=e.ignoreErrors,i,o,a,n,c,l,u,h,p,m,v=s.length,d=0,S=[],f=[];function w(){return d}function g(L){throw t.error("Unclosed "+L,d)}function E(){return f.length===0&&d>=v}function I(L){if(f.length)return f.pop();if(d>=v)return;let W=L?L.ignoreUnclosed:!1;switch(i=s.charCodeAt(d),i){case Fe:case de:case Be:case Ue:case _e:{n=d;do n+=1,i=s.charCodeAt(n);while(i===de||i===Fe||i===Be||i===Ue||i===_e);l=["space",s.slice(d,n)],d=n-1;break}case Ao:case Io:case Fo:case _o:case Wo:case Bo:case Lo:{let K=String.fromCharCode(i);l=[K,K,d];break}case Po:{if(m=S.length?S.pop()[1]:"",p=s.charCodeAt(d+1),m==="url"&&p!==Rt&&p!==sr&&p!==de&&p!==Fe&&p!==Be&&p!==_e&&p!==Ue){n=d;do{if(u=!1,n=s.indexOf(")",n+1),n===-1)if(r||W){n=d;break}else g("bracket");for(h=n;s.charCodeAt(h-1)===Le;)h-=1,u=!u}while(u);l=["brackets",s.slice(d,n+1),d,n],d=n}else n=s.indexOf(")",d+1),o=s.slice(d,n+1),n===-1||Vo.test(o)?l=["(","(",d]:(l=["brackets",o,d,n],d=n);break}case Rt:case sr:{c=i===Rt?"'":'"',n=d;do{if(u=!1,n=s.indexOf(c,n+1),n===-1)if(r||W){n=d+1;break}else g("string");for(h=n;s.charCodeAt(h-1)===Le;)h-=1,u=!u}while(u);l=["string",s.slice(d,n+1),d,n],d=n;break}case jo:{We.lastIndex=d+1,We.test(s),We.lastIndex===0?n=s.length-1:n=We.lastIndex-2,l=["at-word",s.slice(d,n+1),d,n],d=n;break}case Le:{for(n=d,a=!0;s.charCodeAt(n+1)===Le;)n+=1,a=!a;if(i=s.charCodeAt(n+1),a&&i!==rr&&i!==de&&i!==Fe&&i!==Be&&i!==Ue&&i!==_e&&(n+=1,ir.test(s.charAt(n)))){for(;ir.test(s.charAt(n+1));)n+=1;s.charCodeAt(n+1)===de&&(n+=1)}l=["word",s.slice(d,n+1),d,n],d=n;break}default:{i===rr&&s.charCodeAt(d+1)===Uo?(n=s.indexOf("*/",d+2)+1,n===0&&(r||W?n=s.length:g("comment")),l=["comment",s.slice(d,n+1),d,n],d=n):(je.lastIndex=d+1,je.test(s),je.lastIndex===0?n=s.length-1:n=je.lastIndex-2,l=["word",s.slice(d,n+1),d,n],S.push(l),d=n);break}}return d++,l}function B(L){f.push(L)}return{back:B,endOfFile:E,nextToken:I,position:w}};let Yo=Ss,Go=gt,Zo=yt,Xo=Oe,nr=Cs,Ho=zo;const or={empty:!0,space:!0};function Jo(t){for(let e=t.length-1;e>=0;e--){let s=t[e],r=s[3]||s[2];if(r)return r}}let $o=class{constructor(t){this.input=t,this.root=new Xo,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let e=new Yo;e.name=t[1].slice(1),e.name===""&&this.unnamedAtrule(e,t),this.init(e,t[2]);let s,r,i,o=!1,a=!1,n=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),s=t[0],s==="("||s==="["?c.push(s==="("?")":"]"):s==="{"&&c.length>0?c.push("}"):s===c[c.length-1]&&c.pop(),c.length===0)if(s===";"){e.source.end=this.getPosition(t[2]),e.source.end.offset++,this.semicolon=!0;break}else if(s==="{"){a=!0;break}else if(s==="}"){if(n.length>0){for(i=n.length-1,r=n[i];r&&r[0]==="space";)r=n[--i];r&&(e.source.end=this.getPosition(r[3]||r[2]),e.source.end.offset++)}this.end(t);break}else n.push(t);else n.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}e.raws.between=this.spacesAndCommentsFromEnd(n),n.length?(e.raws.afterName=this.spacesAndCommentsFromStart(n),this.raw(e,"params",n),o&&(t=n[n.length-1],e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++,this.spaces=e.raws.between,e.raws.between="")):(e.raws.afterName="",e.params=""),a&&(e.nodes=[],this.current=e)}checkMissedSemicolon(t){let e=this.colon(t);if(e===!1)return;let s=0,r;for(let i=e-1;i>=0&&(r=t[i],!(r[0]!=="space"&&(s+=1,s===2)));i--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(t){let e=0,s,r,i;for(let[o,a]of t.entries()){if(r=a,i=r[0],i==="("&&(e+=1),i===")"&&(e-=1),e===0&&i===":")if(!s)this.doubleColon(r);else{if(s[0]==="word"&&s[1]==="progid")continue;return o}s=r}return!1}comment(t){let e=new Go;this.init(e,t[2]),e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++;let s=t[1].slice(2,-2);if(/^\s*$/.test(s))e.text="",e.raws.left=s,e.raws.right="";else{let r=s.match(/^(\s*)([^]*\S)(\s*)$/);e.text=r[2],e.raws.left=r[1],e.raws.right=r[3]}}createTokenizer(){this.tokenizer=Ho(this.input)}decl(t,e){let s=new Zo;this.init(s,t[0][2]);let r=t[t.length-1];for(r[0]===";"&&(this.semicolon=!0,t.pop()),s.source.end=this.getPosition(r[3]||r[2]||Jo(t)),s.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),s.raws.before+=t.shift()[1];for(s.source.start=this.getPosition(t[0][2]),s.prop="";t.length;){let n=t[0][0];if(n===":"||n==="space"||n==="comment")break;s.prop+=t.shift()[1]}s.raws.between="";let i;for(;t.length;)if(i=t.shift(),i[0]===":"){s.raws.between+=i[1];break}else i[0]==="word"&&/\w/.test(i[1])&&this.unknownWord([i]),s.raws.between+=i[1];(s.prop[0]==="_"||s.prop[0]==="*")&&(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let n=t.length-1;n>=0;n--){if(i=t[n],i[1].toLowerCase()==="!important"){s.important=!0;let c=this.stringFrom(t,n);c=this.spacesFromEnd(t)+c,c!==" !important"&&(s.raws.important=c);break}else if(i[1].toLowerCase()==="important"){let c=t.slice(0),l="";for(let u=n;u>0;u--){let h=c[u][0];if(l.trim().startsWith("!")&&h!=="space")break;l=c.pop()[1]+l}l.trim().startsWith("!")&&(s.important=!0,s.raws.important=l,t=c)}if(i[0]!=="space"&&i[0]!=="comment")break}t.some(n=>n[0]!=="space"&&n[0]!=="comment")&&(s.raws.between+=o.map(n=>n[1]).join(""),o=[]),this.raw(s,"value",o.concat(t),e),s.value.includes(":")&&!e&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let e=new nr;this.init(e,t[2]),e.selector="",e.raws.between="",this.current=e}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type==="rule"&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="",e.source.end=this.getPosition(t[2]),e.source.end.offset+=e.raws.ownSemicolon.length)}}getPosition(t){let e=this.input.fromOffset(t);return{column:e.col,line:e.line,offset:t}}init(t,e){this.current.push(t),t.source={input:this.input,start:this.getPosition(e)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let e=!1,s=null,r=!1,i=null,o=[],a=t[1].startsWith("--"),n=[],c=t;for(;c;){if(s=c[0],n.push(c),s==="("||s==="[")i||(i=c),o.push(s==="("?")":"]");else if(a&&r&&s==="{")i||(i=c),o.push("}");else if(o.length===0)if(s===";")if(r){this.decl(n,a);return}else break;else if(s==="{"){this.rule(n);return}else if(s==="}"){this.tokenizer.back(n.pop()),e=!0;break}else s===":"&&(r=!0);else s===o[o.length-1]&&(o.pop(),o.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(e=!0),o.length>0&&this.unclosedBracket(i),e&&r){if(!a)for(;n.length&&(c=n[n.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(n.pop());this.decl(n,a)}else this.unknownWord(n)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,e,s,r){let i,o,a=s.length,n="",c=!0,l,u;for(let h=0;h<a;h+=1)i=s[h],o=i[0],o==="space"&&h===a-1&&!r?c=!1:o==="comment"?(u=s[h-1]?s[h-1][0]:"empty",l=s[h+1]?s[h+1][0]:"empty",!or[u]&&!or[l]?n.slice(-1)===","?c=!1:n+=i[1]:c=!1):n+=i[1];if(!c){let h=s.reduce((p,m)=>p+m[1],"");t.raws[e]={raw:h,value:n}}t[e]=n}rule(t){t.pop();let e=new nr;this.init(e,t[0][2]),e.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(e,"selector",t),this.current=e}spacesAndCommentsFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],!(e!=="space"&&e!=="comment"));)s=t.pop()[1]+s;return s}spacesAndCommentsFromStart(t){let e,s="";for(;t.length&&(e=t[0][0],!(e!=="space"&&e!=="comment"));)s+=t.shift()[1];return s}spacesFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],e==="space");)s=t.pop()[1]+s;return s}stringFrom(t,e){let s="";for(let r=e;r<t.length;r++)s+=t[r][1];return t.splice(e,t.length-e),s}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,e){throw this.input.error("At-rule without name",{offset:e[2]},{offset:e[2]+e[1].length})}};var Qo=$o;let Ko=q,qo=wt,ea=Qo;function nt(t,e){let s=new qo(t,e),r=new ea(s);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?i.message+=`
|
|
27
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(e.from)?i.message+=`
|
|
28
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(e.from)&&(i.message+=`
|
|
29
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Es=nt;nt.default=nt;Ko.registerParse(nt);let Ht=class{constructor(t,e={}){if(this.type="warning",this.text=t,e.node&&e.node.source){let s=e.node.rangeBy(e);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in e)this[s]=e[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=Ht;Ht.default=Ht;let ta=xi,Jt=class{get content(){return this.css}constructor(t,e,s){this.processor=t,this.messages=[],this.root=e,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(t,e={}){e.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(e.plugin=this.lastPlugin.postcssPlugin);let s=new ta(t,e);return this.messages.push(s),s}warnings(){return this.messages.filter(t=>t.type==="warning")}};var Ms=Jt;Jt.default=Jt;let ar={};var Ci=function(t){ar[t]||(ar[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))};let sa=q,ra=xs,ia=Si,na=Es,lr=Ms,oa=Oe,aa=ft,{isClean:z,my:la}=Re,ca=Ci;const ua={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ha={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},pa={Once:!0,postcssPlugin:!0,prepare:!0},oe=0;function fe(t){return typeof t=="object"&&typeof t.then=="function"}function Ei(t){let e=!1,s=ua[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[s,s+"-"+e,oe,s+"Exit",s+"Exit-"+e]:e?[s,s+"-"+e,s+"Exit",s+"Exit-"+e]:t.append?[s,oe,s+"Exit"]:[s,s+"Exit"]}function cr(t){let e;return t.type==="document"?e=["Document",oe,"DocumentExit"]:t.type==="root"?e=["Root",oe,"RootExit"]:e=Ei(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function $t(t){return t[z]=!1,t.nodes&&t.nodes.forEach(e=>$t(e)),t}let Qt={},ae=class Mi{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"}constructor(e,s,r){this.stringified=!1,this.processed=!1;let i;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))i=$t(s);else if(s instanceof Mi||s instanceof lr)i=$t(s.root),s.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let o=na;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(s,r)}catch(a){this.processed=!0,this.error=a}i&&!i[la]&&sa.rebuild(i)}this.result=new lr(e,i,r),this.helpers={...Qt,postcss:Qt,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}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,s){let r=this.result.lastPlugin;try{if(s&&s.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=r.postcssPlugin,e.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,o=r.postcssVersion,a=this.result.processor.version,n=o.split("."),c=a.split(".");(n[0]!==c[0]||parseInt(n[1])>parseInt(c[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+a+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(s,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([s,i])};for(let s of this.plugins)if(typeof s=="object")for(let r in s){if(!ha[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!pa[r])if(typeof s[r]=="object")for(let i in s[r])i==="*"?e(s,r,s[r][i]):e(s,r+"-"+i.toLowerCase(),s[r][i]);else typeof s[r]=="function"&&e(s,r,s[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let s=this.plugins[e],r=this.runOnRoot(s);if(fe(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[z];){e[z]=!0;let s=[cr(e)];for(;s.length>0;){let r=this.visitTick(s);if(fe(r))try{await r}catch(i){let o=s[s.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[s,r]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(e.type==="document"){let i=e.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let s=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return fe(s[0])?Promise.all(s):s}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(s){throw this.handleError(s)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,s=aa;e.syntax&&(s=e.syntax.stringify),e.stringifier&&(s=e.stringifier),s.stringify&&(s=s.stringify);let r=new ia(s,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let s=this.runOnRoot(e);if(fe(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[z];)e[z]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let s of e.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,s){return process.env.NODE_ENV!=="production"&&("from"in this.opts||ca("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,s)}toString(){return this.css}visitSync(e,s){for(let[r,i]of e){this.result.lastPlugin=r;let o;try{o=i(s,this.helpers)}catch(a){throw this.handleError(a,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if(fe(o))throw this.getAsyncError()}}visitTick(e){let s=e[e.length-1],{node:r,visitors:i}=s;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&s.visitorIndex<i.length){let[a,n]=i[s.visitorIndex];s.visitorIndex+=1,s.visitorIndex===i.length&&(s.visitors=[],s.visitorIndex=0),this.result.lastPlugin=a;try{return n(r.toProxy(),this.helpers)}catch(c){throw this.handleError(c,r)}}if(s.iterator!==0){let a=s.iterator,n;for(;n=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!n[z]){n[z]=!0,e.push(cr(n));return}s.iterator=0,delete r.indexes[a]}let o=s.events;for(;s.eventIndex<o.length;){let a=o[s.eventIndex];if(s.eventIndex+=1,a===oe){r.nodes&&r.nodes.length&&(r[z]=!0,s.iterator=r.getIterator());return}else if(this.listeners[a]){s.visitors=this.listeners[a];return}}e.pop()}walkSync(e){e[z]=!0;let s=Ei(e);for(let r of s)if(r===oe)e.nodes&&e.each(i=>{i[z]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}};ae.registerPostcss=t=>{Qt=t};var Ni=ae;ae.default=ae;oa.registerLazyResult(ae);ra.registerLazyResult(ae);let da=Si,fa=Es;const ma=Ms;let ga=ft,ya=Ci,Kt=class{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 t,e=fa;try{t=e(this._css,this._opts)}catch(s){this.error=s}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,e,s){e=e.toString(),this.stringified=!1,this._processor=t,this._css=e,this._opts=s,this._map=void 0;let r,i=ga;this.result=new ma(this._processor,r,this._opts),this.result.css=e;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new da(i,r,this._opts,e);if(a.isMap()){let[n,c]=a.generate();n&&(this.result.css=n),c&&(this.result.map=c)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,e){return process.env.NODE_ENV!=="production"&&("from"in this._opts||ya("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(t,e)}toString(){return this._css}warnings(){return[]}};var wa=Kt;Kt.default=Kt;let ba=xs,va=Ni,Sa=wa,xa=Oe,Me=class{constructor(t=[]){this.version="8.5.6",this.plugins=this.normalize(t)}normalize(t){let e=[];for(let s of t)if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),typeof s=="object"&&Array.isArray(s.plugins))e=e.concat(s.plugins);else if(typeof s=="object"&&s.postcssPlugin)e.push(s);else if(typeof s=="function")e.push(s);else if(typeof s=="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production")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.")}else throw new Error(s+" is not a PostCSS plugin");return e}process(t,e={}){return!this.plugins.length&&!e.parser&&!e.stringifier&&!e.syntax?new Sa(this,t,e):new va(this,t,e)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var Ca=Me;Me.default=Me;xa.registerProcessor(Me);ba.registerProcessor(Me);let Ti=Ss,ki=gt,Ea=q,Ma=ws,Di=yt,Ri=xs,Na=To,Ta=wt,ka=Ni,Da=mi,Ra=mt,Oa=Es,Ns=Ca,Aa=Ms,Oi=Oe,Ai=Cs,Ia=ft,Pa=xi;function k(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Ns(t)}k.plugin=function(t,e){let s=!1;function r(...o){console&&console.warn&&!s&&(s=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
30
30
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
31
|
-
https://www.w3ctech.com/topic/2226`));let a=e(...
|
|
32
|
-
`+a)}}))}}}},
|
|
31
|
+
https://www.w3ctech.com/topic/2226`));let a=e(...o);return a.postcssPlugin=t,a.postcssVersion=new Ns().version,a}let i;return Object.defineProperty(r,"postcss",{get(){return i||(i=r()),i}}),r.process=function(o,a,n){return k([r(n)]).process(o,a)},r};k.stringify=Ia;k.parse=Oa;k.fromJSON=Na;k.list=Da;k.comment=t=>new ki(t);k.atRule=t=>new Ti(t);k.decl=t=>new Di(t);k.rule=t=>new Ai(t);k.root=t=>new Oi(t);k.document=t=>new Ri(t);k.CssSyntaxError=Ma;k.Declaration=Di;k.Container=Ea;k.Processor=Ns;k.Document=Ri;k.Comment=ki;k.Warning=Pa;k.AtRule=Ti;k.Result=Aa;k.Input=Ta;k.Rule=Ai;k.Root=Oi;k.Node=Ra;ka.registerPostcss(k);var La=k;k.default=k;const O=Gn(La);O.stringify;O.fromJSON;O.plugin;O.parse;O.list;O.document;O.comment;O.atRule;O.rule;O.decl;O.root;O.CssSyntaxError;O.Declaration;O.Container;O.Processor;O.Document;O.Comment;O.Warning;O.AtRule;O.Result;O.Input;O.Rule;O.Root;O.Node;const Fa=/(max|min)-device-(width|height)/,ur=new RegExp(Fa.source,"g"),_a={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(t){t.params.match(ur)&&(t.params=t.params.replace(ur,"$1-$2"))}}}},Ba={postcssPlugin:"postcss-hover-classes",prepare:function(){const t=[];return{Rule:function(e){t.indexOf(e)===-1&&(t.push(e),e.selectors.forEach(function(s){if(!s.includes(":"))return;const r=s.replace(/\n/g," ").split(" "),i=[];r.forEach(function(a){const n=a.match(/::?([^:]+)/g);if(!n){i.push(a);return}const c=a.substr(0,a.length-n.join("").length),l=n.map(function(u){return u.replace(/\(.*/g,"")!==":hover"||u.match(/^::/)?u:(u=u.substr(1),u=u.replace(/\(/g,"\\("),u=u.replace(/\)/g,"\\)"),".\\:"+u)});i.push(c+l.join(""))}),o(i.join(" "));function o(a){a&&a!==s&&(e.selector+=`,
|
|
32
|
+
`+a)}}))}}}},hr={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 Ua(t){let e=hr[t.tagName]?hr[t.tagName]:t.tagName;return e==="link"&&t.attributes._cssText&&(e="style"),e}function pr(t,e){const s=e==null?void 0:e.stylesWithHoverClass.get(t);if(s)return s;const r=O([_a,Ba]).process(t).css;return e==null||e.stylesWithHoverClass.set(t,r),r}function dr(){return{stylesWithHoverClass:new Map}}function Wa(t,e){var s;const{doc:r,hackCss:i,cache:o}=e;switch(t.type){case R.Document:return r.implementation.createDocument(null,"",null);case R.DocumentType:return r.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case R.Element:{const a=Ua(t);let n;t.isSVG?n=r.createElementNS("http://www.w3.org/2000/svg",a):(t.isCustom&&(s=r.defaultView)!=null&&s.customElements&&!r.defaultView.customElements.get(t.tagName)&&r.defaultView.customElements.define(t.tagName,class extends r.defaultView.HTMLElement{}),n=r.createElement(a));const c={};for(const l in t.attributes){if(!Object.prototype.hasOwnProperty.call(t.attributes,l))continue;let u=t.attributes[l];if(a==="option"&&l==="selected"&&u===!1||u===null)continue;if(u===!0&&(u=""),l.startsWith("rr_")){c[l]=u;continue}const h=a==="textarea"&&l==="value",p=a==="style"&&l==="_cssText";if(p&&i&&typeof u=="string"&&(u=pr(u,o)),(h||p)&&typeof u=="string"){n.appendChild(r.createTextNode(u)),t.childNodes=[];continue}try{if(t.isSVG&&l==="xlink:href")n.setAttributeNS("http://www.w3.org/1999/xlink",l,u.toString());else if(l==="onload"||l==="onclick"||l.substring(0,7)==="onmouse")n.setAttribute("_"+l,u.toString());else if(a==="meta"&&t.attributes["http-equiv"]==="Content-Security-Policy"&&l==="content"){n.setAttribute("csp-content",u.toString());continue}else a==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")&&t.attributes.as==="script"||a==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&t.attributes.href.endsWith(".js")||(a==="img"&&t.attributes.srcset&&t.attributes.rr_dataURL?n.setAttribute("original-srcset",t.attributes.srcset):n.setAttribute(l,u.toString()))}catch{}}for(const l in c){const u=c[l];if(a==="canvas"&&l==="rr_dataURL"){const h=r.createElement("img");h.onload=()=>{const p=n.getContext("2d");p&&p.drawImage(h,0,0,h.width,h.height)},h.src=u.toString(),n.RRNodeType&&(n.rr_dataURL=u.toString())}else if(a==="img"&&l==="rr_dataURL"){const h=n;h.currentSrc.startsWith("data:")||(h.setAttribute("original-src",t.attributes.src),h.src=u.toString())}if(l==="rr_width")n.style.width=u.toString();else if(l==="rr_height")n.style.height=u.toString();else if(l==="rr_mediaCurrentTime"&&typeof u=="number")n.currentTime=u;else if(l==="rr_mediaState")switch(u){case"played":n.play().catch(h=>console.warn("media playback error",h));break;case"paused":n.pause();break}else l==="rr_mediaPlaybackRate"&&typeof u=="number"?n.playbackRate=u:l==="rr_mediaMuted"&&typeof u=="boolean"?n.muted=u:l==="rr_mediaLoop"&&typeof u=="boolean"?n.loop=u:l==="rr_mediaVolume"&&typeof u=="number"&&(n.volume=u)}if(t.isShadowHost)if(!n.shadowRoot)n.attachShadow({mode:"open"});else for(;n.shadowRoot.firstChild;)n.shadowRoot.removeChild(n.shadowRoot.firstChild);return n}case R.Text:return r.createTextNode(t.isStyle&&i?pr(t.textContent,o):t.textContent);case R.CDATA:return r.createCDATASection(t.textContent);case R.Comment:return r.createComment(t.textContent);default:return null}}function Se(t,e){const{doc:s,mirror:r,skipChild:i=!1,hackCss:o=!0,afterAppend:a,cache:n}=e;if(r.has(t.id)){const l=r.getNode(t.id),u=r.getMeta(l);if(Yn(u,t))return r.getNode(t.id)}let c=Wa(t,{doc:s,hackCss:o,cache:n});if(!c)return null;if(t.rootId&&r.getNode(t.rootId)!==s&&r.replace(t.rootId,s),t.type===R.Document&&(s.close(),s.open(),t.compatMode==="BackCompat"&&t.childNodes&&t.childNodes[0].type!==R.DocumentType&&(t.childNodes[0].type===R.Element&&"xmlns"in t.childNodes[0].attributes&&t.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),c=s),r.add(c,t),(t.type===R.Document||t.type===R.Element)&&!i)for(const l of t.childNodes){const u=Se(l,{doc:s,mirror:r,skipChild:!1,hackCss:o,afterAppend:a,cache:n});if(!u){console.warn("Failed to rebuild",l);continue}if(l.isShadow&&Vn(c)&&c.shadowRoot)c.shadowRoot.appendChild(u);else if(t.type===R.Document&&l.type==R.Element){const h=u;let p=null;h.childNodes.forEach(m=>{m.nodeName==="BODY"&&(p=m)}),p?(h.removeChild(p),c.appendChild(u),h.appendChild(p)):c.appendChild(u)}else c.appendChild(u);a&&a(u,l.id)}return c}function ja(t,e){function s(r){e(r)}for(const r of t.getIds())t.has(r)&&s(t.getNode(r))}function Va(t,e){const s=e.getMeta(t);if((s==null?void 0:s.type)!==R.Element)return;const r=t;for(const i in s.attributes){if(!(Object.prototype.hasOwnProperty.call(s.attributes,i)&&i.startsWith("rr_")))continue;const o=s.attributes[i];i==="rr_scrollLeft"&&(r.scrollLeft=o),i==="rr_scrollTop"&&(r.scrollTop=o)}}function za(t,e){const{doc:s,onVisit:r,hackCss:i=!0,afterAppend:o,cache:a,mirror:n=new Hr}=e,c=Se(t,{doc:s,mirror:n,skipChild:!1,hackCss:i,afterAppend:o,cache:a});return ja(n,l=>{r&&r(l),Va(l,n)}),c}var P=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t[t.Device=24]="Device",t[t.SailfishCustom=25]="SailfishCustom",t))(P||{}),T=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t[t.Typing=17]="Typing",t))(T||{}),we=(t=>(t.Append="append",t.Insert="insert",t.Delete="delete",t.Replace="replace",t))(we||{}),F=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(F||{}),ot=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(ot||{}),qt=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(qt||{}),N=(t=>(t.Start="start",t.Pause="pause",t.Resume="resume",t.Resize="resize",t.Finish="finish",t.FullsnapshotRebuilded="fullsnapshot-rebuilded",t.LoadStylesheetStart="load-stylesheet-start",t.LoadStylesheetEnd="load-stylesheet-end",t.SkipStart="skip-start",t.SkipEnd="skip-end",t.MouseInteraction="mouse-interaction",t.EventCast="event-cast",t.CustomEvent="custom-event",t.Flush="flush",t.StateChange="state-change",t.PlayBack="play-back",t.Destroy="destroy",t))(N||{});const te=`Please stop import mirror directly. Instead of that,\r
|
|
33
33
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
34
|
-
or you can use record.mirror to access the mirror instance during recording.`;let
|
|
35
|
-
`+g+
|
|
36
|
-
`+v+
|
|
34
|
+
or you can use record.mirror to access the mirror instance during recording.`;let fr={map:{},getId(){return console.error(te),-1},getNode(){return console.error(te),null},removeNodeFromMap(){console.error(te)},has(){return console.error(te),!1},reset(){console.error(te)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(fr=new Proxy(fr,{get(t,e,s){return e==="map"&&console.error(te),Reflect.get(t,e,s)}}));Date.now().toString();function Ya(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let s=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===s)return!0;while(s=s&&s.parentNode);return!1})}function Ga(t){const e={},s=(i,o)=>{const a={value:i,parent:o,children:[]};return e[i.node.id]=a,a},r=[];for(const i of t){const{nextId:o,parentId:a}=i;if(o&&o in e){const n=e[o];if(n.parent){const c=n.parent.children.indexOf(n);n.parent.children.splice(c,0,s(i,n.parent))}else{const c=r.indexOf(n);r.splice(c,0,s(i,null))}continue}if(a in e){const n=e[a];n.children.push(s(i,n));continue}r.push(s(i,null))}return r}function Ii(t,e){e(t.value);for(let s=t.children.length-1;s>=0;s--)Ii(t.children[s],e)}function Ot(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function Pi(t,e){var s,r;const i=(r=(s=t.ownerDocument)==null?void 0:s.defaultView)==null?void 0:r.frameElement;if(!i||i===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),a=Pi(i,e),n=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:n,absoluteScale:a.absoluteScale*n}}function Ve(t){return!!(t!=null&&t.shadowRoot)}function be(t,e){const s=t[e[0]];return e.length===1?s:be(s.cssRules[e[1]].cssRules,e.slice(2))}function mr(t){const e=[...t],s=e.pop();return{positions:e,index:s}}function Za(t){const e=new Set,s=[];for(let r=t.length;r--;){const i=t[r];e.has(i.id)||(s.push(i),e.add(i.id))}return s}class Xa{constructor(){b(this,"id",1),b(this,"styleIDMap",new WeakMap),b(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,s){if(this.has(e))return this.getId(e);let r;return s===void 0?r=this.id++:r=s,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Ha(t,e){const s=t||"";switch(e.op){case we.Append:return s+e.text;case we.Insert:return s.slice(0,e.pos)+e.text+s.slice(e.pos);case we.Delete:return s.slice(0,e.pos)+s.slice(e.pos+e.length);case we.Replace:return s.slice(0,e.pos)+e.text+s.slice(e.pos+e.deleteCount);default:return s}}const Ja="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Zvcih2YXIgcj0iQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyIsdz10eXBlb2YgVWludDhBcnJheT4idSI/W106bmV3IFVpbnQ4QXJyYXkoMjU2KSxpPTA7aTxyLmxlbmd0aDtpKyspd1tyLmNoYXJDb2RlQXQoaSldPWk7dmFyIHA9ZnVuY3Rpb24ocyl7dmFyIGU9bmV3IFVpbnQ4QXJyYXkocyksbixhPWUubGVuZ3RoLHQ9IiI7Zm9yKG49MDtuPGE7bis9Myl0Kz1yW2Vbbl0+PjJdLHQrPXJbKGVbbl0mMyk8PDR8ZVtuKzFdPj40XSx0Kz1yWyhlW24rMV0mMTUpPDwyfGVbbisyXT4+Nl0sdCs9cltlW24rMl0mNjNdO3JldHVybiBhJTM9PT0yP3Q9dC5zdWJzdHJpbmcoMCx0Lmxlbmd0aC0xKSsiPSI6YSUzPT09MSYmKHQ9dC5zdWJzdHJpbmcoMCx0Lmxlbmd0aC0yKSsiPT0iKSx0fTtjb25zdCBsPW5ldyBNYXAsYj1uZXcgTWFwO2FzeW5jIGZ1bmN0aW9uIHkocyxlLG4pe2NvbnN0IGE9YCR7c30tJHtlfWA7aWYoIk9mZnNjcmVlbkNhbnZhcyJpbiBnbG9iYWxUaGlzKXtpZihiLmhhcyhhKSlyZXR1cm4gYi5nZXQoYSk7Y29uc3QgdD1uZXcgT2Zmc2NyZWVuQ2FudmFzKHMsZSk7dC5nZXRDb250ZXh0KCIyZCIpO2NvbnN0IGc9YXdhaXQoYXdhaXQgdC5jb252ZXJ0VG9CbG9iKG4pKS5hcnJheUJ1ZmZlcigpLGM9cChnKTtyZXR1cm4gYi5zZXQoYSxjKSxjfWVsc2UgcmV0dXJuIiJ9Y29uc3Qgbz1zZWxmO28ub25tZXNzYWdlPWFzeW5jIGZ1bmN0aW9uKHMpe2lmKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcyl7Y29uc3R7aWQ6ZSxiaXRtYXA6bix3aWR0aDphLGhlaWdodDp0LGRhdGFVUkxPcHRpb25zOnV9PXMuZGF0YSxnPXkoYSx0LHUpLGM9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2MuZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCBkPWF3YWl0IGMuY29udmVydFRvQmxvYih1KSx2PWQudHlwZSxoPWF3YWl0IGQuYXJyYXlCdWZmZXIoKSxmPXAoaCk7aWYoIWwuaGFzKGUpJiZhd2FpdCBnPT09ZilyZXR1cm4gbC5zZXQoZSxmKSxvLnBvc3RNZXNzYWdlKHtpZDplfSk7aWYobC5nZXQoZSk9PT1mKXJldHVybiBvLnBvc3RNZXNzYWdlKHtpZDplfSk7by5wb3N0TWVzc2FnZSh7aWQ6ZSx0eXBlOnYsYmFzZTY0OmYsd2lkdGg6YSxoZWlnaHQ6dH0pLGwuc2V0KGUsZil9ZWxzZSByZXR1cm4gby5wb3N0TWVzc2FnZSh7aWQ6cy5kYXRhLmlkfSl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW1hZ2UtYml0bWFwLWRhdGEtdXJsLXdvcmtlci1Cb1hHVm1Zby5qcy5tYXAK",$a=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));typeof self<"u"&&self.Blob&&new Blob([$a(Ja)],{type:"text/javascript;charset=utf-8"});var gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ve=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var ze=0;ze<gr.length;ze++)ve[gr.charCodeAt(ze)]=ze;var Qa=function(t){var e=t.length*.75,s=t.length,r,i=0,o,a,n,c;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);var l=new ArrayBuffer(e),u=new Uint8Array(l);for(r=0;r<s;r+=4)o=ve[t.charCodeAt(r)],a=ve[t.charCodeAt(r+1)],n=ve[t.charCodeAt(r+2)],c=ve[t.charCodeAt(r+3)],u[i++]=o<<2|a>>4,u[i++]=(a&15)<<4|n>>2,u[i++]=(n&3)<<6|c&63;return l},yr;try{if(Array.from([1],t=>t*2)[0]!==2){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=((yr=t.contentWindow)==null?void 0:yr.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}Jr();var Ka=Object.defineProperty,qa=(t,e,s)=>e in t?Ka(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,y=(t,e,s)=>qa(t,typeof e!="symbol"?e+"":e,s),el=Object.defineProperty,tl=(t,e,s)=>e in t?el(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,wr=(t,e,s)=>tl(t,typeof e!="symbol"?e+"":e,s),M=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(M||{});class sl{constructor(){wr(this,"idNodeMap",new Map),wr(this,"nodeMetaMap",new WeakMap)}getId(e){var s;return e?((s=this.getMeta(e))==null?void 0:s.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const s=this.getId(e);this.idNodeMap.delete(s),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,s){const r=s.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,s)}replace(e,s){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(s,i)}this.idNodeMap.set(e,s)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function rl(){return new sl}function il(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function nl(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var s=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};s.prototype=e.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),s}var Ts={exports:{}},C=String,Li=function(){return{isColorSupported:!1,reset:C,bold:C,dim:C,italic:C,underline:C,inverse:C,hidden:C,strikethrough:C,black:C,red:C,green:C,yellow:C,blue:C,magenta:C,cyan:C,white:C,gray:C,bgBlack:C,bgRed:C,bgGreen:C,bgYellow:C,bgBlue:C,bgMagenta:C,bgCyan:C,bgWhite:C,blackBright:C,redBright:C,greenBright:C,yellowBright:C,blueBright:C,magentaBright:C,cyanBright:C,whiteBright:C,bgBlackBright:C,bgRedBright:C,bgGreenBright:C,bgYellowBright:C,bgBlueBright:C,bgMagentaBright:C,bgCyanBright:C,bgWhiteBright:C}};Ts.exports=Li();Ts.exports.createColors=Li;var ol=Ts.exports;const al={},ll=Object.freeze(Object.defineProperty({__proto__:null,default:al},Symbol.toStringTag,{value:"Module"})),V=nl(ll);let br=ol,vr=V,es=class Fi extends Error{constructor(e,s,r,i,o,a){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),typeof s<"u"&&typeof r<"u"&&(typeof s=="number"?(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,Fi)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let s=this.source;e==null&&(e=br.isColorSupported);let r=u=>u,i=u=>u,o=u=>u;if(e){let{bold:u,gray:h,red:p}=br.createColors(!0);i=m=>u(p(m)),r=m=>h(m),vr&&(o=m=>vr(m))}let a=s.split(/\r?\n/),n=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),l=String(c).length;return a.slice(n,c).map((u,h)=>{let p=n+1+h,m=" "+(" "+p).slice(-l)+" | ";if(p===this.line){if(u.length>160){let d=20,S=Math.max(0,this.column-d),f=Math.max(this.column+d,this.endColumn+d),w=u.slice(S,f),g=r(m.replace(/\d/g," "))+u.slice(0,Math.min(this.column-1,d-1)).replace(/[^\t]/g," ");return i(">")+r(m)+o(w)+`
|
|
35
|
+
`+g+i("^")}let v=r(m.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+r(m)+o(u)+`
|
|
36
|
+
`+v+i("^")}return" "+r(m)+o(u)}).join(`
|
|
37
37
|
`)}toString(){let e=this.showSourceCode();return e&&(e=`
|
|
38
38
|
|
|
39
39
|
`+e+`
|
|
40
|
-
`),this.name+": "+this.message+e}};var ks=es;es.default=es;const
|
|
40
|
+
`),this.name+": "+this.message+e}};var ks=es;es.default=es;const Sr={after:`
|
|
41
41
|
`,beforeClose:`
|
|
42
42
|
`,beforeComment:`
|
|
43
43
|
`,beforeDecl:`
|
|
44
44
|
`,beforeOpen:" ",beforeRule:`
|
|
45
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function
|
|
46
|
-
`)){let
|
|
47
|
-
`)&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawBeforeComment(t,e){let s;return t.walkComments(
|
|
48
|
-
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(e,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(t,e){let s;return t.walkDecls(
|
|
45
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function cl(t){return t[0].toUpperCase()+t.slice(1)}let ts=class{constructor(t){this.builder=t}atrule(t,e){let s="@"+t.name,r=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?s+=t.raws.afterName:r&&(s+=" "),t.nodes)this.block(t,s+r);else{let i=(t.raws.between||"")+(e?";":"");this.builder(s+r+i,t)}}beforeAfter(t,e){let s;t.type==="decl"?s=this.raw(t,null,"beforeDecl"):t.type==="comment"?s=this.raw(t,null,"beforeComment"):e==="before"?s=this.raw(t,null,"beforeRule"):s=this.raw(t,null,"beforeClose");let r=t.parent,i=0;for(;r&&r.type!=="root";)i+=1,r=r.parent;if(s.includes(`
|
|
46
|
+
`)){let o=this.raw(t,null,"indent");if(o.length)for(let a=0;a<i;a++)s+=o}return s}block(t,e){let s=this.raw(t,"between","beforeOpen");this.builder(e+s+"{",t,"start");let r;t.nodes&&t.nodes.length?(this.body(t),r=this.raw(t,"after")):r=this.raw(t,"after","emptyBody"),r&&this.builder(r),this.builder("}",t,"end")}body(t){let e=t.nodes.length-1;for(;e>0&&t.nodes[e].type==="comment";)e-=1;let s=this.raw(t,"semicolon");for(let r=0;r<t.nodes.length;r++){let i=t.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,e!==r||s)}}comment(t){let e=this.raw(t,"left","commentLeft"),s=this.raw(t,"right","commentRight");this.builder("/*"+e+t.text+s+"*/",t)}decl(t,e){let s=this.raw(t,"between","colon"),r=t.prop+s+this.rawValue(t,"value");t.important&&(r+=t.raws.important||" !important"),e&&(r+=";"),this.builder(r,t)}document(t){this.body(t)}raw(t,e,s){let r;if(s||(s=e),e&&(r=t.raws[e],typeof r<"u"))return r;let i=t.parent;if(s==="before"&&(!i||i.type==="root"&&i.first===t||i&&i.type==="document"))return"";if(!i)return Sr[s];let o=t.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[s]<"u")return o.rawCache[s];if(s==="before"||s==="after")return this.beforeAfter(t,s);{let a="raw"+cl(s);this[a]?r=this[a](o,t):o.walk(n=>{if(r=n.raws[e],typeof r<"u")return!1})}return typeof r>"u"&&(r=Sr[s]),o.rawCache[s]=r,r}rawBeforeClose(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length>0&&typeof s.raws.after<"u")return e=s.raws.after,e.includes(`
|
|
47
|
+
`)&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawBeforeComment(t,e){let s;return t.walkComments(r=>{if(typeof r.raws.before<"u")return s=r.raws.before,s.includes(`
|
|
48
|
+
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(e,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(t,e){let s;return t.walkDecls(r=>{if(typeof r.raws.before<"u")return s=r.raws.before,s.includes(`
|
|
49
49
|
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(e,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(t){let e;return t.walk(s=>{if(s.type!=="decl"&&(e=s.raws.between,typeof e<"u"))return!1}),e}rawBeforeRule(t){let e;return t.walk(s=>{if(s.nodes&&(s.parent!==t||t.first!==s)&&typeof s.raws.before<"u")return e=s.raws.before,e.includes(`
|
|
50
|
-
`)&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawColon(t){let e;return t.walkDecls(s=>{if(typeof s.raws.between<"u")return e=s.raws.between.replace(/[^\s:]/g,""),!1}),e}rawEmptyBody(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length===0&&(e=s.raws.after,typeof e<"u"))return!1}),e}rawIndent(t){if(t.raws.indent)return t.raws.indent;let e;return t.walk(s=>{let
|
|
51
|
-
`);return e=
|
|
52
|
-
`?(s=1,
|
|
53
|
-
`?(e=1,s+=1):e+=1;return{column:e,line:s}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let e={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:e.column+1,line:e.line};if(t.word){let i="document"in this.source.input?this.source.input.document:this.source.input.css,n=i.slice(me(i,this.source.start),me(i,this.source.end)).indexOf(t.word);n!==-1&&(e=this.positionInside(n),s=this.positionInside(n+t.word.length))}else t.start?e={column:t.start.column,line:t.start.line}:t.index&&(e=this.positionInside(t.index)),t.end?s={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?s=this.positionInside(t.endIndex):t.index&&(s=this.positionInside(t.index+1));return(s.line<e.line||s.line===e.line&&s.column<=e.column)&&(s={column:e.column+1,line:e.line}),{end:s,start:e}}raw(t,e){return new ul().raw(this,t,e)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let e=this,s=!1;for(let i of t)i===this?s=!0:s?(this.parent.insertAfter(e,i),e=i):this.parent.insertBefore(e,i);s||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,e){let s={},i=e==null;e=e||new Map;let n=0;for(let r in this){if(!Object.prototype.hasOwnProperty.call(this,r)||r==="parent"||r==="proxyCache")continue;let a=this[r];if(Array.isArray(a))s[r]=a.map(o=>typeof o=="object"&&o.toJSON?o.toJSON(null,e):o);else if(typeof a=="object"&&a.toJSON)s[r]=a.toJSON(null,e);else if(r==="source"){let o=e.get(a.input);o==null&&(o=n,e.set(a.input,n),n++),s[r]={end:a.end,inputId:o,start:a.start}}else s[r]=a}return i&&(s.inputs=[...e.keys()].map(r=>r.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=hl){t.stringify&&(t=t.stringify);let e="";return t(this,s=>{e+=s}),e}warn(t,e,s){let i={node:this};for(let n in s)i[n]=s[n];return t.warn(e,i)}};var vt=ns;ns.default=ns;let dl=vt,os=class extends dl{constructor(t){super(t),this.type="comment"}};var St=os;os.default=os;let fl=vt,rs=class extends fl{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}};var xt=rs;rs.default=rs;let _n=St,Bn=xt,ml=vt,{isClean:Un,my:Wn}=Ae,Ds,jn,Vn,Rs;function zn(t){return t.map(e=>(e.nodes&&(e.nodes=zn(e.nodes)),delete e.source,e))}function Yn(t){if(t[Un]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)Yn(e)}let Z=class Gn extends ml{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]}append(...e){for(let s of e){let i=this.normalize(s,this.last);for(let n of i)this.proxyOf.nodes.push(n)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let s=this.getIterator(),i,n;for(;this.indexes[s]<this.proxyOf.nodes.length&&(i=this.indexes[s],n=e(this.proxyOf.nodes[i],i),n!==!1);)this.indexes[s]+=1;return delete this.indexes[s],n}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,s){return s==="proxyOf"?e:e[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?(...i)=>e[s](...i.map(n=>typeof n=="function"?(r,a)=>n(r.toProxy(),a):n)):s==="every"||s==="some"?i=>e[s]((n,...r)=>i(n.toProxy(),...r)):s==="root"?()=>e.root().toProxy():s==="nodes"?e.nodes.map(i=>i.toProxy()):s==="first"||s==="last"?e[s].toProxy():e[s]:e[s]},set(e,s,i){return e[s]===i||(e[s]=i,(s==="name"||s==="params"||s==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,s){let i=this.index(e),n=this.normalize(s,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(let a of n)this.proxyOf.nodes.splice(i+1,0,a);let r;for(let a in this.indexes)r=this.indexes[a],i<r&&(this.indexes[a]=r+n.length);return this.markDirty(),this}insertBefore(e,s){let i=this.index(e),n=i===0?"prepend":!1,r=this.normalize(s,this.proxyOf.nodes[i],n).reverse();i=this.index(e);for(let o of r)this.proxyOf.nodes.splice(i,0,o);let a;for(let o in this.indexes)a=this.indexes[o],i<=a&&(this.indexes[o]=a+r.length);return this.markDirty(),this}normalize(e,s){if(typeof e=="string")e=zn(jn(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Bn(e)]}else if(e.selector||e.selectors)e=[new Rs(e)];else if(e.name)e=[new Ds(e)];else if(e.text)e=[new _n(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[Wn]||Gn.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Un]&&Yn(i),i.raws||(i.raws={}),typeof i.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(i.raws.before=s.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let s of e){let i=this.normalize(s,this.first,"prepend").reverse();for(let n of i)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+i.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){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let s;for(let i in this.indexes)s=this.indexes[i],s>=e&&(this.indexes[i]=s-1);return this.markDirty(),this}replaceValues(e,s,i){return i||(i=s,s={}),this.walkDecls(n=>{s.props&&!s.props.includes(n.prop)||s.fast&&!n.value.includes(s.fast)||(n.value=n.value.replace(e,i))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((s,i)=>{let n;try{n=e(s,i)}catch(r){throw s.addToError(r)}return n!==!1&&s.walk&&(n=s.walk(e)),n})}walkAtRules(e,s){return s?e instanceof RegExp?this.walk((i,n)=>{if(i.type==="atrule"&&e.test(i.name))return s(i,n)}):this.walk((i,n)=>{if(i.type==="atrule"&&i.name===e)return s(i,n)}):(s=e,this.walk((i,n)=>{if(i.type==="atrule")return s(i,n)}))}walkComments(e){return this.walk((s,i)=>{if(s.type==="comment")return e(s,i)})}walkDecls(e,s){return s?e instanceof RegExp?this.walk((i,n)=>{if(i.type==="decl"&&e.test(i.prop))return s(i,n)}):this.walk((i,n)=>{if(i.type==="decl"&&i.prop===e)return s(i,n)}):(s=e,this.walk((i,n)=>{if(i.type==="decl")return s(i,n)}))}walkRules(e,s){return s?e instanceof RegExp?this.walk((i,n)=>{if(i.type==="rule"&&e.test(i.selector))return s(i,n)}):this.walk((i,n)=>{if(i.type==="rule"&&i.selector===e)return s(i,n)}):(s=e,this.walk((i,n)=>{if(i.type==="rule")return s(i,n)}))}};Z.registerParse=t=>{jn=t};Z.registerRule=t=>{Rs=t};Z.registerAtRule=t=>{Ds=t};Z.registerRoot=t=>{Vn=t};var K=Z;Z.default=Z;Z.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,Ds.prototype):t.type==="rule"?Object.setPrototypeOf(t,Rs.prototype):t.type==="decl"?Object.setPrototypeOf(t,Bn.prototype):t.type==="comment"?Object.setPrototypeOf(t,_n.prototype):t.type==="root"&&Object.setPrototypeOf(t,Vn.prototype),t[Wn]=!0,t.nodes&&t.nodes.forEach(e=>{Z.rebuild(e)})};let Xn=K,at=class extends Xn{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var Os=at;at.default=at;Xn.registerAtRule(at);let gl=K,Zn,$n,Ne=class extends gl{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Zn(new $n,this,t).stringify()}};Ne.registerLazyResult=t=>{Zn=t};Ne.registerProcessor=t=>{$n=t};var As=Ne;Ne.default=Ne;let yl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",wl=(t=21)=>{let e="",s=t|0;for(;s--;)e+=yl[Math.random()*64|0];return e};var bl={nanoid:wl};let{existsSync:vl,readFileSync:Sl}=V,{dirname:At,join:xl}=V,{SourceMapConsumer:Si,SourceMapGenerator:xi}=V;function Cl(t){return Buffer?Buffer.from(t,"base64").toString():window.atob(t)}let as=class{constructor(t,e){if(e.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let s=e.map?e.map.prev:void 0,i=this.loadMap(e.from,s);!this.mapFile&&e.from&&(this.mapFile=e.from),this.mapFile&&(this.root=At(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Si(this.text)),this.consumerCache}decodeInline(t){let e=/^data:application\/json;charset=utf-?8;base64,/,s=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/,r=t.match(i)||t.match(n);if(r)return decodeURIComponent(t.substr(r[0].length));let a=t.match(e)||t.match(s);if(a)return Cl(t.substr(a[0].length));let o=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let e=t.match(/\/\*\s*# sourceMappingURL=/g);if(!e)return;let s=t.lastIndexOf(e.pop()),i=t.indexOf("*/",s);s>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(s,i)))}loadFile(t){if(this.root=At(t),vl(t))return this.mapFile=t,Sl(t,"utf-8").toString().trim()}loadMap(t,e){if(e===!1)return!1;if(e){if(typeof e=="string")return e;if(typeof e=="function"){let s=e(t);if(s){let i=this.loadFile(s);if(!i)throw new Error("Unable to load previous source map: "+s.toString());return i}}else{if(e instanceof Si)return xi.fromSourceMap(e).toString();if(e instanceof xi)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let s=this.annotation;return t&&(s=xl(At(t),s)),this.loadFile(s)}}}startWith(t,e){return t?t.substr(0,e.length)===e:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Jn=as;as.default=as;let{nanoid:El}=bl,{isAbsolute:ls,resolve:cs}=V,{SourceMapConsumer:Ml,SourceMapGenerator:Nl}=V,{fileURLToPath:Ci,pathToFileURL:Ye}=V,Ei=ks,Tl=Jn,It=V,Pt=Symbol("fromOffsetCache"),kl=!!(Ml&&Nl),Mi=!!(cs&&ls),lt=class{get from(){return this.file||this.id}constructor(t,e={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,e.document&&(this.document=e.document.toString()),e.from&&(!Mi||/^\w+:\/\//.test(e.from)||ls(e.from)?this.file=e.from:this.file=cs(e.from)),Mi&&kl){let s=new Tl(this.css,e);if(s.text){this.map=s;let i=s.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+El(6)+">"),this.map&&(this.map.file=this.from)}error(t,e,s,i={}){let n,r,a;if(e&&typeof e=="object"){let l=e,c=s;if(typeof l.offset=="number"){let u=this.fromOffset(l.offset);e=u.line,s=u.col}else e=l.line,s=l.column;if(typeof c.offset=="number"){let u=this.fromOffset(c.offset);r=u.line,n=u.col}else r=c.line,n=c.column}else if(!s){let l=this.fromOffset(e);e=l.line,s=l.col}let o=this.origin(e,s,r,n);return o?a=new Ei(t,o.endLine===void 0?o.line:{column:o.column,line:o.line},o.endLine===void 0?o.column:{column:o.endColumn,line:o.endLine},o.source,o.file,i.plugin):a=new Ei(t,r===void 0?e:{column:s,line:e},r===void 0?s:{column:n,line:r},this.css,this.file,i.plugin),a.input={column:s,endColumn:n,endLine:r,line:e,source:this.css},this.file&&(Ye&&(a.input.url=Ye(this.file).toString()),a.input.file=this.file),a}fromOffset(t){let e,s;if(this[Pt])s=this[Pt];else{let n=this.css.split(`
|
|
54
|
-
`)
|
|
55
|
-
`," "];return Te.split(t,e)},split(t,e,s){let
|
|
50
|
+
`)&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawColon(t){let e;return t.walkDecls(s=>{if(typeof s.raws.between<"u")return e=s.raws.between.replace(/[^\s:]/g,""),!1}),e}rawEmptyBody(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length===0&&(e=s.raws.after,typeof e<"u"))return!1}),e}rawIndent(t){if(t.raws.indent)return t.raws.indent;let e;return t.walk(s=>{let r=s.parent;if(r&&r!==t&&r.parent&&r.parent===t&&typeof s.raws.before<"u"){let i=s.raws.before.split(`
|
|
51
|
+
`);return e=i[i.length-1],e=e.replace(/\S/g,""),!1}}),e}rawSemicolon(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length&&s.last.type==="decl"&&(e=s.raws.semicolon,typeof e<"u"))return!1}),e}rawValue(t,e){let s=t[e],r=t.raws[e];return r&&r.value===s?r.raw:s}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,e){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,e)}};var _i=ts;ts.default=ts;let ul=_i;function ss(t,e){new ul(e).stringify(t)}var bt=ss;ss.default=ss;var Ae={};Ae.isClean=Symbol("isClean");Ae.my=Symbol("my");let hl=ks,pl=_i,dl=bt,{isClean:me,my:fl}=Ae;function rs(t,e){let s=new t.constructor;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||r==="proxyCache")continue;let i=t[r],o=typeof i;r==="parent"&&o==="object"?e&&(s[r]=e):r==="source"?s[r]=i:Array.isArray(i)?s[r]=i.map(a=>rs(a,s)):(o==="object"&&i!==null&&(i=rs(i)),s[r]=i)}return s}function X(t,e){if(e&&typeof e.offset<"u")return e.offset;let s=1,r=1,i=0;for(let o=0;o<t.length;o++){if(r===e.line&&s===e.column){i=o;break}t[o]===`
|
|
52
|
+
`?(s=1,r+=1):s+=1}return i}let is=class{get proxyOf(){return this}constructor(t={}){this.raws={},this[me]=!1,this[fl]=!0;for(let e in t)if(e==="nodes"){this.nodes=[];for(let s of t[e])typeof s.clone=="function"?this.append(s.clone()):this.append(s)}else this[e]=t[e]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let e=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${e.input.from}:${e.start.line}:${e.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let e in t)this[e]=t[e];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let e=rs(this);for(let s in t)e[s]=t[s];return e}cloneAfter(t={}){let e=this.clone(t);return this.parent.insertAfter(this,e),e}cloneBefore(t={}){let e=this.clone(t);return this.parent.insertBefore(this,e),e}error(t,e={}){if(this.source){let{end:s,start:r}=this.rangeBy(e);return this.source.input.error(t,{column:r.column,line:r.line},{column:s.column,line:s.line},e)}return new hl(t)}getProxyProcessor(){return{get(t,e){return e==="proxyOf"?t:e==="root"?()=>t.root().toProxy():t[e]},set(t,e,s){return t[e]===s||(t[e]=s,(e==="prop"||e==="value"||e==="name"||e==="params"||e==="important"||e==="text")&&t.markDirty()),!0}}}markClean(){this[me]=!0}markDirty(){if(this[me]){this[me]=!1;let t=this;for(;t=t.parent;)t[me]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let e=this.source.start;if(t.index)e=this.positionInside(t.index);else if(t.word){let s="document"in this.source.input?this.source.input.document:this.source.input.css,r=s.slice(X(s,this.source.start),X(s,this.source.end)).indexOf(t.word);r!==-1&&(e=this.positionInside(r))}return e}positionInside(t){let e=this.source.start.column,s=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,i=X(r,this.source.start),o=i+t;for(let a=i;a<o;a++)r[a]===`
|
|
53
|
+
`?(e=1,s+=1):e+=1;return{column:e,line:s,offset:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let e="document"in this.source.input?this.source.input.document:this.source.input.css,s={column:this.source.start.column,line:this.source.start.line,offset:X(e,this.source.start)},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:X(e,this.source.end)+1}:{column:s.column+1,line:s.line,offset:s.offset+1};if(t.word){let i=e.slice(X(e,this.source.start),X(e,this.source.end)).indexOf(t.word);i!==-1&&(s=this.positionInside(i),r=this.positionInside(i+t.word.length))}else t.start?s={column:t.start.column,line:t.start.line,offset:X(e,t.start)}:t.index&&(s=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line,offset:X(e,t.end)}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<s.line||r.line===s.line&&r.column<=s.column)&&(r={column:s.column+1,line:s.line,offset:s.offset+1}),{end:r,start:s}}raw(t,e){return new pl().raw(this,t,e)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let e=this,s=!1;for(let r of t)r===this?s=!0:s?(this.parent.insertAfter(e,r),e=r):this.parent.insertBefore(e,r);s||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,e){let s={},r=e==null;e=e||new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))s[o]=a.map(n=>typeof n=="object"&&n.toJSON?n.toJSON(null,e):n);else if(typeof a=="object"&&a.toJSON)s[o]=a.toJSON(null,e);else if(o==="source"){if(a==null)continue;let n=e.get(a.input);n==null&&(n=i,e.set(a.input,i),i++),s[o]={end:a.end,inputId:n,start:a.start}}else s[o]=a}return r&&(s.inputs=[...e.keys()].map(o=>o.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=dl){t.stringify&&(t=t.stringify);let e="";return t(this,s=>{e+=s}),e}warn(t,e,s={}){let r={node:this};for(let i in s)r[i]=s[i];return t.warn(e,r)}};var vt=is;is.default=is;let ml=vt,ns=class extends ml{constructor(t){super(t),this.type="comment"}};var St=ns;ns.default=ns;let gl=vt,os=class extends gl{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}};var xt=os;os.default=os;let Bi=St,Ui=xt,yl=vt,{isClean:Wi,my:ji}=Ae,Ds,Vi,zi,Rs;function Yi(t){return t.map(e=>(e.nodes&&(e.nodes=Yi(e.nodes)),delete e.source,e))}function Gi(t){if(t[Wi]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)Gi(e)}let J=class Zi extends yl{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]}append(...e){for(let s of e){let r=this.normalize(s,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let s=this.getIterator(),r,i;for(;this.indexes[s]<this.proxyOf.nodes.length&&(r=this.indexes[s],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[s]+=1;return delete this.indexes[s],i}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,s){return s==="proxyOf"?e:e[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?(...r)=>e[s](...r.map(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):s==="every"||s==="some"?r=>e[s]((i,...o)=>r(i.toProxy(),...o)):s==="root"?()=>e.root().toProxy():s==="nodes"?e.nodes.map(r=>r.toProxy()):s==="first"||s==="last"?e[s].toProxy():e[s]:e[s]},set(e,s,r){return e[s]===r||(e[s]=r,(s==="name"||s==="params"||s==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,s){let r=this.index(e),i=this.normalize(s,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(e,s){let r=this.index(e),i=r===0?"prepend":!1,o=this.normalize(s,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let n of o)this.proxyOf.nodes.splice(r,0,n);let a;for(let n in this.indexes)a=this.indexes[n],r<=a&&(this.indexes[n]=a+o.length);return this.markDirty(),this}normalize(e,s){if(typeof e=="string")e=Yi(Vi(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Ui(e)]}else if(e.selector||e.selectors)e=[new Rs(e)];else if(e.name)e=[new Ds(e)];else if(e.text)e=[new Bi(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[ji]||Zi.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[Wi]&&Gi(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(r.raws.before=s.raws.before.replace(/\S/g,"")),r.parent=this.proxyOf,r))}prepend(...e){e=e.reverse();for(let s of e){let r=this.normalize(s,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.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){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let s;for(let r in this.indexes)s=this.indexes[r],s>=e&&(this.indexes[r]=s-1);return this.markDirty(),this}replaceValues(e,s,r){return r||(r=s,s={}),this.walkDecls(i=>{s.props&&!s.props.includes(i.prop)||s.fast&&!i.value.includes(s.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((s,r)=>{let i;try{i=e(s,r)}catch(o){throw s.addToError(o)}return i!==!1&&s.walk&&(i=s.walk(e)),i})}walkAtRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return s(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="atrule")return s(r,i)}))}walkComments(e){return this.walk((s,r)=>{if(s.type==="comment")return e(s,r)})}walkDecls(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return s(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="decl")return s(r,i)}))}walkRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return s(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="rule")return s(r,i)}))}};J.registerParse=t=>{Vi=t};J.registerRule=t=>{Rs=t};J.registerAtRule=t=>{Ds=t};J.registerRoot=t=>{zi=t};var ee=J;J.default=J;J.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,Ds.prototype):t.type==="rule"?Object.setPrototypeOf(t,Rs.prototype):t.type==="decl"?Object.setPrototypeOf(t,Ui.prototype):t.type==="comment"?Object.setPrototypeOf(t,Bi.prototype):t.type==="root"&&Object.setPrototypeOf(t,zi.prototype),t[ji]=!0,t.nodes&&t.nodes.forEach(e=>{J.rebuild(e)})};let Xi=ee,at=class extends Xi{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var Os=at;at.default=at;Xi.registerAtRule(at);let wl=ee,Hi,Ji,Ne=class extends wl{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Hi(new Ji,this,t).stringify()}};Ne.registerLazyResult=t=>{Hi=t};Ne.registerProcessor=t=>{Ji=t};var As=Ne;Ne.default=Ne;let bl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",vl=(t=21)=>{let e="",s=t|0;for(;s--;)e+=bl[Math.random()*64|0];return e};var Sl={nanoid:vl};let{existsSync:xl,readFileSync:Cl}=V,{dirname:At,join:El}=V,{SourceMapConsumer:xr,SourceMapGenerator:Cr}=V;function Ml(t){return Buffer?Buffer.from(t,"base64").toString():window.atob(t)}let as=class{constructor(t,e){if(e.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let s=e.map?e.map.prev:void 0,r=this.loadMap(e.from,s);!this.mapFile&&e.from&&(this.mapFile=e.from),this.mapFile&&(this.root=At(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new xr(this.text)),this.consumerCache}decodeInline(t){let e=/^data:application\/json;charset=utf-?8;base64,/,s=/^data:application\/json;base64,/,r=/^data:application\/json;charset=utf-?8,/,i=/^data:application\/json,/,o=t.match(r)||t.match(i);if(o)return decodeURIComponent(t.substr(o[0].length));let a=t.match(e)||t.match(s);if(a)return Ml(t.substr(a[0].length));let n=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let e=t.match(/\/\*\s*# sourceMappingURL=/g);if(!e)return;let s=t.lastIndexOf(e.pop()),r=t.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(t.substring(s,r)))}loadFile(t){if(this.root=At(t),xl(t))return this.mapFile=t,Cl(t,"utf-8").toString().trim()}loadMap(t,e){if(e===!1)return!1;if(e){if(typeof e=="string")return e;if(typeof e=="function"){let s=e(t);if(s){let r=this.loadFile(s);if(!r)throw new Error("Unable to load previous source map: "+s.toString());return r}}else{if(e instanceof xr)return Cr.fromSourceMap(e).toString();if(e instanceof Cr)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let s=this.annotation;return t&&(s=El(At(t),s)),this.loadFile(s)}}}startWith(t,e){return t?t.substr(0,e.length)===e:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var $i=as;as.default=as;let{nanoid:Nl}=Sl,{isAbsolute:ls,resolve:cs}=V,{SourceMapConsumer:Tl,SourceMapGenerator:kl}=V,{fileURLToPath:Er,pathToFileURL:Ye}=V,Mr=ks,Dl=$i,It=V,Pt=Symbol("lineToIndexCache"),Rl=!!(Tl&&kl),Nr=!!(cs&&ls);function Tr(t){if(t[Pt])return t[Pt];let e=t.css.split(`
|
|
54
|
+
`),s=new Array(e.length),r=0;for(let i=0,o=e.length;i<o;i++)s[i]=r,r+=e[i].length+1;return t[Pt]=s,s}let lt=class{get from(){return this.file||this.id}constructor(t,e={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,e.document&&(this.document=e.document.toString()),e.from&&(!Nr||/^\w+:\/\//.test(e.from)||ls(e.from)?this.file=e.from:this.file=cs(e.from)),Nr&&Rl){let s=new Dl(this.css,e);if(s.text){this.map=s;let r=s.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+Nl(6)+">"),this.map&&(this.map.file=this.from)}error(t,e,s,r={}){let i,o,a,n,c;if(e&&typeof e=="object"){let u=e,h=s;if(typeof u.offset=="number"){n=u.offset;let p=this.fromOffset(n);e=p.line,s=p.col}else e=u.line,s=u.column,n=this.fromLineAndColumn(e,s);if(typeof h.offset=="number"){a=h.offset;let p=this.fromOffset(a);o=p.line,i=p.col}else o=h.line,i=h.column,a=this.fromLineAndColumn(h.line,h.column)}else if(s)n=this.fromLineAndColumn(e,s);else{n=e;let u=this.fromOffset(n);e=u.line,s=u.col}let l=this.origin(e,s,o,i);return l?c=new Mr(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,r.plugin):c=new Mr(t,o===void 0?e:{column:s,line:e},o===void 0?s:{column:i,line:o},this.css,this.file,r.plugin),c.input={column:s,endColumn:i,endLine:o,endOffset:a,line:e,offset:n,source:this.css},this.file&&(Ye&&(c.input.url=Ye(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(t,e){return Tr(this)[t-1]+e-1}fromOffset(t){let e=Tr(this),s=e[e.length-1],r=0;if(t>=s)r=e.length-1;else{let i=e.length-2,o;for(;r<i;)if(o=r+(i-r>>1),t<e[o])i=o-1;else if(t>=e[o+1])r=o+1;else{r=o;break}}return{col:t-e[r]+1,line:r+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:cs(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,e,s,r){if(!this.map)return!1;let i=this.map.consumer(),o=i.originalPositionFor({column:e,line:t});if(!o.source)return!1;let a;typeof s=="number"&&(a=i.originalPositionFor({column:r,line:s}));let n;ls(o.source)?n=Ye(o.source):n=new URL(o.source,this.map.consumer().sourceRoot||Ye(this.map.mapFile));let c={column:o.column,endColumn:a&&a.column,endLine:a&&a.line,line:o.line,url:n.toString()};if(n.protocol==="file:")if(Er)c.file=Er(n);else throw new Error("file: protocol is not available in this PostCSS build");let l=i.sourceContentFor(o.source);return l&&(c.source=l),c}toJSON(){let t={};for(let e of["hasBOM","css","file","id"])this[e]!=null&&(t[e]=this[e]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}};var Ct=lt;lt.default=lt;It&&It.registerInput&&It.registerInput(lt);let Qi=ee,Ki,qi,le=class extends Qi{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,e,s){let r=super.normalize(t);if(e){if(s==="prepend")this.nodes.length>1?e.raws.before=this.nodes[1].raws.before:delete e.raws.before;else if(this.first!==e)for(let i of r)i.raws.before=e.raws.before}return r}removeChild(t,e){let s=this.index(t);return!e&&s===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(t)}toResult(t={}){return new Ki(new qi,this,t).stringify()}};le.registerLazyResult=t=>{Ki=t};le.registerProcessor=t=>{qi=t};var Ie=le;le.default=le;Qi.registerRoot(le);let Te={comma(t){return Te.split(t,[","],!0)},space(t){let e=[" ",`
|
|
55
|
+
`," "];return Te.split(t,e)},split(t,e,s){let r=[],i="",o=!1,a=0,n=!1,c="",l=!1;for(let u of t)l?l=!1:u==="\\"?l=!0:n?u===c&&(n=!1):u==='"'||u==="'"?(n=!0,c=u):u==="("?a+=1:u===")"?a>0&&(a-=1):a===0&&e.includes(u)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=u;return(s||i!=="")&&r.push(i.trim()),r}};var en=Te;Te.default=Te;let tn=ee,Ol=en,ct=class extends tn{get selectors(){return Ol.comma(this.selector)}set selectors(t){let e=this.selector?this.selector.match(/,\s*/):null,s=e?e[0]:","+this.raw("between","beforeOpen");this.selector=t.join(s)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};var Is=ct;ct.default=ct;tn.registerRule(ct);let Al=Os,Il=St,Pl=xt,Ll=Ct,Fl=$i,_l=Ie,Bl=Is;function ke(t,e){if(Array.isArray(t))return t.map(i=>ke(i));let{inputs:s,...r}=t;if(s){e=[];for(let i of s){let o={...i,__proto__:Ll.prototype};o.map&&(o.map={...o.map,__proto__:Fl.prototype}),e.push(o)}}if(r.nodes&&(r.nodes=t.nodes.map(i=>ke(i,e))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=e[i])}if(r.type==="root")return new _l(r);if(r.type==="decl")return new Pl(r);if(r.type==="rule")return new Bl(r);if(r.type==="comment")return new Il(r);if(r.type==="atrule")return new Al(r);throw new Error("Unknown node type: "+t.type)}var Ul=ke;ke.default=ke;let{dirname:et,relative:sn,resolve:rn,sep:nn}=V,{SourceMapConsumer:on,SourceMapGenerator:tt}=V,{pathToFileURL:kr}=V,Wl=Ct,jl=!!(on&&tt),Vl=!!(et&&rn&&sn&&nn),zl=class{constructor(t,e,s,r){this.stringify=t,this.mapOpts=s.map||{},this.root=e,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 t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let e=`
|
|
56
56
|
`;this.css.includes(`\r
|
|
57
57
|
`)&&(e=`\r
|
|
58
|
-
`),this.css+=e+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let e=this.toUrl(this.path(t.file)),s=t.root||et(t.file),
|
|
59
|
-
`),e=a.length-n):e+=a.length,o&&l!=="start"){let c=o.parent||{raws:{}};(!(o.type==="decl"||o.type==="atrule"&&!o.nodes)||o!==c.last||c.raws.semicolon)&&(o.source&&o.source.end?(i.source=this.sourcePath(o),i.original.line=o.source.end.line,i.original.column=o.source.end.column-1,i.generated.line=t,i.generated.column=e-2,this.map.addMapping(i)):(i.source=s,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=e-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(e=>e.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let e=this.memoizedPaths.get(t);if(e)return e;let s=this.opts.to?et(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(s=et(so(s,this.mapOpts.annotation)));let i=to(s,t);return this.memoizedPaths.set(t,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let e=t.source.input.map;this.previousMaps.includes(e)||this.previousMaps.push(e)}});else{let t=new Bl(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(e=>{if(e.source){let s=e.source.input.from;if(s&&!t[s]){t[s]=!0;let i=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(i,e.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(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let e=this.memoizedFileURLs.get(t);if(e)return e;if(Ni){let s=Ni(t).toString();return this.memoizedFileURLs.set(t,s),s}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let e=this.memoizedURLs.get(t);if(e)return e;io==="\\"&&(t=t.replace(/\\/g,"/"));let s=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,s),s}};var oo=jl;const Lt=39,Ti=34,Ge=92,ki=47,Xe=10,ge=32,Ze=12,$e=9,Je=13,Vl=91,zl=93,Yl=40,Gl=41,Xl=123,Zl=125,$l=59,Jl=42,Hl=58,Ql=64,He=/[\t\n\f\r "#'()/;[\\\]{}]/g,Qe=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Kl=/.[\r\n"'(/\\]/,Di=/[\da-f]/i;var ql=function(t,e={}){let s=t.css.valueOf(),i=e.ignoreErrors,n,r,a,o,l,c,u,h,p,m,v=s.length,d=0,S=[],f=[];function w(){return d}function g(L){throw t.error("Unclosed "+L,d)}function E(){return f.length===0&&d>=v}function I(L){if(f.length)return f.pop();if(d>=v)return;let W=L?L.ignoreUnclosed:!1;switch(n=s.charCodeAt(d),n){case Xe:case ge:case $e:case Je:case Ze:{o=d;do o+=1,n=s.charCodeAt(o);while(n===ge||n===Xe||n===$e||n===Je||n===Ze);c=["space",s.slice(d,o)],d=o-1;break}case Vl:case zl:case Xl:case Zl:case Hl:case $l:case Gl:{let H=String.fromCharCode(n);c=[H,H,d];break}case Yl:{if(m=S.length?S.pop()[1]:"",p=s.charCodeAt(d+1),m==="url"&&p!==Lt&&p!==Ti&&p!==ge&&p!==Xe&&p!==$e&&p!==Ze&&p!==Je){o=d;do{if(u=!1,o=s.indexOf(")",o+1),o===-1)if(i||W){o=d;break}else g("bracket");for(h=o;s.charCodeAt(h-1)===Ge;)h-=1,u=!u}while(u);c=["brackets",s.slice(d,o+1),d,o],d=o}else o=s.indexOf(")",d+1),r=s.slice(d,o+1),o===-1||Kl.test(r)?c=["(","(",d]:(c=["brackets",r,d,o],d=o);break}case Lt:case Ti:{l=n===Lt?"'":'"',o=d;do{if(u=!1,o=s.indexOf(l,o+1),o===-1)if(i||W){o=d+1;break}else g("string");for(h=o;s.charCodeAt(h-1)===Ge;)h-=1,u=!u}while(u);c=["string",s.slice(d,o+1),d,o],d=o;break}case Ql:{He.lastIndex=d+1,He.test(s),He.lastIndex===0?o=s.length-1:o=He.lastIndex-2,c=["at-word",s.slice(d,o+1),d,o],d=o;break}case Ge:{for(o=d,a=!0;s.charCodeAt(o+1)===Ge;)o+=1,a=!a;if(n=s.charCodeAt(o+1),a&&n!==ki&&n!==ge&&n!==Xe&&n!==$e&&n!==Je&&n!==Ze&&(o+=1,Di.test(s.charAt(o)))){for(;Di.test(s.charAt(o+1));)o+=1;s.charCodeAt(o+1)===ge&&(o+=1)}c=["word",s.slice(d,o+1),d,o],d=o;break}default:{n===ki&&s.charCodeAt(d+1)===Jl?(o=s.indexOf("*/",d+2)+1,o===0&&(i||W?o=s.length:g("comment")),c=["comment",s.slice(d,o+1),d,o],d=o):(Qe.lastIndex=d+1,Qe.test(s),Qe.lastIndex===0?o=s.length-1:o=Qe.lastIndex-2,c=["word",s.slice(d,o+1),d,o],S.push(c),d=o);break}}return d++,c}function B(L){f.push(L)}return{back:B,endOfFile:E,nextToken:I,position:w}};let ec=Os,tc=St,sc=xt,ic=Ie,Ri=Is,nc=ql;const Oi={empty:!0,space:!0};function oc(t){for(let e=t.length-1;e>=0;e--){let s=t[e],i=s[3]||s[2];if(i)return i}}let rc=class{constructor(t){this.input=t,this.root=new ic,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let e=new ec;e.name=t[1].slice(1),e.name===""&&this.unnamedAtrule(e,t),this.init(e,t[2]);let s,i,n,r=!1,a=!1,o=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),s=t[0],s==="("||s==="["?l.push(s==="("?")":"]"):s==="{"&&l.length>0?l.push("}"):s===l[l.length-1]&&l.pop(),l.length===0)if(s===";"){e.source.end=this.getPosition(t[2]),e.source.end.offset++,this.semicolon=!0;break}else if(s==="{"){a=!0;break}else if(s==="}"){if(o.length>0){for(n=o.length-1,i=o[n];i&&i[0]==="space";)i=o[--n];i&&(e.source.end=this.getPosition(i[3]||i[2]),e.source.end.offset++)}this.end(t);break}else o.push(t);else o.push(t);if(this.tokenizer.endOfFile()){r=!0;break}}e.raws.between=this.spacesAndCommentsFromEnd(o),o.length?(e.raws.afterName=this.spacesAndCommentsFromStart(o),this.raw(e,"params",o),r&&(t=o[o.length-1],e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++,this.spaces=e.raws.between,e.raws.between="")):(e.raws.afterName="",e.params=""),a&&(e.nodes=[],this.current=e)}checkMissedSemicolon(t){let e=this.colon(t);if(e===!1)return;let s=0,i;for(let n=e-1;n>=0&&(i=t[n],!(i[0]!=="space"&&(s+=1,s===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let e=0,s,i,n;for(let[r,a]of t.entries()){if(i=a,n=i[0],n==="("&&(e+=1),n===")"&&(e-=1),e===0&&n===":")if(!s)this.doubleColon(i);else{if(s[0]==="word"&&s[1]==="progid")continue;return r}s=i}return!1}comment(t){let e=new tc;this.init(e,t[2]),e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++;let s=t[1].slice(2,-2);if(/^\s*$/.test(s))e.text="",e.raws.left=s,e.raws.right="";else{let i=s.match(/^(\s*)([^]*\S)(\s*)$/);e.text=i[2],e.raws.left=i[1],e.raws.right=i[3]}}createTokenizer(){this.tokenizer=nc(this.input)}decl(t,e){let s=new sc;this.init(s,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),s.source.end=this.getPosition(i[3]||i[2]||oc(t)),s.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),s.raws.before+=t.shift()[1];for(s.source.start=this.getPosition(t[0][2]),s.prop="";t.length;){let o=t[0][0];if(o===":"||o==="space"||o==="comment")break;s.prop+=t.shift()[1]}s.raws.between="";let n;for(;t.length;)if(n=t.shift(),n[0]===":"){s.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),s.raws.between+=n[1];(s.prop[0]==="_"||s.prop[0]==="*")&&(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let r=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)r.push(t.shift());this.precheckMissedSemicolon(t);for(let o=t.length-1;o>=0;o--){if(n=t[o],n[1].toLowerCase()==="!important"){s.important=!0;let l=this.stringFrom(t,o);l=this.spacesFromEnd(t)+l,l!==" !important"&&(s.raws.important=l);break}else if(n[1].toLowerCase()==="important"){let l=t.slice(0),c="";for(let u=o;u>0;u--){let h=l[u][0];if(c.trim().startsWith("!")&&h!=="space")break;c=l.pop()[1]+c}c.trim().startsWith("!")&&(s.important=!0,s.raws.important=c,t=l)}if(n[0]!=="space"&&n[0]!=="comment")break}t.some(o=>o[0]!=="space"&&o[0]!=="comment")&&(s.raws.between+=r.map(o=>o[1]).join(""),r=[]),this.raw(s,"value",r.concat(t),e),s.value.includes(":")&&!e&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let e=new Ri;this.init(e,t[2]),e.selector="",e.raws.between="",this.current=e}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type==="rule"&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="",e.source.end=this.getPosition(t[2]),e.source.end.offset+=e.raws.ownSemicolon.length)}}getPosition(t){let e=this.input.fromOffset(t);return{column:e.col,line:e.line,offset:t}}init(t,e){this.current.push(t),t.source={input:this.input,start:this.getPosition(e)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let e=!1,s=null,i=!1,n=null,r=[],a=t[1].startsWith("--"),o=[],l=t;for(;l;){if(s=l[0],o.push(l),s==="("||s==="[")n||(n=l),r.push(s==="("?")":"]");else if(a&&i&&s==="{")n||(n=l),r.push("}");else if(r.length===0)if(s===";")if(i){this.decl(o,a);return}else break;else if(s==="{"){this.rule(o);return}else if(s==="}"){this.tokenizer.back(o.pop()),e=!0;break}else s===":"&&(i=!0);else s===r[r.length-1]&&(r.pop(),r.length===0&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(e=!0),r.length>0&&this.unclosedBracket(n),e&&i){if(!a)for(;o.length&&(l=o[o.length-1][0],!(l!=="space"&&l!=="comment"));)this.tokenizer.back(o.pop());this.decl(o,a)}else this.unknownWord(o)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,e,s,i){let n,r,a=s.length,o="",l=!0,c,u;for(let h=0;h<a;h+=1)n=s[h],r=n[0],r==="space"&&h===a-1&&!i?l=!1:r==="comment"?(u=s[h-1]?s[h-1][0]:"empty",c=s[h+1]?s[h+1][0]:"empty",!Oi[u]&&!Oi[c]?o.slice(-1)===","?l=!1:o+=n[1]:l=!1):o+=n[1];if(!l){let h=s.reduce((p,m)=>p+m[1],"");t.raws[e]={raw:h,value:o}}t[e]=o}rule(t){t.pop();let e=new Ri;this.init(e,t[0][2]),e.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(e,"selector",t),this.current=e}spacesAndCommentsFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],!(e!=="space"&&e!=="comment"));)s=t.pop()[1]+s;return s}spacesAndCommentsFromStart(t){let e,s="";for(;t.length&&(e=t[0][0],!(e!=="space"&&e!=="comment"));)s+=t.shift()[1];return s}spacesFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],e==="space");)s=t.pop()[1]+s;return s}stringFrom(t,e){let s="";for(let i=e;i<t.length;i++)s+=t[i][1];return t.splice(e,t.length-e),s}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,e){throw this.input.error("At-rule without name",{offset:e[2]},{offset:e[2]+e[1].length})}};var ac=rc;let lc=K,cc=Ct,uc=ac;function ut(t,e){let s=new cc(t,e),i=new uc(s);try{i.parse()}catch(n){throw process.env.NODE_ENV!=="production"&&n.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?n.message+=`
|
|
60
|
-
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(e.from)?
|
|
61
|
-
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(e.from)&&(
|
|
62
|
-
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),n}return i.root}var Ps=ut;ut.default=ut;lc.registerParse(ut);let us=class{constructor(t,e={}){if(this.type="warning",this.text=t,e.node&&e.node.source){let s=e.node.rangeBy(e);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in e)this[s]=e[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 ro=us;us.default=us;let hc=ro,hs=class{get content(){return this.css}constructor(t,e,s){this.processor=t,this.messages=[],this.root=e,this.opts=s,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,e={}){e.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(e.plugin=this.lastPlugin.postcssPlugin);let s=new hc(t,e);return this.messages.push(s),s}warnings(){return this.messages.filter(t=>t.type==="warning")}};var Ls=hs;hs.default=hs;let Ai={};var ao=function(t){Ai[t]||(Ai[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))};let pc=K,dc=As,fc=oo,mc=Ps,Ii=Ls,gc=Ie,yc=bt,{isClean:Y,my:wc}=Ae,bc=ao;const vc={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Sc={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},xc={Once:!0,postcssPlugin:!0,prepare:!0},ae=0;function ye(t){return typeof t=="object"&&typeof t.then=="function"}function lo(t){let e=!1,s=vc[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[s,s+"-"+e,ae,s+"Exit",s+"Exit-"+e]:e?[s,s+"-"+e,s+"Exit",s+"Exit-"+e]:t.append?[s,ae,s+"Exit"]:[s,s+"Exit"]}function Pi(t){let e;return t.type==="document"?e=["Document",ae,"DocumentExit"]:t.type==="root"?e=["Root",ae,"RootExit"]:e=lo(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function ps(t){return t[Y]=!1,t.nodes&&t.nodes.forEach(e=>ps(e)),t}let ds={},le=class co{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"}constructor(e,s,i){this.stringified=!1,this.processed=!1;let n;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))n=ps(s);else if(s instanceof co||s instanceof Ii)n=ps(s.root),s.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=s.map);else{let r=mc;i.syntax&&(r=i.syntax.parse),i.parser&&(r=i.parser),r.parse&&(r=r.parse);try{n=r(s,i)}catch(a){this.processed=!0,this.error=a}n&&!n[wc]&&pc.rebuild(n)}this.result=new Ii(e,n,i),this.helpers={...ds,postcss:ds,result:this.result},this.plugins=this.processor.plugins.map(r=>typeof r=="object"&&r.prepare?{...r,...r.prepare(this.result)}:r)}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,s){let i=this.result.lastPlugin;try{if(s&&s.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=i.postcssPlugin,e.setMessage();else if(i.postcssVersion&&process.env.NODE_ENV!=="production"){let n=i.postcssPlugin,r=i.postcssVersion,a=this.result.processor.version,o=r.split("."),l=a.split(".");(o[0]!==l[0]||parseInt(o[1])>parseInt(l[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+a+", but "+n+" uses "+r+". Perhaps this is the source of the error below.")}}catch(n){console&&console.error&&console.error(n)}return e}prepareVisitors(){this.listeners={};let e=(s,i,n)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([s,n])};for(let s of this.plugins)if(typeof s=="object")for(let i in s){if(!Sc[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!xc[i])if(typeof s[i]=="object")for(let n in s[i])n==="*"?e(s,i,s[i][n]):e(s,i+"-"+n.toLowerCase(),s[i][n]);else typeof s[i]=="function"&&e(s,i,s[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let s=this.plugins[e],i=this.runOnRoot(s);if(ye(i))try{await i}catch(n){throw this.handleError(n)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Y];){e[Y]=!0;let s=[Pi(e)];for(;s.length>0;){let i=this.visitTick(s);if(ye(i))try{await i}catch(n){let r=s[s.length-1].node;throw this.handleError(n,r)}}}if(this.listeners.OnceExit)for(let[s,i]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(e.type==="document"){let n=e.nodes.map(r=>i(r,this.helpers));await Promise.all(n)}else await i(e,this.helpers)}catch(n){throw this.handleError(n)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let s=this.result.root.nodes.map(i=>e.Once(i,this.helpers));return ye(s[0])?Promise.all(s):s}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(s){throw this.handleError(s)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,s=yc;e.syntax&&(s=e.syntax.stringify),e.stringifier&&(s=e.stringifier),s.stringify&&(s=s.stringify);let i=new fc(s,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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){let s=this.runOnRoot(e);if(ye(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Y];)e[Y]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let s of e.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,s){return process.env.NODE_ENV!=="production"&&("from"in this.opts||bc("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,s)}toString(){return this.css}visitSync(e,s){for(let[i,n]of e){this.result.lastPlugin=i;let r;try{r=n(s,this.helpers)}catch(a){throw this.handleError(a,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if(ye(r))throw this.getAsyncError()}}visitTick(e){let s=e[e.length-1],{node:i,visitors:n}=s;if(i.type!=="root"&&i.type!=="document"&&!i.parent){e.pop();return}if(n.length>0&&s.visitorIndex<n.length){let[a,o]=n[s.visitorIndex];s.visitorIndex+=1,s.visitorIndex===n.length&&(s.visitors=[],s.visitorIndex=0),this.result.lastPlugin=a;try{return o(i.toProxy(),this.helpers)}catch(l){throw this.handleError(l,i)}}if(s.iterator!==0){let a=s.iterator,o;for(;o=i.nodes[i.indexes[a]];)if(i.indexes[a]+=1,!o[Y]){o[Y]=!0,e.push(Pi(o));return}s.iterator=0,delete i.indexes[a]}let r=s.events;for(;s.eventIndex<r.length;){let a=r[s.eventIndex];if(s.eventIndex+=1,a===ae){i.nodes&&i.nodes.length&&(i[Y]=!0,s.iterator=i.getIterator());return}else if(this.listeners[a]){s.visitors=this.listeners[a];return}}e.pop()}walkSync(e){e[Y]=!0;let s=lo(e);for(let i of s)if(i===ae)e.nodes&&e.each(n=>{n[Y]||this.walkSync(n)});else{let n=this.listeners[i];if(n&&this.visitSync(n,e.toProxy()))return}}warnings(){return this.sync().warnings()}};le.registerPostcss=t=>{ds=t};var uo=le;le.default=le;gc.registerLazyResult(le);dc.registerLazyResult(le);let Cc=oo,Ec=Ps;const Mc=Ls;let Nc=bt,Tc=ao,fs=class{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 t,e=Ec;try{t=e(this._css,this._opts)}catch(s){this.error=s}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,e,s){e=e.toString(),this.stringified=!1,this._processor=t,this._css=e,this._opts=s,this._map=void 0;let i,n=Nc;this.result=new Mc(this._processor,i,this._opts),this.result.css=e;let r=this;Object.defineProperty(this.result,"root",{get(){return r.root}});let a=new Cc(n,i,this._opts,e);if(a.isMap()){let[o,l]=a.generate();o&&(this.result.css=o),l&&(this.result.map=l)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,e){return process.env.NODE_ENV!=="production"&&("from"in this._opts||Tc("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(t,e)}toString(){return this._css}warnings(){return[]}};var kc=fs;fs.default=fs;let Dc=As,Rc=uo,Oc=kc,Ac=Ie,De=class{constructor(t=[]){this.version="8.5.3",this.plugins=this.normalize(t)}normalize(t){let e=[];for(let s of t)if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),typeof s=="object"&&Array.isArray(s.plugins))e=e.concat(s.plugins);else if(typeof s=="object"&&s.postcssPlugin)e.push(s);else if(typeof s=="function")e.push(s);else if(typeof s=="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production")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.")}else throw new Error(s+" is not a PostCSS plugin");return e}process(t,e={}){return!this.plugins.length&&!e.parser&&!e.stringifier&&!e.syntax?new Oc(this,t,e):new Rc(this,t,e)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var Ic=De;De.default=De;Ac.registerProcessor(De);Dc.registerProcessor(De);let ho=Os,po=St,Pc=K,Lc=ks,fo=xt,mo=As,Fc=_l,_c=Ct,Bc=uo,Uc=qn,Wc=vt,jc=Ps,Fs=Ic,Vc=Ls,go=Ie,yo=Is,zc=bt,Yc=ro;function D(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Fs(t)}D.plugin=function(t,e){let s=!1;function i(...r){console&&console.warn&&!s&&(s=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
58
|
+
`),this.css+=e+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let e=this.toUrl(this.path(t.file)),s=t.root||et(t.file),r;this.mapOpts.sourcesContent===!1?(r=new on(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,e,this.toUrl(this.path(s)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let e=this.root.nodes.length-1;e>=0;e--)t=this.root.nodes[e],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Vl&&jl&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=tt.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new tt({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 tt({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,e=1,s="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},i,o;this.stringify(this.root,(a,n,c)=>{if(this.css+=a,n&&c!=="end"&&(r.generated.line=t,r.generated.column=e-1,n.source&&n.source.start?(r.source=this.sourcePath(n),r.original.line=n.source.start.line,r.original.column=n.source.start.column-1,this.map.addMapping(r)):(r.source=s,r.original.line=1,r.original.column=0,this.map.addMapping(r))),o=a.match(/\n/g),o?(t+=o.length,i=a.lastIndexOf(`
|
|
59
|
+
`),e=a.length-i):e+=a.length,n&&c!=="start"){let l=n.parent||{raws:{}};(!(n.type==="decl"||n.type==="atrule"&&!n.nodes)||n!==l.last||l.raws.semicolon)&&(n.source&&n.source.end?(r.source=this.sourcePath(n),r.original.line=n.source.end.line,r.original.column=n.source.end.column-1,r.generated.line=t,r.generated.column=e-2,this.map.addMapping(r)):(r.source=s,r.original.line=1,r.original.column=0,r.generated.line=t,r.generated.column=e-1,this.map.addMapping(r)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(e=>e.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let e=this.memoizedPaths.get(t);if(e)return e;let s=this.opts.to?et(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(s=et(rn(s,this.mapOpts.annotation)));let r=sn(s,t);return this.memoizedPaths.set(t,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let e=t.source.input.map;this.previousMaps.includes(e)||this.previousMaps.push(e)}});else{let t=new Wl(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(e=>{if(e.source){let s=e.source.input.from;if(s&&!t[s]){t[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,e.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(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let e=this.memoizedFileURLs.get(t);if(e)return e;if(kr){let s=kr(t).toString();return this.memoizedFileURLs.set(t,s),s}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let e=this.memoizedURLs.get(t);if(e)return e;nn==="\\"&&(t=t.replace(/\\/g,"/"));let s=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,s),s}};var an=zl;const Lt=39,Dr=34,Ge=92,Rr=47,Ze=10,ge=32,Xe=12,He=9,Je=13,Yl=91,Gl=93,Zl=40,Xl=41,Hl=123,Jl=125,$l=59,Ql=42,Kl=58,ql=64,$e=/[\t\n\f\r "#'()/;[\\\]{}]/g,Qe=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ec=/.[\r\n"'(/\\]/,Or=/[\da-f]/i;var tc=function(t,e={}){let s=t.css.valueOf(),r=e.ignoreErrors,i,o,a,n,c,l,u,h,p,m,v=s.length,d=0,S=[],f=[];function w(){return d}function g(L){throw t.error("Unclosed "+L,d)}function E(){return f.length===0&&d>=v}function I(L){if(f.length)return f.pop();if(d>=v)return;let W=L?L.ignoreUnclosed:!1;switch(i=s.charCodeAt(d),i){case Ze:case ge:case He:case Je:case Xe:{n=d;do n+=1,i=s.charCodeAt(n);while(i===ge||i===Ze||i===He||i===Je||i===Xe);l=["space",s.slice(d,n)],d=n-1;break}case Yl:case Gl:case Hl:case Jl:case Kl:case $l:case Xl:{let K=String.fromCharCode(i);l=[K,K,d];break}case Zl:{if(m=S.length?S.pop()[1]:"",p=s.charCodeAt(d+1),m==="url"&&p!==Lt&&p!==Dr&&p!==ge&&p!==Ze&&p!==He&&p!==Xe&&p!==Je){n=d;do{if(u=!1,n=s.indexOf(")",n+1),n===-1)if(r||W){n=d;break}else g("bracket");for(h=n;s.charCodeAt(h-1)===Ge;)h-=1,u=!u}while(u);l=["brackets",s.slice(d,n+1),d,n],d=n}else n=s.indexOf(")",d+1),o=s.slice(d,n+1),n===-1||ec.test(o)?l=["(","(",d]:(l=["brackets",o,d,n],d=n);break}case Lt:case Dr:{c=i===Lt?"'":'"',n=d;do{if(u=!1,n=s.indexOf(c,n+1),n===-1)if(r||W){n=d+1;break}else g("string");for(h=n;s.charCodeAt(h-1)===Ge;)h-=1,u=!u}while(u);l=["string",s.slice(d,n+1),d,n],d=n;break}case ql:{$e.lastIndex=d+1,$e.test(s),$e.lastIndex===0?n=s.length-1:n=$e.lastIndex-2,l=["at-word",s.slice(d,n+1),d,n],d=n;break}case Ge:{for(n=d,a=!0;s.charCodeAt(n+1)===Ge;)n+=1,a=!a;if(i=s.charCodeAt(n+1),a&&i!==Rr&&i!==ge&&i!==Ze&&i!==He&&i!==Je&&i!==Xe&&(n+=1,Or.test(s.charAt(n)))){for(;Or.test(s.charAt(n+1));)n+=1;s.charCodeAt(n+1)===ge&&(n+=1)}l=["word",s.slice(d,n+1),d,n],d=n;break}default:{i===Rr&&s.charCodeAt(d+1)===Ql?(n=s.indexOf("*/",d+2)+1,n===0&&(r||W?n=s.length:g("comment")),l=["comment",s.slice(d,n+1),d,n],d=n):(Qe.lastIndex=d+1,Qe.test(s),Qe.lastIndex===0?n=s.length-1:n=Qe.lastIndex-2,l=["word",s.slice(d,n+1),d,n],S.push(l),d=n);break}}return d++,l}function B(L){f.push(L)}return{back:B,endOfFile:E,nextToken:I,position:w}};let sc=Os,rc=St,ic=xt,nc=Ie,Ar=Is,oc=tc;const Ir={empty:!0,space:!0};function ac(t){for(let e=t.length-1;e>=0;e--){let s=t[e],r=s[3]||s[2];if(r)return r}}let lc=class{constructor(t){this.input=t,this.root=new nc,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let e=new sc;e.name=t[1].slice(1),e.name===""&&this.unnamedAtrule(e,t),this.init(e,t[2]);let s,r,i,o=!1,a=!1,n=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),s=t[0],s==="("||s==="["?c.push(s==="("?")":"]"):s==="{"&&c.length>0?c.push("}"):s===c[c.length-1]&&c.pop(),c.length===0)if(s===";"){e.source.end=this.getPosition(t[2]),e.source.end.offset++,this.semicolon=!0;break}else if(s==="{"){a=!0;break}else if(s==="}"){if(n.length>0){for(i=n.length-1,r=n[i];r&&r[0]==="space";)r=n[--i];r&&(e.source.end=this.getPosition(r[3]||r[2]),e.source.end.offset++)}this.end(t);break}else n.push(t);else n.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}e.raws.between=this.spacesAndCommentsFromEnd(n),n.length?(e.raws.afterName=this.spacesAndCommentsFromStart(n),this.raw(e,"params",n),o&&(t=n[n.length-1],e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++,this.spaces=e.raws.between,e.raws.between="")):(e.raws.afterName="",e.params=""),a&&(e.nodes=[],this.current=e)}checkMissedSemicolon(t){let e=this.colon(t);if(e===!1)return;let s=0,r;for(let i=e-1;i>=0&&(r=t[i],!(r[0]!=="space"&&(s+=1,s===2)));i--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(t){let e=0,s,r,i;for(let[o,a]of t.entries()){if(r=a,i=r[0],i==="("&&(e+=1),i===")"&&(e-=1),e===0&&i===":")if(!s)this.doubleColon(r);else{if(s[0]==="word"&&s[1]==="progid")continue;return o}s=r}return!1}comment(t){let e=new rc;this.init(e,t[2]),e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++;let s=t[1].slice(2,-2);if(/^\s*$/.test(s))e.text="",e.raws.left=s,e.raws.right="";else{let r=s.match(/^(\s*)([^]*\S)(\s*)$/);e.text=r[2],e.raws.left=r[1],e.raws.right=r[3]}}createTokenizer(){this.tokenizer=oc(this.input)}decl(t,e){let s=new ic;this.init(s,t[0][2]);let r=t[t.length-1];for(r[0]===";"&&(this.semicolon=!0,t.pop()),s.source.end=this.getPosition(r[3]||r[2]||ac(t)),s.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),s.raws.before+=t.shift()[1];for(s.source.start=this.getPosition(t[0][2]),s.prop="";t.length;){let n=t[0][0];if(n===":"||n==="space"||n==="comment")break;s.prop+=t.shift()[1]}s.raws.between="";let i;for(;t.length;)if(i=t.shift(),i[0]===":"){s.raws.between+=i[1];break}else i[0]==="word"&&/\w/.test(i[1])&&this.unknownWord([i]),s.raws.between+=i[1];(s.prop[0]==="_"||s.prop[0]==="*")&&(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let n=t.length-1;n>=0;n--){if(i=t[n],i[1].toLowerCase()==="!important"){s.important=!0;let c=this.stringFrom(t,n);c=this.spacesFromEnd(t)+c,c!==" !important"&&(s.raws.important=c);break}else if(i[1].toLowerCase()==="important"){let c=t.slice(0),l="";for(let u=n;u>0;u--){let h=c[u][0];if(l.trim().startsWith("!")&&h!=="space")break;l=c.pop()[1]+l}l.trim().startsWith("!")&&(s.important=!0,s.raws.important=l,t=c)}if(i[0]!=="space"&&i[0]!=="comment")break}t.some(n=>n[0]!=="space"&&n[0]!=="comment")&&(s.raws.between+=o.map(n=>n[1]).join(""),o=[]),this.raw(s,"value",o.concat(t),e),s.value.includes(":")&&!e&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let e=new Ar;this.init(e,t[2]),e.selector="",e.raws.between="",this.current=e}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type==="rule"&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="",e.source.end=this.getPosition(t[2]),e.source.end.offset+=e.raws.ownSemicolon.length)}}getPosition(t){let e=this.input.fromOffset(t);return{column:e.col,line:e.line,offset:t}}init(t,e){this.current.push(t),t.source={input:this.input,start:this.getPosition(e)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let e=!1,s=null,r=!1,i=null,o=[],a=t[1].startsWith("--"),n=[],c=t;for(;c;){if(s=c[0],n.push(c),s==="("||s==="[")i||(i=c),o.push(s==="("?")":"]");else if(a&&r&&s==="{")i||(i=c),o.push("}");else if(o.length===0)if(s===";")if(r){this.decl(n,a);return}else break;else if(s==="{"){this.rule(n);return}else if(s==="}"){this.tokenizer.back(n.pop()),e=!0;break}else s===":"&&(r=!0);else s===o[o.length-1]&&(o.pop(),o.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(e=!0),o.length>0&&this.unclosedBracket(i),e&&r){if(!a)for(;n.length&&(c=n[n.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(n.pop());this.decl(n,a)}else this.unknownWord(n)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,e,s,r){let i,o,a=s.length,n="",c=!0,l,u;for(let h=0;h<a;h+=1)i=s[h],o=i[0],o==="space"&&h===a-1&&!r?c=!1:o==="comment"?(u=s[h-1]?s[h-1][0]:"empty",l=s[h+1]?s[h+1][0]:"empty",!Ir[u]&&!Ir[l]?n.slice(-1)===","?c=!1:n+=i[1]:c=!1):n+=i[1];if(!c){let h=s.reduce((p,m)=>p+m[1],"");t.raws[e]={raw:h,value:n}}t[e]=n}rule(t){t.pop();let e=new Ar;this.init(e,t[0][2]),e.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(e,"selector",t),this.current=e}spacesAndCommentsFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],!(e!=="space"&&e!=="comment"));)s=t.pop()[1]+s;return s}spacesAndCommentsFromStart(t){let e,s="";for(;t.length&&(e=t[0][0],!(e!=="space"&&e!=="comment"));)s+=t.shift()[1];return s}spacesFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],e==="space");)s=t.pop()[1]+s;return s}stringFrom(t,e){let s="";for(let r=e;r<t.length;r++)s+=t[r][1];return t.splice(e,t.length-e),s}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,e){throw this.input.error("At-rule without name",{offset:e[2]},{offset:e[2]+e[1].length})}};var cc=lc;let uc=ee,hc=Ct,pc=cc;function ut(t,e){let s=new hc(t,e),r=new pc(s);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?i.message+=`
|
|
60
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(e.from)?i.message+=`
|
|
61
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(e.from)&&(i.message+=`
|
|
62
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Ps=ut;ut.default=ut;uc.registerParse(ut);let us=class{constructor(t,e={}){if(this.type="warning",this.text=t,e.node&&e.node.source){let s=e.node.rangeBy(e);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in e)this[s]=e[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 ln=us;us.default=us;let dc=ln,hs=class{get content(){return this.css}constructor(t,e,s){this.processor=t,this.messages=[],this.root=e,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(t,e={}){e.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(e.plugin=this.lastPlugin.postcssPlugin);let s=new dc(t,e);return this.messages.push(s),s}warnings(){return this.messages.filter(t=>t.type==="warning")}};var Ls=hs;hs.default=hs;let Pr={};var cn=function(t){Pr[t]||(Pr[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))};let fc=ee,mc=As,gc=an,yc=Ps,Lr=Ls,wc=Ie,bc=bt,{isClean:Y,my:vc}=Ae,Sc=cn;const xc={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Cc={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},Ec={Once:!0,postcssPlugin:!0,prepare:!0},ce=0;function ye(t){return typeof t=="object"&&typeof t.then=="function"}function un(t){let e=!1,s=xc[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[s,s+"-"+e,ce,s+"Exit",s+"Exit-"+e]:e?[s,s+"-"+e,s+"Exit",s+"Exit-"+e]:t.append?[s,ce,s+"Exit"]:[s,s+"Exit"]}function Fr(t){let e;return t.type==="document"?e=["Document",ce,"DocumentExit"]:t.type==="root"?e=["Root",ce,"RootExit"]:e=un(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function ps(t){return t[Y]=!1,t.nodes&&t.nodes.forEach(e=>ps(e)),t}let ds={},ue=class hn{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"}constructor(e,s,r){this.stringified=!1,this.processed=!1;let i;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))i=ps(s);else if(s instanceof hn||s instanceof Lr)i=ps(s.root),s.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let o=yc;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(s,r)}catch(a){this.processed=!0,this.error=a}i&&!i[vc]&&fc.rebuild(i)}this.result=new Lr(e,i,r),this.helpers={...ds,postcss:ds,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}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,s){let r=this.result.lastPlugin;try{if(s&&s.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=r.postcssPlugin,e.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,o=r.postcssVersion,a=this.result.processor.version,n=o.split("."),c=a.split(".");(n[0]!==c[0]||parseInt(n[1])>parseInt(c[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+a+", but "+i+" uses "+o+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(s,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([s,i])};for(let s of this.plugins)if(typeof s=="object")for(let r in s){if(!Cc[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Ec[r])if(typeof s[r]=="object")for(let i in s[r])i==="*"?e(s,r,s[r][i]):e(s,r+"-"+i.toLowerCase(),s[r][i]);else typeof s[r]=="function"&&e(s,r,s[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let s=this.plugins[e],r=this.runOnRoot(s);if(ye(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Y];){e[Y]=!0;let s=[Fr(e)];for(;s.length>0;){let r=this.visitTick(s);if(ye(r))try{await r}catch(i){let o=s[s.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[s,r]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(e.type==="document"){let i=e.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let s=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return ye(s[0])?Promise.all(s):s}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(s){throw this.handleError(s)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,s=bc;e.syntax&&(s=e.syntax.stringify),e.stringifier&&(s=e.stringifier),s.stringify&&(s=s.stringify);let r=new gc(s,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let s=this.runOnRoot(e);if(ye(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Y];)e[Y]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let s of e.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,s){return process.env.NODE_ENV!=="production"&&("from"in this.opts||Sc("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,s)}toString(){return this.css}visitSync(e,s){for(let[r,i]of e){this.result.lastPlugin=r;let o;try{o=i(s,this.helpers)}catch(a){throw this.handleError(a,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if(ye(o))throw this.getAsyncError()}}visitTick(e){let s=e[e.length-1],{node:r,visitors:i}=s;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&s.visitorIndex<i.length){let[a,n]=i[s.visitorIndex];s.visitorIndex+=1,s.visitorIndex===i.length&&(s.visitors=[],s.visitorIndex=0),this.result.lastPlugin=a;try{return n(r.toProxy(),this.helpers)}catch(c){throw this.handleError(c,r)}}if(s.iterator!==0){let a=s.iterator,n;for(;n=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!n[Y]){n[Y]=!0,e.push(Fr(n));return}s.iterator=0,delete r.indexes[a]}let o=s.events;for(;s.eventIndex<o.length;){let a=o[s.eventIndex];if(s.eventIndex+=1,a===ce){r.nodes&&r.nodes.length&&(r[Y]=!0,s.iterator=r.getIterator());return}else if(this.listeners[a]){s.visitors=this.listeners[a];return}}e.pop()}walkSync(e){e[Y]=!0;let s=un(e);for(let r of s)if(r===ce)e.nodes&&e.each(i=>{i[Y]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}};ue.registerPostcss=t=>{ds=t};var pn=ue;ue.default=ue;wc.registerLazyResult(ue);mc.registerLazyResult(ue);let Mc=an,Nc=Ps;const Tc=Ls;let kc=bt,Dc=cn,fs=class{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 t,e=Nc;try{t=e(this._css,this._opts)}catch(s){this.error=s}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,e,s){e=e.toString(),this.stringified=!1,this._processor=t,this._css=e,this._opts=s,this._map=void 0;let r,i=kc;this.result=new Tc(this._processor,r,this._opts),this.result.css=e;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new Mc(i,r,this._opts,e);if(a.isMap()){let[n,c]=a.generate();n&&(this.result.css=n),c&&(this.result.map=c)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,e){return process.env.NODE_ENV!=="production"&&("from"in this._opts||Dc("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(t,e)}toString(){return this._css}warnings(){return[]}};var Rc=fs;fs.default=fs;let Oc=As,Ac=pn,Ic=Rc,Pc=Ie,De=class{constructor(t=[]){this.version="8.5.6",this.plugins=this.normalize(t)}normalize(t){let e=[];for(let s of t)if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),typeof s=="object"&&Array.isArray(s.plugins))e=e.concat(s.plugins);else if(typeof s=="object"&&s.postcssPlugin)e.push(s);else if(typeof s=="function")e.push(s);else if(typeof s=="object"&&(s.parse||s.stringify)){if(process.env.NODE_ENV!=="production")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.")}else throw new Error(s+" is not a PostCSS plugin");return e}process(t,e={}){return!this.plugins.length&&!e.parser&&!e.stringifier&&!e.syntax?new Ic(this,t,e):new Ac(this,t,e)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var Lc=De;De.default=De;Pc.registerProcessor(De);Oc.registerProcessor(De);let dn=Os,fn=St,Fc=ee,_c=ks,mn=xt,gn=As,Bc=Ul,Uc=Ct,Wc=pn,jc=en,Vc=vt,zc=Ps,Fs=Lc,Yc=Ls,yn=Ie,wn=Is,Gc=bt,Zc=ln;function D(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Fs(t)}D.plugin=function(t,e){let s=!1;function r(...o){console&&console.warn&&!s&&(s=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
63
63
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
64
|
-
https://www.w3ctech.com/topic/2226`));let a=e(...r);return a.postcssPlugin=t,a.postcssVersion=new Fs().version,a}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(r,a,o){return D([i(o)]).process(r,a)},i};D.stringify=zc;D.parse=jc;D.fromJSON=Fc;D.list=Uc;D.comment=t=>new po(t);D.atRule=t=>new ho(t);D.decl=t=>new fo(t);D.rule=t=>new yo(t);D.root=t=>new go(t);D.document=t=>new mo(t);D.CssSyntaxError=Lc;D.Declaration=fo;D.Container=Pc;D.Processor=Fs;D.Document=mo;D.Comment=po;D.Warning=Yc;D.AtRule=ho;D.Result=Vc;D.Input=_c;D.Rule=yo;D.Root=go;D.Node=Wc;Bc.registerPostcss(D);var Gc=D;D.default=D;const A=sl(Gc);A.stringify;A.fromJSON;A.plugin;A.parse;A.list;A.document;A.comment;A.atRule;A.rule;A.decl;A.root;A.CssSyntaxError;A.Declaration;A.Container;A.Processor;A.Document;A.Comment;A.Warning;A.AtRule;A.Result;A.Input;A.Rule;A.Root;A.Node;function Xc(t){const e={},s=/;(?![^(]*\))/g,i=/:(.+)/,n=/\/\*.*?\*\//g;return t.replace(n,"").split(s).forEach(function(r){if(r){const a=r.split(i);a.length>1&&(e[ms(a[0].trim())]=a[1].trim())}}),e}function Li(t){const e=[];for(const s in t){const i=t[s];if(typeof i!="string")continue;const n=Hc(s);e.push(`${n}: ${i};`)}return e.join(" ")}const Zc=/-([a-z])/g,$c=/^--[a-zA-Z0-9-]+$/,ms=t=>$c.test(t)?t:t.replace(Zc,(e,s)=>s?s.toUpperCase():""),Jc=/\B([A-Z])/g,Hc=t=>t.replace(Jc,"-$1").toLowerCase();class J{constructor(...e){y(this,"parentElement",null),y(this,"parentNode",null),y(this,"ownerDocument"),y(this,"firstChild",null),y(this,"lastChild",null),y(this,"previousSibling",null),y(this,"nextSibling",null),y(this,"ELEMENT_NODE",1),y(this,"TEXT_NODE",3),y(this,"nodeType"),y(this,"nodeName"),y(this,"RRNodeType")}get childNodes(){const e=[];let s=this.firstChild;for(;s;)e.push(s),s=s.nextSibling;return e}contains(e){if(e instanceof J){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;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,s){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 _s extends J{constructor(...e){super(e),y(this,"nodeType",9),y(this,"nodeName","#document"),y(this,"compatMode","CSS1Compat"),y(this,"RRNodeType",M.Document),y(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===M.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(s=>s.RRNodeType===M.Element&&s.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(s=>s.RRNodeType===M.Element&&s.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const s=e.RRNodeType;if((s===M.Element||s===M.DocumentType)&&this.childNodes.some(n=>n.RRNodeType===s))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${s===M.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Us(this,e);return i.parentElement=null,i}insertBefore(e,s){const i=e.RRNodeType;if((i===M.Element||i===M.DocumentType)&&this.childNodes.some(r=>r.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${i===M.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const n=xo(this,e,s);return n.parentElement=null,n}removeChild(e){return Co(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let s;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?s="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(s="-//W3C//DTD HTML 4.0 Transitional//EN"),s){const i=this.createDocumentType("html",s,"");this.open(),this.appendChild(i)}}createDocument(e,s,i){return new _s}createDocumentType(e,s,i){const n=new wo(e,s,i);return n.ownerDocument=this,n}createElement(e){const s=new Bs(e);return s.ownerDocument=this,s}createElementNS(e,s){return this.createElement(s)}createTextNode(e){const s=new bo(e);return s.ownerDocument=this,s}createComment(e){const s=new vo(e);return s.ownerDocument=this,s}createCDATASection(e){const s=new So(e);return s.ownerDocument=this,s}toString(){return"RRDocument"}}class wo extends J{constructor(e,s,i){super(),y(this,"nodeType",10),y(this,"RRNodeType",M.DocumentType),y(this,"name"),y(this,"publicId"),y(this,"systemId"),y(this,"textContent",null),this.name=e,this.publicId=s,this.systemId=i,this.nodeName=e}toString(){return"RRDocumentType"}}class Bs extends J{constructor(e){super(),y(this,"nodeType",1),y(this,"RRNodeType",M.Element),y(this,"tagName"),y(this,"attributes",{}),y(this,"shadowRoot",null),y(this,"scrollLeft"),y(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(s=>e+=s.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new Kc(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?Xc(this.attributes.style):{},s=/\B([A-Z])/g;return e.setProperty=(i,n,r)=>{if(s.test(i))return;const a=ms(i);n?e[a]=n:delete e[a],r==="important"&&(e[a]+=" !important"),this.attributes.style=Li(e)},e.removeProperty=i=>{if(s.test(i))return"";const n=ms(i),r=e[n]||"";return delete e[n],this.attributes.style=Li(e),r},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,s){this.attributes[e]=s}setAttributeNS(e,s,i){this.setAttribute(s,i)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return Us(this,e)}insertBefore(e,s){return xo(this,e,s)}removeChild(e){return Co(this,e)}attachShadow(e){const s=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=s,s}dispatchEvent(e){return!0}toString(){let e="";for(const s in this.attributes)e+=`${s}="${this.attributes[s]}" `;return`${this.tagName} ${e}`}}class Qc extends Bs{constructor(){super(...arguments),y(this,"currentTime"),y(this,"volume"),y(this,"paused"),y(this,"muted"),y(this,"playbackRate"),y(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 bo extends J{constructor(e){super(),y(this,"nodeType",3),y(this,"nodeName","#text"),y(this,"RRNodeType",M.Text),y(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 vo extends J{constructor(e){super(),y(this,"nodeType",8),y(this,"nodeName","#comment"),y(this,"RRNodeType",M.Comment),y(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 So extends J{constructor(e){super(),y(this,"nodeName","#cdata-section"),y(this,"nodeType",4),y(this,"RRNodeType",M.CDATA),y(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 Kc{constructor(e,s){if(y(this,"onChange"),y(this,"classes",[]),y(this,"add",(...i)=>{for(const n of i){const r=String(n);this.classes.indexOf(r)>=0||this.classes.push(r)}this.onChange&&this.onChange(this.classes.join(" "))}),y(this,"remove",(...i)=>{this.classes=this.classes.filter(n=>i.indexOf(n)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){const i=e.trim().split(/\s+/);this.classes.push(...i)}this.onChange=s}}function Us(t,e){return e.parentNode&&e.parentNode.removeChild(e),t.lastChild?(t.lastChild.nextSibling=e,e.previousSibling=t.lastChild):(t.firstChild=e,e.previousSibling=null),t.lastChild=e,e.nextSibling=null,e.parentNode=t,e.parentElement=t,e.ownerDocument=t.ownerDocument,e}function xo(t,e,s){if(!s)return Us(t,e);if(s.parentNode!==t)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 e===s||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=s.previousSibling,s.previousSibling=e,e.nextSibling=s,e.previousSibling?e.previousSibling.nextSibling=e:t.firstChild=e,e.parentElement=t,e.parentNode=t,e.ownerDocument=t.ownerDocument),e}function Co(t,e){if(e.parentNode!==t)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return e.previousSibling?e.previousSibling.nextSibling=e.nextSibling:t.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:t.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}var U=(t=>(t[t.PLACEHOLDER=0]="PLACEHOLDER",t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",t))(U||{});const gs={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},qc={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 G=null;function ht(t,e,s,i=e.mirror||e.ownerDocument.mirror){t=eu(t,e,s,i),Eo(t,e,s,i),tu(t,e,s)}function eu(t,e,s,i){var n;if(s.afterAppend&&!G&&(G=new WeakSet,setTimeout(()=>{G=null},0)),!Ws(t,e)){const r=pt(e,s.mirror,i);(n=t.parentNode)==null||n.replaceChild(r,t),t=r}switch(e.RRNodeType){case M.Document:{if(!ee(t,e,s.mirror,i)){const r=i.getMeta(e);r&&(s.mirror.removeNodeFromMap(t),t.close(),t.open(),s.mirror.add(t,r),G==null||G.add(t))}break}case M.Element:{const r=t,a=e;switch(a.tagName){case"IFRAME":{const o=t.contentDocument;if(!o)break;ht(o,e.contentDocument,s,i);break}}a.shadowRoot&&(r.shadowRoot||r.attachShadow({mode:"open"}),Eo(r.shadowRoot,a.shadowRoot,s,i)),su(r,a,i);break}}return t}function tu(t,e,s){var i;switch(e.RRNodeType){case M.Document:{const n=e.scrollData;n&&s.applyScroll(n,!0);break}case M.Element:{const n=t,r=e;switch(r.scrollData&&s.applyScroll(r.scrollData,!0),r.inputData&&s.applyInput(r.inputData),r.tagName){case"AUDIO":case"VIDEO":{const a=t,o=r;o.paused!==void 0&&(o.paused?a.pause():a.play()),o.muted!==void 0&&(a.muted=o.muted),o.volume!==void 0&&(a.volume=o.volume),o.currentTime!==void 0&&(a.currentTime=o.currentTime),o.playbackRate!==void 0&&(a.playbackRate=o.playbackRate),o.loop!==void 0&&(a.loop=o.loop);break}case"CANVAS":{const a=e;if(a.rr_dataURL!==null){const o=document.createElement("img");o.onload=()=>{const l=n.getContext("2d");l&&l.drawImage(o,0,0,o.width,o.height)},o.src=a.rr_dataURL}a.canvasMutations.forEach(o=>s.applyCanvas(o.event,o.mutation,t));break}case"STYLE":{const a=n.sheet;a&&e.rules.forEach(o=>s.applyStyleSheetMutation(o,a));break}}break}case M.Text:case M.Comment:case M.CDATA:{t.textContent!==e.data&&(t.textContent=e.data);break}}G!=null&&G.has(t)&&(G.delete(t),(i=s.afterAppend)==null||i.call(s,t,s.mirror.getId(t)))}function su(t,e,s){const i=t.attributes,n=e.attributes;for(const r in n){const a=n[r],o=s.getMeta(e);if(o!=null&&o.isSVG&&gs[r])t.setAttributeNS(gs[r],r,a);else if(e.tagName==="CANVAS"&&r==="rr_dataURL"){const l=document.createElement("img");l.src=a,l.onload=()=>{const c=t.getContext("2d");c&&c.drawImage(l,0,0,l.width,l.height)}}else{if(e.tagName==="IFRAME"&&r==="srcdoc")continue;t.setAttribute(r,a)}}for(const{name:r}of Array.from(i))r in n||t.removeAttribute(r);e.scrollLeft&&(t.scrollLeft=e.scrollLeft),e.scrollTop&&(t.scrollTop=e.scrollTop)}function Eo(t,e,s,i){const n=Array.from(t.childNodes),r=e.childNodes;if(n.length===0&&r.length===0)return;let a=0,o=n.length-1,l=0,c=r.length-1,u=n[a],h=n[o],p=r[l],m=r[c],v,d;for(;a<=o&&l<=c;)if(u===void 0)u=n[++a];else if(h===void 0)h=n[--o];else if(ee(u,p,s.mirror,i))u=n[++a],p=r[++l];else if(ee(h,m,s.mirror,i))h=n[--o],m=r[--c];else if(ee(u,m,s.mirror,i)){try{t.insertBefore(u,h.nextSibling)}catch(w){console.warn(w)}u=n[++a],m=r[--c]}else if(ee(h,p,s.mirror,i)){try{t.insertBefore(h,u)}catch(w){console.warn(w)}h=n[--o],p=r[++l]}else{if(!v){v={};for(let g=a;g<=o;g++){const E=n[g];E&&s.mirror.hasNode(E)&&(v[s.mirror.getId(E)]=g)}}d=v[i.getId(p)];const w=n[d];if(d!==void 0&&w&&ee(w,p,s.mirror,i)){try{t.insertBefore(w,u)}catch(g){console.warn(g)}n[d]=void 0}else{const g=pt(p,s.mirror,i);t.nodeName==="#document"&&u&&(g.nodeType===g.DOCUMENT_TYPE_NODE&&u.nodeType===u.DOCUMENT_TYPE_NODE||g.nodeType===g.ELEMENT_NODE&&u.nodeType===u.ELEMENT_NODE)&&(t.removeChild(u),s.mirror.removeNodeFromMap(u),u=n[++a]);try{t.insertBefore(g,u||null)}catch(E){console.warn(E)}}p=r[++l]}if(a>o){const w=r[c+1];let g=null;for(w&&(g=s.mirror.getNode(i.getId(w)));l<=c;++l){const E=pt(r[l],s.mirror,i);try{t.insertBefore(E,g)}catch(I){console.warn(I)}}}else if(l>c)for(;a<=o;a++){const w=n[a];if(!(!w||w.parentNode!==t))try{t.removeChild(w),s.mirror.removeNodeFromMap(w)}catch(g){console.warn(g)}}let S=t.firstChild,f=e.firstChild;for(;S!==null&&f!==null;)ht(S,f,s,i),S=S.nextSibling,f=f.nextSibling}function pt(t,e,s){const i=s.getId(t),n=s.getMeta(t);let r=null;if(i>-1&&(r=e.getNode(i)),r!==null&&Ws(r,t))return r;switch(t.RRNodeType){case M.Document:r=new Document;break;case M.DocumentType:r=document.implementation.createDocumentType(t.name,t.publicId,t.systemId);break;case M.Element:{let a=t.tagName.toLowerCase();a=qc[a]||a,n&&"isSVG"in n&&n!=null&&n.isSVG?r=document.createElementNS(gs.svg,a):r=document.createElement(t.tagName);break}case M.Text:r=document.createTextNode(t.data);break;case M.Comment:r=document.createComment(t.data);break;case M.CDATA:r=document.createCDATASection(t.data);break}n&&e.add(r,{...n});try{G==null||G.add(r)}catch{}return r}function Ws(t,e){return t.nodeType!==e.nodeType?!1:t.nodeType!==t.ELEMENT_NODE||t.tagName.toUpperCase()===e.tagName}function ee(t,e,s,i){const n=s.getId(t),r=i.getId(e);return n===-1||n!==r?!1:Ws(t,e)}class ce extends _s{constructor(e){super(),y(this,"UNSERIALIZED_STARTING_ID",-2),y(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),y(this,"mirror",du()),y(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,s,i){return new ce}createDocumentType(e,s,i){const n=new iu(e,s,i);return n.ownerDocument=this,n}createElement(e){const s=e.toUpperCase();let i;switch(s){case"AUDIO":case"VIDEO":i=new nu(s);break;case"IFRAME":i=new au(s,this.mirror);break;case"CANVAS":i=new ou(s);break;case"STYLE":i=new ru(s);break;default:i=new Et(s);break}return i.ownerDocument=this,i}createComment(e){const s=new cu(e);return s.ownerDocument=this,s}createCDATASection(e){const s=new uu(e);return s.ownerDocument=this,s}createTextNode(e){const s=new lu(e);return s.ownerDocument=this,s}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const iu=wo;class Et extends Bs{constructor(){super(...arguments),y(this,"inputData",null),y(this,"scrollData",null)}}class nu extends Qc{}class ou extends Et{constructor(){super(...arguments),y(this,"rr_dataURL",null),y(this,"canvasMutations",[])}getContext(){return null}}class ru extends Et{constructor(){super(...arguments),y(this,"rules",[])}}class au extends Et{constructor(e,s){super(e),y(this,"contentDocument",new ce),this.contentDocument.mirror=s}}const lu=bo,cu=vo,uu=So;function hu(t){return t instanceof HTMLFormElement?"FORM":t.tagName.toUpperCase()}function Mo(t,e,s,i){let n;switch(t.nodeType){case U.DOCUMENT_NODE:i&&i.nodeName==="IFRAME"?n=i.contentDocument:(n=e,n.compatMode=t.compatMode);break;case U.DOCUMENT_TYPE_NODE:{const a=t;n=e.createDocumentType(a.name,a.publicId,a.systemId);break}case U.ELEMENT_NODE:{const a=t,o=hu(a);n=e.createElement(o);const l=n;for(const{name:c,value:u}of Array.from(a.attributes))l.attributes[c]=u;a.scrollLeft&&(l.scrollLeft=a.scrollLeft),a.scrollTop&&(l.scrollTop=a.scrollTop);break}case U.TEXT_NODE:n=e.createTextNode(t.textContent||"");break;case U.CDATA_SECTION_NODE:n=e.createCDATASection(t.data);break;case U.COMMENT_NODE:n=e.createComment(t.textContent||"");break;case U.DOCUMENT_FRAGMENT_NODE:n=i.attachShadow({mode:"open"});break;default:return null}let r=s.getMeta(t);return e instanceof ce&&(r||(r=No(n,e.unserializedId),s.add(t,r)),e.mirror.add(n,{...r})),n}function pu(t,e=tl(),s=new ce){function i(n,r){const a=Mo(n,s,e,r);if(a!==null)if((r==null?void 0:r.nodeName)!=="IFRAME"&&n.nodeType!==U.DOCUMENT_FRAGMENT_NODE&&(r==null||r.appendChild(a),a.parentNode=r,a.parentElement=r),n.nodeName==="IFRAME"){const o=n.contentDocument;o&&i(o,a)}else(n.nodeType===U.DOCUMENT_NODE||n.nodeType===U.ELEMENT_NODE||n.nodeType===U.DOCUMENT_FRAGMENT_NODE)&&(n.nodeType===U.ELEMENT_NODE&&n.shadowRoot&&i(n.shadowRoot,a),n.childNodes.forEach(o=>i(o,a)))}return i(t,null),s}function du(){return new fu}class fu{constructor(){y(this,"idNodeMap",new Map),y(this,"nodeMetaMap",new WeakMap)}getId(e){var s;return e?((s=this.getMeta(e))==null?void 0:s.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const s=this.getId(e);this.idNodeMap.delete(s),e.childNodes&&e.childNodes.forEach(i=>this.removeNodeFromMap(i))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,s){const i=s.id;this.idNodeMap.set(i,e),this.nodeMetaMap.set(e,s)}replace(e,s){const i=this.getNode(e);if(i){const n=this.nodeMetaMap.get(i);n&&this.nodeMetaMap.set(s,n)}this.idNodeMap.set(e,s)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function No(t,e){switch(t.RRNodeType){case M.Document:return{id:e,type:t.RRNodeType,childNodes:[]};case M.DocumentType:{const s=t;return{id:e,type:t.RRNodeType,name:s.name,publicId:s.publicId,systemId:s.systemId}}case M.Element:return{id:e,type:t.RRNodeType,tagName:t.tagName.toLowerCase(),attributes:{},childNodes:[]};case M.Text:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case M.Comment:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case M.CDATA:return{id:e,type:t.RRNodeType,textContent:""}}}function To(t){return{all:t=t||new Map,on:function(e,s){var i=t.get(e);i?i.push(s):t.set(e,[s])},off:function(e,s){var i=t.get(e);i&&(s?i.splice(i.indexOf(s)>>>0,1):t.set(e,[]))},emit:function(e,s){var i=t.get(e);i&&i.slice().map(function(n){n(s)}),(i=t.get("*"))&&i.slice().map(function(n){n(e,s)})}}}const mu=Object.freeze(Object.defineProperty({__proto__:null,default:To},Symbol.toStringTag,{value:"Module"})),Fi=new Map;function ko(t,e){let s=Fi.get(t);return s||(s=new Map,Fi.set(t,s)),s.has(e)||s.set(e,[]),s.get(e)}function $(t,e,s){return async i=>{if(i&&typeof i=="object"&&"rr_type"in i)if(s&&(s.isUnchanged=!1),i.rr_type==="ImageBitmap"&&"args"in i){const n=await $(t,e,s)(i.args);return await createImageBitmap.apply(null,n)}else if("index"in i){if(s||e===null)return i;const{rr_type:n,index:r}=i;return ko(e,n)[r]}else if("args"in i){const{rr_type:n,args:r}=i,a=window[n];return new a(...await Promise.all(r.map($(t,e,s))))}else{if("base64"in i)return Ja(i.base64);if("src"in i){const n=t.get(i.src);if(n)return n;{const r=new Image;return r.src=i.src,t.set(i.src,r),r}}else if("data"in i&&i.rr_type==="Blob"){const n=await Promise.all(i.data.map($(t,e,s)));return new Blob(n,{type:i.type})}}else if(Array.isArray(i))return await Promise.all(i.map($(t,e,s)));return i}}async function gu({event:t,mutations:e,target:s,imageMap:i,errorHandler:n}){const r=s.getContext("2d");if(!r){n(e[0],new Error("Canvas context is null"));return}const a=e.map(async o=>Promise.all(o.args.map($(i,r))));(await Promise.all(a)).forEach((o,l)=>{const c=e[l];try{if(c.setter){r[c.property]=c.args[0];return}const u=r[c.property];c.property==="drawImage"&&typeof c.args[0]=="string"?(i.get(t),u.apply(r,c.args)):u.apply(r,o)}catch(u){n(c,u)}})}function yu(t,e){try{return e===rt.WebGL?t.getContext("webgl")||t.getContext("experimental-webgl"):t.getContext("webgl2")}catch{return null}}const wu=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function bu(t,e){if(!(e!=null&&e.constructor))return;const{name:s}=e.constructor;if(!wu.includes(s))return;const i=ko(t,s);i.includes(e)||i.push(e)}async function vu({mutation:t,target:e,type:s,imageMap:i,errorHandler:n}){try{const r=yu(e,s);if(!r)return;if(t.setter){r[t.property]=t.args[0];return}const a=r[t.property],o=await Promise.all(t.args.map($(i,r))),l=a.apply(r,o);bu(r,l);const c=!1}catch(r){n(t,r)}}async function _i({event:t,mutation:e,target:s,imageMap:i,canvasEventMap:n,errorHandler:r}){try{const a=n.get(t)||e,o="commands"in a?a.commands:[a];if([rt.WebGL,rt.WebGL2].includes(e.type)){for(let l=0;l<o.length;l++){const c=o[l];await vu({mutation:c,type:e.type,target:s,imageMap:i,errorHandler:r})}return}await gu({event:t,mutations:o,target:s,imageMap:i,errorHandler:r})}catch(a){r(e,a)}}/*! *****************************************************************************
|
|
64
|
+
https://www.w3ctech.com/topic/2226`));let a=e(...o);return a.postcssPlugin=t,a.postcssVersion=new Fs().version,a}let i;return Object.defineProperty(r,"postcss",{get(){return i||(i=r()),i}}),r.process=function(o,a,n){return D([r(n)]).process(o,a)},r};D.stringify=Gc;D.parse=zc;D.fromJSON=Bc;D.list=jc;D.comment=t=>new fn(t);D.atRule=t=>new dn(t);D.decl=t=>new mn(t);D.rule=t=>new wn(t);D.root=t=>new yn(t);D.document=t=>new gn(t);D.CssSyntaxError=_c;D.Declaration=mn;D.Container=Fc;D.Processor=Fs;D.Document=gn;D.Comment=fn;D.Warning=Zc;D.AtRule=dn;D.Result=Yc;D.Input=Uc;D.Rule=wn;D.Root=yn;D.Node=Vc;Wc.registerPostcss(D);var Xc=D;D.default=D;const A=il(Xc);A.stringify;A.fromJSON;A.plugin;A.parse;A.list;A.document;A.comment;A.atRule;A.rule;A.decl;A.root;A.CssSyntaxError;A.Declaration;A.Container;A.Processor;A.Document;A.Comment;A.Warning;A.AtRule;A.Result;A.Input;A.Rule;A.Root;A.Node;function Hc(t){const e={},s=/;(?![^(]*\))/g,r=/:(.+)/,i=/\/\*.*?\*\//g;return t.replace(i,"").split(s).forEach(function(o){if(o){const a=o.split(r);a.length>1&&(e[ms(a[0].trim())]=a[1].trim())}}),e}function _r(t){const e=[];for(const s in t){const r=t[s];if(typeof r!="string")continue;const i=Kc(s);e.push(`${i}: ${r};`)}return e.join(" ")}const Jc=/-([a-z])/g,$c=/^--[a-zA-Z0-9-]+$/,ms=t=>$c.test(t)?t:t.replace(Jc,(e,s)=>s?s.toUpperCase():""),Qc=/\B([A-Z])/g,Kc=t=>t.replace(Qc,"-$1").toLowerCase();class Q{constructor(...e){y(this,"parentElement",null),y(this,"parentNode",null),y(this,"ownerDocument"),y(this,"firstChild",null),y(this,"lastChild",null),y(this,"previousSibling",null),y(this,"nextSibling",null),y(this,"ELEMENT_NODE",1),y(this,"TEXT_NODE",3),y(this,"nodeType"),y(this,"nodeName"),y(this,"RRNodeType")}get childNodes(){const e=[];let s=this.firstChild;for(;s;)e.push(s),s=s.nextSibling;return e}contains(e){if(e instanceof Q){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;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,s){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 _s extends Q{constructor(...e){super(e),y(this,"nodeType",9),y(this,"nodeName","#document"),y(this,"compatMode","CSS1Compat"),y(this,"RRNodeType",M.Document),y(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===M.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(s=>s.RRNodeType===M.Element&&s.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(s=>s.RRNodeType===M.Element&&s.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const s=e.RRNodeType;if((s===M.Element||s===M.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===s))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${s===M.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const r=Us(this,e);return r.parentElement=null,r}insertBefore(e,s){const r=e.RRNodeType;if((r===M.Element||r===M.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${r===M.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Cn(this,e,s);return i.parentElement=null,i}removeChild(e){return En(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let s;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?s="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(s="-//W3C//DTD HTML 4.0 Transitional//EN"),s){const r=this.createDocumentType("html",s,"");this.open(),this.appendChild(r)}}createDocument(e,s,r){return new _s}createDocumentType(e,s,r){const i=new bn(e,s,r);return i.ownerDocument=this,i}createElement(e){const s=new Bs(e);return s.ownerDocument=this,s}createElementNS(e,s){return this.createElement(s)}createTextNode(e){const s=new vn(e);return s.ownerDocument=this,s}createComment(e){const s=new Sn(e);return s.ownerDocument=this,s}createCDATASection(e){const s=new xn(e);return s.ownerDocument=this,s}toString(){return"RRDocument"}}class bn extends Q{constructor(e,s,r){super(),y(this,"nodeType",10),y(this,"RRNodeType",M.DocumentType),y(this,"name"),y(this,"publicId"),y(this,"systemId"),y(this,"textContent",null),this.name=e,this.publicId=s,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}}class Bs extends Q{constructor(e){super(),y(this,"nodeType",1),y(this,"RRNodeType",M.Element),y(this,"tagName"),y(this,"attributes",{}),y(this,"shadowRoot",null),y(this,"scrollLeft"),y(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(s=>e+=s.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new eu(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?Hc(this.attributes.style):{},s=/\B([A-Z])/g;return e.setProperty=(r,i,o)=>{if(s.test(r))return;const a=ms(r);i?e[a]=i:delete e[a],o==="important"&&(e[a]+=" !important"),this.attributes.style=_r(e)},e.removeProperty=r=>{if(s.test(r))return"";const i=ms(r),o=e[i]||"";return delete e[i],this.attributes.style=_r(e),o},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,s){this.attributes[e]=s}setAttributeNS(e,s,r){this.setAttribute(s,r)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return Us(this,e)}insertBefore(e,s){return Cn(this,e,s)}removeChild(e){return En(this,e)}attachShadow(e){const s=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=s,s}dispatchEvent(e){return!0}toString(){let e="";for(const s in this.attributes)e+=`${s}="${this.attributes[s]}" `;return`${this.tagName} ${e}`}}class qc extends Bs{constructor(){super(...arguments),y(this,"currentTime"),y(this,"volume"),y(this,"paused"),y(this,"muted"),y(this,"playbackRate"),y(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 vn extends Q{constructor(e){super(),y(this,"nodeType",3),y(this,"nodeName","#text"),y(this,"RRNodeType",M.Text),y(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 Sn extends Q{constructor(e){super(),y(this,"nodeType",8),y(this,"nodeName","#comment"),y(this,"RRNodeType",M.Comment),y(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 xn extends Q{constructor(e){super(),y(this,"nodeName","#cdata-section"),y(this,"nodeType",4),y(this,"RRNodeType",M.CDATA),y(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 eu{constructor(e,s){if(y(this,"onChange"),y(this,"classes",[]),y(this,"add",(...r)=>{for(const i of r){const o=String(i);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))}),y(this,"remove",(...r)=>{this.classes=this.classes.filter(i=>r.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){const r=e.trim().split(/\s+/);this.classes.push(...r)}this.onChange=s}}function Us(t,e){return e.parentNode&&e.parentNode.removeChild(e),t.lastChild?(t.lastChild.nextSibling=e,e.previousSibling=t.lastChild):(t.firstChild=e,e.previousSibling=null),t.lastChild=e,e.nextSibling=null,e.parentNode=t,e.parentElement=t,e.ownerDocument=t.ownerDocument,e}function Cn(t,e,s){if(!s)return Us(t,e);if(s.parentNode!==t)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 e===s||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=s.previousSibling,s.previousSibling=e,e.nextSibling=s,e.previousSibling?e.previousSibling.nextSibling=e:t.firstChild=e,e.parentElement=t,e.parentNode=t,e.ownerDocument=t.ownerDocument),e}function En(t,e){if(e.parentNode!==t)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return e.previousSibling?e.previousSibling.nextSibling=e.nextSibling:t.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:t.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}var U=(t=>(t[t.PLACEHOLDER=0]="PLACEHOLDER",t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",t))(U||{});const gs={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},tu={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 G=null;function ht(t,e,s,r=e.mirror||e.ownerDocument.mirror){t=su(t,e,s,r),Mn(t,e,s,r),ru(t,e,s)}function su(t,e,s,r){var i;if(s.afterAppend&&!G&&(G=new WeakSet,setTimeout(()=>{G=null},0)),!Ws(t,e)){const o=pt(e,s.mirror,r);(i=t.parentNode)==null||i.replaceChild(o,t),t=o}switch(e.RRNodeType){case M.Document:{if(!se(t,e,s.mirror,r)){const o=r.getMeta(e);o&&(s.mirror.removeNodeFromMap(t),t.close(),t.open(),s.mirror.add(t,o),G==null||G.add(t))}break}case M.Element:{const o=t,a=e;switch(a.tagName){case"IFRAME":{const n=t.contentDocument;if(!n)break;ht(n,e.contentDocument,s,r);break}}a.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),Mn(o.shadowRoot,a.shadowRoot,s,r)),iu(o,a,r);break}}return t}function ru(t,e,s){var r;switch(e.RRNodeType){case M.Document:{const i=e.scrollData;i&&s.applyScroll(i,!0);break}case M.Element:{const i=t,o=e;switch(o.scrollData&&s.applyScroll(o.scrollData,!0),o.inputData&&s.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{const a=t,n=o;n.paused!==void 0&&(n.paused?a.pause():a.play()),n.muted!==void 0&&(a.muted=n.muted),n.volume!==void 0&&(a.volume=n.volume),n.currentTime!==void 0&&(a.currentTime=n.currentTime),n.playbackRate!==void 0&&(a.playbackRate=n.playbackRate),n.loop!==void 0&&(a.loop=n.loop);break}case"CANVAS":{const a=e;if(a.rr_dataURL!==null){const n=document.createElement("img");n.onload=()=>{const c=i.getContext("2d");c&&c.drawImage(n,0,0,n.width,n.height)},n.src=a.rr_dataURL}a.canvasMutations.forEach(n=>s.applyCanvas(n.event,n.mutation,t));break}case"STYLE":{const a=i.sheet;a&&e.rules.forEach(n=>s.applyStyleSheetMutation(n,a));break}}break}case M.Text:case M.Comment:case M.CDATA:{t.textContent!==e.data&&(t.textContent=e.data);break}}G!=null&&G.has(t)&&(G.delete(t),(r=s.afterAppend)==null||r.call(s,t,s.mirror.getId(t)))}function iu(t,e,s){const r=t.attributes,i=e.attributes;for(const o in i){const a=i[o],n=s.getMeta(e);if(n!=null&&n.isSVG&&gs[o])t.setAttributeNS(gs[o],o,a);else if(e.tagName==="CANVAS"&&o==="rr_dataURL"){const c=document.createElement("img");c.src=a,c.onload=()=>{const l=t.getContext("2d");l&&l.drawImage(c,0,0,c.width,c.height)}}else{if(e.tagName==="IFRAME"&&o==="srcdoc")continue;t.setAttribute(o,a)}}for(const{name:o}of Array.from(r))o in i||t.removeAttribute(o);e.scrollLeft&&(t.scrollLeft=e.scrollLeft),e.scrollTop&&(t.scrollTop=e.scrollTop)}function Mn(t,e,s,r){const i=Array.from(t.childNodes),o=e.childNodes;if(i.length===0&&o.length===0)return;let a=0,n=i.length-1,c=0,l=o.length-1,u=i[a],h=i[n],p=o[c],m=o[l],v,d;for(;a<=n&&c<=l;)if(u===void 0)u=i[++a];else if(h===void 0)h=i[--n];else if(se(u,p,s.mirror,r))u=i[++a],p=o[++c];else if(se(h,m,s.mirror,r))h=i[--n],m=o[--l];else if(se(u,m,s.mirror,r)){try{t.insertBefore(u,h.nextSibling)}catch(w){console.warn(w)}u=i[++a],m=o[--l]}else if(se(h,p,s.mirror,r)){try{t.insertBefore(h,u)}catch(w){console.warn(w)}h=i[--n],p=o[++c]}else{if(!v){v={};for(let g=a;g<=n;g++){const E=i[g];E&&s.mirror.hasNode(E)&&(v[s.mirror.getId(E)]=g)}}d=v[r.getId(p)];const w=i[d];if(d!==void 0&&w&&se(w,p,s.mirror,r)){try{t.insertBefore(w,u)}catch(g){console.warn(g)}i[d]=void 0}else{const g=pt(p,s.mirror,r);t.nodeName==="#document"&&u&&(g.nodeType===g.DOCUMENT_TYPE_NODE&&u.nodeType===u.DOCUMENT_TYPE_NODE||g.nodeType===g.ELEMENT_NODE&&u.nodeType===u.ELEMENT_NODE)&&(t.removeChild(u),s.mirror.removeNodeFromMap(u),u=i[++a]);try{t.insertBefore(g,u||null)}catch(E){console.warn(E)}}p=o[++c]}if(a>n){const w=o[l+1];let g=null;for(w&&(g=s.mirror.getNode(r.getId(w)));c<=l;++c){const E=pt(o[c],s.mirror,r);try{t.insertBefore(E,g)}catch(I){console.warn(I)}}}else if(c>l)for(;a<=n;a++){const w=i[a];if(!(!w||w.parentNode!==t))try{t.removeChild(w),s.mirror.removeNodeFromMap(w)}catch(g){console.warn(g)}}let S=t.firstChild,f=e.firstChild;for(;S!==null&&f!==null;)ht(S,f,s,r),S=S.nextSibling,f=f.nextSibling}function pt(t,e,s){const r=s.getId(t),i=s.getMeta(t);let o=null;if(r>-1&&(o=e.getNode(r)),o!==null&&Ws(o,t))return o;switch(t.RRNodeType){case M.Document:o=new Document;break;case M.DocumentType:o=document.implementation.createDocumentType(t.name,t.publicId,t.systemId);break;case M.Element:{let a=t.tagName.toLowerCase();a=tu[a]||a,i&&"isSVG"in i&&i!=null&&i.isSVG?o=document.createElementNS(gs.svg,a):o=document.createElement(t.tagName);break}case M.Text:o=document.createTextNode(t.data);break;case M.Comment:o=document.createComment(t.data);break;case M.CDATA:o=document.createCDATASection(t.data);break}i&&e.add(o,{...i});try{G==null||G.add(o)}catch{}return o}function Ws(t,e){return t.nodeType!==e.nodeType?!1:t.nodeType!==t.ELEMENT_NODE||t.tagName.toUpperCase()===e.tagName}function se(t,e,s,r){const i=s.getId(t),o=r.getId(e);return i===-1||i!==o?!1:Ws(t,e)}class he extends _s{constructor(e){super(),y(this,"UNSERIALIZED_STARTING_ID",-2),y(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),y(this,"mirror",mu()),y(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,s,r){return new he}createDocumentType(e,s,r){const i=new nu(e,s,r);return i.ownerDocument=this,i}createElement(e){const s=e.toUpperCase();let r;switch(s){case"AUDIO":case"VIDEO":r=new ou(s);break;case"IFRAME":r=new cu(s,this.mirror);break;case"CANVAS":r=new au(s);break;case"STYLE":r=new lu(s);break;default:r=new Et(s);break}return r.ownerDocument=this,r}createComment(e){const s=new hu(e);return s.ownerDocument=this,s}createCDATASection(e){const s=new pu(e);return s.ownerDocument=this,s}createTextNode(e){const s=new uu(e);return s.ownerDocument=this,s}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const nu=bn;class Et extends Bs{constructor(){super(...arguments),y(this,"inputData",null),y(this,"scrollData",null)}}class ou extends qc{}class au extends Et{constructor(){super(...arguments),y(this,"rr_dataURL",null),y(this,"canvasMutations",[])}getContext(){return null}}class lu extends Et{constructor(){super(...arguments),y(this,"rules",[])}}class cu extends Et{constructor(e,s){super(e),y(this,"contentDocument",new he),this.contentDocument.mirror=s}}const uu=vn,hu=Sn,pu=xn;function du(t){return t instanceof HTMLFormElement?"FORM":t.tagName.toUpperCase()}function Nn(t,e,s,r){let i;switch(t.nodeType){case U.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=e,i.compatMode=t.compatMode);break;case U.DOCUMENT_TYPE_NODE:{const a=t;i=e.createDocumentType(a.name,a.publicId,a.systemId);break}case U.ELEMENT_NODE:{const a=t,n=du(a);i=e.createElement(n);const c=i;for(const{name:l,value:u}of Array.from(a.attributes))c.attributes[l]=u;a.scrollLeft&&(c.scrollLeft=a.scrollLeft),a.scrollTop&&(c.scrollTop=a.scrollTop);break}case U.TEXT_NODE:i=e.createTextNode(t.textContent||"");break;case U.CDATA_SECTION_NODE:i=e.createCDATASection(t.data);break;case U.COMMENT_NODE:i=e.createComment(t.textContent||"");break;case U.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let o=s.getMeta(t);return e instanceof he&&(o||(o=Tn(i,e.unserializedId),s.add(t,o)),e.mirror.add(i,{...o})),i}function fu(t,e=rl(),s=new he){function r(i,o){const a=Nn(i,s,e,o);if(a!==null)if((o==null?void 0:o.nodeName)!=="IFRAME"&&i.nodeType!==U.DOCUMENT_FRAGMENT_NODE&&(o==null||o.appendChild(a),a.parentNode=o,a.parentElement=o),i.nodeName==="IFRAME"){const n=i.contentDocument;n&&r(n,a)}else(i.nodeType===U.DOCUMENT_NODE||i.nodeType===U.ELEMENT_NODE||i.nodeType===U.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===U.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,a),i.childNodes.forEach(n=>r(n,a)))}return r(t,null),s}function mu(){return new gu}class gu{constructor(){y(this,"idNodeMap",new Map),y(this,"nodeMetaMap",new WeakMap)}getId(e){var s;return e?((s=this.getMeta(e))==null?void 0:s.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const s=this.getId(e);this.idNodeMap.delete(s),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,s){const r=s.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,s)}replace(e,s){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(s,i)}this.idNodeMap.set(e,s)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Tn(t,e){switch(t.RRNodeType){case M.Document:return{id:e,type:t.RRNodeType,childNodes:[]};case M.DocumentType:{const s=t;return{id:e,type:t.RRNodeType,name:s.name,publicId:s.publicId,systemId:s.systemId}}case M.Element:return{id:e,type:t.RRNodeType,tagName:t.tagName.toLowerCase(),attributes:{},childNodes:[]};case M.Text:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case M.Comment:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case M.CDATA:return{id:e,type:t.RRNodeType,textContent:""}}}function kn(t){return{all:t=t||new Map,on:function(e,s){var r=t.get(e);r?r.push(s):t.set(e,[s])},off:function(e,s){var r=t.get(e);r&&(s?r.splice(r.indexOf(s)>>>0,1):t.set(e,[]))},emit:function(e,s){var r=t.get(e);r&&r.slice().map(function(i){i(s)}),(r=t.get("*"))&&r.slice().map(function(i){i(e,s)})}}}const yu=Object.freeze(Object.defineProperty({__proto__:null,default:kn},Symbol.toStringTag,{value:"Module"})),Br=new Map;function Dn(t,e){let s=Br.get(t);return s||(s=new Map,Br.set(t,s)),s.has(e)||s.set(e,[]),s.get(e)}function $(t,e,s){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(s&&(s.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const i=await $(t,e,s)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(s||e===null)return r;const{rr_type:i,index:o}=r;return Dn(e,i)[o]}else if("args"in r){const{rr_type:i,args:o}=r,a=window[i];return new a(...await Promise.all(o.map($(t,e,s))))}else{if("base64"in r)return Qa(r.base64);if("src"in r){const i=t.get(r.src);if(i)return i;{const o=new Image;return o.src=r.src,t.set(r.src,o),o}}else if("data"in r&&r.rr_type==="Blob"){const i=await Promise.all(r.data.map($(t,e,s)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map($(t,e,s)));return r}}async function wu({event:t,mutations:e,target:s,imageMap:r,errorHandler:i}){const o=s.getContext("2d");if(!o){i(e[0],new Error("Canvas context is null"));return}const a=e.map(async n=>Promise.all(n.args.map($(r,o))));(await Promise.all(a)).forEach((n,c)=>{const l=e[c];try{if(l.setter){o[l.property]=l.args[0];return}const u=o[l.property];l.property==="drawImage"&&typeof l.args[0]=="string"?(r.get(t),u.apply(o,l.args)):u.apply(o,n)}catch(u){i(l,u)}})}function bu(t,e){try{return e===ot.WebGL?t.getContext("webgl")||t.getContext("experimental-webgl"):t.getContext("webgl2")}catch{return null}}const vu=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Su(t,e){if(!(e!=null&&e.constructor))return;const{name:s}=e.constructor;if(!vu.includes(s))return;const r=Dn(t,s);r.includes(e)||r.push(e)}async function xu({mutation:t,target:e,type:s,imageMap:r,errorHandler:i}){try{const o=bu(e,s);if(!o)return;if(t.setter){o[t.property]=t.args[0];return}const a=o[t.property],n=await Promise.all(t.args.map($(r,o))),c=a.apply(o,n);Su(o,c);const l=!1}catch(o){i(t,o)}}async function Ur({event:t,mutation:e,target:s,imageMap:r,canvasEventMap:i,errorHandler:o}){try{const a=i.get(t)||e,n="commands"in a?a.commands:[a];if([ot.WebGL,ot.WebGL2].includes(e.type)){for(let c=0;c<n.length;c++){const l=n[c];await xu({mutation:l,type:e.type,target:s,imageMap:r,errorHandler:o})}return}await wu({event:t,mutations:n,target:s,imageMap:r,errorHandler:o})}catch(a){o(e,a)}}/*! *****************************************************************************
|
|
65
65
|
Copyright (c) Microsoft Corporation.
|
|
66
66
|
|
|
67
67
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -74,5 +74,5 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
74
74
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
75
75
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
76
76
|
PERFORMANCE OF THIS SOFTWARE.
|
|
77
|
-
***************************************************************************** */function Bi(t,e){var s=typeof Symbol=="function"&&t[Symbol.iterator];if(!s)return t;var i,n,r=s.call(t),a=[];try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(o){n={error:o}}finally{try{i&&!i.done&&(s=r.return)&&s.call(r)}finally{if(n)throw n.error}}return a}var se;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(se||(se={}));var Do={type:"xstate.init"};function Ft(t){return t===void 0?[]:[].concat(t)}function te(t){return{type:"xstate.assign",assignment:t}}function Ui(t,e){return typeof(t=typeof t=="string"&&e&&e[t]?e[t]:t)=="string"?{type:t}:typeof t=="function"?{type:t.name,exec:t}:t}function dt(t){return function(e){return t===e}}function Ro(t){return typeof t=="string"?{type:t}:t}function Wi(t,e){return{value:t,context:e,actions:[],changed:!1,matches:dt(t)}}function ji(t,e,s){var i=e,n=!1;return[t.filter(function(r){if(r.type==="xstate.assign"){n=!0;var a=Object.assign({},i);return typeof r.assignment=="function"?a=r.assignment(i,s):Object.keys(r.assignment).forEach(function(o){a[o]=typeof r.assignment[o]=="function"?r.assignment[o](i,s):r.assignment[o]}),i=a,!1}return!0}),i,n]}function Oo(t,e){e===void 0&&(e={});var s=Bi(ji(Ft(t.states[t.initial].entry).map(function(a){return Ui(a,e.actions)}),t.context,Do),2),i=s[0],n=s[1],r={config:t,_options:e,initialState:{value:t.initial,actions:i,context:n,matches:dt(t.initial)},transition:function(a,o){var l,c,u=typeof a=="string"?{value:a,context:t.context}:a,h=u.value,p=u.context,m=Ro(o),v=t.states[h];if(v.on){var d=Ft(v.on[m.type]);try{for(var S=function(_){var Nt=typeof Symbol=="function"&&Symbol.iterator,zs=Nt&&_[Nt],Ys=0;if(zs)return zs.call(_);if(_&&typeof _.length=="number")return{next:function(){return _&&Ys>=_.length&&(_=void 0),{value:_&&_[Ys++],done:!_}}};throw new TypeError(Nt?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),f=S.next();!f.done;f=S.next()){var w=f.value;if(w===void 0)return Wi(h,p);var g=typeof w=="string"?{target:w}:w,E=g.target,I=g.actions,B=I===void 0?[]:I,L=g.cond,W=L===void 0?function(){return!0}:L,H=E===void 0,Io=E??h,Po=t.states[Io];if(W(p,m)){var Mt=Bi(ji((H?Ft(B):[].concat(v.exit,B,Po.entry).filter(function(_){return _})).map(function(_){return Ui(_,r._options.actions)}),p,m),3),js=Mt[0],Lo=Mt[1],Fo=Mt[2],Vs=E??h;return{value:Vs,context:Lo,actions:js,changed:E!==h||js.length>0||Fo,matches:dt(Vs)}}}}catch(_){l={error:_}}finally{try{f&&!f.done&&(c=S.return)&&c.call(S)}finally{if(l)throw l.error}}}return Wi(h,p)}};return r}var Vi=function(t,e){return t.actions.forEach(function(s){var i=s.exec;return i&&i(t.context,e)})};function Ao(t){var e=t.initialState,s=se.NotStarted,i=new Set,n={_machine:t,send:function(r){s===se.Running&&(e=t.transition(e,r),Vi(e,Ro(r)),i.forEach(function(a){return a(e)}))},subscribe:function(r){return i.add(r),r(e),{unsubscribe:function(){return i.delete(r)}}},start:function(r){if(r){var a=typeof r=="object"?r:{context:t.config.context,value:r};e={value:a.value,actions:[],context:a.context,matches:dt(a.value)}}return s=se.Running,Vi(e,Do),n},stop:function(){return s=se.Stopped,i.clear(),n},get state(){return e},get status(){return s}};return n}class Su{constructor(e=[],s){b(this,"timeOffset",0),b(this,"speed"),b(this,"actions"),b(this,"raf",null),b(this,"lastTimestamp"),this.actions=e,this.speed=s.speed}addAction(e){const s=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const i=this.findActionIndex(e);this.actions.splice(i,0,e)}s&&(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 s=this.actions[0];if(this.timeOffset>=s.delay)this.actions.shift(),s.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let s=0,i=this.actions.length-1;for(;s<=i;){const n=Math.floor((s+i)/2);if(this.actions[n].delay<e.delay)s=n+1;else if(this.actions[n].delay>e.delay)i=n-1;else return n+1}return s}}function zi(t,e){if(t.type===P.IncrementalSnapshot&&t.data.source===T.MouseMove&&t.data.positions&&t.data.positions.length){const s=t.data.positions[0].timeOffset,i=t.timestamp+s;return t.delay=i-e,i-e}return t.delay=t.timestamp-e,t.delay}function xu(t,e){for(let s=t.length-1;s>=0;s--){const i=t[s];if(i.type===P.Meta&&i.timestamp<=e)return t.slice(s)}return t}function Cu(t,{getCastFn:e,applyEventsSynchronously:s,emitter:i}){const n=Oo({id:"player",context:t,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:te({lastPlayedEvent:(r,a)=>a.type==="CAST_EVENT"?a.payload.event:r.lastPlayedEvent}),recordTimeOffset:te((r,a)=>{let o=r.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(o=a.payload.timeOffset),{...r,timeOffset:o,baselineTime:r.events[0].timestamp+o}}),play(r){const{timer:a,events:o,baselineTime:l}=r;a.clear();for(const h of o)zi(h,l);const c=xu(o,l);i.emit(N.PlayBack);const u=new Array;for(const h of c)if(h.timestamp<l)u.push(h);else{const p=e(h,!1);a.addAction({doAction:()=>{p()},delay:h.delay})}s(u),i.emit(N.Flush),a.start()},pause(r){r.timer.clear()},resetLastPlayedEvent:te(r=>({...r,lastPlayedEvent:null})),startLive:te({baselineTime:(r,a)=>(r.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),addEvent:te((r,a)=>{const{baselineTime:o,timer:l,events:c}=r;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;zi(u,o);let h=c.length-1;if(!c[h]||c[h].timestamp<=u.timestamp)c.push(u);else{let v=-1,d=0;for(;d<=h;){const S=Math.floor((d+h)/2);c[S].timestamp<=u.timestamp?d=S+1:h=S-1}v===-1&&(v=d),c.splice(v,0,u)}const p=u.timestamp<o,m=e(u,p);p?m():l.isActive()&&l.addAction({doAction:()=>{m()},delay:u.delay})}return{...r,events:c}})}});return Ao(n)}function Eu(t){const e=Oo({id:"speed",context:t,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:(s,i)=>{"payload"in i&&s.timer.setSpeed(i.payload.speed)},recordSpeed:te({normalSpeed:s=>s.timer.speed}),restoreSpeed:s=>{s.timer.setSpeed(s.normalSpeed)}}});return Ao(e)}class Mu{constructor(e){b(this,"mediaMap",new Map),b(this,"warn"),b(this,"service"),b(this,"speedService"),b(this,"emitter"),b(this,"getCurrentTime"),b(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(N.Start,this.start.bind(this)),this.emitter.on(N.SkipStart,this.start.bind(this)),this.emitter.on(N.Pause,this.pause.bind(this)),this.emitter.on(N.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((s,i)=>{this.syncTargetWithState(i),e.pause&&i.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:s,mediaState:i}){if(i.isPlaying){const n=(e-i.lastInteractionTimeOffset)/1e3*i.playbackRate,r="duration"in s&&s.duration;if(Number.isNaN(r)){this.waitForMetadata(s);return}let a=i.currentTimeAtLastInteraction+n;s.loop&&r!==!1&&(a=a%r),s.currentTime=a}else s.pause(),s.currentTime=i.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const s=()=>{this.metadataCallbackMap.delete(e);const i=this.mediaMap.get(e);i&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:i})};this.metadataCallbackMap.set(e,s),e.addEventListener("loadedmetadata",s,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:s,mutation:i}){const n=this.mediaMap.get(e),{type:r,playbackRate:a,currentTime:o,muted:l,volume:c,loop:u}=i;return{isPlaying:r===qt.Play||r!==qt.Pause&&((n==null?void 0:n.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:o??(n==null?void 0:n.currentTimeAtLastInteraction)??0,lastInteractionTimeOffset:s,playbackRate:a??(n==null?void 0:n.playbackRate)??1,volume:c??(n==null?void 0:n.volume)??1,muted:l??(n==null?void 0:n.muted)??e.getAttribute("muted")===null,loop:u??(n==null?void 0:n.loop)??e.getAttribute("loop")===null}}syncTargetWithState(e){const s=this.mediaMap.get(e);if(!s)return;const{muted:i,loop:n,volume:r,isPlaying:a}=s,o=this.service.state.matches("paused"),l=s.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:s}),e.volume!==r&&(e.volume=r),e.muted=i,e.loop=n,e.playbackRate!==l&&(e.playbackRate=l),a&&!o?e.play():e.pause()}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}}addMediaElements(e,s,i){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const n=e,r=i.getMeta(n);if(!r||!("attributes"in r))return;const a=this.service.state.matches("paused"),o=r.attributes;let l=!1;o.rr_mediaState?l=o.rr_mediaState==="played":l=n.getAttribute("autoplay")!==null,l&&a&&n.pause();let c=1;typeof o.rr_mediaPlaybackRate=="number"&&(c=o.rr_mediaPlaybackRate);let u=!1;typeof o.rr_mediaMuted=="boolean"?u=o.rr_mediaMuted:u=n.getAttribute("muted")!==null;let h=!1;typeof o.rr_mediaLoop=="boolean"?h=o.rr_mediaLoop:h=n.getAttribute("loop")!==null;let p=1;typeof o.rr_mediaVolume=="number"&&(p=o.rr_mediaVolume);let m=0;typeof o.rr_mediaCurrentTime=="number"&&(m=o.rr_mediaCurrentTime),this.mediaMap.set(n,{isPlaying:l,currentTimeAtLastInteraction:m,lastInteractionTimeOffset:s,playbackRate:c,volume:p,muted:u,loop:h}),this.syncTargetWithState(n)}mediaMutation({target:e,timeOffset:s,mutation:i}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:s,mutation:i})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function Nu(t=window,e=document){if("scrollBehavior"in e.documentElement.style&&t.__forceSmoothScrollPolyfill__!==!0)return;const s=t.HTMLElement||t.Element,i=468,n={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:s.prototype.scroll||l,scrollIntoView:s.prototype.scrollIntoView},r=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now;function a(f){const w=["MSIE ","Trident/","Edge/"];return new RegExp(w.join("|")).test(f)}const o=a(t.navigator.userAgent)?1:0;function l(f,w){this.scrollLeft=f,this.scrollTop=w}function c(f){return .5*(1-Math.cos(Math.PI*f))}function u(f){if(f===null||typeof f!="object"||f.behavior===void 0||f.behavior==="auto"||f.behavior==="instant")return!0;if(typeof f=="object"&&f.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+f.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(f,w){if(w==="Y")return f.clientHeight+o<f.scrollHeight;if(w==="X")return f.clientWidth+o<f.scrollWidth}function p(f,w){const g=t.getComputedStyle(f,null)["overflow"+w];return g==="auto"||g==="scroll"}function m(f){const w=h(f,"Y")&&p(f,"Y"),g=h(f,"X")&&p(f,"X");return w||g}function v(f){for(;f!==e.body&&m(f)===!1;)f=f.parentNode||f.host;return f}function d(f){const w=r();let g,E,I,B=(w-f.startTime)/i;B=B>1?1:B,g=c(B),E=f.startX+(f.x-f.startX)*g,I=f.startY+(f.y-f.startY)*g,f.method.call(f.scrollable,E,I),(E!==f.x||I!==f.y)&&t.requestAnimationFrame(d.bind(t,f))}function S(f,w,g){let E,I,B,L;const W=r();f===e.body?(E=t,I=t.scrollX||t.pageXOffset,B=t.scrollY||t.pageYOffset,L=n.scroll):(E=f,I=f.scrollLeft,B=f.scrollTop,L=l),d({scrollable:E,method:L,startTime:W,startX:I,startY:B,x:w,y:g})}t.scroll=t.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){n.scroll.call(t,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:t.scrollY||t.pageYOffset);return}S.call(t,e.body,arguments[0].left!==void 0?~~arguments[0].left:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:t.scrollY||t.pageYOffset)}},t.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){n.scrollBy.call(t,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}S.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset))}},s.prototype.scroll=s.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");n.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const f=arguments[0].left,w=arguments[0].top;S.call(this,this,typeof f>"u"?this.scrollLeft:~~f,typeof w>"u"?this.scrollTop:~~w)},s.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){n.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},s.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){n.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const f=v(this),w=f.getBoundingClientRect(),g=this.getBoundingClientRect();f!==e.body?(S.call(this,f,f.scrollLeft+g.left-w.left,f.scrollTop+g.top-w.top),t.getComputedStyle(f).position!=="fixed"&&t.scrollBy({left:w.left,top:w.top,behavior:"smooth"})):t.scrollBy({left:g.left,top:g.top,behavior:"smooth"})}}const Tu=t=>[`.${t} { background: currentColor }`,"noscript { display: none !important; }"],ku=5*1e3,Du=To||mu,Yi="[replayer]",_t={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Gi(t){return t.type==P.IncrementalSnapshot&&(t.data.source==T.TouchMove||t.data.source==T.MouseInteraction&&t.data.type==F.TouchStart)}class Ru{constructor(e,s){if(b(this,"wrapper"),b(this,"iframe"),b(this,"service"),b(this,"speedService"),b(this,"config"),b(this,"usingVirtualDom",!1),b(this,"virtualDom",new ce),b(this,"mouse"),b(this,"mouseTail",null),b(this,"tailPositions",[]),b(this,"emitter",Du()),b(this,"nextUserInteractionEvent"),b(this,"legacy_missingNodeRetryMap",{}),b(this,"cache",pi()),b(this,"imageMap",new Map),b(this,"canvasEventMap",new Map),b(this,"mirror",Zi()),b(this,"styleMirror",new Ga),b(this,"mediaManager"),b(this,"firstFullSnapshot",null),b(this,"newDocumentQueue",[]),b(this,"mousePos",null),b(this,"touchActive",null),b(this,"lastMouseDownEvent",null),b(this,"lastHoveredRootNode"),b(this,"textValueMap",new Map),b(this,"lastSelectionData",null),b(this,"constructedStyleMutations",[]),b(this,"adoptedStyleSheets",[]),b(this,"handleResize",o=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(o.width)),l.setAttribute("height",String(o.height)))}),b(this,"applyEventsSynchronously",o=>{for(const l of o){switch(l.type){case P.DomContentLoaded:case P.Load:case P.Custom:continue;case P.FullSnapshot:case P.Meta:case P.Plugin:case P.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),b(this,"getCastFn",(o,l=!1)=>{let c;switch(o.type){case P.DomContentLoaded:case P.Load:break;case P.Custom:c=()=>{this.emitter.emit(N.CustomEvent,o)};break;case P.Meta:c=()=>this.emitter.emit(N.Resize,{width:o.data.width,height:o.data.height});break;case P.FullSnapshot:c=()=>{var u;if(this.firstFullSnapshot){if(this.firstFullSnapshot===o){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(o,l),(u=this.iframe.contentWindow)==null||u.scrollTo(o.data.initialOffset)};break;case P.IncrementalSnapshot:c=()=>{if(this.applyIncremental(o,l),!l&&(o===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),!this.nextUserInteractionEvent)){for(const u of this.service.state.context.events)if(!(u.timestamp<=o.timestamp)&&this.isUserInteraction(u)){u.delay-o.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent)if(this.config.skipInactive)this.play(this.nextUserInteractionEvent.timestamp-this.getMetaData().startTime-1e3);else{const u=this.nextUserInteractionEvent.delay-o.delay,h={speed:Math.min(Math.round(u/ku),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:h}),this.emitter.emit(N.SkipStart,h)}}};break}return()=>{c&&c();for(const h of this.config.plugins||[])h.handler&&h.handler(o,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:o}});const u=this.service.state.context.events.length-1;if(!this.config.liveMode&&o===this.service.state.context.events[u]){const h=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(N.Finish))};let p=50;o.type===P.IncrementalSnapshot&&o.data.source===T.MouseMove&&o.data.positions.length&&(p+=Math.max(0,-o.data.positions[0].timeOffset)),setTimeout(h,p)}this.emitter.emit(N.EventCast,o)}}),!(s!=null&&s.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const i={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:_t,useVirtualDom:!0,logger:console};this.config=Object.assign({},i,s),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(N.Resize,this.handleResize),this.setupDom();for(const o of this.config.plugins||[])o.getMirror&&o.getMirror({nodeMirror:this.mirror});this.emitter.on(N.Flush,()=>{if(this.usingVirtualDom){const o={mirror:this.mirror,applyCanvas:(l,c,u)=>{_i({event:l,mutation:c,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,c)=>{l.source===T.StyleSheetRule?this.applyStyleSheetRule(l,c):l.source===T.StyleDeclaration&&this.applyStyleDeclaration(l,c)},afterAppend:(l,c)=>{for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(l,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{ht(this.iframe.contentDocument,this.virtualDom,o,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[l],u=pt(c.node,this.mirror,this.virtualDom.mirror);ht(u,c.node,o,this.virtualDom.mirror),c.node=u}catch(c){this.warn(c)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[o,l]=this.lastMouseDownEvent;o.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(N.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.textValueMap.clear()});const n=new Su([],{speed:this.config.speed});this.service=Cu({events:e.map(o=>s&&s.unpackFn?s.unpackFn(o):o).sort((o,l)=>o.timestamp-l.timestamp),timer:n,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(o=>{this.emitter.emit(N.StateChange,{player:o})}),this.speedService=Eu({normalSpeed:-1,timer:n}),this.speedService.start(),this.speedService.subscribe(o=>{this.emitter.emit(N.StateChange,{speed:o})}),this.mediaManager=new Mu({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const r=this.service.state.context.events.find(o=>o.type===P.Meta),a=this.service.state.context.events.find(o=>o.type===P.FullSnapshot);if(r){const{width:o,height:l}=r.data;setTimeout(()=>{this.emitter.emit(N.Resize,{width:o,height:l})},0)}a&&setTimeout(()=>{var o;this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),(o=this.iframe.contentWindow)==null||o.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Gi)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,s){return this.emitter.on(e,s),this}off(e,s){return this.emitter.off(e,s),this}setConfig(e){Object.keys(e).forEach(s=>{e[s],this.config[s]=e[s]}),this.config.skipInactive||this.backToNormal(),typeof e.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail<"u"&&(e.mouseTail===!1?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],s=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:s.timestamp,totalTime:s.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:s}=this.service.state.context;return e-s[0].timestamp}getMirror(){return this.mirror}play(e=0){var s,i;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(i=(s=this.iframe.contentDocument)==null?void 0:s.getElementsByTagName("html")[0])==null||i.classList.remove("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.Start)}pause(e){var s,i;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(i=(s=this.iframe.contentDocument)==null?void 0:s.getElementsByTagName("html")[0])==null||i.classList.add("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.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(N.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.textValueMap.clear(),this.config.root.removeChild(this.wrapper),this.emitter.emit(N.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const s=this.config.unpackFn?this.config.unpackFn(e):e;Gi(s)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:s}}))}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=pi()}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),this.config.mouseTail!==!1&&(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&&(Nu(this.iframe.contentWindow,this.iframe.contentDocument),Va(this.iframe.contentWindow))}rebuildFullSnapshot(e,s=!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 i=[],n=(o,l)=>{if(this.collectIframeAndAttachDocument(i,o),this.mediaManager.isSupportedMediaElement(o)){const{events:c}=this.service.state.context;this.mediaManager.addMediaElements(o,e.timestamp-c[0].timestamp,this.mirror)}for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(o,{id:l,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),this.textValueMap.clear(),ja(e.data.node,{doc:this.iframe.contentDocument,afterAppend:n,cache:this.cache,mirror:this.mirror}),n(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:o,builtNode:l}of i)this.attachDocumentToIframe(o,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==o);const{documentElement:r,head:a}=this.iframe.contentDocument;this.insertStyleRules(r,a),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.FullsnapshotRebuilded,e),s||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,s){var i;const n=Tu(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&n.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const r=this.virtualDom.createElement("style");this.virtualDom.mirror.add(r,No(r,this.virtualDom.unserializedId)),e.insertBefore(r,s),r.rules.push({source:T.StyleSheetRule,adds:n.map((a,o)=>({rule:a,index:o}))})}else{const r=document.createElement("style");e.insertBefore(r,s);for(let a=0;a<n.length;a++)(i=r.sheet)==null||i.insertRule(n[a],a)}}attachDocumentToIframe(e,s){const i=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,n=[],r=(a,o)=>{this.collectIframeAndAttachDocument(n,a);const l=i.getMeta(a);if((l==null?void 0:l.type)===R.Element&&(l==null?void 0:l.tagName.toUpperCase())==="HTML"){const{documentElement:c,head:u}=s.contentDocument;this.insertStyleRules(c,u)}if(!this.usingVirtualDom)for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:o,replayer:this})};Se(e.node,{doc:s.contentDocument,mirror:i,hackCss:!0,skipChild:!1,afterAppend:r,cache:this.cache}),r(s.contentDocument,e.node.id);for(const{mutationInQueue:a,builtNode:o}of n)this.attachDocumentToIframe(a,o),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==a)}collectIframeAndAttachDocument(e,s){if(Ot(s,this.mirror)){const i=this.newDocumentQueue.find(n=>n.parentId===this.mirror.getId(s));i&&e.push({mutationInQueue:i,builtNode:s})}}waitForStylesheetLoad(){var e;const s=(e=this.iframe.contentDocument)==null?void 0:e.head;if(s){const i=new Set;let n,r=this.service.state;const a=()=>{r=this.service.state};this.emitter.on(N.Start,a),this.emitter.on(N.Pause,a);const o=()=>{this.emitter.off(N.Start,a),this.emitter.off(N.Pause,a)};s.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(i.add(l),l.addEventListener("load",()=>{i.delete(l),i.size===0&&n!==-1&&(r.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(N.LoadStylesheetEnd),n&&clearTimeout(n),o())}))}),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(N.LoadStylesheetStart),n=setTimeout(()=>{r.matches("playing")&&this.play(this.getCurrentTime()),n=-1,o()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const s of this.service.state.context.events)s.type===P.IncrementalSnapshot&&s.data.source===T.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(s.data,s)),("commands"in s.data?s.data.commands:[s.data]).forEach(i=>{this.preloadImages(i,s)}));return Promise.all(e)}preloadImages(e,s){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(s)){const i=document.createElement("canvas"),n=i.getContext("2d"),r=n==null?void 0:n.createImageData(i.width,i.height);n==null||n.putImageData(r,0,0)}}async deserializeAndPreloadCanvasEvents(e,s){if(!this.canvasEventMap.has(s)){const i={isUnchanged:!0};if("commands"in e){const n=await Promise.all(e.commands.map(async r=>{const a=await Promise.all(r.args.map($(this.imageMap,null,i)));return{...r,args:a}}));i.isUnchanged===!1&&this.canvasEventMap.set(s,{...e,commands:n})}else{const n=await Promise.all(e.args.map($(this.imageMap,null,i)));i.isUnchanged===!1&&this.canvasEventMap.set(s,{...e,args:n})}}}applyIncremental(e,s){var i,n,r;const{data:a}=e;switch(a.source){case T.Mutation:{try{this.applyMutation(a,s)}catch(o){this.warn(`Exception in mutation ${o.message||o}`,a)}break}case T.Drag:case T.TouchMove:case T.MouseMove:if(s){const o=a.positions[a.positions.length-1];this.mousePos={x:o.x,y:o.y,id:o.id,debugData:a}}else a.positions.forEach(o=>{const l={doAction:()=>{this.moveAndHover(o.x,o.y,o.id,s,a)},delay:o.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:e.delay-((i=a.positions[0])==null?void 0:i.timeOffset)});break;case T.MouseInteraction:{if(a.id===-1)break;const o=new Event(Vo(F[a.type])),l=this.mirror.getNode(a.id);if(!l)return this.debugNodeNotFound(a,a.id);this.emitter.emit(N.MouseInteraction,{type:a.type,target:l});const{triggerFocus:c}=this.config;switch(a.type){case F.Blur:"blur"in l&&l.blur();break;case F.Focus:c&&l.focus&&l.focus({preventScroll:!0});break;case F.Click:case F.TouchStart:case F.TouchEnd:case F.MouseDown:case F.MouseUp:s?(a.type===F.TouchStart?this.touchActive=!0:a.type===F.TouchEnd&&(this.touchActive=!1),a.type===F.MouseDown?this.lastMouseDownEvent=[l,o]:a.type===F.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:a.x||0,y:a.y||0,id:a.id,debugData:a}):(a.type===F.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(a.x||0,a.y||0,a.id,s,a),a.type===F.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):a.type===F.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):a.type===F.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(o));break;case F.TouchCancel:s?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(o)}break}case T.Scroll:{if(a.id===-1)break;if(this.usingVirtualDom){const o=this.virtualDom.mirror.getNode(a.id);if(!o)return this.debugNodeNotFound(a,a.id);o.scrollData=a;break}this.applyScroll(a,s);break}case T.ViewportResize:this.emitter.emit(N.Resize,{width:a.width,height:a.height});break;case T.Input:{if(a.id===-1)break;if(this.usingVirtualDom){const o=this.virtualDom.mirror.getNode(a.id);if(!o)return this.debugNodeNotFound(a,a.id);o.inputData=a;break}this.applyInput(a);break}case T.MediaInteraction:{const o=this.usingVirtualDom?this.virtualDom.mirror.getNode(a.id):this.mirror.getNode(a.id);if(!o)return this.debugNodeNotFound(a,a.id);const l=o,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:e.timestamp-c[0].timestamp,mutation:a});break}case T.StyleSheetRule:case T.StyleDeclaration:{this.usingVirtualDom?a.styleId?this.constructedStyleMutations.push(a):a.id&&((n=this.virtualDom.mirror.getNode(a.id))==null||n.rules.push(a)):this.applyStyleSheetMutation(a);break}case T.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const o=this.virtualDom.mirror.getNode(a.id);if(!o)return this.debugNodeNotFound(a,a.id);o.canvasMutations.push({event:e,mutation:a})}else{const o=this.mirror.getNode(a.id);if(!o)return this.debugNodeNotFound(a,a.id);_i({event:e,mutation:a,target:o,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case T.Font:{try{const o=new FontFace(a.family,a.buffer?new Uint8Array(JSON.parse(a.fontSource)):a.fontSource,a.descriptors);(r=this.iframe.contentDocument)==null||r.fonts.add(o)}catch(o){this.warn(o)}break}case T.Selection:{if(s){this.lastSelectionData=a;break}this.applySelection(a);break}case T.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(a):this.applyAdoptedStyleSheet(a);break}}}applyMutation(e,s){if(this.config.useVirtualDom&&!this.usingVirtualDom&&s&&(this.usingVirtualDom=!0,pu(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[c],h=Mo(u.node,this.virtualDom,this.mirror);h&&(u.node=h)}catch(u){this.warn(u)}const i=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(c=>i.getNode(c.id)?!0:(this.warnNodeNotFound(e,c.id),!1)),e.removes.forEach(c=>{var u;const h=i.getNode(c.id);if(!h)return;let p=i.getNode(c.parentId);if(!p)return this.warnNodeNotFound(e,c.parentId);if(c.isShadow&&Ve(p)&&(p=p.shadowRoot),i.removeNodeFromMap(h),p)try{p.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&p.nodeName==="STYLE"&&((u=p.rules)==null?void 0:u.length)>0&&(p.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",p,h,e);else throw m}});const n={...this.legacy_missingNodeRetryMap},r=[],a=c=>{let u=null;return c.nextId&&(u=i.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!u},o=c=>{var u,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let p=i.getNode(c.parentId);if(!p)return c.node.type===R.Document?this.newDocumentQueue.push(c):r.push(c);c.node.isShadow&&(Ve(p)||p.attachShadow({mode:"open"}),p=p.shadowRoot);let m=null,v=null;if(c.previousId&&(m=i.getNode(c.previousId)),c.nextId&&(v=i.getNode(c.nextId)),a(c))return r.push(c);if(c.node.rootId&&!i.getNode(c.node.rootId))return;const d=c.node.rootId?i.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ot(p,i)){this.attachDocumentToIframe(c,p);return}const S=(g,E)=>{if(!this.usingVirtualDom)for(const I of this.config.plugins||[])I.onBuild&&I.onBuild(g,{id:E,replayer:this})},f=Se(c.node,{doc:d,mirror:i,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:S});if(c.previousId===-1||c.nextId===-1){n[c.node.id]={node:f,mutation:c};return}const w=i.getMeta(p);if(w&&w.type===R.Element&&c.node.type===R.Text){const g=Array.isArray(p.childNodes)?p.childNodes:Array.from(p.childNodes);if(w.tagName==="textarea")for(const E of g)E.nodeType===p.TEXT_NODE&&p.removeChild(E);else if(w.tagName==="style"&&g.length===1)for(const E of g)E.nodeType===p.TEXT_NODE&&!i.hasNode(E)&&(f.textContent=E.textContent,p.removeChild(E))}else if((w==null?void 0:w.type)===R.Document){const g=p;c.node.type===R.DocumentType&&((u=g.childNodes[0])==null?void 0:u.nodeType)===Node.DOCUMENT_TYPE_NODE&&g.removeChild(g.childNodes[0]),f.nodeName==="HTML"&&g.documentElement&&g.removeChild(g.documentElement)}if(m&&m.nextSibling&&m.nextSibling.parentNode?p.insertBefore(f,m.nextSibling):v&&v.parentNode?p.contains(v)?p.insertBefore(f,v):p.insertBefore(f,null):p.appendChild(f),S(f,c.node.id),this.usingVirtualDom&&f.nodeName==="#text"&&p.nodeName==="STYLE"&&((h=p.rules)==null?void 0:h.length)>0&&(p.rules=[]),Ot(f,this.mirror)){const g=this.mirror.getId(f),E=this.newDocumentQueue.find(I=>I.parentId===g);E&&(this.attachDocumentToIframe(E,f),this.newDocumentQueue=this.newDocumentQueue.filter(I=>I!==E))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(n,p,f,c)};e.adds.forEach(c=>{o(c)});const l=Date.now();for(;r.length;){const c=za(r);if(r.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const u of c)i.getNode(u.value.parentId)?An(u,h=>{o(h)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(n).length&&Object.assign(this.legacy_missingNodeRetryMap,n),Ya(e.texts).forEach(c=>{var u;const h=i.getNode(c.id);if(!h)return e.removes.find(m=>m.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);let p;if(c.delta){const m=this.textValueMap.get(c.id)||"";p=Xa(m,c.delta)}else p=c.value??null;if(h.textContent=p,p!==null&&this.textValueMap.set(c.id,p),this.usingVirtualDom){const m=h.parentNode;((u=m==null?void 0:m.rules)==null?void 0:u.length)>0&&(m.rules=[])}}),e.attributes.forEach(c=>{var u;const h=i.getNode(c.id);if(!h)return e.removes.find(p=>p.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);for(const p in c.attributes)if(typeof p=="string"){const m=c.attributes[p];if(m===null)h.removeAttribute(p);else if(typeof m=="string")try{if(p==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{const v=i.getMeta(h);Object.assign(v.attributes,c.attributes);const d=Se(v,{doc:h.ownerDocument,mirror:i,skipChild:!0,hackCss:!0,cache:this.cache}),S=h.nextSibling,f=h.parentNode;if(d&&f){f.removeChild(h),f.insertBefore(d,S),i.replace(c.id,d);break}}catch{}if(p==="value"&&h.nodeName==="TEXTAREA"){const v=h;v.childNodes.forEach(S=>v.removeChild(S));const d=(u=h.ownerDocument)==null?void 0:u.createTextNode(m);d&&v.appendChild(d)}else h.setAttribute(p,m)}catch(v){this.warn("An error occurred may due to the checkout feature.",v)}else if(p==="style"){const v=m,d=h;for(const S in v)if(v[S]===!1)d.style.removeProperty(S);else if(v[S]instanceof Array){const f=v[S];d.style.setProperty(S,f[0],f[1])}else{const f=v[S];d.style.setProperty(S,f)}}}})}applyScroll(e,s){var i,n;const r=this.mirror.getNode(e.id);if(!r)return this.debugNodeNotFound(e,e.id);const a=this.mirror.getMeta(r);if(r===this.iframe.contentDocument)(i=this.iframe.contentWindow)==null||i.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"});else if((a==null?void 0:a.type)===R.Document)(n=r.defaultView)==null||n.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"});else try{r.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"})}catch{}}applyInput(e){const s=this.mirror.getNode(e.id);if(!s)return this.debugNodeNotFound(e,e.id);try{s.checked=e.isChecked,s.value=e.text}catch{}}applySelection(e){try{const s=new Set,i=e.ranges.map(({start:n,startOffset:r,end:a,endOffset:o})=>{const l=this.mirror.getNode(n),c=this.mirror.getNode(a);if(!l||!c)return;const u=new Range;u.setStart(l,r),u.setEnd(c,o);const h=l.ownerDocument,p=h==null?void 0:h.getSelection();return p&&s.add(p),{range:u,selection:p}});s.forEach(n=>n.removeAllRanges()),i.forEach(n=>{var r;return n&&((r=n.selection)==null?void 0:r.addRange(n.range))})}catch{}}applyStyleSheetMutation(e){var s;let i=null;e.styleId?i=this.styleMirror.getStyle(e.styleId):e.id&&(i=((s=this.mirror.getNode(e.id))==null?void 0:s.sheet)||null),i&&(e.source===T.StyleSheetRule?this.applyStyleSheetRule(e,i):e.source===T.StyleDeclaration&&this.applyStyleDeclaration(e,i))}applyStyleSheetRule(e,s){var i,n,r,a;if((i=e.adds)==null||i.forEach(({rule:o,index:l})=>{try{if(Array.isArray(l)){const{positions:c,index:u}=fi(l);be(s.cssRules,c).insertRule(o,u)}else{const c=l===void 0?void 0:Math.min(l,s.cssRules.length);s==null||s.insertRule(o,c)}}catch{}}),(n=e.removes)==null||n.forEach(({index:o})=>{try{if(Array.isArray(o)){const{positions:l,index:c}=fi(o);be(s.cssRules,l).deleteRule(c||0)}else s==null||s.deleteRule(o)}catch{}}),e.replace)try{(r=s.replace)==null||r.call(s,e.replace)}catch{}if(e.replaceSync)try{(a=s.replaceSync)==null||a.call(s,e.replaceSync)}catch{}}applyStyleDeclaration(e,s){e.set&&be(s.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&be(s.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var s;const i=this.mirror.getNode(e.id);if(!i)return;(s=e.styles)==null||s.forEach(o=>{var l;let c=null,u=null;if(Ve(i)?u=((l=i.ownerDocument)==null?void 0:l.defaultView)||null:i.nodeName==="#document"&&(u=i.defaultView),!!u)try{c=new u.CSSStyleSheet,this.styleMirror.add(c,o.styleId),this.applyStyleSheetRule({source:T.StyleSheetRule,adds:o.rules},c)}catch{}});const n=10;let r=0;const a=(o,l)=>{const c=l.map(u=>this.styleMirror.getStyle(u)).filter(u=>u!==null);Ve(o)?o.shadowRoot.adoptedStyleSheets=c:o.nodeName==="#document"&&(o.adoptedStyleSheets=c),c.length!==l.length&&r<n&&(setTimeout(()=>a(o,l),0+100*r),r++)};a(i,e.styleIds)}legacy_resolveMissingNode(e,s,i,n){const{previousId:r,nextId:a}=n,o=r&&e[r],l=a&&e[a];if(o){const{node:c,mutation:u}=o;s.insertBefore(c,i),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,s,c,u)}if(l){const{node:c,mutation:u}=l;s.insertBefore(c,i.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,s,c,u)}}moveAndHover(e,s,i,n,r){const a=this.mirror.getNode(i);if(!a)return this.debugNodeNotFound(r,i);const o=In(a,this.iframe),l=e*o.absoluteScale+o.x,c=s*o.absoluteScale+o.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${c}px`,n||this.drawMouseTail({x:l,y:c}),this.hoverElements(a)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:s,lineWidth:i,strokeStyle:n,duration:r}=this.config.mouseTail===!0?_t:Object.assign({},_t,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const o=this.mouseTail.getContext("2d");!o||!this.tailPositions.length||(o.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),o.beginPath(),o.lineWidth=i,o.lineCap=s,o.strokeStyle=n,o.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>o.lineTo(l.x,l.y)),o.stroke())};this.tailPositions.push(e),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(o=>o!==e),a()},r/this.speedService.state.context.timer.speed)}hoverElements(e){var s;(s=this.lastHoveredRootNode||this.iframe.contentDocument)==null||s.querySelectorAll(".\\:hover").forEach(n=>{n.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let i=e;for(;i;)i.classList&&i.classList.add(":hover"),i=i.parentElement}isUserInteraction(e){return e.type!==P.IncrementalSnapshot?!1:e.data.source>T.Mutation&&e.data.source<=T.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(N.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,s){this.warn(`Node with id '${s}' not found. `,e)}warnCanvasMutationFailed(e,s){this.warn("Has error on canvas update",s,"canvas mutation:",e)}debugNodeNotFound(e,s){this.debug(`Node with id '${s}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(Yi,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(Yi,...e)}}exports.Replayer=Ru;
|
|
77
|
+
***************************************************************************** */function Wr(t,e){var s=typeof Symbol=="function"&&t[Symbol.iterator];if(!s)return t;var r,i,o=s.call(t),a=[];try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(n){i={error:n}}finally{try{r&&!r.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}return a}var ie;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(ie||(ie={}));var Rn={type:"xstate.init"};function Ft(t){return t===void 0?[]:[].concat(t)}function re(t){return{type:"xstate.assign",assignment:t}}function jr(t,e){return typeof(t=typeof t=="string"&&e&&e[t]?e[t]:t)=="string"?{type:t}:typeof t=="function"?{type:t.name,exec:t}:t}function dt(t){return function(e){return t===e}}function On(t){return typeof t=="string"?{type:t}:t}function Vr(t,e){return{value:t,context:e,actions:[],changed:!1,matches:dt(t)}}function zr(t,e,s){var r=e,i=!1;return[t.filter(function(o){if(o.type==="xstate.assign"){i=!0;var a=Object.assign({},r);return typeof o.assignment=="function"?a=o.assignment(r,s):Object.keys(o.assignment).forEach(function(n){a[n]=typeof o.assignment[n]=="function"?o.assignment[n](r,s):o.assignment[n]}),r=a,!1}return!0}),r,i]}function An(t,e){e===void 0&&(e={});var s=Wr(zr(Ft(t.states[t.initial].entry).map(function(a){return jr(a,e.actions)}),t.context,Rn),2),r=s[0],i=s[1],o={config:t,_options:e,initialState:{value:t.initial,actions:r,context:i,matches:dt(t.initial)},transition:function(a,n){var c,l,u=typeof a=="string"?{value:a,context:t.context}:a,h=u.value,p=u.context,m=On(n),v=t.states[h];if(v.on){var d=Ft(v.on[m.type]);try{for(var S=function(_){var Nt=typeof Symbol=="function"&&Symbol.iterator,zs=Nt&&_[Nt],Ys=0;if(zs)return zs.call(_);if(_&&typeof _.length=="number")return{next:function(){return _&&Ys>=_.length&&(_=void 0),{value:_&&_[Ys++],done:!_}}};throw new TypeError(Nt?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),f=S.next();!f.done;f=S.next()){var w=f.value;if(w===void 0)return Vr(h,p);var g=typeof w=="string"?{target:w}:w,E=g.target,I=g.actions,B=I===void 0?[]:I,L=g.cond,W=L===void 0?function(){return!0}:L,K=E===void 0,Pn=E??h,Ln=t.states[Pn];if(W(p,m)){var Mt=Wr(zr((K?Ft(B):[].concat(v.exit,B,Ln.entry).filter(function(_){return _})).map(function(_){return jr(_,o._options.actions)}),p,m),3),js=Mt[0],Fn=Mt[1],_n=Mt[2],Vs=E??h;return{value:Vs,context:Fn,actions:js,changed:E!==h||js.length>0||_n,matches:dt(Vs)}}}}catch(_){c={error:_}}finally{try{f&&!f.done&&(l=S.return)&&l.call(S)}finally{if(c)throw c.error}}}return Vr(h,p)}};return o}var Yr=function(t,e){return t.actions.forEach(function(s){var r=s.exec;return r&&r(t.context,e)})};function In(t){var e=t.initialState,s=ie.NotStarted,r=new Set,i={_machine:t,send:function(o){s===ie.Running&&(e=t.transition(e,o),Yr(e,On(o)),r.forEach(function(a){return a(e)}))},subscribe:function(o){return r.add(o),o(e),{unsubscribe:function(){return r.delete(o)}}},start:function(o){if(o){var a=typeof o=="object"?o:{context:t.config.context,value:o};e={value:a.value,actions:[],context:a.context,matches:dt(a.value)}}return s=ie.Running,Yr(e,Rn),i},stop:function(){return s=ie.Stopped,r.clear(),i},get state(){return e},get status(){return s}};return i}class Cu{constructor(e=[],s){b(this,"timeOffset",0),b(this,"speed"),b(this,"actions"),b(this,"raf",null),b(this,"lastTimestamp"),this.actions=e,this.speed=s.speed}addAction(e){const s=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const r=this.findActionIndex(e);this.actions.splice(r,0,e)}s&&(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 s=this.actions[0];if(this.timeOffset>=s.delay)this.actions.shift(),s.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let s=0,r=this.actions.length-1;for(;s<=r;){const i=Math.floor((s+r)/2);if(this.actions[i].delay<e.delay)s=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return s}}function Gr(t,e){if(t.type===P.IncrementalSnapshot&&t.data.source===T.MouseMove&&t.data.positions&&t.data.positions.length){const s=t.data.positions[0].timeOffset,r=t.timestamp+s;return t.delay=r-e,r-e}return t.delay=t.timestamp-e,t.delay}function Eu(t,e){for(let s=t.length-1;s>=0;s--){const r=t[s];if(r.type===P.Meta&&r.timestamp<=e)return t.slice(s)}return t}function Mu(t,{getCastFn:e,applyEventsSynchronously:s,emitter:r}){const i=An({id:"player",context:t,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:re({lastPlayedEvent:(o,a)=>a.type==="CAST_EVENT"?a.payload.event:o.lastPlayedEvent}),recordTimeOffset:re((o,a)=>{let n=o.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(n=a.payload.timeOffset),{...o,timeOffset:n,baselineTime:o.events[0].timestamp+n}}),play(o){const{timer:a,events:n,baselineTime:c}=o;a.clear();for(const h of n)Gr(h,c);const l=Eu(n,c);r.emit(N.PlayBack);const u=new Array;for(const h of l)if(h.timestamp<c)u.push(h);else{const p=e(h,!1);a.addAction({doAction:()=>{p()},delay:h.delay})}s(u),r.emit(N.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:re(o=>({...o,lastPlayedEvent:null})),startLive:re({baselineTime:(o,a)=>(o.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),addEvent:re((o,a)=>{const{baselineTime:n,timer:c,events:l}=o;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;Gr(u,n);let h=l.length-1;if(!l[h]||l[h].timestamp<=u.timestamp)l.push(u);else{let v=-1,d=0;for(;d<=h;){const S=Math.floor((d+h)/2);l[S].timestamp<=u.timestamp?d=S+1:h=S-1}v===-1&&(v=d),l.splice(v,0,u)}const p=u.timestamp<n,m=e(u,p);p?m():c.isActive()&&c.addAction({doAction:()=>{m()},delay:u.delay})}return{...o,events:l}})}});return In(i)}function Nu(t){const e=An({id:"speed",context:t,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:(s,r)=>{"payload"in r&&s.timer.setSpeed(r.payload.speed)},recordSpeed:re({normalSpeed:s=>s.timer.speed}),restoreSpeed:s=>{s.timer.setSpeed(s.normalSpeed)}}});return In(e)}class Tu{constructor(e){b(this,"mediaMap",new Map),b(this,"warn"),b(this,"service"),b(this,"speedService"),b(this,"emitter"),b(this,"getCurrentTime"),b(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(N.Start,this.start.bind(this)),this.emitter.on(N.SkipStart,this.start.bind(this)),this.emitter.on(N.Pause,this.pause.bind(this)),this.emitter.on(N.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((s,r)=>{this.syncTargetWithState(r),e.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:s,mediaState:r}){if(r.isPlaying){const i=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,o="duration"in s&&s.duration;if(Number.isNaN(o)){this.waitForMetadata(s);return}let a=r.currentTimeAtLastInteraction+i;s.loop&&o!==!1&&(a=a%o),s.currentTime=a}else s.pause(),s.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const s=()=>{this.metadataCallbackMap.delete(e);const r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})};this.metadataCallbackMap.set(e,s),e.addEventListener("loadedmetadata",s,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:s,mutation:r}){const i=this.mediaMap.get(e),{type:o,playbackRate:a,currentTime:n,muted:c,volume:l,loop:u}=r;return{isPlaying:o===qt.Play||o!==qt.Pause&&((i==null?void 0:i.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:n??(i==null?void 0:i.currentTimeAtLastInteraction)??0,lastInteractionTimeOffset:s,playbackRate:a??(i==null?void 0:i.playbackRate)??1,volume:l??(i==null?void 0:i.volume)??1,muted:c??(i==null?void 0:i.muted)??e.getAttribute("muted")===null,loop:u??(i==null?void 0:i.loop)??e.getAttribute("loop")===null}}syncTargetWithState(e){const s=this.mediaMap.get(e);if(!s)return;const{muted:r,loop:i,volume:o,isPlaying:a}=s,n=this.service.state.matches("paused"),c=s.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:s}),e.volume!==o&&(e.volume=o),e.muted=r,e.loop=i,e.playbackRate!==c&&(e.playbackRate=c),a&&!n?e.play():e.pause()}catch(l){this.warn(`Failed to replay media interactions: ${l.message||l}`)}}addMediaElements(e,s,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const i=e,o=r.getMeta(i);if(!o||!("attributes"in o))return;const a=this.service.state.matches("paused"),n=o.attributes;let c=!1;n.rr_mediaState?c=n.rr_mediaState==="played":c=i.getAttribute("autoplay")!==null,c&&a&&i.pause();let l=1;typeof n.rr_mediaPlaybackRate=="number"&&(l=n.rr_mediaPlaybackRate);let u=!1;typeof n.rr_mediaMuted=="boolean"?u=n.rr_mediaMuted:u=i.getAttribute("muted")!==null;let h=!1;typeof n.rr_mediaLoop=="boolean"?h=n.rr_mediaLoop:h=i.getAttribute("loop")!==null;let p=1;typeof n.rr_mediaVolume=="number"&&(p=n.rr_mediaVolume);let m=0;typeof n.rr_mediaCurrentTime=="number"&&(m=n.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:c,currentTimeAtLastInteraction:m,lastInteractionTimeOffset:s,playbackRate:l,volume:p,muted:u,loop:h}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:s,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:s,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function ku(t=window,e=document){if("scrollBehavior"in e.documentElement.style&&t.__forceSmoothScrollPolyfill__!==!0)return;const s=t.HTMLElement||t.Element,r=468,i={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:s.prototype.scroll||c,scrollIntoView:s.prototype.scrollIntoView},o=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now;function a(f){const w=["MSIE ","Trident/","Edge/"];return new RegExp(w.join("|")).test(f)}const n=a(t.navigator.userAgent)?1:0;function c(f,w){this.scrollLeft=f,this.scrollTop=w}function l(f){return .5*(1-Math.cos(Math.PI*f))}function u(f){if(f===null||typeof f!="object"||f.behavior===void 0||f.behavior==="auto"||f.behavior==="instant")return!0;if(typeof f=="object"&&f.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+f.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(f,w){if(w==="Y")return f.clientHeight+n<f.scrollHeight;if(w==="X")return f.clientWidth+n<f.scrollWidth}function p(f,w){const g=t.getComputedStyle(f,null)["overflow"+w];return g==="auto"||g==="scroll"}function m(f){const w=h(f,"Y")&&p(f,"Y"),g=h(f,"X")&&p(f,"X");return w||g}function v(f){for(;f!==e.body&&m(f)===!1;)f=f.parentNode||f.host;return f}function d(f){const w=o();let g,E,I,B=(w-f.startTime)/r;B=B>1?1:B,g=l(B),E=f.startX+(f.x-f.startX)*g,I=f.startY+(f.y-f.startY)*g,f.method.call(f.scrollable,E,I),(E!==f.x||I!==f.y)&&t.requestAnimationFrame(d.bind(t,f))}function S(f,w,g){let E,I,B,L;const W=o();f===e.body?(E=t,I=t.scrollX||t.pageXOffset,B=t.scrollY||t.pageYOffset,L=i.scroll):(E=f,I=f.scrollLeft,B=f.scrollTop,L=c),d({scrollable:E,method:L,startTime:W,startX:I,startY:B,x:w,y:g})}t.scroll=t.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.scroll.call(t,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:t.scrollY||t.pageYOffset);return}S.call(t,e.body,arguments[0].left!==void 0?~~arguments[0].left:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:t.scrollY||t.pageYOffset)}},t.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){i.scrollBy.call(t,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}S.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset))}},s.prototype.scroll=s.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const f=arguments[0].left,w=arguments[0].top;S.call(this,this,typeof f>"u"?this.scrollLeft:~~f,typeof w>"u"?this.scrollTop:~~w)},s.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},s.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const f=v(this),w=f.getBoundingClientRect(),g=this.getBoundingClientRect();f!==e.body?(S.call(this,f,f.scrollLeft+g.left-w.left,f.scrollTop+g.top-w.top),t.getComputedStyle(f).position!=="fixed"&&t.scrollBy({left:w.left,top:w.top,behavior:"smooth"})):t.scrollBy({left:g.left,top:g.top,behavior:"smooth"})}}const Du=t=>[`.${t} { background: currentColor }`,"noscript { display: none !important; }"],Ru=5*1e3,Ou=kn||yu,Zr="[replayer]",_t={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Xr(t){return t.type==P.IncrementalSnapshot&&(t.data.source==T.TouchMove||t.data.source==T.MouseInteraction&&t.data.type==F.TouchStart)}class Au{constructor(e,s){if(b(this,"wrapper"),b(this,"iframe"),b(this,"service"),b(this,"speedService"),b(this,"config"),b(this,"usingVirtualDom",!1),b(this,"virtualDom",new he),b(this,"mouse"),b(this,"mouseTail",null),b(this,"tailPositions",[]),b(this,"emitter",Ou()),b(this,"nextUserInteractionEvent"),b(this,"legacy_missingNodeRetryMap",{}),b(this,"cache",dr()),b(this,"imageMap",new Map),b(this,"canvasEventMap",new Map),b(this,"mirror",Jr()),b(this,"styleMirror",new Xa),b(this,"mediaManager"),b(this,"firstFullSnapshot",null),b(this,"newDocumentQueue",[]),b(this,"mousePos",null),b(this,"touchActive",null),b(this,"lastMouseDownEvent",null),b(this,"lastHoveredRootNode"),b(this,"textValueMap",new Map),b(this,"lastSelectionData",null),b(this,"constructedStyleMutations",[]),b(this,"adoptedStyleSheets",[]),b(this,"handleResize",n=>{this.iframe.style.display="inherit";for(const c of[this.mouseTail,this.iframe])c&&(c.setAttribute("width",String(n.width)),c.setAttribute("height",String(n.height)))}),b(this,"applyEventsSynchronously",n=>{for(const c of n){switch(c.type){case P.DomContentLoaded:case P.Load:case P.Custom:continue;case P.FullSnapshot:case P.Meta:case P.Plugin:case P.IncrementalSnapshot:break}this.getCastFn(c,!0)()}}),b(this,"getCastFn",(n,c=!1)=>{let l;switch(n.type){case P.DomContentLoaded:case P.Load:break;case P.Custom:l=()=>{this.emitter.emit(N.CustomEvent,n)};break;case P.Meta:l=()=>this.emitter.emit(N.Resize,{width:n.data.width,height:n.data.height});break;case P.FullSnapshot:l=()=>{var u;if(this.firstFullSnapshot){if(this.firstFullSnapshot===n){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(n,c),(u=this.iframe.contentWindow)==null||u.scrollTo(n.data.initialOffset)};break;case P.IncrementalSnapshot:l=()=>{if(this.applyIncremental(n,c),!c&&(n===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),!this.nextUserInteractionEvent)){for(const u of this.service.state.context.events)if(!(u.timestamp<=n.timestamp)&&this.isUserInteraction(u)){u.delay-n.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent)if(this.config.skipInactive)this.play(this.nextUserInteractionEvent.timestamp-this.getMetaData().startTime-1e3);else{const u=this.nextUserInteractionEvent.delay-n.delay,h={speed:Math.min(Math.round(u/Ru),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:h}),this.emitter.emit(N.SkipStart,h)}}};break}return()=>{l&&l();for(const h of this.config.plugins||[])h.handler&&h.handler(n,c,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:n}});const u=this.service.state.context.events.length-1;if(!this.config.liveMode&&n===this.service.state.context.events[u]){const h=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(N.Finish))};let p=50;n.type===P.IncrementalSnapshot&&n.data.source===T.MouseMove&&n.data.positions.length&&(p+=Math.max(0,-n.data.positions[0].timeOffset)),setTimeout(h,p)}this.emitter.emit(N.EventCast,n)}}),!(s!=null&&s.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:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:_t,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,s),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(N.Resize,this.handleResize),this.setupDom();for(const n of this.config.plugins||[])n.getMirror&&n.getMirror({nodeMirror:this.mirror});this.emitter.on(N.Flush,()=>{if(this.usingVirtualDom){const n={mirror:this.mirror,applyCanvas:(c,l,u)=>{Ur({event:c,mutation:l,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(c,l)=>{c.source===T.StyleSheetRule?this.applyStyleSheetRule(c,l):c.source===T.StyleDeclaration&&this.applyStyleDeclaration(c,l)},afterAppend:(c,l)=>{for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(c,{id:l,replayer:this})}};if(this.iframe.contentDocument)try{ht(this.iframe.contentDocument,this.virtualDom,n,this.virtualDom.mirror)}catch(c){console.warn(c)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const c in this.legacy_missingNodeRetryMap)try{const l=this.legacy_missingNodeRetryMap[c],u=pt(l.node,this.mirror,this.virtualDom.mirror);ht(u,l.node,n,this.virtualDom.mirror),l.node=u}catch(l){this.warn(l)}this.constructedStyleMutations.forEach(c=>{this.applyStyleSheetMutation(c)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(c=>{this.applyAdoptedStyleSheet(c)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[n,c]=this.lastMouseDownEvent;n.dispatchEvent(c)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(N.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.textValueMap.clear()});const i=new Cu([],{speed:this.config.speed});this.service=Mu({events:e.map(n=>s&&s.unpackFn?s.unpackFn(n):n).sort((n,c)=>n.timestamp-c.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(n=>{this.emitter.emit(N.StateChange,{player:n})}),this.speedService=Nu({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(n=>{this.emitter.emit(N.StateChange,{speed:n})}),this.mediaManager=new Tu({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const o=this.service.state.context.events.find(n=>n.type===P.Meta),a=this.service.state.context.events.find(n=>n.type===P.FullSnapshot);if(o){const{width:n,height:c}=o.data;setTimeout(()=>{this.emitter.emit(N.Resize,{width:n,height:c})},0)}a&&setTimeout(()=>{var n;this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),(n=this.iframe.contentWindow)==null||n.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Xr)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,s){return this.emitter.on(e,s),this}off(e,s){return this.emitter.off(e,s),this}setConfig(e){Object.keys(e).forEach(s=>{e[s],this.config[s]=e[s]}),this.config.skipInactive||this.backToNormal(),typeof e.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail<"u"&&(e.mouseTail===!1?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],s=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:s.timestamp,totalTime:s.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:s}=this.service.state.context;return e-s[0].timestamp}getMirror(){return this.mirror}play(e=0){var s,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(s=this.iframe.contentDocument)==null?void 0:s.getElementsByTagName("html")[0])==null||r.classList.remove("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.Start)}pause(e){var s,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(s=this.iframe.contentDocument)==null?void 0:s.getElementsByTagName("html")[0])==null||r.classList.add("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.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(N.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.textValueMap.clear(),this.config.root.removeChild(this.wrapper),this.emitter.emit(N.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const s=this.config.unpackFn?this.config.unpackFn(e):e;Xr(s)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:s}}))}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=dr()}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),this.config.mouseTail!==!1&&(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&&(ku(this.iframe.contentWindow,this.iframe.contentDocument),Ya(this.iframe.contentWindow))}rebuildFullSnapshot(e,s=!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 r=[],i=(n,c)=>{if(this.collectIframeAndAttachDocument(r,n),this.mediaManager.isSupportedMediaElement(n)){const{events:l}=this.service.state.context;this.mediaManager.addMediaElements(n,e.timestamp-l[0].timestamp,this.mirror)}for(const l of this.config.plugins||[])l.onBuild&&l.onBuild(n,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),this.textValueMap.clear(),za(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:n,builtNode:c}of r)this.attachDocumentToIframe(n,c),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==n);const{documentElement:o,head:a}=this.iframe.contentDocument;this.insertStyleRules(o,a),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.FullsnapshotRebuilded,e),s||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,s){var r;const i=Du(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,Tn(o,this.virtualDom.unserializedId)),e.insertBefore(o,s),o.rules.push({source:T.StyleSheetRule,adds:i.map((a,n)=>({rule:a,index:n}))})}else{const o=document.createElement("style");e.insertBefore(o,s);for(let a=0;a<i.length;a++)(r=o.sheet)==null||r.insertRule(i[a],a)}}attachDocumentToIframe(e,s){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=(a,n)=>{this.collectIframeAndAttachDocument(i,a);const c=r.getMeta(a);if((c==null?void 0:c.type)===R.Element&&(c==null?void 0:c.tagName.toUpperCase())==="HTML"){const{documentElement:l,head:u}=s.contentDocument;this.insertStyleRules(l,u)}if(!this.usingVirtualDom)for(const l of this.config.plugins||[])l.onBuild&&l.onBuild(a,{id:n,replayer:this})};Se(e.node,{doc:s.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(s.contentDocument,e.node.id);for(const{mutationInQueue:a,builtNode:n}of i)this.attachDocumentToIframe(a,n),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a)}collectIframeAndAttachDocument(e,s){if(Ot(s,this.mirror)){const r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(s));r&&e.push({mutationInQueue:r,builtNode:s})}}waitForStylesheetLoad(){var e;const s=(e=this.iframe.contentDocument)==null?void 0:e.head;if(s){const r=new Set;let i,o=this.service.state;const a=()=>{o=this.service.state};this.emitter.on(N.Start,a),this.emitter.on(N.Pause,a);const n=()=>{this.emitter.off(N.Start,a),this.emitter.off(N.Pause,a)};s.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(r.add(c),c.addEventListener("load",()=>{r.delete(c),r.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(N.LoadStylesheetEnd),i&&clearTimeout(i),n())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(N.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,n()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const s of this.service.state.context.events)s.type===P.IncrementalSnapshot&&s.data.source===T.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(s.data,s)),("commands"in s.data?s.data.commands:[s.data]).forEach(r=>{this.preloadImages(r,s)}));return Promise.all(e)}preloadImages(e,s){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(s)){const r=document.createElement("canvas"),i=r.getContext("2d"),o=i==null?void 0:i.createImageData(r.width,r.height);i==null||i.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(e,s){if(!this.canvasEventMap.has(s)){const r={isUnchanged:!0};if("commands"in e){const i=await Promise.all(e.commands.map(async o=>{const a=await Promise.all(o.args.map($(this.imageMap,null,r)));return{...o,args:a}}));r.isUnchanged===!1&&this.canvasEventMap.set(s,{...e,commands:i})}else{const i=await Promise.all(e.args.map($(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(s,{...e,args:i})}}}applyIncremental(e,s){var r,i,o;const{data:a}=e;switch(a.source){case T.Mutation:{try{this.applyMutation(a,s)}catch(n){this.warn(`Exception in mutation ${n.message||n}`,a)}break}case T.Drag:case T.TouchMove:case T.MouseMove:if(s){const n=a.positions[a.positions.length-1];this.mousePos={x:n.x,y:n.y,id:n.id,debugData:a}}else a.positions.forEach(n=>{const c={doAction:()=>{this.moveAndHover(n.x,n.y,n.id,s,a)},delay:n.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(c)}),this.timer.addAction({doAction(){},delay:e.delay-((r=a.positions[0])==null?void 0:r.timeOffset)});break;case T.MouseInteraction:{if(a.id===-1)break;const n=new Event(zn(F[a.type])),c=this.mirror.getNode(a.id);if(!c)return this.debugNodeNotFound(a,a.id);this.emitter.emit(N.MouseInteraction,{type:a.type,target:c});const{triggerFocus:l}=this.config;switch(a.type){case F.Blur:"blur"in c&&c.blur();break;case F.Focus:l&&c.focus&&c.focus({preventScroll:!0});break;case F.Click:case F.TouchStart:case F.TouchEnd:case F.MouseDown:case F.MouseUp:s?(a.type===F.TouchStart?this.touchActive=!0:a.type===F.TouchEnd&&(this.touchActive=!1),a.type===F.MouseDown?this.lastMouseDownEvent=[c,n]:a.type===F.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:a.x||0,y:a.y||0,id:a.id,debugData:a}):(a.type===F.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(a.x||0,a.y||0,a.id,s,a),a.type===F.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):a.type===F.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):a.type===F.TouchEnd?this.mouse.classList.remove("touch-active"):c.dispatchEvent(n));break;case F.TouchCancel:s?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:c.dispatchEvent(n)}break}case T.Scroll:{if(a.id===-1)break;if(this.usingVirtualDom){const n=this.virtualDom.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);n.scrollData=a;break}this.applyScroll(a,s);break}case T.ViewportResize:this.emitter.emit(N.Resize,{width:a.width,height:a.height});break;case T.Input:{if(a.id===-1)break;if(this.usingVirtualDom){const n=this.virtualDom.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);n.inputData=a;break}this.applyInput(a);break}case T.MediaInteraction:{const n=this.usingVirtualDom?this.virtualDom.mirror.getNode(a.id):this.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);const c=n,{events:l}=this.service.state.context;this.mediaManager.mediaMutation({target:c,timeOffset:e.timestamp-l[0].timestamp,mutation:a});break}case T.StyleSheetRule:case T.StyleDeclaration:{this.usingVirtualDom?a.styleId?this.constructedStyleMutations.push(a):a.id&&((i=this.virtualDom.mirror.getNode(a.id))==null||i.rules.push(a)):this.applyStyleSheetMutation(a);break}case T.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const n=this.virtualDom.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);n.canvasMutations.push({event:e,mutation:a})}else{const n=this.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);Ur({event:e,mutation:a,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case T.Font:{try{const n=new FontFace(a.family,a.buffer?new Uint8Array(JSON.parse(a.fontSource)):a.fontSource,a.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(n)}catch(n){this.warn(n)}break}case T.Selection:{if(s){this.lastSelectionData=a;break}this.applySelection(a);break}case T.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(a):this.applyAdoptedStyleSheet(a);break}}}applyMutation(e,s){if(this.config.useVirtualDom&&!this.usingVirtualDom&&s&&(this.usingVirtualDom=!0,fu(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const l in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[l],h=Nn(u.node,this.virtualDom,this.mirror);h&&(u.node=h)}catch(u){this.warn(u)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(l=>r.getNode(l.id)?!0:(this.warnNodeNotFound(e,l.id),!1)),e.removes.forEach(l=>{var u;const h=r.getNode(l.id);if(!h)return;let p=r.getNode(l.parentId);if(!p)return this.warnNodeNotFound(e,l.parentId);if(l.isShadow&&Ve(p)&&(p=p.shadowRoot),r.removeNodeFromMap(h),p)try{p.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&p.nodeName==="STYLE"&&((u=p.rules)==null?void 0:u.length)>0&&(p.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",p,h,e);else throw m}});const i={...this.legacy_missingNodeRetryMap},o=[],a=l=>{let u=null;return l.nextId&&(u=r.getNode(l.nextId)),l.nextId!==null&&l.nextId!==void 0&&l.nextId!==-1&&!u},n=l=>{var u,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let p=r.getNode(l.parentId);if(!p)return l.node.type===R.Document?this.newDocumentQueue.push(l):o.push(l);l.node.isShadow&&(Ve(p)||p.attachShadow({mode:"open"}),p=p.shadowRoot);let m=null,v=null;if(l.previousId&&(m=r.getNode(l.previousId)),l.nextId&&(v=r.getNode(l.nextId)),a(l))return o.push(l);if(l.node.rootId&&!r.getNode(l.node.rootId))return;const d=l.node.rootId?r.getNode(l.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ot(p,r)){this.attachDocumentToIframe(l,p);return}const S=(g,E)=>{if(!this.usingVirtualDom)for(const I of this.config.plugins||[])I.onBuild&&I.onBuild(g,{id:E,replayer:this})},f=Se(l.node,{doc:d,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:S});if(l.previousId===-1||l.nextId===-1){i[l.node.id]={node:f,mutation:l};return}const w=r.getMeta(p);if(w&&w.type===R.Element&&l.node.type===R.Text){const g=Array.isArray(p.childNodes)?p.childNodes:Array.from(p.childNodes);if(w.tagName==="textarea")for(const E of g)E.nodeType===p.TEXT_NODE&&p.removeChild(E);else if(w.tagName==="style"&&g.length===1)for(const E of g)E.nodeType===p.TEXT_NODE&&!r.hasNode(E)&&(f.textContent=E.textContent,p.removeChild(E))}else if((w==null?void 0:w.type)===R.Document){const g=p;l.node.type===R.DocumentType&&((u=g.childNodes[0])==null?void 0:u.nodeType)===Node.DOCUMENT_TYPE_NODE&&g.removeChild(g.childNodes[0]),f.nodeName==="HTML"&&g.documentElement&&g.removeChild(g.documentElement)}if(m&&m.nextSibling&&m.nextSibling.parentNode?p.insertBefore(f,m.nextSibling):v&&v.parentNode?p.contains(v)?p.insertBefore(f,v):p.insertBefore(f,null):p.appendChild(f),S(f,l.node.id),this.usingVirtualDom&&f.nodeName==="#text"&&p.nodeName==="STYLE"&&((h=p.rules)==null?void 0:h.length)>0&&(p.rules=[]),Ot(f,this.mirror)){const g=this.mirror.getId(f),E=this.newDocumentQueue.find(I=>I.parentId===g);E&&(this.attachDocumentToIframe(E,f),this.newDocumentQueue=this.newDocumentQueue.filter(I=>I!==E))}(l.previousId||l.nextId)&&this.legacy_resolveMissingNode(i,p,f,l)};e.adds.forEach(l=>{n(l)});const c=Date.now();for(;o.length;){const l=Ga(o);if(o.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",l);break}for(const u of l)r.getNode(u.value.parentId)?Ii(u,h=>{n(h)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),Za(e.texts).forEach(l=>{var u;const h=r.getNode(l.id);if(!h)return e.removes.find(m=>m.id===l.id)?void 0:this.warnNodeNotFound(e,l.id);let p;if(l.delta){const m=this.textValueMap.get(l.id)||"";p=Ha(m,l.delta)}else p=l.value??null;if(h.textContent=p,p!==null&&this.textValueMap.set(l.id,p),this.usingVirtualDom){const m=h.parentNode;((u=m==null?void 0:m.rules)==null?void 0:u.length)>0&&(m.rules=[])}}),e.attributes.forEach(l=>{var u;const h=r.getNode(l.id);if(!h)return e.removes.find(p=>p.id===l.id)?void 0:this.warnNodeNotFound(e,l.id);for(const p in l.attributes)if(typeof p=="string"){const m=l.attributes[p];if(m===null)h.removeAttribute(p);else if(typeof m=="string")try{if(p==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{const v=r.getMeta(h);Object.assign(v.attributes,l.attributes);const d=Se(v,{doc:h.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache}),S=h.nextSibling,f=h.parentNode;if(d&&f){f.removeChild(h),f.insertBefore(d,S),r.replace(l.id,d);break}}catch{}if(p==="value"&&h.nodeName==="TEXTAREA"){const v=h;v.childNodes.forEach(S=>v.removeChild(S));const d=(u=h.ownerDocument)==null?void 0:u.createTextNode(m);d&&v.appendChild(d)}else h.setAttribute(p,m)}catch(v){this.warn("An error occurred may due to the checkout feature.",v)}else if(p==="style"){const v=m,d=h;for(const S in v)if(v[S]===!1)d.style.removeProperty(S);else if(v[S]instanceof Array){const f=v[S];d.style.setProperty(S,f[0],f[1])}else{const f=v[S];d.style.setProperty(S,f)}}}})}applyScroll(e,s){var r,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const a=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"});else if((a==null?void 0:a.type)===R.Document)(i=o.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"})}catch{}}applyInput(e){const s=this.mirror.getNode(e.id);if(!s)return this.debugNodeNotFound(e,e.id);try{s.checked=e.isChecked,s.value=e.text}catch{}}applySelection(e){try{const s=new Set,r=e.ranges.map(({start:i,startOffset:o,end:a,endOffset:n})=>{const c=this.mirror.getNode(i),l=this.mirror.getNode(a);if(!c||!l)return;const u=new Range;u.setStart(c,o),u.setEnd(l,n);const h=c.ownerDocument,p=h==null?void 0:h.getSelection();return p&&s.add(p),{range:u,selection:p}});s.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var o;return i&&((o=i.selection)==null?void 0:o.addRange(i.range))})}catch{}}applyStyleSheetMutation(e){var s;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((s=this.mirror.getNode(e.id))==null?void 0:s.sheet)||null),r&&(e.source===T.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===T.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,s){var r,i,o,a;if((r=e.adds)==null||r.forEach(({rule:n,index:c})=>{try{if(Array.isArray(c)){const{positions:l,index:u}=mr(c);be(s.cssRules,l).insertRule(n,u)}else{const l=c===void 0?void 0:Math.min(c,s.cssRules.length);s==null||s.insertRule(n,l)}}catch{}}),(i=e.removes)==null||i.forEach(({index:n})=>{try{if(Array.isArray(n)){const{positions:c,index:l}=mr(n);be(s.cssRules,c).deleteRule(l||0)}else s==null||s.deleteRule(n)}catch{}}),e.replace)try{(o=s.replace)==null||o.call(s,e.replace)}catch{}if(e.replaceSync)try{(a=s.replaceSync)==null||a.call(s,e.replaceSync)}catch{}}applyStyleDeclaration(e,s){e.set&&be(s.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&be(s.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var s;const r=this.mirror.getNode(e.id);if(!r)return;(s=e.styles)==null||s.forEach(n=>{var c;let l=null,u=null;if(Ve(r)?u=((c=r.ownerDocument)==null?void 0:c.defaultView)||null:r.nodeName==="#document"&&(u=r.defaultView),!!u)try{l=new u.CSSStyleSheet,this.styleMirror.add(l,n.styleId),this.applyStyleSheetRule({source:T.StyleSheetRule,adds:n.rules},l)}catch{}});const i=10;let o=0;const a=(n,c)=>{const l=c.map(u=>this.styleMirror.getStyle(u)).filter(u=>u!==null);Ve(n)?n.shadowRoot.adoptedStyleSheets=l:n.nodeName==="#document"&&(n.adoptedStyleSheets=l),l.length!==c.length&&o<i&&(setTimeout(()=>a(n,c),0+100*o),o++)};a(r,e.styleIds)}legacy_resolveMissingNode(e,s,r,i){const{previousId:o,nextId:a}=i,n=o&&e[o],c=a&&e[a];if(n){const{node:l,mutation:u}=n;s.insertBefore(l,r),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,s,l,u)}if(c){const{node:l,mutation:u}=c;s.insertBefore(l,r.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,s,l,u)}}moveAndHover(e,s,r,i,o){const a=this.mirror.getNode(r);if(!a)return this.debugNodeNotFound(o,r);const n=Pi(a,this.iframe),c=e*n.absoluteScale+n.x,l=s*n.absoluteScale+n.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${l}px`,i||this.drawMouseTail({x:c,y:l}),this.hoverElements(a)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:s,lineWidth:r,strokeStyle:i,duration:o}=this.config.mouseTail===!0?_t:Object.assign({},_t,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const n=this.mouseTail.getContext("2d");!n||!this.tailPositions.length||(n.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),n.beginPath(),n.lineWidth=r,n.lineCap=s,n.strokeStyle=i,n.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>n.lineTo(c.x,c.y)),n.stroke())};this.tailPositions.push(e),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(n=>n!==e),a()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var s;(s=this.lastHoveredRootNode||this.iframe.contentDocument)==null||s.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==P.IncrementalSnapshot?!1:e.data.source>T.Mutation&&e.data.source<=T.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(N.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,s){this.warn(`Node with id '${s}' not found. `,e)}warnCanvasMutationFailed(e,s){this.warn("Has error on canvas update",s,"canvas mutation:",e)}debugNodeNotFound(e,s){this.debug(`Node with id '${s}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(Zr,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(Zr,...e)}}exports.Replayer=Au;
|
|
78
78
|
//# sourceMappingURL=replay.cjs.map
|