@volter/editor 0.5.57

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.
Files changed (141) hide show
  1. package/BUNDLED_NOTICES +6196 -0
  2. package/LICENSE +686 -0
  3. package/LICENSE-BLENDER +1409 -0
  4. package/LICENSE-MCP +21 -0
  5. package/NOTICE +20 -0
  6. package/dist/.vite/manifest.json +1744 -0
  7. package/dist/assets/AudioViewer-DILwc7Pt.js +1 -0
  8. package/dist/assets/BVHLoader--2mLoe3e.js +1 -0
  9. package/dist/assets/BufferGeometryUtils-oP8-Ve4I.js +1 -0
  10. package/dist/assets/ColladaLoader-CyOCKXko.js +3 -0
  11. package/dist/assets/EntityModelDocument-DVlDQ_IJ.js +1 -0
  12. package/dist/assets/EnvironmentAssetDocument-BVGDJjW4.js +5 -0
  13. package/dist/assets/FBXLoader-DzWtiWYm.js +1 -0
  14. package/dist/assets/GameplaySessionTimeline-X_nMT8Sa.js +142 -0
  15. package/dist/assets/ImageViewer-D-aZoyr1.js +1 -0
  16. package/dist/assets/InspectorCanvasPreview-CLDhscy0.js +1 -0
  17. package/dist/assets/InspectorObjectPreview-CpHEw6QH.js +1 -0
  18. package/dist/assets/JsonAssetDocument-CLVN1V9Z.js +3 -0
  19. package/dist/assets/LineSegments2-vfeDUBfs.js +370 -0
  20. package/dist/assets/MTLLoader-D8SKGOsv.js +2 -0
  21. package/dist/assets/ModelAssetDocument-C60lQ11c.js +1 -0
  22. package/dist/assets/NonThreeAuthoringBootstrap-D8oHDftw.js +2 -0
  23. package/dist/assets/OBJLoader-8SrBLZ7J.js +5 -0
  24. package/dist/assets/Object3DPreview-CSmLPKkk.js +2 -0
  25. package/dist/assets/OnlineAssetDetail-D8wVVoay.js +2 -0
  26. package/dist/assets/OrbitControls-BHxt84w6.js +1 -0
  27. package/dist/assets/PLYLoader-BXUWXVtV.js +2 -0
  28. package/dist/assets/RectAreaLightUniformsLib-BGT7Bu4n.js +1 -0
  29. package/dist/assets/STLLoader-U-3fQm8v.js +1 -0
  30. package/dist/assets/SourceAssetViewer-BcOCJ2ye.js +13 -0
  31. package/dist/assets/StageHost-B_YrFNiC.js +1126 -0
  32. package/dist/assets/TDSLoader-BtiaQ4S3.js +1 -0
  33. package/dist/assets/ToolObject3DPreview-Crowr7IN.js +1 -0
  34. package/dist/assets/TransientHint-GNwuzA4c.js +1 -0
  35. package/dist/assets/VideoViewer-CjQ4P9AJ.js +1 -0
  36. package/dist/assets/_commonjsHelpers-D6-XlEtG.js +1 -0
  37. package/dist/assets/agx-base-srgb-BjWZJgrZ.lut +0 -0
  38. package/dist/assets/agx-look-medium-high-contrast-D5F_ob1L.lut +0 -0
  39. package/dist/assets/agx-look-punchy-dxsnycNs.lut +0 -0
  40. package/dist/assets/asset-editor-persistence-D3Yy77wZ.js +1 -0
  41. package/dist/assets/blender-emscripten-engine-C_uFxIuO.js +2 -0
  42. package/dist/assets/blender-node-editor.document-BfvoBocD.js +1 -0
  43. package/dist/assets/blender-outliner-model-B8b00oxr.js +1 -0
  44. package/dist/assets/blender-properties-tab-0M780SHF.js +3 -0
  45. package/dist/assets/blender-runtime-host-D8NHsAfD.js +4 -0
  46. package/dist/assets/blender-runtime-skin-DcwXD-m8.js +61 -0
  47. package/dist/assets/blender-runtime.document-BixTvrw8.js +7 -0
  48. package/dist/assets/blender-timeline.document-RtHIpbT1.js +1 -0
  49. package/dist/assets/blender-uv-editor.document-ChwaS3BG.js +1 -0
  50. package/dist/assets/blender-version.status-Bnhf8h1I.js +1 -0
  51. package/dist/assets/blender-wali-engine-C7bet0ss.js +2 -0
  52. package/dist/assets/blender.command-BCCEp0kb.js +1 -0
  53. package/dist/assets/blender.keymap-GAQgeklK.js +1 -0
  54. package/dist/assets/blender.status-ujwGU6dU.js +1 -0
  55. package/dist/assets/blender.style-Dcem5f_T.js +1 -0
  56. package/dist/assets/browserAll-Do0ehj3Q.js +14 -0
  57. package/dist/assets/client-DNXj_opT.js +25 -0
  58. package/dist/assets/clip-planes-CnAI6DZn.js +1 -0
  59. package/dist/assets/edit-mode-authoring-BX4IRQq9.js +1 -0
  60. package/dist/assets/editor-presentation-activity-C7SNSmTd.js +1 -0
  61. package/dist/assets/events-156d8d12.esm-Dy_KXdhT.js +36 -0
  62. package/dist/assets/fflate.module-DPuTF8aG.js +6 -0
  63. package/dist/assets/filmic-srgb-Ct35FIH6.lut +0 -0
  64. package/dist/assets/hosted-asset-materialization-BK7DHisS.js +2 -0
  65. package/dist/assets/index-5av5LJja.js +1691 -0
  66. package/dist/assets/index-BP6wv2A0.js +5 -0
  67. package/dist/assets/index-Bge9JUr6.js +1 -0
  68. package/dist/assets/index-BncK9THk.js +1 -0
  69. package/dist/assets/index-C5UECeSr.js +952 -0
  70. package/dist/assets/index-CJbYy-CF.js +3 -0
  71. package/dist/assets/index-CanA16PU.js +2 -0
  72. package/dist/assets/index-CinJrH5C.js +9 -0
  73. package/dist/assets/index-Cl83EGRl.js +2 -0
  74. package/dist/assets/index-CtzuWnCS.js +1 -0
  75. package/dist/assets/index-D2LwEE0L.js +562 -0
  76. package/dist/assets/index-D2fNXpHa.css +1 -0
  77. package/dist/assets/index-DUqP1RMl.js +1 -0
  78. package/dist/assets/index-D_NuPfjr.js +9 -0
  79. package/dist/assets/index-DaQZGF7d.js +1 -0
  80. package/dist/assets/index-DgapqSPi.js +7 -0
  81. package/dist/assets/index-IEjydI9d.js +1 -0
  82. package/dist/assets/index-gHZae-lw.js +13 -0
  83. package/dist/assets/jsx-runtime-DPjLkJKQ.js +9 -0
  84. package/dist/assets/model.layout-BJUEQYUI.js +1 -0
  85. package/dist/assets/models.finder-Bm1YfG95.js +1 -0
  86. package/dist/assets/product-Ywxte8eQ.js +1 -0
  87. package/dist/assets/properties-bone-constraints.inspector-Ck0Hzlvr.js +1 -0
  88. package/dist/assets/properties-bone.inspector-B8M42o0V.js +1 -0
  89. package/dist/assets/properties-collection.inspector-D-RSO5zy.js +1 -0
  90. package/dist/assets/properties-constraints.inspector-DbJa57oa.js +1 -0
  91. package/dist/assets/properties-data.inspector-DLgjbRW6.js +1 -0
  92. package/dist/assets/properties-material.inspector-B11LZYDW.js +1 -0
  93. package/dist/assets/properties-modifiers.inspector-BCWwuA26.js +1 -0
  94. package/dist/assets/properties-object.inspector-UZVJG49S.js +1 -0
  95. package/dist/assets/properties-output.inspector-XOwcBits.js +1 -0
  96. package/dist/assets/properties-particles.inspector-By04vT7R.js +1 -0
  97. package/dist/assets/properties-physics.inspector-D3T7FLdg.js +1 -0
  98. package/dist/assets/properties-render.inspector-Y0Rjr9gZ.js +1 -0
  99. package/dist/assets/properties-scene.inspector-CfyDWB4W.js +1 -0
  100. package/dist/assets/properties-texture.inspector-AFRsJx6-.js +1 -0
  101. package/dist/assets/properties-view-layer.inspector-Co07LAmQ.js +1 -0
  102. package/dist/assets/properties-world.inspector-C7T4JocI.js +1 -0
  103. package/dist/assets/react-18-DyywM-Z2.js +1 -0
  104. package/dist/assets/react-story-board-vrmj74Ng.js +1 -0
  105. package/dist/assets/react-three-rapier.esm-D874pLFD.js +1 -0
  106. package/dist/assets/sculpt.layout-zJF55yCR.js +1 -0
  107. package/dist/assets/session-1bPxsLdy.js +4167 -0
  108. package/dist/assets/shading.layout-DULYZV6M.js +1 -0
  109. package/dist/assets/sky-precompute-worker-ChN7J87v.js +1 -0
  110. package/dist/assets/spark.module-D1CUMLYS.js +12120 -0
  111. package/dist/assets/stage-keyboard-Cx90EYIT.js +1 -0
  112. package/dist/assets/stage-overlay-set-duu3P0mZ.js +1 -0
  113. package/dist/assets/stage-presence-markers-DKH3p_ao.js +1 -0
  114. package/dist/assets/story-capture-Dqurwlhr.js +1 -0
  115. package/dist/assets/story-mount-turn-2IYGgHob.js +1 -0
  116. package/dist/assets/story-pixi-preview-c78Aygdi.js +1 -0
  117. package/dist/assets/story-three-preview-CbZo5B3D.js +2 -0
  118. package/dist/assets/texture.layout-DASpHVht.js +1 -0
  119. package/dist/assets/three.module-BynznMJN.js +3840 -0
  120. package/dist/assets/uv-editing.layout-BEKHxmHw.js +1 -0
  121. package/dist/assets/vgai-shared-fontawesome-CFSkqz69.js +1 -0
  122. package/dist/assets/vgai-shared-jsx-dev-runtime-VfxIYu0y.js +9 -0
  123. package/dist/assets/vgai-shared-jsx-runtime-DIqBpTut.js +1 -0
  124. package/dist/assets/vgai-shared-react-DL5U9FnC.js +1 -0
  125. package/dist/assets/vgai-shared-react-dom-DFajMqMT.js +1 -0
  126. package/dist/assets/vgai-shared-react-dom-client-S0ozfl6_.js +1 -0
  127. package/dist/assets/vgai-shared-three-BWkbSQ3V.js +1 -0
  128. package/dist/assets/viewport-pick-context-DkawXbEi.js +1 -0
  129. package/dist/assets/webworkerAll-iMzrvNir.js +101 -0
  130. package/dist/assets/worker-DTgfRRas.js +1 -0
  131. package/dist/assets/world-documents-CGbrcsYk.js +3 -0
  132. package/dist/vgai-shared-react.json +10 -0
  133. package/dist/vgai-shared-three.json +3 -0
  134. package/dist-node/cli.js +17823 -0
  135. package/dist-node/create.js +14084 -0
  136. package/package.json +56 -0
  137. package/presets.mjs +2 -0
  138. package/src/contributions.d.ts +4 -0
  139. package/src/index.ts +9 -0
  140. package/starter/cube.blend +0 -0
  141. package/starter/cube.py +81 -0
@@ -0,0 +1,142 @@
1
+ import{a as z}from"./jsx-runtime-DPjLkJKQ.js";import{r as ie}from"./index-DaQZGF7d.js";import"./index-CtzuWnCS.js";import{aN as Fs,aO as Us,aP as ne,aQ as st,H as Se,t as X,aR as Bs}from"./index-5av5LJja.js";import"./index-D2LwEE0L.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./client-DNXj_opT.js";import"./three.module-BynznMJN.js";var Le={},$s=Object.defineProperty,zs=(e,t,i)=>t in e?$s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,O=(e,t,i)=>zs(e,typeof t!="symbol"?t+"":t,i),Or,Ws=Object.defineProperty,js=(e,t,i)=>t in e?Ws(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Tr=(e,t,i)=>js(e,typeof t!="symbol"?t+"":t,i),$=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))($||{});Date.now().toString();function qs(e){return e.nodeType===e.ELEMENT_NODE}class rs{constructor(){Tr(this,"idNodeMap",new Map),Tr(this,"nodeMetaMap",new WeakMap)}getId(t){var i;return t?((i=this.getMeta(t))==null?void 0:i.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 i=this.getId(t);this.idNodeMap.delete(i),t.childNodes&&t.childNodes.forEach(o=>this.removeNodeFromMap(o))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,i){const o=i.id;this.idNodeMap.set(o,t),this.nodeMetaMap.set(t,i)}replace(t,i){const o=this.getNode(t);if(o){const r=this.nodeMetaMap.get(o);r&&this.nodeMetaMap.set(i,r)}this.idNodeMap.set(t,i)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function is(){return new rs}function Vs(e){return e.toLowerCase()}function Gs(e,t){return!e||!t||e.type!==t.type?!1:e.type===$.Document?e.compatMode===t.compatMode:e.type===$.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===$.Comment||e.type===$.Text||e.type===$.CDATA?e.textContent===t.textContent:e.type===$.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function Hs(e,t){let i;try{i=new URL(e,t??window.location.href)}catch{return null}const o=/\.([0-9a-z]+)(?:$)/i,r=i.pathname.match(o);return r?.[1]??null}const Ys=/(max|min)-device-(width|height)/,_r=new RegExp(Ys.source,"g"),Js={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(e){e.params.match(_r)&&(e.params=e.params.replace(_r,"$1-$2"))}}}},Xs={postcssPlugin:"postcss-hover-classes",prepare:function(){const e=[];return{Rule:function(t){e.indexOf(t)===-1&&(e.push(t),t.selectors.forEach(function(i){i.includes(":hover")&&(t.selector+=`,
2
+ `+i.replace(/:hover/g,".\\:hover"))}))}}}};function Qs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ks(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var i=function o(){return this instanceof o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(i,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}),i}var Ne={exports:{}},Pr;function Zs(){if(Pr)return Ne.exports;Pr=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Ne.exports=t(),Ne.exports.createColors=t,Ne.exports}const en={},tn=Object.freeze(Object.defineProperty({__proto__:null,default:en},Symbol.toStringTag,{value:"Module"})),Q=Ks(tn);var nt,Ir;function hr(){if(Ir)return nt;Ir=1;let e=Zs(),t=Q;class i extends Error{constructor(r,u,n,a,h,c){super(r),this.name="CssSyntaxError",this.reason=r,h&&(this.file=h),a&&(this.source=a),c&&(this.plugin=c),typeof u<"u"&&typeof n<"u"&&(typeof u=="number"?(this.line=u,this.column=n):(this.line=u.line,this.column=u.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,i)}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(r){if(!this.source)return"";let u=this.source;r==null&&(r=e.isColorSupported),t&&r&&(u=t(u));let n=u.split(/\r?\n/),a=Math.max(this.line-3,0),h=Math.min(this.line+2,n.length),c=String(h).length,s,d;if(r){let{bold:l,gray:f,red:m}=e.createColors(!0);s=p=>l(m(p)),d=p=>f(p)}else s=d=l=>l;return n.slice(a,h).map((l,f)=>{let m=a+1+f,p=" "+(" "+m).slice(-c)+" | ";if(m===this.line){let y=d(p.replace(/\d/g," "))+l.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+d(p)+l+`
3
+ `+y+s("^")}return" "+d(p)+l}).join(`
4
+ `)}toString(){let r=this.showSourceCode();return r&&(r=`
5
+
6
+ `+r+`
7
+ `),this.name+": "+this.message+r}}return nt=i,i.default=i,nt}var Ae={},kr;function fr(){return kr||(kr=1,Ae.isClean=Symbol("isClean"),Ae.my=Symbol("my")),Ae}var ot,Lr;function ss(){if(Lr)return ot;Lr=1;const e={after:`
8
+ `,beforeClose:`
9
+ `,beforeComment:`
10
+ `,beforeDecl:`
11
+ `,beforeOpen:" ",beforeRule:`
12
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(o){return o[0].toUpperCase()+o.slice(1)}class i{constructor(r){this.builder=r}atrule(r,u){let n="@"+r.name,a=r.params?this.rawValue(r,"params"):"";if(typeof r.raws.afterName<"u"?n+=r.raws.afterName:a&&(n+=" "),r.nodes)this.block(r,n+a);else{let h=(r.raws.between||"")+(u?";":"");this.builder(n+a+h,r)}}beforeAfter(r,u){let n;r.type==="decl"?n=this.raw(r,null,"beforeDecl"):r.type==="comment"?n=this.raw(r,null,"beforeComment"):u==="before"?n=this.raw(r,null,"beforeRule"):n=this.raw(r,null,"beforeClose");let a=r.parent,h=0;for(;a&&a.type!=="root";)h+=1,a=a.parent;if(n.includes(`
13
+ `)){let c=this.raw(r,null,"indent");if(c.length)for(let s=0;s<h;s++)n+=c}return n}block(r,u){let n=this.raw(r,"between","beforeOpen");this.builder(u+n+"{",r,"start");let a;r.nodes&&r.nodes.length?(this.body(r),a=this.raw(r,"after")):a=this.raw(r,"after","emptyBody"),a&&this.builder(a),this.builder("}",r,"end")}body(r){let u=r.nodes.length-1;for(;u>0&&r.nodes[u].type==="comment";)u-=1;let n=this.raw(r,"semicolon");for(let a=0;a<r.nodes.length;a++){let h=r.nodes[a],c=this.raw(h,"before");c&&this.builder(c),this.stringify(h,u!==a||n)}}comment(r){let u=this.raw(r,"left","commentLeft"),n=this.raw(r,"right","commentRight");this.builder("/*"+u+r.text+n+"*/",r)}decl(r,u){let n=this.raw(r,"between","colon"),a=r.prop+n+this.rawValue(r,"value");r.important&&(a+=r.raws.important||" !important"),u&&(a+=";"),this.builder(a,r)}document(r){this.body(r)}raw(r,u,n){let a;if(n||(n=u),u&&(a=r.raws[u],typeof a<"u"))return a;let h=r.parent;if(n==="before"&&(!h||h.type==="root"&&h.first===r||h&&h.type==="document"))return"";if(!h)return e[n];let c=r.root();if(c.rawCache||(c.rawCache={}),typeof c.rawCache[n]<"u")return c.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(r,n);{let s="raw"+t(n);this[s]?a=this[s](c,r):c.walk(d=>{if(a=d.raws[u],typeof a<"u")return!1})}return typeof a>"u"&&(a=e[n]),c.rawCache[n]=a,a}rawBeforeClose(r){let u;return r.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return u=n.raws.after,u.includes(`
14
+ `)&&(u=u.replace(/[^\n]+$/,"")),!1}),u&&(u=u.replace(/\S/g,"")),u}rawBeforeComment(r,u){let n;return r.walkComments(a=>{if(typeof a.raws.before<"u")return n=a.raws.before,n.includes(`
15
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(u,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(r,u){let n;return r.walkDecls(a=>{if(typeof a.raws.before<"u")return n=a.raws.before,n.includes(`
16
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(u,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(r){let u;return r.walk(n=>{if(n.type!=="decl"&&(u=n.raws.between,typeof u<"u"))return!1}),u}rawBeforeRule(r){let u;return r.walk(n=>{if(n.nodes&&(n.parent!==r||r.first!==n)&&typeof n.raws.before<"u")return u=n.raws.before,u.includes(`
17
+ `)&&(u=u.replace(/[^\n]+$/,"")),!1}),u&&(u=u.replace(/\S/g,"")),u}rawColon(r){let u;return r.walkDecls(n=>{if(typeof n.raws.between<"u")return u=n.raws.between.replace(/[^\s:]/g,""),!1}),u}rawEmptyBody(r){let u;return r.walk(n=>{if(n.nodes&&n.nodes.length===0&&(u=n.raws.after,typeof u<"u"))return!1}),u}rawIndent(r){if(r.raws.indent)return r.raws.indent;let u;return r.walk(n=>{let a=n.parent;if(a&&a!==r&&a.parent&&a.parent===r&&typeof n.raws.before<"u"){let h=n.raws.before.split(`
18
+ `);return u=h[h.length-1],u=u.replace(/\S/g,""),!1}}),u}rawSemicolon(r){let u;return r.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(u=n.raws.semicolon,typeof u<"u"))return!1}),u}rawValue(r,u){let n=r[u],a=r.raws[u];return a&&a.value===n?a.raw:n}root(r){this.body(r),r.raws.after&&this.builder(r.raws.after)}rule(r){this.block(r,this.rawValue(r,"selector")),r.raws.ownSemicolon&&this.builder(r.raws.ownSemicolon,r,"end")}stringify(r,u){if(!this[r.type])throw new Error("Unknown AST node type "+r.type+". Maybe you need to change PostCSS stringifier.");this[r.type](r,u)}}return ot=i,i.default=i,ot}var at,Fr;function ze(){if(Fr)return at;Fr=1;let e=ss();function t(i,o){new e(o).stringify(i)}return at=t,t.default=t,at}var lt,Ur;function We(){if(Ur)return lt;Ur=1;let{isClean:e,my:t}=fr(),i=hr(),o=ss(),r=ze();function u(a,h){let c=new a.constructor;for(let s in a){if(!Object.prototype.hasOwnProperty.call(a,s)||s==="proxyCache")continue;let d=a[s],l=typeof d;s==="parent"&&l==="object"?h&&(c[s]=h):s==="source"?c[s]=d:Array.isArray(d)?c[s]=d.map(f=>u(f,c)):(l==="object"&&d!==null&&(d=u(d)),c[s]=d)}return c}class n{constructor(h={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in h)if(c==="nodes"){this.nodes=[];for(let s of h[c])typeof s.clone=="function"?this.append(s.clone()):this.append(s)}else this[c]=h[c]}addToError(h){if(h.postcssNode=this,h.stack&&this.source&&/\n\s{4}at /.test(h.stack)){let c=this.source;h.stack=h.stack.replace(/\n\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return h}after(h){return this.parent.insertAfter(this,h),this}assign(h={}){for(let c in h)this[c]=h[c];return this}before(h){return this.parent.insertBefore(this,h),this}cleanRaws(h){delete this.raws.before,delete this.raws.after,h||delete this.raws.between}clone(h={}){let c=u(this);for(let s in h)c[s]=h[s];return c}cloneAfter(h={}){let c=this.clone(h);return this.parent.insertAfter(this,c),c}cloneBefore(h={}){let c=this.clone(h);return this.parent.insertBefore(this,c),c}error(h,c={}){if(this.source){let{end:s,start:d}=this.rangeBy(c);return this.source.input.error(h,{column:d.column,line:d.line},{column:s.column,line:s.line},c)}return new i(h)}getProxyProcessor(){return{get(h,c){return c==="proxyOf"?h:c==="root"?()=>h.root().toProxy():h[c]},set(h,c,s){return h[c]===s||(h[c]=s,(c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="text")&&h.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let h=this;for(;h=h.parent;)h[e]=!1}}next(){if(!this.parent)return;let h=this.parent.index(this);return this.parent.nodes[h+1]}positionBy(h,c){let s=this.source.start;if(h.index)s=this.positionInside(h.index,c);else if(h.word){c=this.toString();let d=c.indexOf(h.word);d!==-1&&(s=this.positionInside(d,c))}return s}positionInside(h,c){let s=c||this.toString(),d=this.source.start.column,l=this.source.start.line;for(let f=0;f<h;f++)s[f]===`
19
+ `?(d=1,l+=1):d+=1;return{column:d,line:l}}prev(){if(!this.parent)return;let h=this.parent.index(this);return this.parent.nodes[h-1]}rangeBy(h){let c={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:c.column+1,line:c.line};if(h.word){let d=this.toString(),l=d.indexOf(h.word);l!==-1&&(c=this.positionInside(l,d),s=this.positionInside(l+h.word.length,d))}else h.start?c={column:h.start.column,line:h.start.line}:h.index&&(c=this.positionInside(h.index)),h.end?s={column:h.end.column,line:h.end.line}:typeof h.endIndex=="number"?s=this.positionInside(h.endIndex):h.index&&(s=this.positionInside(h.index+1));return(s.line<c.line||s.line===c.line&&s.column<=c.column)&&(s={column:c.column+1,line:c.line}),{end:s,start:c}}raw(h,c){return new o().raw(this,h,c)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...h){if(this.parent){let c=this,s=!1;for(let d of h)d===this?s=!0:s?(this.parent.insertAfter(c,d),c=d):this.parent.insertBefore(c,d);s||this.remove()}return this}root(){let h=this;for(;h.parent&&h.parent.type!=="document";)h=h.parent;return h}toJSON(h,c){let s={},d=c==null;c=c||new Map;let l=0;for(let f in this){if(!Object.prototype.hasOwnProperty.call(this,f)||f==="parent"||f==="proxyCache")continue;let m=this[f];if(Array.isArray(m))s[f]=m.map(p=>typeof p=="object"&&p.toJSON?p.toJSON(null,c):p);else if(typeof m=="object"&&m.toJSON)s[f]=m.toJSON(null,c);else if(f==="source"){let p=c.get(m.input);p==null&&(p=l,c.set(m.input,l),l++),s[f]={end:m.end,inputId:p,start:m.start}}else s[f]=m}return d&&(s.inputs=[...c.keys()].map(f=>f.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(h=r){h.stringify&&(h=h.stringify);let c="";return h(this,s=>{c+=s}),c}warn(h,c,s){let d={node:this};for(let l in s)d[l]=s[l];return h.warn(c,d)}get proxyOf(){return this}}return lt=n,n.default=n,lt}var ut,Br;function je(){if(Br)return ut;Br=1;let e=We();class t extends e{constructor(o){o&&typeof o.value<"u"&&typeof o.value!="string"&&(o={...o,value:String(o.value)}),super(o),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return ut=t,t.default=t,ut}var ct,$r;function rn(){if($r)return ct;$r=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return ct={nanoid:(o=21)=>{let r="",u=o;for(;u--;)r+=e[Math.random()*64|0];return r},customAlphabet:(o,r=21)=>(u=r)=>{let n="",a=u;for(;a--;)n+=o[Math.random()*o.length|0];return n}},ct}var ht,zr;function ns(){if(zr)return ht;zr=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Q,{existsSync:i,readFileSync:o}=Q,{dirname:r,join:u}=Q;function n(h){return Buffer?Buffer.from(h,"base64").toString():window.atob(h)}class a{constructor(c,s){if(s.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let d=s.map?s.map.prev:void 0,l=this.loadMap(s.from,d);!this.mapFile&&s.from&&(this.mapFile=s.from),this.mapFile&&(this.root=r(this.mapFile)),l&&(this.text=l)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(c){let s=/^data:application\/json;charset=utf-?8;base64,/,d=/^data:application\/json;base64,/,l=/^data:application\/json;charset=utf-?8,/,f=/^data:application\/json,/;if(l.test(c)||f.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(s.test(c)||d.test(c))return n(c.substr(RegExp.lastMatch.length));let m=c.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+m)}getAnnotationURL(c){return c.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(c){return typeof c!="object"?!1:typeof c.mappings=="string"||typeof c._mappings=="string"||Array.isArray(c.sections)}loadAnnotation(c){let s=c.match(/\/\*\s*# sourceMappingURL=/gm);if(!s)return;let d=c.lastIndexOf(s.pop()),l=c.indexOf("*/",d);d>-1&&l>-1&&(this.annotation=this.getAnnotationURL(c.substring(d,l)))}loadFile(c){if(this.root=r(c),i(c))return this.mapFile=c,o(c,"utf-8").toString().trim()}loadMap(c,s){if(s===!1)return!1;if(s){if(typeof s=="string")return s;if(typeof s=="function"){let d=s(c);if(d){let l=this.loadFile(d);if(!l)throw new Error("Unable to load previous source map: "+d.toString());return l}}else{if(s instanceof e)return t.fromSourceMap(s).toString();if(s instanceof t)return s.toString();if(this.isMap(s))return JSON.stringify(s);throw new Error("Unsupported previous source map format: "+s.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let d=this.annotation;return c&&(d=u(r(c),d)),this.loadFile(d)}}}startWith(c,s){return c?c.substr(0,s.length)===s:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return ht=a,a.default=a,ht}var ft,Wr;function qe(){if(Wr)return ft;Wr=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Q,{fileURLToPath:i,pathToFileURL:o}=Q,{isAbsolute:r,resolve:u}=Q,{nanoid:n}=rn(),a=Q,h=hr(),c=ns(),s=Symbol("fromOffsetCache"),d=!!(e&&t),l=!!(u&&r);class f{constructor(p,y={}){if(p===null||typeof p>"u"||typeof p=="object"&&!p.toString)throw new Error(`PostCSS received ${p} instead of CSS string`);if(this.css=p.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,y.from&&(!l||/^\w+:\/\//.test(y.from)||r(y.from)?this.file=y.from:this.file=u(y.from)),l&&d){let S=new c(this.css,y);if(S.text){this.map=S;let b=S.consumer().file;!this.file&&b&&(this.file=this.mapResolve(b))}}this.file||(this.id="<input css "+n(6)+">"),this.map&&(this.map.file=this.from)}error(p,y,S,b={}){let v,g,w;if(y&&typeof y=="object"){let E=y,N=S;if(typeof E.offset=="number"){let D=this.fromOffset(E.offset);y=D.line,S=D.col}else y=E.line,S=E.column;if(typeof N.offset=="number"){let D=this.fromOffset(N.offset);g=D.line,w=D.col}else g=N.line,w=N.column}else if(!S){let E=this.fromOffset(y);y=E.line,S=E.col}let x=this.origin(y,S,g,w);return x?v=new h(p,x.endLine===void 0?x.line:{column:x.column,line:x.line},x.endLine===void 0?x.column:{column:x.endColumn,line:x.endLine},x.source,x.file,b.plugin):v=new h(p,g===void 0?y:{column:S,line:y},g===void 0?S:{column:w,line:g},this.css,this.file,b.plugin),v.input={column:S,endColumn:w,endLine:g,line:y,source:this.css},this.file&&(o&&(v.input.url=o(this.file).toString()),v.input.file=this.file),v}fromOffset(p){let y,S;if(this[s])S=this[s];else{let v=this.css.split(`
20
+ `);S=new Array(v.length);let g=0;for(let w=0,x=v.length;w<x;w++)S[w]=g,g+=v[w].length+1;this[s]=S}y=S[S.length-1];let b=0;if(p>=y)b=S.length-1;else{let v=S.length-2,g;for(;b<v;)if(g=b+(v-b>>1),p<S[g])v=g-1;else if(p>=S[g+1])b=g+1;else{b=g;break}}return{col:p-S[b]+1,line:b+1}}mapResolve(p){return/^\w+:\/\//.test(p)?p:u(this.map.consumer().sourceRoot||this.map.root||".",p)}origin(p,y,S,b){if(!this.map)return!1;let v=this.map.consumer(),g=v.originalPositionFor({column:y,line:p});if(!g.source)return!1;let w;typeof S=="number"&&(w=v.originalPositionFor({column:b,line:S}));let x;r(g.source)?x=o(g.source):x=new URL(g.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let E={column:g.column,endColumn:w&&w.column,endLine:w&&w.line,line:g.line,url:x.toString()};if(x.protocol==="file:")if(i)E.file=i(x);else throw new Error("file: protocol is not available in this PostCSS build");let N=v.sourceContentFor(g.source);return N&&(E.source=N),E}toJSON(){let p={};for(let y of["hasBOM","css","file","id"])this[y]!=null&&(p[y]=this[y]);return this.map&&(p.map={...this.map},p.map.consumerCache&&(p.map.consumerCache=void 0)),p}get from(){return this.file||this.id}}return ft=f,f.default=f,a&&a.registerInput&&a.registerInput(f),ft}var dt,jr;function os(){if(jr)return dt;jr=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Q,{dirname:i,relative:o,resolve:r,sep:u}=Q,{pathToFileURL:n}=Q,a=qe(),h=!!(e&&t),c=!!(i&&r&&o&&u);class s{constructor(l,f,m,p){this.stringify=l,this.mapOpts=m.map||{},this.root=f,this.opts=m,this.css=p,this.originalCSS=p,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let l;this.isInline()?l="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?l=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?l=this.mapOpts.annotation(this.opts.to,this.root):l=this.outputFile()+".map";let f=`
21
+ `;this.css.includes(`\r
22
+ `)&&(f=`\r
23
+ `),this.css+=f+"/*# sourceMappingURL="+l+" */"}applyPrevMaps(){for(let l of this.previous()){let f=this.toUrl(this.path(l.file)),m=l.root||i(l.file),p;this.mapOpts.sourcesContent===!1?(p=new e(l.text),p.sourcesContent&&(p.sourcesContent=null)):p=l.consumer(),this.map.applySourceMap(p,f,this.toUrl(this.path(m)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let l;for(let f=this.root.nodes.length-1;f>=0;f--)l=this.root.nodes[f],l.type==="comment"&&l.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(f)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&h&&this.isMap())return this.generateMap();{let l="";return this.stringify(this.root,f=>{l+=f}),[l]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let l=this.previous()[0].consumer();l.file=this.outputFile(),this.map=t.fromSourceMap(l,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let l=1,f=1,m="<no source>",p={generated:{column:0,line:0},original:{column:0,line:0},source:""},y,S;this.stringify(this.root,(b,v,g)=>{if(this.css+=b,v&&g!=="end"&&(p.generated.line=l,p.generated.column=f-1,v.source&&v.source.start?(p.source=this.sourcePath(v),p.original.line=v.source.start.line,p.original.column=v.source.start.column-1,this.map.addMapping(p)):(p.source=m,p.original.line=1,p.original.column=0,this.map.addMapping(p))),y=b.match(/\n/g),y?(l+=y.length,S=b.lastIndexOf(`
24
+ `),f=b.length-S):f+=b.length,v&&g!=="start"){let w=v.parent||{raws:{}};(!(v.type==="decl"||v.type==="atrule"&&!v.nodes)||v!==w.last||w.raws.semicolon)&&(v.source&&v.source.end?(p.source=this.sourcePath(v),p.original.line=v.source.end.line,p.original.column=v.source.end.column-1,p.generated.line=l,p.generated.column=f-2,this.map.addMapping(p)):(p.source=m,p.original.line=1,p.original.column=0,p.generated.line=l,p.generated.column=f-1,this.map.addMapping(p)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(l=>l.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let l=this.mapOpts.annotation;return typeof l<"u"&&l!==!0?!1:this.previous().length?this.previous().some(f=>f.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(l=>l.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(l){if(this.mapOpts.absolute||l.charCodeAt(0)===60||/^\w+:\/\//.test(l))return l;let f=this.memoizedPaths.get(l);if(f)return f;let m=this.opts.to?i(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=i(r(m,this.mapOpts.annotation)));let p=o(m,l);return this.memoizedPaths.set(l,p),p}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(l=>{if(l.source&&l.source.input.map){let f=l.source.input.map;this.previousMaps.includes(f)||this.previousMaps.push(f)}});else{let l=new a(this.originalCSS,this.opts);l.map&&this.previousMaps.push(l.map)}return this.previousMaps}setSourcesContent(){let l={};if(this.root)this.root.walk(f=>{if(f.source){let m=f.source.input.from;if(m&&!l[m]){l[m]=!0;let p=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(p,f.source.input.css)}}});else if(this.css){let f=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(f,this.css)}}sourcePath(l){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(l.source.input.from):this.toUrl(this.path(l.source.input.from))}toBase64(l){return Buffer?Buffer.from(l).toString("base64"):window.btoa(unescape(encodeURIComponent(l)))}toFileUrl(l){let f=this.memoizedFileURLs.get(l);if(f)return f;if(n){let m=n(l).toString();return this.memoizedFileURLs.set(l,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(l){let f=this.memoizedURLs.get(l);if(f)return f;u==="\\"&&(l=l.replace(/\\/g,"/"));let m=encodeURI(l).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(l,m),m}}return dt=s,dt}var pt,qr;function Ve(){if(qr)return pt;qr=1;let e=We();class t extends e{constructor(o){super(o),this.type="comment"}}return pt=t,t.default=t,pt}var mt,Vr;function fe(){if(Vr)return mt;Vr=1;let{isClean:e,my:t}=fr(),i=je(),o=Ve(),r=We(),u,n,a,h;function c(l){return l.map(f=>(f.nodes&&(f.nodes=c(f.nodes)),delete f.source,f))}function s(l){if(l[e]=!1,l.proxyOf.nodes)for(let f of l.proxyOf.nodes)s(f)}class d extends r{append(...f){for(let m of f){let p=this.normalize(m,this.last);for(let y of p)this.proxyOf.nodes.push(y)}return this.markDirty(),this}cleanRaws(f){if(super.cleanRaws(f),this.nodes)for(let m of this.nodes)m.cleanRaws(f)}each(f){if(!this.proxyOf.nodes)return;let m=this.getIterator(),p,y;for(;this.indexes[m]<this.proxyOf.nodes.length&&(p=this.indexes[m],y=f(this.proxyOf.nodes[p],p),y!==!1);)this.indexes[m]+=1;return delete this.indexes[m],y}every(f){return this.nodes.every(f)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let f=this.lastEach;return this.indexes[f]=0,f}getProxyProcessor(){return{get(f,m){return m==="proxyOf"?f:f[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...p)=>f[m](...p.map(y=>typeof y=="function"?(S,b)=>y(S.toProxy(),b):y)):m==="every"||m==="some"?p=>f[m]((y,...S)=>p(y.toProxy(),...S)):m==="root"?()=>f.root().toProxy():m==="nodes"?f.nodes.map(p=>p.toProxy()):m==="first"||m==="last"?f[m].toProxy():f[m]:f[m]},set(f,m,p){return f[m]===p||(f[m]=p,(m==="name"||m==="params"||m==="selector")&&f.markDirty()),!0}}}index(f){return typeof f=="number"?f:(f.proxyOf&&(f=f.proxyOf),this.proxyOf.nodes.indexOf(f))}insertAfter(f,m){let p=this.index(f),y=this.normalize(m,this.proxyOf.nodes[p]).reverse();p=this.index(f);for(let b of y)this.proxyOf.nodes.splice(p+1,0,b);let S;for(let b in this.indexes)S=this.indexes[b],p<S&&(this.indexes[b]=S+y.length);return this.markDirty(),this}insertBefore(f,m){let p=this.index(f),y=p===0?"prepend":!1,S=this.normalize(m,this.proxyOf.nodes[p],y).reverse();p=this.index(f);for(let v of S)this.proxyOf.nodes.splice(p,0,v);let b;for(let v in this.indexes)b=this.indexes[v],p<=b&&(this.indexes[v]=b+S.length);return this.markDirty(),this}normalize(f,m){if(typeof f=="string")f=c(u(f).nodes);else if(typeof f>"u")f=[];else if(Array.isArray(f)){f=f.slice(0);for(let y of f)y.parent&&y.parent.removeChild(y,"ignore")}else if(f.type==="root"&&this.type!=="document"){f=f.nodes.slice(0);for(let y of f)y.parent&&y.parent.removeChild(y,"ignore")}else if(f.type)f=[f];else if(f.prop){if(typeof f.value>"u")throw new Error("Value field is missed in node creation");typeof f.value!="string"&&(f.value=String(f.value)),f=[new i(f)]}else if(f.selector)f=[new n(f)];else if(f.name)f=[new a(f)];else if(f.text)f=[new o(f)];else throw new Error("Unknown node type in node creation");return f.map(y=>(y[t]||d.rebuild(y),y=y.proxyOf,y.parent&&y.parent.removeChild(y),y[e]&&s(y),typeof y.raws.before>"u"&&m&&typeof m.raws.before<"u"&&(y.raws.before=m.raws.before.replace(/\S/g,"")),y.parent=this.proxyOf,y))}prepend(...f){f=f.reverse();for(let m of f){let p=this.normalize(m,this.first,"prepend").reverse();for(let y of p)this.proxyOf.nodes.unshift(y);for(let y in this.indexes)this.indexes[y]=this.indexes[y]+p.length}return this.markDirty(),this}push(f){return f.parent=this,this.proxyOf.nodes.push(f),this}removeAll(){for(let f of this.proxyOf.nodes)f.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(f){f=this.index(f),this.proxyOf.nodes[f].parent=void 0,this.proxyOf.nodes.splice(f,1);let m;for(let p in this.indexes)m=this.indexes[p],m>=f&&(this.indexes[p]=m-1);return this.markDirty(),this}replaceValues(f,m,p){return p||(p=m,m={}),this.walkDecls(y=>{m.props&&!m.props.includes(y.prop)||m.fast&&!y.value.includes(m.fast)||(y.value=y.value.replace(f,p))}),this.markDirty(),this}some(f){return this.nodes.some(f)}walk(f){return this.each((m,p)=>{let y;try{y=f(m,p)}catch(S){throw m.addToError(S)}return y!==!1&&m.walk&&(y=m.walk(f)),y})}walkAtRules(f,m){return m?f instanceof RegExp?this.walk((p,y)=>{if(p.type==="atrule"&&f.test(p.name))return m(p,y)}):this.walk((p,y)=>{if(p.type==="atrule"&&p.name===f)return m(p,y)}):(m=f,this.walk((p,y)=>{if(p.type==="atrule")return m(p,y)}))}walkComments(f){return this.walk((m,p)=>{if(m.type==="comment")return f(m,p)})}walkDecls(f,m){return m?f instanceof RegExp?this.walk((p,y)=>{if(p.type==="decl"&&f.test(p.prop))return m(p,y)}):this.walk((p,y)=>{if(p.type==="decl"&&p.prop===f)return m(p,y)}):(m=f,this.walk((p,y)=>{if(p.type==="decl")return m(p,y)}))}walkRules(f,m){return m?f instanceof RegExp?this.walk((p,y)=>{if(p.type==="rule"&&f.test(p.selector))return m(p,y)}):this.walk((p,y)=>{if(p.type==="rule"&&p.selector===f)return m(p,y)}):(m=f,this.walk((p,y)=>{if(p.type==="rule")return m(p,y)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=l=>{u=l},d.registerRule=l=>{n=l},d.registerAtRule=l=>{a=l},d.registerRoot=l=>{h=l},mt=d,d.default=d,d.rebuild=l=>{l.type==="atrule"?Object.setPrototypeOf(l,a.prototype):l.type==="rule"?Object.setPrototypeOf(l,n.prototype):l.type==="decl"?Object.setPrototypeOf(l,i.prototype):l.type==="comment"?Object.setPrototypeOf(l,o.prototype):l.type==="root"&&Object.setPrototypeOf(l,h.prototype),l[t]=!0,l.nodes&&l.nodes.forEach(f=>{d.rebuild(f)})},mt}var gt,Gr;function dr(){if(Gr)return gt;Gr=1;let e=fe(),t,i;class o extends e{constructor(u){super({type:"document",...u}),this.nodes||(this.nodes=[])}toResult(u={}){return new t(new i,this,u).stringify()}}return o.registerLazyResult=r=>{t=r},o.registerProcessor=r=>{i=r},gt=o,o.default=o,gt}var yt,Hr;function as(){if(Hr)return yt;Hr=1;class e{constructor(i,o={}){if(this.type="warning",this.text=i,o.node&&o.node.source){let r=o.node.rangeBy(o);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in o)this[r]=o[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return yt=e,e.default=e,yt}var wt,Yr;function pr(){if(Yr)return wt;Yr=1;let e=as();class t{constructor(o,r,u){this.processor=o,this.messages=[],this.root=r,this.opts=u,this.css=void 0,this.map=void 0}toString(){return this.css}warn(o,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let u=new e(o,r);return this.messages.push(u),u}warnings(){return this.messages.filter(o=>o.type==="warning")}get content(){return this.css}}return wt=t,t.default=t,wt}var vt,Jr;function sn(){if(Jr)return vt;Jr=1;const e=39,t=34,i=92,o=47,r=10,u=32,n=12,a=9,h=13,c=91,s=93,d=40,l=41,f=123,m=125,p=59,y=42,S=58,b=64,v=/[\t\n\f\r "#'()/;[\\\]{}]/g,g=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,w=/.[\r\n"'(/\\]/,x=/[\da-f]/i;return vt=function(N,D={}){let R=N.css.valueOf(),q=D.ignoreErrors,T,C,le,te,J,P,V,se,W,L,ve=R.length,M=0,ue=[],re=[];function et(){return M}function ce(G){throw N.error("Unclosed "+G,M)}function tt(){return re.length===0&&M>=ve}function rt(G){if(re.length)return re.pop();if(M>=ve)return;let he=G?G.ignoreUnclosed:!1;switch(T=R.charCodeAt(M),T){case r:case u:case a:case h:case n:{C=M;do C+=1,T=R.charCodeAt(C);while(T===u||T===r||T===a||T===h||T===n);L=["space",R.slice(M,C)],M=C-1;break}case c:case s:case f:case m:case S:case p:case l:{let be=String.fromCharCode(T);L=[be,be,M];break}case d:{if(se=ue.length?ue.pop()[1]:"",W=R.charCodeAt(M+1),se==="url"&&W!==e&&W!==t&&W!==u&&W!==r&&W!==a&&W!==n&&W!==h){C=M;do{if(P=!1,C=R.indexOf(")",C+1),C===-1)if(q||he){C=M;break}else ce("bracket");for(V=C;R.charCodeAt(V-1)===i;)V-=1,P=!P}while(P);L=["brackets",R.slice(M,C+1),M,C],M=C}else C=R.indexOf(")",M+1),te=R.slice(M,C+1),C===-1||w.test(te)?L=["(","(",M]:(L=["brackets",te,M,C],M=C);break}case e:case t:{le=T===e?"'":'"',C=M;do{if(P=!1,C=R.indexOf(le,C+1),C===-1)if(q||he){C=M+1;break}else ce("string");for(V=C;R.charCodeAt(V-1)===i;)V-=1,P=!P}while(P);L=["string",R.slice(M,C+1),M,C],M=C;break}case b:{v.lastIndex=M+1,v.test(R),v.lastIndex===0?C=R.length-1:C=v.lastIndex-2,L=["at-word",R.slice(M,C+1),M,C],M=C;break}case i:{for(C=M,J=!0;R.charCodeAt(C+1)===i;)C+=1,J=!J;if(T=R.charCodeAt(C+1),J&&T!==o&&T!==u&&T!==r&&T!==a&&T!==h&&T!==n&&(C+=1,x.test(R.charAt(C)))){for(;x.test(R.charAt(C+1));)C+=1;R.charCodeAt(C+1)===u&&(C+=1)}L=["word",R.slice(M,C+1),M,C],M=C;break}default:{T===o&&R.charCodeAt(M+1)===y?(C=R.indexOf("*/",M+2)+1,C===0&&(q||he?C=R.length:ce("comment")),L=["comment",R.slice(M,C+1),M,C],M=C):(g.lastIndex=M+1,g.test(R),g.lastIndex===0?C=R.length-1:C=g.lastIndex-2,L=["word",R.slice(M,C+1),M,C],ue.push(L),M=C);break}}return M++,L}function it(G){re.push(G)}return{back:it,endOfFile:tt,nextToken:rt,position:et}},vt}var bt,Xr;function mr(){if(Xr)return bt;Xr=1;let e=fe();class t extends e{constructor(o){super(o),this.type="atrule"}append(...o){return this.proxyOf.nodes||(this.nodes=[]),super.append(...o)}prepend(...o){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...o)}}return bt=t,t.default=t,e.registerAtRule(t),bt}var St,Qr;function Re(){if(Qr)return St;Qr=1;let e=fe(),t,i;class o extends e{constructor(u){super(u),this.type="root",this.nodes||(this.nodes=[])}normalize(u,n,a){let h=super.normalize(u);if(n){if(a==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let c of h)c.raws.before=n.raws.before}return h}removeChild(u,n){let a=this.index(u);return!n&&a===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[a].raws.before),super.removeChild(u)}toResult(u={}){return new t(new i,this,u).stringify()}}return o.registerLazyResult=r=>{t=r},o.registerProcessor=r=>{i=r},St=o,o.default=o,e.registerRoot(o),St}var xt,Kr;function ls(){if(Kr)return xt;Kr=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let i=[" ",`
25
+ `," "];return e.split(t,i)},split(t,i,o){let r=[],u="",n=!1,a=0,h=!1,c="",s=!1;for(let d of t)s?s=!1:d==="\\"?s=!0:h?d===c&&(h=!1):d==='"'||d==="'"?(h=!0,c=d):d==="("?a+=1:d===")"?a>0&&(a-=1):a===0&&i.includes(d)&&(n=!0),n?(u!==""&&r.push(u.trim()),u="",n=!1):u+=d;return(o||u!=="")&&r.push(u.trim()),r}};return xt=e,e.default=e,xt}var Et,Zr;function gr(){if(Zr)return Et;Zr=1;let e=fe(),t=ls();class i extends e{constructor(r){super(r),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(r){let u=this.selector?this.selector.match(/,\s*/):null,n=u?u[0]:","+this.raw("between","beforeOpen");this.selector=r.join(n)}}return Et=i,i.default=i,e.registerRule(i),Et}var Ct,ei;function nn(){if(ei)return Ct;ei=1;let e=je(),t=sn(),i=Ve(),o=mr(),r=Re(),u=gr();const n={empty:!0,space:!0};function a(c){for(let s=c.length-1;s>=0;s--){let d=c[s],l=d[3]||d[2];if(l)return l}}class h{constructor(s){this.input=s,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:s,start:{column:1,line:1,offset:0}}}atrule(s){let d=new o;d.name=s[1].slice(1),d.name===""&&this.unnamedAtrule(d,s),this.init(d,s[2]);let l,f,m,p=!1,y=!1,S=[],b=[];for(;!this.tokenizer.endOfFile();){if(s=this.tokenizer.nextToken(),l=s[0],l==="("||l==="["?b.push(l==="("?")":"]"):l==="{"&&b.length>0?b.push("}"):l===b[b.length-1]&&b.pop(),b.length===0)if(l===";"){d.source.end=this.getPosition(s[2]),d.source.end.offset++,this.semicolon=!0;break}else if(l==="{"){y=!0;break}else if(l==="}"){if(S.length>0){for(m=S.length-1,f=S[m];f&&f[0]==="space";)f=S[--m];f&&(d.source.end=this.getPosition(f[3]||f[2]),d.source.end.offset++)}this.end(s);break}else S.push(s);else S.push(s);if(this.tokenizer.endOfFile()){p=!0;break}}d.raws.between=this.spacesAndCommentsFromEnd(S),S.length?(d.raws.afterName=this.spacesAndCommentsFromStart(S),this.raw(d,"params",S),p&&(s=S[S.length-1],d.source.end=this.getPosition(s[3]||s[2]),d.source.end.offset++,this.spaces=d.raws.between,d.raws.between="")):(d.raws.afterName="",d.params=""),y&&(d.nodes=[],this.current=d)}checkMissedSemicolon(s){let d=this.colon(s);if(d===!1)return;let l=0,f;for(let m=d-1;m>=0&&(f=s[m],!(f[0]!=="space"&&(l+=1,l===2)));m--);throw this.input.error("Missed semicolon",f[0]==="word"?f[3]+1:f[2])}colon(s){let d=0,l,f,m;for(let[p,y]of s.entries()){if(l=y,f=l[0],f==="("&&(d+=1),f===")"&&(d-=1),d===0&&f===":")if(!m)this.doubleColon(l);else{if(m[0]==="word"&&m[1]==="progid")continue;return p}m=l}return!1}comment(s){let d=new i;this.init(d,s[2]),d.source.end=this.getPosition(s[3]||s[2]),d.source.end.offset++;let l=s[1].slice(2,-2);if(/^\s*$/.test(l))d.text="",d.raws.left=l,d.raws.right="";else{let f=l.match(/^(\s*)([^]*\S)(\s*)$/);d.text=f[2],d.raws.left=f[1],d.raws.right=f[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(s,d){let l=new e;this.init(l,s[0][2]);let f=s[s.length-1];for(f[0]===";"&&(this.semicolon=!0,s.pop()),l.source.end=this.getPosition(f[3]||f[2]||a(s)),l.source.end.offset++;s[0][0]!=="word";)s.length===1&&this.unknownWord(s),l.raws.before+=s.shift()[1];for(l.source.start=this.getPosition(s[0][2]),l.prop="";s.length;){let b=s[0][0];if(b===":"||b==="space"||b==="comment")break;l.prop+=s.shift()[1]}l.raws.between="";let m;for(;s.length;)if(m=s.shift(),m[0]===":"){l.raws.between+=m[1];break}else m[0]==="word"&&/\w/.test(m[1])&&this.unknownWord([m]),l.raws.between+=m[1];(l.prop[0]==="_"||l.prop[0]==="*")&&(l.raws.before+=l.prop[0],l.prop=l.prop.slice(1));let p=[],y;for(;s.length&&(y=s[0][0],!(y!=="space"&&y!=="comment"));)p.push(s.shift());this.precheckMissedSemicolon(s);for(let b=s.length-1;b>=0;b--){if(m=s[b],m[1].toLowerCase()==="!important"){l.important=!0;let v=this.stringFrom(s,b);v=this.spacesFromEnd(s)+v,v!==" !important"&&(l.raws.important=v);break}else if(m[1].toLowerCase()==="important"){let v=s.slice(0),g="";for(let w=b;w>0;w--){let x=v[w][0];if(g.trim().indexOf("!")===0&&x!=="space")break;g=v.pop()[1]+g}g.trim().indexOf("!")===0&&(l.important=!0,l.raws.important=g,s=v)}if(m[0]!=="space"&&m[0]!=="comment")break}s.some(b=>b[0]!=="space"&&b[0]!=="comment")&&(l.raws.between+=p.map(b=>b[1]).join(""),p=[]),this.raw(l,"value",p.concat(s),d),l.value.includes(":")&&!d&&this.checkMissedSemicolon(s)}doubleColon(s){throw this.input.error("Double colon",{offset:s[2]},{offset:s[2]+s[1].length})}emptyRule(s){let d=new u;this.init(d,s[2]),d.selector="",d.raws.between="",this.current=d}end(s){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(s[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(s)}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(s){if(this.spaces+=s[1],this.current.nodes){let d=this.current.nodes[this.current.nodes.length-1];d&&d.type==="rule"&&!d.raws.ownSemicolon&&(d.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(s){let d=this.input.fromOffset(s);return{column:d.col,line:d.line,offset:s}}init(s,d){this.current.push(s),s.source={input:this.input,start:this.getPosition(d)},s.raws.before=this.spaces,this.spaces="",s.type!=="comment"&&(this.semicolon=!1)}other(s){let d=!1,l=null,f=!1,m=null,p=[],y=s[1].startsWith("--"),S=[],b=s;for(;b;){if(l=b[0],S.push(b),l==="("||l==="[")m||(m=b),p.push(l==="("?")":"]");else if(y&&f&&l==="{")m||(m=b),p.push("}");else if(p.length===0)if(l===";")if(f){this.decl(S,y);return}else break;else if(l==="{"){this.rule(S);return}else if(l==="}"){this.tokenizer.back(S.pop()),d=!0;break}else l===":"&&(f=!0);else l===p[p.length-1]&&(p.pop(),p.length===0&&(m=null));b=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(d=!0),p.length>0&&this.unclosedBracket(m),d&&f){if(!y)for(;S.length&&(b=S[S.length-1][0],!(b!=="space"&&b!=="comment"));)this.tokenizer.back(S.pop());this.decl(S,y)}else this.unknownWord(S)}parse(){let s;for(;!this.tokenizer.endOfFile();)switch(s=this.tokenizer.nextToken(),s[0]){case"space":this.spaces+=s[1];break;case";":this.freeSemicolon(s);break;case"}":this.end(s);break;case"comment":this.comment(s);break;case"at-word":this.atrule(s);break;case"{":this.emptyRule(s);break;default:this.other(s);break}this.endFile()}precheckMissedSemicolon(){}raw(s,d,l,f){let m,p,y=l.length,S="",b=!0,v,g;for(let w=0;w<y;w+=1)m=l[w],p=m[0],p==="space"&&w===y-1&&!f?b=!1:p==="comment"?(g=l[w-1]?l[w-1][0]:"empty",v=l[w+1]?l[w+1][0]:"empty",!n[g]&&!n[v]?S.slice(-1)===","?b=!1:S+=m[1]:b=!1):S+=m[1];if(!b){let w=l.reduce((x,E)=>x+E[1],"");s.raws[d]={raw:w,value:S}}s[d]=S}rule(s){s.pop();let d=new u;this.init(d,s[0][2]),d.raws.between=this.spacesAndCommentsFromEnd(s),this.raw(d,"selector",s),this.current=d}spacesAndCommentsFromEnd(s){let d,l="";for(;s.length&&(d=s[s.length-1][0],!(d!=="space"&&d!=="comment"));)l=s.pop()[1]+l;return l}spacesAndCommentsFromStart(s){let d,l="";for(;s.length&&(d=s[0][0],!(d!=="space"&&d!=="comment"));)l+=s.shift()[1];return l}spacesFromEnd(s){let d,l="";for(;s.length&&(d=s[s.length-1][0],d==="space");)l=s.pop()[1]+l;return l}stringFrom(s,d){let l="";for(let f=d;f<s.length;f++)l+=s[f][1];return s.splice(d,s.length-d),l}unclosedBlock(){let s=this.current.source.start;throw this.input.error("Unclosed block",s.line,s.column)}unclosedBracket(s){throw this.input.error("Unclosed bracket",{offset:s[2]},{offset:s[2]+1})}unexpectedClose(s){throw this.input.error("Unexpected }",{offset:s[2]},{offset:s[2]+1})}unknownWord(s){throw this.input.error("Unknown word",{offset:s[0][2]},{offset:s[0][2]+s[0][1].length})}unnamedAtrule(s,d){throw this.input.error("At-rule without name",{offset:d[2]},{offset:d[2]+d[1].length})}}return Ct=h,Ct}var Rt,ti;function yr(){if(ti)return Rt;ti=1;let e=fe(),t=nn(),i=qe();function o(r,u){let n=new i(r,u),a=new t(n);try{a.parse()}catch(h){throw h}return a.root}return Rt=o,o.default=o,e.registerParse(o),Rt}var Mt,ri;function us(){if(ri)return Mt;ri=1;let{isClean:e,my:t}=fr(),i=os(),o=ze(),r=fe(),u=dr(),n=pr(),a=yr(),h=Re();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},s={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},d={Once:!0,postcssPlugin:!0,prepare:!0},l=0;function f(v){return typeof v=="object"&&typeof v.then=="function"}function m(v){let g=!1,w=c[v.type];return v.type==="decl"?g=v.prop.toLowerCase():v.type==="atrule"&&(g=v.name.toLowerCase()),g&&v.append?[w,w+"-"+g,l,w+"Exit",w+"Exit-"+g]:g?[w,w+"-"+g,w+"Exit",w+"Exit-"+g]:v.append?[w,l,w+"Exit"]:[w,w+"Exit"]}function p(v){let g;return v.type==="document"?g=["Document",l,"DocumentExit"]:v.type==="root"?g=["Root",l,"RootExit"]:g=m(v),{eventIndex:0,events:g,iterator:0,node:v,visitorIndex:0,visitors:[]}}function y(v){return v[e]=!1,v.nodes&&v.nodes.forEach(g=>y(g)),v}let S={};class b{constructor(g,w,x){this.stringified=!1,this.processed=!1;let E;if(typeof w=="object"&&w!==null&&(w.type==="root"||w.type==="document"))E=y(w);else if(w instanceof b||w instanceof n)E=y(w.root),w.map&&(typeof x.map>"u"&&(x.map={}),x.map.inline||(x.map.inline=!1),x.map.prev=w.map);else{let N=a;x.syntax&&(N=x.syntax.parse),x.parser&&(N=x.parser),N.parse&&(N=N.parse);try{E=N(w,x)}catch(D){this.processed=!0,this.error=D}E&&!E[t]&&r.rebuild(E)}this.result=new n(g,E,x),this.helpers={...S,postcss:S,result:this.result},this.plugins=this.processor.plugins.map(N=>typeof N=="object"&&N.prepare?{...N,...N.prepare(this.result)}:N)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(g){return this.async().catch(g)}finally(g){return this.async().then(g,g)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(g,w){let x=this.result.lastPlugin;try{w&&w.addToError(g),this.error=g,g.name==="CssSyntaxError"&&!g.plugin?(g.plugin=x.postcssPlugin,g.setMessage()):x.postcssVersion}catch(E){console&&console.error&&console.error(E)}return g}prepareVisitors(){this.listeners={};let g=(w,x,E)=>{this.listeners[x]||(this.listeners[x]=[]),this.listeners[x].push([w,E])};for(let w of this.plugins)if(typeof w=="object")for(let x in w){if(!s[x]&&/^[A-Z]/.test(x))throw new Error(`Unknown event ${x} in ${w.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[x])if(typeof w[x]=="object")for(let E in w[x])E==="*"?g(w,x,w[x][E]):g(w,x+"-"+E.toLowerCase(),w[x][E]);else typeof w[x]=="function"&&g(w,x,w[x])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let g=0;g<this.plugins.length;g++){let w=this.plugins[g],x=this.runOnRoot(w);if(f(x))try{await x}catch(E){throw this.handleError(E)}}if(this.prepareVisitors(),this.hasListener){let g=this.result.root;for(;!g[e];){g[e]=!0;let w=[p(g)];for(;w.length>0;){let x=this.visitTick(w);if(f(x))try{await x}catch(E){let N=w[w.length-1].node;throw this.handleError(E,N)}}}if(this.listeners.OnceExit)for(let[w,x]of this.listeners.OnceExit){this.result.lastPlugin=w;try{if(g.type==="document"){let E=g.nodes.map(N=>x(N,this.helpers));await Promise.all(E)}else await x(g,this.helpers)}catch(E){throw this.handleError(E)}}}return this.processed=!0,this.stringify()}runOnRoot(g){this.result.lastPlugin=g;try{if(typeof g=="object"&&g.Once){if(this.result.root.type==="document"){let w=this.result.root.nodes.map(x=>g.Once(x,this.helpers));return f(w[0])?Promise.all(w):w}return g.Once(this.result.root,this.helpers)}else if(typeof g=="function")return g(this.result.root,this.result)}catch(w){throw this.handleError(w)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let g=this.result.opts,w=o;g.syntax&&(w=g.syntax.stringify),g.stringifier&&(w=g.stringifier),w.stringify&&(w=w.stringify);let E=new i(w,this.result.root,this.result.opts).generate();return this.result.css=E[0],this.result.map=E[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 g of this.plugins){let w=this.runOnRoot(g);if(f(w))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let g=this.result.root;for(;!g[e];)g[e]=!0,this.walkSync(g);if(this.listeners.OnceExit)if(g.type==="document")for(let w of g.nodes)this.visitSync(this.listeners.OnceExit,w);else this.visitSync(this.listeners.OnceExit,g)}return this.result}then(g,w){return this.async().then(g,w)}toString(){return this.css}visitSync(g,w){for(let[x,E]of g){this.result.lastPlugin=x;let N;try{N=E(w,this.helpers)}catch(D){throw this.handleError(D,w.proxyOf)}if(w.type!=="root"&&w.type!=="document"&&!w.parent)return!0;if(f(N))throw this.getAsyncError()}}visitTick(g){let w=g[g.length-1],{node:x,visitors:E}=w;if(x.type!=="root"&&x.type!=="document"&&!x.parent){g.pop();return}if(E.length>0&&w.visitorIndex<E.length){let[D,R]=E[w.visitorIndex];w.visitorIndex+=1,w.visitorIndex===E.length&&(w.visitors=[],w.visitorIndex=0),this.result.lastPlugin=D;try{return R(x.toProxy(),this.helpers)}catch(q){throw this.handleError(q,x)}}if(w.iterator!==0){let D=w.iterator,R;for(;R=x.nodes[x.indexes[D]];)if(x.indexes[D]+=1,!R[e]){R[e]=!0,g.push(p(R));return}w.iterator=0,delete x.indexes[D]}let N=w.events;for(;w.eventIndex<N.length;){let D=N[w.eventIndex];if(w.eventIndex+=1,D===l){x.nodes&&x.nodes.length&&(x[e]=!0,w.iterator=x.getIterator());return}else if(this.listeners[D]){w.visitors=this.listeners[D];return}}g.pop()}walkSync(g){g[e]=!0;let w=m(g);for(let x of w)if(x===l)g.nodes&&g.each(E=>{E[e]||this.walkSync(E)});else{let E=this.listeners[x];if(E&&this.visitSync(E,g.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return b.registerPostcss=v=>{S=v},Mt=b,b.default=b,h.registerLazyResult(b),u.registerLazyResult(b),Mt}var Nt,ii;function on(){if(ii)return Nt;ii=1;let e=os(),t=ze(),i=yr();const o=pr();class r{constructor(n,a,h){a=a.toString(),this.stringified=!1,this._processor=n,this._css=a,this._opts=h,this._map=void 0;let c,s=t;this.result=new o(this._processor,c,this._opts),this.result.css=a;let d=this;Object.defineProperty(this.result,"root",{get(){return d.root}});let l=new e(s,c,this._opts,a);if(l.isMap()){let[f,m]=l.generate();f&&(this.result.css=f),m&&(this.result.map=m)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(n){return this.async().catch(n)}finally(n){return this.async().then(n,n)}sync(){if(this.error)throw this.error;return this.result}then(n,a){return this.async().then(n,a)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let n,a=i;try{n=a(this._css,this._opts)}catch(h){this.error=h}if(this.error)throw this.error;return this._root=n,n}get[Symbol.toStringTag](){return"NoWorkResult"}}return Nt=r,r.default=r,Nt}var At,si;function an(){if(si)return At;si=1;let e=on(),t=us(),i=dr(),o=Re();class r{constructor(n=[]){this.version="8.4.38",this.plugins=this.normalize(n)}normalize(n){let a=[];for(let h of n)if(h.postcss===!0?h=h():h.postcss&&(h=h.postcss),typeof h=="object"&&Array.isArray(h.plugins))a=a.concat(h.plugins);else if(typeof h=="object"&&h.postcssPlugin)a.push(h);else if(typeof h=="function")a.push(h);else if(!(typeof h=="object"&&(h.parse||h.stringify)))throw new Error(h+" is not a PostCSS plugin");return a}process(n,a={}){return!this.plugins.length&&!a.parser&&!a.stringifier&&!a.syntax?new e(this,n,a):new t(this,n,a)}use(n){return this.plugins=this.plugins.concat(this.normalize([n])),this}}return At=r,r.default=r,o.registerProcessor(r),i.registerProcessor(r),At}var Dt,ni;function ln(){if(ni)return Dt;ni=1;let e=je(),t=ns(),i=Ve(),o=mr(),r=qe(),u=Re(),n=gr();function a(h,c){if(Array.isArray(h))return h.map(l=>a(l));let{inputs:s,...d}=h;if(s){c=[];for(let l of s){let f={...l,__proto__:r.prototype};f.map&&(f.map={...f.map,__proto__:t.prototype}),c.push(f)}}if(d.nodes&&(d.nodes=h.nodes.map(l=>a(l,c))),d.source){let{inputId:l,...f}=d.source;d.source=f,l!=null&&(d.source.input=c[l])}if(d.type==="root")return new u(d);if(d.type==="decl")return new e(d);if(d.type==="rule")return new n(d);if(d.type==="comment")return new i(d);if(d.type==="atrule")return new o(d);throw new Error("Unknown node type: "+h.type)}return Dt=a,a.default=a,Dt}var Ot,oi;function un(){if(oi)return Ot;oi=1;let e=hr(),t=je(),i=us(),o=fe(),r=an(),u=ze(),n=ln(),a=dr(),h=as(),c=Ve(),s=mr(),d=pr(),l=qe(),f=yr(),m=ls(),p=gr(),y=Re(),S=We();function b(...v){return v.length===1&&Array.isArray(v[0])&&(v=v[0]),new r(v)}return b.plugin=function(g,w){let x=!1;function E(...D){console&&console.warn&&!x&&(x=!0,console.warn(g+`: postcss.plugin was deprecated. Migration guide:
26
+ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),Le.LANG&&Le.LANG.startsWith("cn")&&console.warn(g+`: 里面 postcss.plugin 被弃用. 迁移指南:
27
+ https://www.w3ctech.com/topic/2226`));let R=w(...D);return R.postcssPlugin=g,R.postcssVersion=new r().version,R}let N;return Object.defineProperty(E,"postcss",{get(){return N||(N=E()),N}}),E.process=function(D,R,q){return b([E(q)]).process(D,R)},E},b.stringify=u,b.parse=f,b.fromJSON=n,b.list=m,b.comment=v=>new c(v),b.atRule=v=>new s(v),b.decl=v=>new t(v),b.rule=v=>new p(v),b.root=v=>new y(v),b.document=v=>new a(v),b.CssSyntaxError=e,b.Declaration=t,b.Container=o,b.Processor=r,b.Document=a,b.Comment=c,b.Warning=h,b.AtRule=s,b.Result=d,b.Input=l,b.Rule=p,b.Root=y,b.Node=S,i.registerPostcss(b),Ot=b,b.default=b,Ot}var cn=un();const F=Qs(cn);F.stringify;F.fromJSON;F.plugin;F.parse;F.list;F.document;F.comment;F.atRule;F.rule;F.decl;F.root;F.CssSyntaxError;F.Declaration;F.Container;F.Processor;F.Document;F.Comment;F.Warning;F.AtRule;F.Result;F.Input;F.Rule;F.Root;F.Node;const ai={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 hn(e){let t=ai[e.tagName]?ai[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Ge(e,t){const i=t?.stylesWithHoverClass.get(e);if(i)return i;let o=e;try{o=F([Js,Xs]).process(e).css}catch(r){console.warn("Failed to adapt css for replay",r)}return t?.stylesWithHoverClass.set(e,o),o}function li(){return{stylesWithHoverClass:new Map}}const fn="rrweb-snapshot.rebuild() cannot rebuild into an unprotected browser document. Use rebuildIntoSandboxedIframe() or set UNSAFE_allowUnprotectedRebuild: true only when you accept the script-execution risk.",ui="rrweb-snapshot.createSandboxedIframe() requires root to be connected to a document before creating a sandboxed iframe.",cs=new WeakSet;function dn(e){if(!e||e.tagName!=="IFRAME"||!("sandbox"in e))return!1;const t=Array.from(e.sandbox);return t.length===1&&t[0]==="allow-same-origin"}function pn(e){if(e.UNSAFE_allowUnprotectedRebuild)return;const t=e.doc.defaultView;if(t&&!(cs.has(e.doc)&&dn(t.frameElement)))throw new Error(fn)}function mn(e,t,i,o){const r=[];for(const h of e.childNodes)h.type===$.Text&&r.push(h);const u=t.split("/* rr_split */");for(;u.length>1&&u.length>r.length;)u.splice(-2,2,u.slice(-2).join(""));let n="";i&&(n=Ge(u.join(""),o));let a=0;for(let h=0;h<r.length&&h!==u.length;h++){const c=r[h];if(!i)c.textContent=u[h];else if(h<u.length-1){let s=a,d=u[h+1].length;d=Math.min(d,30);let l=!1;for(;d>2;d--){const f=u[h+1].substring(0,d),m=n.substring(a).indexOf(f);if(l=m!==-1,l){s+=m;break}}l||(s+=u[h].length),c.textContent=n.substring(a,s),a=s}else c.textContent=n.substring(a)}}function gn(e,t,i,o){const{doc:r,hackCss:u,cache:n}=o;e.childNodes.length?mn(e,i,u,n):(u&&(i=Ge(i,n)),t.appendChild(r.createTextNode(i)))}function yn(e,t){var i;const{doc:o,hackCss:r,cache:u}=t;switch(e.type){case $.Document:return o.implementation.createDocument(null,"",null);case $.DocumentType:return o.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case $.Element:{const n=hn(e);let a;e.isSVG?a=o.createElementNS("http://www.w3.org/2000/svg",n):(e.isCustom&&((i=o.defaultView)!=null&&i.customElements)&&!o.defaultView.customElements.get(e.tagName)&&o.defaultView.customElements.define(e.tagName,class extends o.defaultView.HTMLElement{}),a=o.createElement(n));const h={};for(const c in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,c))continue;let s=e.attributes[c];if(!(n==="option"&&c==="selected"&&s===!1)&&s!==null){if(s===!0&&(s=""),c.startsWith("rr_")){h[c]=s;continue}if(typeof s=="string"){if(n==="style"&&c==="_cssText"){gn(e,a,s,t);continue}else if(n==="textarea"&&c==="value"){a.appendChild(o.createTextNode(s)),e.childNodes=[];continue}}try{if(e.isSVG&&c==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",c,s.toString());else if(c==="onload"||c==="onclick"||c.substring(0,7)==="onmouse")a.setAttribute("_"+c,s.toString());else if(n==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&c==="content"){a.setAttribute("csp-content",s.toString());continue}else n==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||n==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Hs(e.attributes.href)==="js"||(n==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(c,s.toString()))}catch{}}}for(const c in h){const s=h[c];if(n==="canvas"&&c==="rr_dataURL"){const d=o.createElement("img");d.onload=()=>{const l=a.getContext("2d");l&&l.drawImage(d,0,0,d.width,d.height)},d.src=s.toString(),a.RRNodeType&&(a.rr_dataURL=s.toString())}else if(n==="img"&&c==="rr_dataURL"){const d=a;d.currentSrc.startsWith("data:")||(d.setAttribute("rrweb-original-src",e.attributes.src),d.src=s.toString())}if(c==="rr_width")a.style.setProperty("width",s.toString());else if(c==="rr_height")a.style.setProperty("height",s.toString());else if(c==="rr_mediaCurrentTime"&&typeof s=="number")a.currentTime=s;else if(c==="rr_mediaState")switch(s){case"played":a.play().catch(d=>console.warn("media playback error",d));break;case"paused":a.pause();break}else c==="rr_mediaPlaybackRate"&&typeof s=="number"?a.playbackRate=s:c==="rr_mediaMuted"&&typeof s=="boolean"?a.muted=s:c==="rr_mediaLoop"&&typeof s=="boolean"?a.loop=s:c==="rr_mediaVolume"&&typeof s=="number"?a.volume=s:c==="rr_open_mode"&&a.setAttribute("rr_open_mode",s)}if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return(n==="input"||n==="textarea")&&a.setAttribute("autocomplete","off"),a}case $.Text:return e.isStyle&&r?o.createTextNode(Ge(e.textContent,u)):o.createTextNode(e.textContent);case $.CDATA:return o.createCDATASection(e.textContent);case $.Comment:return o.createComment(e.textContent);default:return null}}function Ce(e,t){const{doc:i,mirror:o,skipChild:r=!1,hackCss:u=!0,afterAppend:n,cache:a}=t;if(o.has(e.id)){const c=o.getNode(e.id),s=o.getMeta(c);if(Gs(s,e))return o.getNode(e.id)}let h=yn(e,{doc:i,hackCss:u,cache:a});if(!h)return null;if(e.rootId&&o.getNode(e.rootId)!==i&&o.replace(e.rootId,i),e.type===$.Document&&(i.close(),i.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==$.DocumentType&&(e.childNodes[0].type===$.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?i.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):i.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),h=i),o.add(h,e),(e.type===$.Document||e.type===$.Element)&&!r)for(const c of e.childNodes){const s=Ce(c,{doc:i,mirror:o,skipChild:!1,hackCss:u,afterAppend:n,cache:a});if(!s){console.warn("Failed to rebuild",c);continue}if(c.isShadow&&qs(h)&&h.shadowRoot)h.shadowRoot.appendChild(s);else if(e.type===$.Document&&c.type==$.Element){const d=s;let l=null;d.childNodes.forEach(f=>{f.nodeName==="BODY"&&(l=f)}),l?(d.removeChild(l),h.appendChild(s),d.appendChild(l)):h.appendChild(s)}else h.appendChild(s);n&&n(s,c.id)}return h}function wn(e,t){function i(o){t(o)}for(const o of e.getIds())e.has(o)&&i(e.getNode(o))}function vn(e,t){const i=t.getMeta(e);if(i?.type!==$.Element)return;const o=e;for(const r in i.attributes){if(!(Object.prototype.hasOwnProperty.call(i.attributes,r)&&r.startsWith("rr_")))continue;const u=i.attributes[r];r==="rr_scrollLeft"&&(o.scrollLeft=u),r==="rr_scrollTop"&&(o.scrollTop=u)}}function bn(e,t){pn(t);const{doc:i,onVisit:o,hackCss:r=!0,afterAppend:u,cache:n,mirror:a=new rs}=t,h=Ce(e,{doc:i,mirror:a,skipChild:!1,hackCss:r,afterAppend:u,cache:n});return wn(a,c=>{o&&o(c),vn(c,a)}),h}function Sn(e){var t;if(!e.root.isConnected)throw new Error(ui);const i=e.root.ownerDocument.createElement("iframe");for(const[r,u]of Object.entries(e.iframeAttributes||{}))r!=="sandbox"&&i.setAttribute(r,u);i.setAttribute("sandbox","allow-same-origin"),e.root.appendChild(i);const o=i.contentDocument;if(!o||!i.contentWindow)throw(t=i.parentNode)==null||t.removeChild(i),new Error(ui);return cs.add(o),i}var xn=Object.defineProperty,En=(e,t,i)=>t in e?xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,A=(e,t,i)=>En(e,typeof t!="symbol"?t+"":t,i),Cn=Object.defineProperty,Rn=(e,t,i)=>t in e?Cn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,ci=(e,t,i)=>Rn(e,typeof t!="symbol"?t+"":t,i);Date.now().toString();let Mn=class{constructor(){ci(this,"idNodeMap",new Map),ci(this,"nodeMetaMap",new WeakMap)}getId(t){var i;return t?((i=this.getMeta(t))==null?void 0:i.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 i=this.getId(t);this.idNodeMap.delete(i),t.childNodes&&t.childNodes.forEach(o=>this.removeNodeFromMap(o))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,i){const o=i.id;this.idNodeMap.set(o,t),this.nodeMetaMap.set(t,i)}replace(t,i){const o=this.getNode(t);if(o){const r=this.nodeMetaMap.get(o);r&&this.nodeMetaMap.set(i,r)}this.idNodeMap.set(t,i)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Nn(){return new Mn}function An(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Dn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var i=function o(){return this instanceof o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(i,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}),i}var De={exports:{}},hi;function On(){if(hi)return De.exports;hi=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return De.exports=t(),De.exports.createColors=t,De.exports}const Tn={},_n=Object.freeze(Object.defineProperty({__proto__:null,default:Tn},Symbol.toStringTag,{value:"Module"})),K=Dn(_n);var Tt,fi;function wr(){if(fi)return Tt;fi=1;let e=On(),t=K;class i extends Error{constructor(r,u,n,a,h,c){super(r),this.name="CssSyntaxError",this.reason=r,h&&(this.file=h),a&&(this.source=a),c&&(this.plugin=c),typeof u<"u"&&typeof n<"u"&&(typeof u=="number"?(this.line=u,this.column=n):(this.line=u.line,this.column=u.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,i)}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(r){if(!this.source)return"";let u=this.source;r==null&&(r=e.isColorSupported),t&&r&&(u=t(u));let n=u.split(/\r?\n/),a=Math.max(this.line-3,0),h=Math.min(this.line+2,n.length),c=String(h).length,s,d;if(r){let{bold:l,gray:f,red:m}=e.createColors(!0);s=p=>l(m(p)),d=p=>f(p)}else s=d=l=>l;return n.slice(a,h).map((l,f)=>{let m=a+1+f,p=" "+(" "+m).slice(-c)+" | ";if(m===this.line){let y=d(p.replace(/\d/g," "))+l.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+d(p)+l+`
28
+ `+y+s("^")}return" "+d(p)+l}).join(`
29
+ `)}toString(){let r=this.showSourceCode();return r&&(r=`
30
+
31
+ `+r+`
32
+ `),this.name+": "+this.message+r}}return Tt=i,i.default=i,Tt}var Oe={},di;function vr(){return di||(di=1,Oe.isClean=Symbol("isClean"),Oe.my=Symbol("my")),Oe}var _t,pi;function hs(){if(pi)return _t;pi=1;const e={after:`
33
+ `,beforeClose:`
34
+ `,beforeComment:`
35
+ `,beforeDecl:`
36
+ `,beforeOpen:" ",beforeRule:`
37
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(o){return o[0].toUpperCase()+o.slice(1)}class i{constructor(r){this.builder=r}atrule(r,u){let n="@"+r.name,a=r.params?this.rawValue(r,"params"):"";if(typeof r.raws.afterName<"u"?n+=r.raws.afterName:a&&(n+=" "),r.nodes)this.block(r,n+a);else{let h=(r.raws.between||"")+(u?";":"");this.builder(n+a+h,r)}}beforeAfter(r,u){let n;r.type==="decl"?n=this.raw(r,null,"beforeDecl"):r.type==="comment"?n=this.raw(r,null,"beforeComment"):u==="before"?n=this.raw(r,null,"beforeRule"):n=this.raw(r,null,"beforeClose");let a=r.parent,h=0;for(;a&&a.type!=="root";)h+=1,a=a.parent;if(n.includes(`
38
+ `)){let c=this.raw(r,null,"indent");if(c.length)for(let s=0;s<h;s++)n+=c}return n}block(r,u){let n=this.raw(r,"between","beforeOpen");this.builder(u+n+"{",r,"start");let a;r.nodes&&r.nodes.length?(this.body(r),a=this.raw(r,"after")):a=this.raw(r,"after","emptyBody"),a&&this.builder(a),this.builder("}",r,"end")}body(r){let u=r.nodes.length-1;for(;u>0&&r.nodes[u].type==="comment";)u-=1;let n=this.raw(r,"semicolon");for(let a=0;a<r.nodes.length;a++){let h=r.nodes[a],c=this.raw(h,"before");c&&this.builder(c),this.stringify(h,u!==a||n)}}comment(r){let u=this.raw(r,"left","commentLeft"),n=this.raw(r,"right","commentRight");this.builder("/*"+u+r.text+n+"*/",r)}decl(r,u){let n=this.raw(r,"between","colon"),a=r.prop+n+this.rawValue(r,"value");r.important&&(a+=r.raws.important||" !important"),u&&(a+=";"),this.builder(a,r)}document(r){this.body(r)}raw(r,u,n){let a;if(n||(n=u),u&&(a=r.raws[u],typeof a<"u"))return a;let h=r.parent;if(n==="before"&&(!h||h.type==="root"&&h.first===r||h&&h.type==="document"))return"";if(!h)return e[n];let c=r.root();if(c.rawCache||(c.rawCache={}),typeof c.rawCache[n]<"u")return c.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(r,n);{let s="raw"+t(n);this[s]?a=this[s](c,r):c.walk(d=>{if(a=d.raws[u],typeof a<"u")return!1})}return typeof a>"u"&&(a=e[n]),c.rawCache[n]=a,a}rawBeforeClose(r){let u;return r.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return u=n.raws.after,u.includes(`
39
+ `)&&(u=u.replace(/[^\n]+$/,"")),!1}),u&&(u=u.replace(/\S/g,"")),u}rawBeforeComment(r,u){let n;return r.walkComments(a=>{if(typeof a.raws.before<"u")return n=a.raws.before,n.includes(`
40
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(u,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(r,u){let n;return r.walkDecls(a=>{if(typeof a.raws.before<"u")return n=a.raws.before,n.includes(`
41
+ `)&&(n=n.replace(/[^\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(u,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(r){let u;return r.walk(n=>{if(n.type!=="decl"&&(u=n.raws.between,typeof u<"u"))return!1}),u}rawBeforeRule(r){let u;return r.walk(n=>{if(n.nodes&&(n.parent!==r||r.first!==n)&&typeof n.raws.before<"u")return u=n.raws.before,u.includes(`
42
+ `)&&(u=u.replace(/[^\n]+$/,"")),!1}),u&&(u=u.replace(/\S/g,"")),u}rawColon(r){let u;return r.walkDecls(n=>{if(typeof n.raws.between<"u")return u=n.raws.between.replace(/[^\s:]/g,""),!1}),u}rawEmptyBody(r){let u;return r.walk(n=>{if(n.nodes&&n.nodes.length===0&&(u=n.raws.after,typeof u<"u"))return!1}),u}rawIndent(r){if(r.raws.indent)return r.raws.indent;let u;return r.walk(n=>{let a=n.parent;if(a&&a!==r&&a.parent&&a.parent===r&&typeof n.raws.before<"u"){let h=n.raws.before.split(`
43
+ `);return u=h[h.length-1],u=u.replace(/\S/g,""),!1}}),u}rawSemicolon(r){let u;return r.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(u=n.raws.semicolon,typeof u<"u"))return!1}),u}rawValue(r,u){let n=r[u],a=r.raws[u];return a&&a.value===n?a.raw:n}root(r){this.body(r),r.raws.after&&this.builder(r.raws.after)}rule(r){this.block(r,this.rawValue(r,"selector")),r.raws.ownSemicolon&&this.builder(r.raws.ownSemicolon,r,"end")}stringify(r,u){if(!this[r.type])throw new Error("Unknown AST node type "+r.type+". Maybe you need to change PostCSS stringifier.");this[r.type](r,u)}}return _t=i,i.default=i,_t}var Pt,mi;function He(){if(mi)return Pt;mi=1;let e=hs();function t(i,o){new e(o).stringify(i)}return Pt=t,t.default=t,Pt}var It,gi;function Ye(){if(gi)return It;gi=1;let{isClean:e,my:t}=vr(),i=wr(),o=hs(),r=He();function u(a,h){let c=new a.constructor;for(let s in a){if(!Object.prototype.hasOwnProperty.call(a,s)||s==="proxyCache")continue;let d=a[s],l=typeof d;s==="parent"&&l==="object"?h&&(c[s]=h):s==="source"?c[s]=d:Array.isArray(d)?c[s]=d.map(f=>u(f,c)):(l==="object"&&d!==null&&(d=u(d)),c[s]=d)}return c}class n{constructor(h={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in h)if(c==="nodes"){this.nodes=[];for(let s of h[c])typeof s.clone=="function"?this.append(s.clone()):this.append(s)}else this[c]=h[c]}addToError(h){if(h.postcssNode=this,h.stack&&this.source&&/\n\s{4}at /.test(h.stack)){let c=this.source;h.stack=h.stack.replace(/\n\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return h}after(h){return this.parent.insertAfter(this,h),this}assign(h={}){for(let c in h)this[c]=h[c];return this}before(h){return this.parent.insertBefore(this,h),this}cleanRaws(h){delete this.raws.before,delete this.raws.after,h||delete this.raws.between}clone(h={}){let c=u(this);for(let s in h)c[s]=h[s];return c}cloneAfter(h={}){let c=this.clone(h);return this.parent.insertAfter(this,c),c}cloneBefore(h={}){let c=this.clone(h);return this.parent.insertBefore(this,c),c}error(h,c={}){if(this.source){let{end:s,start:d}=this.rangeBy(c);return this.source.input.error(h,{column:d.column,line:d.line},{column:s.column,line:s.line},c)}return new i(h)}getProxyProcessor(){return{get(h,c){return c==="proxyOf"?h:c==="root"?()=>h.root().toProxy():h[c]},set(h,c,s){return h[c]===s||(h[c]=s,(c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="text")&&h.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let h=this;for(;h=h.parent;)h[e]=!1}}next(){if(!this.parent)return;let h=this.parent.index(this);return this.parent.nodes[h+1]}positionBy(h,c){let s=this.source.start;if(h.index)s=this.positionInside(h.index,c);else if(h.word){c=this.toString();let d=c.indexOf(h.word);d!==-1&&(s=this.positionInside(d,c))}return s}positionInside(h,c){let s=c||this.toString(),d=this.source.start.column,l=this.source.start.line;for(let f=0;f<h;f++)s[f]===`
44
+ `?(d=1,l+=1):d+=1;return{column:d,line:l}}prev(){if(!this.parent)return;let h=this.parent.index(this);return this.parent.nodes[h-1]}rangeBy(h){let c={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:c.column+1,line:c.line};if(h.word){let d=this.toString(),l=d.indexOf(h.word);l!==-1&&(c=this.positionInside(l,d),s=this.positionInside(l+h.word.length,d))}else h.start?c={column:h.start.column,line:h.start.line}:h.index&&(c=this.positionInside(h.index)),h.end?s={column:h.end.column,line:h.end.line}:typeof h.endIndex=="number"?s=this.positionInside(h.endIndex):h.index&&(s=this.positionInside(h.index+1));return(s.line<c.line||s.line===c.line&&s.column<=c.column)&&(s={column:c.column+1,line:c.line}),{end:s,start:c}}raw(h,c){return new o().raw(this,h,c)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...h){if(this.parent){let c=this,s=!1;for(let d of h)d===this?s=!0:s?(this.parent.insertAfter(c,d),c=d):this.parent.insertBefore(c,d);s||this.remove()}return this}root(){let h=this;for(;h.parent&&h.parent.type!=="document";)h=h.parent;return h}toJSON(h,c){let s={},d=c==null;c=c||new Map;let l=0;for(let f in this){if(!Object.prototype.hasOwnProperty.call(this,f)||f==="parent"||f==="proxyCache")continue;let m=this[f];if(Array.isArray(m))s[f]=m.map(p=>typeof p=="object"&&p.toJSON?p.toJSON(null,c):p);else if(typeof m=="object"&&m.toJSON)s[f]=m.toJSON(null,c);else if(f==="source"){let p=c.get(m.input);p==null&&(p=l,c.set(m.input,l),l++),s[f]={end:m.end,inputId:p,start:m.start}}else s[f]=m}return d&&(s.inputs=[...c.keys()].map(f=>f.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(h=r){h.stringify&&(h=h.stringify);let c="";return h(this,s=>{c+=s}),c}warn(h,c,s){let d={node:this};for(let l in s)d[l]=s[l];return h.warn(c,d)}get proxyOf(){return this}}return It=n,n.default=n,It}var kt,yi;function Je(){if(yi)return kt;yi=1;let e=Ye();class t extends e{constructor(o){o&&typeof o.value<"u"&&typeof o.value!="string"&&(o={...o,value:String(o.value)}),super(o),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return kt=t,t.default=t,kt}var Lt,wi;function Pn(){if(wi)return Lt;wi=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return Lt={nanoid:(o=21)=>{let r="",u=o;for(;u--;)r+=e[Math.random()*64|0];return r},customAlphabet:(o,r=21)=>(u=r)=>{let n="",a=u;for(;a--;)n+=o[Math.random()*o.length|0];return n}},Lt}var Ft,vi;function fs(){if(vi)return Ft;vi=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=K,{existsSync:i,readFileSync:o}=K,{dirname:r,join:u}=K;function n(h){return Buffer?Buffer.from(h,"base64").toString():window.atob(h)}class a{constructor(c,s){if(s.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let d=s.map?s.map.prev:void 0,l=this.loadMap(s.from,d);!this.mapFile&&s.from&&(this.mapFile=s.from),this.mapFile&&(this.root=r(this.mapFile)),l&&(this.text=l)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(c){let s=/^data:application\/json;charset=utf-?8;base64,/,d=/^data:application\/json;base64,/,l=/^data:application\/json;charset=utf-?8,/,f=/^data:application\/json,/;if(l.test(c)||f.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(s.test(c)||d.test(c))return n(c.substr(RegExp.lastMatch.length));let m=c.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+m)}getAnnotationURL(c){return c.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(c){return typeof c!="object"?!1:typeof c.mappings=="string"||typeof c._mappings=="string"||Array.isArray(c.sections)}loadAnnotation(c){let s=c.match(/\/\*\s*# sourceMappingURL=/gm);if(!s)return;let d=c.lastIndexOf(s.pop()),l=c.indexOf("*/",d);d>-1&&l>-1&&(this.annotation=this.getAnnotationURL(c.substring(d,l)))}loadFile(c){if(this.root=r(c),i(c))return this.mapFile=c,o(c,"utf-8").toString().trim()}loadMap(c,s){if(s===!1)return!1;if(s){if(typeof s=="string")return s;if(typeof s=="function"){let d=s(c);if(d){let l=this.loadFile(d);if(!l)throw new Error("Unable to load previous source map: "+d.toString());return l}}else{if(s instanceof e)return t.fromSourceMap(s).toString();if(s instanceof t)return s.toString();if(this.isMap(s))return JSON.stringify(s);throw new Error("Unsupported previous source map format: "+s.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let d=this.annotation;return c&&(d=u(r(c),d)),this.loadFile(d)}}}startWith(c,s){return c?c.substr(0,s.length)===s:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Ft=a,a.default=a,Ft}var Ut,bi;function Xe(){if(bi)return Ut;bi=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=K,{fileURLToPath:i,pathToFileURL:o}=K,{isAbsolute:r,resolve:u}=K,{nanoid:n}=Pn(),a=K,h=wr(),c=fs(),s=Symbol("fromOffsetCache"),d=!!(e&&t),l=!!(u&&r);class f{constructor(p,y={}){if(p===null||typeof p>"u"||typeof p=="object"&&!p.toString)throw new Error(`PostCSS received ${p} instead of CSS string`);if(this.css=p.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,y.from&&(!l||/^\w+:\/\//.test(y.from)||r(y.from)?this.file=y.from:this.file=u(y.from)),l&&d){let S=new c(this.css,y);if(S.text){this.map=S;let b=S.consumer().file;!this.file&&b&&(this.file=this.mapResolve(b))}}this.file||(this.id="<input css "+n(6)+">"),this.map&&(this.map.file=this.from)}error(p,y,S,b={}){let v,g,w;if(y&&typeof y=="object"){let E=y,N=S;if(typeof E.offset=="number"){let D=this.fromOffset(E.offset);y=D.line,S=D.col}else y=E.line,S=E.column;if(typeof N.offset=="number"){let D=this.fromOffset(N.offset);g=D.line,w=D.col}else g=N.line,w=N.column}else if(!S){let E=this.fromOffset(y);y=E.line,S=E.col}let x=this.origin(y,S,g,w);return x?v=new h(p,x.endLine===void 0?x.line:{column:x.column,line:x.line},x.endLine===void 0?x.column:{column:x.endColumn,line:x.endLine},x.source,x.file,b.plugin):v=new h(p,g===void 0?y:{column:S,line:y},g===void 0?S:{column:w,line:g},this.css,this.file,b.plugin),v.input={column:S,endColumn:w,endLine:g,line:y,source:this.css},this.file&&(o&&(v.input.url=o(this.file).toString()),v.input.file=this.file),v}fromOffset(p){let y,S;if(this[s])S=this[s];else{let v=this.css.split(`
45
+ `);S=new Array(v.length);let g=0;for(let w=0,x=v.length;w<x;w++)S[w]=g,g+=v[w].length+1;this[s]=S}y=S[S.length-1];let b=0;if(p>=y)b=S.length-1;else{let v=S.length-2,g;for(;b<v;)if(g=b+(v-b>>1),p<S[g])v=g-1;else if(p>=S[g+1])b=g+1;else{b=g;break}}return{col:p-S[b]+1,line:b+1}}mapResolve(p){return/^\w+:\/\//.test(p)?p:u(this.map.consumer().sourceRoot||this.map.root||".",p)}origin(p,y,S,b){if(!this.map)return!1;let v=this.map.consumer(),g=v.originalPositionFor({column:y,line:p});if(!g.source)return!1;let w;typeof S=="number"&&(w=v.originalPositionFor({column:b,line:S}));let x;r(g.source)?x=o(g.source):x=new URL(g.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let E={column:g.column,endColumn:w&&w.column,endLine:w&&w.line,line:g.line,url:x.toString()};if(x.protocol==="file:")if(i)E.file=i(x);else throw new Error("file: protocol is not available in this PostCSS build");let N=v.sourceContentFor(g.source);return N&&(E.source=N),E}toJSON(){let p={};for(let y of["hasBOM","css","file","id"])this[y]!=null&&(p[y]=this[y]);return this.map&&(p.map={...this.map},p.map.consumerCache&&(p.map.consumerCache=void 0)),p}get from(){return this.file||this.id}}return Ut=f,f.default=f,a&&a.registerInput&&a.registerInput(f),Ut}var Bt,Si;function ds(){if(Si)return Bt;Si=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=K,{dirname:i,relative:o,resolve:r,sep:u}=K,{pathToFileURL:n}=K,a=Xe(),h=!!(e&&t),c=!!(i&&r&&o&&u);class s{constructor(l,f,m,p){this.stringify=l,this.mapOpts=m.map||{},this.root=f,this.opts=m,this.css=p,this.originalCSS=p,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let l;this.isInline()?l="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?l=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?l=this.mapOpts.annotation(this.opts.to,this.root):l=this.outputFile()+".map";let f=`
46
+ `;this.css.includes(`\r
47
+ `)&&(f=`\r
48
+ `),this.css+=f+"/*# sourceMappingURL="+l+" */"}applyPrevMaps(){for(let l of this.previous()){let f=this.toUrl(this.path(l.file)),m=l.root||i(l.file),p;this.mapOpts.sourcesContent===!1?(p=new e(l.text),p.sourcesContent&&(p.sourcesContent=null)):p=l.consumer(),this.map.applySourceMap(p,f,this.toUrl(this.path(m)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let l;for(let f=this.root.nodes.length-1;f>=0;f--)l=this.root.nodes[f],l.type==="comment"&&l.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(f)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&h&&this.isMap())return this.generateMap();{let l="";return this.stringify(this.root,f=>{l+=f}),[l]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let l=this.previous()[0].consumer();l.file=this.outputFile(),this.map=t.fromSourceMap(l,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let l=1,f=1,m="<no source>",p={generated:{column:0,line:0},original:{column:0,line:0},source:""},y,S;this.stringify(this.root,(b,v,g)=>{if(this.css+=b,v&&g!=="end"&&(p.generated.line=l,p.generated.column=f-1,v.source&&v.source.start?(p.source=this.sourcePath(v),p.original.line=v.source.start.line,p.original.column=v.source.start.column-1,this.map.addMapping(p)):(p.source=m,p.original.line=1,p.original.column=0,this.map.addMapping(p))),y=b.match(/\n/g),y?(l+=y.length,S=b.lastIndexOf(`
49
+ `),f=b.length-S):f+=b.length,v&&g!=="start"){let w=v.parent||{raws:{}};(!(v.type==="decl"||v.type==="atrule"&&!v.nodes)||v!==w.last||w.raws.semicolon)&&(v.source&&v.source.end?(p.source=this.sourcePath(v),p.original.line=v.source.end.line,p.original.column=v.source.end.column-1,p.generated.line=l,p.generated.column=f-2,this.map.addMapping(p)):(p.source=m,p.original.line=1,p.original.column=0,p.generated.line=l,p.generated.column=f-1,this.map.addMapping(p)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(l=>l.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let l=this.mapOpts.annotation;return typeof l<"u"&&l!==!0?!1:this.previous().length?this.previous().some(f=>f.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(l=>l.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(l){if(this.mapOpts.absolute||l.charCodeAt(0)===60||/^\w+:\/\//.test(l))return l;let f=this.memoizedPaths.get(l);if(f)return f;let m=this.opts.to?i(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=i(r(m,this.mapOpts.annotation)));let p=o(m,l);return this.memoizedPaths.set(l,p),p}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(l=>{if(l.source&&l.source.input.map){let f=l.source.input.map;this.previousMaps.includes(f)||this.previousMaps.push(f)}});else{let l=new a(this.originalCSS,this.opts);l.map&&this.previousMaps.push(l.map)}return this.previousMaps}setSourcesContent(){let l={};if(this.root)this.root.walk(f=>{if(f.source){let m=f.source.input.from;if(m&&!l[m]){l[m]=!0;let p=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(p,f.source.input.css)}}});else if(this.css){let f=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(f,this.css)}}sourcePath(l){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(l.source.input.from):this.toUrl(this.path(l.source.input.from))}toBase64(l){return Buffer?Buffer.from(l).toString("base64"):window.btoa(unescape(encodeURIComponent(l)))}toFileUrl(l){let f=this.memoizedFileURLs.get(l);if(f)return f;if(n){let m=n(l).toString();return this.memoizedFileURLs.set(l,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(l){let f=this.memoizedURLs.get(l);if(f)return f;u==="\\"&&(l=l.replace(/\\/g,"/"));let m=encodeURI(l).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(l,m),m}}return Bt=s,Bt}var $t,xi;function Qe(){if(xi)return $t;xi=1;let e=Ye();class t extends e{constructor(o){super(o),this.type="comment"}}return $t=t,t.default=t,$t}var zt,Ei;function de(){if(Ei)return zt;Ei=1;let{isClean:e,my:t}=vr(),i=Je(),o=Qe(),r=Ye(),u,n,a,h;function c(l){return l.map(f=>(f.nodes&&(f.nodes=c(f.nodes)),delete f.source,f))}function s(l){if(l[e]=!1,l.proxyOf.nodes)for(let f of l.proxyOf.nodes)s(f)}class d extends r{append(...f){for(let m of f){let p=this.normalize(m,this.last);for(let y of p)this.proxyOf.nodes.push(y)}return this.markDirty(),this}cleanRaws(f){if(super.cleanRaws(f),this.nodes)for(let m of this.nodes)m.cleanRaws(f)}each(f){if(!this.proxyOf.nodes)return;let m=this.getIterator(),p,y;for(;this.indexes[m]<this.proxyOf.nodes.length&&(p=this.indexes[m],y=f(this.proxyOf.nodes[p],p),y!==!1);)this.indexes[m]+=1;return delete this.indexes[m],y}every(f){return this.nodes.every(f)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let f=this.lastEach;return this.indexes[f]=0,f}getProxyProcessor(){return{get(f,m){return m==="proxyOf"?f:f[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...p)=>f[m](...p.map(y=>typeof y=="function"?(S,b)=>y(S.toProxy(),b):y)):m==="every"||m==="some"?p=>f[m]((y,...S)=>p(y.toProxy(),...S)):m==="root"?()=>f.root().toProxy():m==="nodes"?f.nodes.map(p=>p.toProxy()):m==="first"||m==="last"?f[m].toProxy():f[m]:f[m]},set(f,m,p){return f[m]===p||(f[m]=p,(m==="name"||m==="params"||m==="selector")&&f.markDirty()),!0}}}index(f){return typeof f=="number"?f:(f.proxyOf&&(f=f.proxyOf),this.proxyOf.nodes.indexOf(f))}insertAfter(f,m){let p=this.index(f),y=this.normalize(m,this.proxyOf.nodes[p]).reverse();p=this.index(f);for(let b of y)this.proxyOf.nodes.splice(p+1,0,b);let S;for(let b in this.indexes)S=this.indexes[b],p<S&&(this.indexes[b]=S+y.length);return this.markDirty(),this}insertBefore(f,m){let p=this.index(f),y=p===0?"prepend":!1,S=this.normalize(m,this.proxyOf.nodes[p],y).reverse();p=this.index(f);for(let v of S)this.proxyOf.nodes.splice(p,0,v);let b;for(let v in this.indexes)b=this.indexes[v],p<=b&&(this.indexes[v]=b+S.length);return this.markDirty(),this}normalize(f,m){if(typeof f=="string")f=c(u(f).nodes);else if(typeof f>"u")f=[];else if(Array.isArray(f)){f=f.slice(0);for(let y of f)y.parent&&y.parent.removeChild(y,"ignore")}else if(f.type==="root"&&this.type!=="document"){f=f.nodes.slice(0);for(let y of f)y.parent&&y.parent.removeChild(y,"ignore")}else if(f.type)f=[f];else if(f.prop){if(typeof f.value>"u")throw new Error("Value field is missed in node creation");typeof f.value!="string"&&(f.value=String(f.value)),f=[new i(f)]}else if(f.selector)f=[new n(f)];else if(f.name)f=[new a(f)];else if(f.text)f=[new o(f)];else throw new Error("Unknown node type in node creation");return f.map(y=>(y[t]||d.rebuild(y),y=y.proxyOf,y.parent&&y.parent.removeChild(y),y[e]&&s(y),typeof y.raws.before>"u"&&m&&typeof m.raws.before<"u"&&(y.raws.before=m.raws.before.replace(/\S/g,"")),y.parent=this.proxyOf,y))}prepend(...f){f=f.reverse();for(let m of f){let p=this.normalize(m,this.first,"prepend").reverse();for(let y of p)this.proxyOf.nodes.unshift(y);for(let y in this.indexes)this.indexes[y]=this.indexes[y]+p.length}return this.markDirty(),this}push(f){return f.parent=this,this.proxyOf.nodes.push(f),this}removeAll(){for(let f of this.proxyOf.nodes)f.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(f){f=this.index(f),this.proxyOf.nodes[f].parent=void 0,this.proxyOf.nodes.splice(f,1);let m;for(let p in this.indexes)m=this.indexes[p],m>=f&&(this.indexes[p]=m-1);return this.markDirty(),this}replaceValues(f,m,p){return p||(p=m,m={}),this.walkDecls(y=>{m.props&&!m.props.includes(y.prop)||m.fast&&!y.value.includes(m.fast)||(y.value=y.value.replace(f,p))}),this.markDirty(),this}some(f){return this.nodes.some(f)}walk(f){return this.each((m,p)=>{let y;try{y=f(m,p)}catch(S){throw m.addToError(S)}return y!==!1&&m.walk&&(y=m.walk(f)),y})}walkAtRules(f,m){return m?f instanceof RegExp?this.walk((p,y)=>{if(p.type==="atrule"&&f.test(p.name))return m(p,y)}):this.walk((p,y)=>{if(p.type==="atrule"&&p.name===f)return m(p,y)}):(m=f,this.walk((p,y)=>{if(p.type==="atrule")return m(p,y)}))}walkComments(f){return this.walk((m,p)=>{if(m.type==="comment")return f(m,p)})}walkDecls(f,m){return m?f instanceof RegExp?this.walk((p,y)=>{if(p.type==="decl"&&f.test(p.prop))return m(p,y)}):this.walk((p,y)=>{if(p.type==="decl"&&p.prop===f)return m(p,y)}):(m=f,this.walk((p,y)=>{if(p.type==="decl")return m(p,y)}))}walkRules(f,m){return m?f instanceof RegExp?this.walk((p,y)=>{if(p.type==="rule"&&f.test(p.selector))return m(p,y)}):this.walk((p,y)=>{if(p.type==="rule"&&p.selector===f)return m(p,y)}):(m=f,this.walk((p,y)=>{if(p.type==="rule")return m(p,y)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=l=>{u=l},d.registerRule=l=>{n=l},d.registerAtRule=l=>{a=l},d.registerRoot=l=>{h=l},zt=d,d.default=d,d.rebuild=l=>{l.type==="atrule"?Object.setPrototypeOf(l,a.prototype):l.type==="rule"?Object.setPrototypeOf(l,n.prototype):l.type==="decl"?Object.setPrototypeOf(l,i.prototype):l.type==="comment"?Object.setPrototypeOf(l,o.prototype):l.type==="root"&&Object.setPrototypeOf(l,h.prototype),l[t]=!0,l.nodes&&l.nodes.forEach(f=>{d.rebuild(f)})},zt}var Wt,Ci;function br(){if(Ci)return Wt;Ci=1;let e=de(),t,i;class o extends e{constructor(u){super({type:"document",...u}),this.nodes||(this.nodes=[])}toResult(u={}){return new t(new i,this,u).stringify()}}return o.registerLazyResult=r=>{t=r},o.registerProcessor=r=>{i=r},Wt=o,o.default=o,Wt}var jt,Ri;function ps(){if(Ri)return jt;Ri=1;class e{constructor(i,o={}){if(this.type="warning",this.text=i,o.node&&o.node.source){let r=o.node.rangeBy(o);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in o)this[r]=o[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return jt=e,e.default=e,jt}var qt,Mi;function Sr(){if(Mi)return qt;Mi=1;let e=ps();class t{constructor(o,r,u){this.processor=o,this.messages=[],this.root=r,this.opts=u,this.css=void 0,this.map=void 0}toString(){return this.css}warn(o,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let u=new e(o,r);return this.messages.push(u),u}warnings(){return this.messages.filter(o=>o.type==="warning")}get content(){return this.css}}return qt=t,t.default=t,qt}var Vt,Ni;function In(){if(Ni)return Vt;Ni=1;const e=39,t=34,i=92,o=47,r=10,u=32,n=12,a=9,h=13,c=91,s=93,d=40,l=41,f=123,m=125,p=59,y=42,S=58,b=64,v=/[\t\n\f\r "#'()/;[\\\]{}]/g,g=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,w=/.[\r\n"'(/\\]/,x=/[\da-f]/i;return Vt=function(N,D={}){let R=N.css.valueOf(),q=D.ignoreErrors,T,C,le,te,J,P,V,se,W,L,ve=R.length,M=0,ue=[],re=[];function et(){return M}function ce(G){throw N.error("Unclosed "+G,M)}function tt(){return re.length===0&&M>=ve}function rt(G){if(re.length)return re.pop();if(M>=ve)return;let he=G?G.ignoreUnclosed:!1;switch(T=R.charCodeAt(M),T){case r:case u:case a:case h:case n:{C=M;do C+=1,T=R.charCodeAt(C);while(T===u||T===r||T===a||T===h||T===n);L=["space",R.slice(M,C)],M=C-1;break}case c:case s:case f:case m:case S:case p:case l:{let be=String.fromCharCode(T);L=[be,be,M];break}case d:{if(se=ue.length?ue.pop()[1]:"",W=R.charCodeAt(M+1),se==="url"&&W!==e&&W!==t&&W!==u&&W!==r&&W!==a&&W!==n&&W!==h){C=M;do{if(P=!1,C=R.indexOf(")",C+1),C===-1)if(q||he){C=M;break}else ce("bracket");for(V=C;R.charCodeAt(V-1)===i;)V-=1,P=!P}while(P);L=["brackets",R.slice(M,C+1),M,C],M=C}else C=R.indexOf(")",M+1),te=R.slice(M,C+1),C===-1||w.test(te)?L=["(","(",M]:(L=["brackets",te,M,C],M=C);break}case e:case t:{le=T===e?"'":'"',C=M;do{if(P=!1,C=R.indexOf(le,C+1),C===-1)if(q||he){C=M+1;break}else ce("string");for(V=C;R.charCodeAt(V-1)===i;)V-=1,P=!P}while(P);L=["string",R.slice(M,C+1),M,C],M=C;break}case b:{v.lastIndex=M+1,v.test(R),v.lastIndex===0?C=R.length-1:C=v.lastIndex-2,L=["at-word",R.slice(M,C+1),M,C],M=C;break}case i:{for(C=M,J=!0;R.charCodeAt(C+1)===i;)C+=1,J=!J;if(T=R.charCodeAt(C+1),J&&T!==o&&T!==u&&T!==r&&T!==a&&T!==h&&T!==n&&(C+=1,x.test(R.charAt(C)))){for(;x.test(R.charAt(C+1));)C+=1;R.charCodeAt(C+1)===u&&(C+=1)}L=["word",R.slice(M,C+1),M,C],M=C;break}default:{T===o&&R.charCodeAt(M+1)===y?(C=R.indexOf("*/",M+2)+1,C===0&&(q||he?C=R.length:ce("comment")),L=["comment",R.slice(M,C+1),M,C],M=C):(g.lastIndex=M+1,g.test(R),g.lastIndex===0?C=R.length-1:C=g.lastIndex-2,L=["word",R.slice(M,C+1),M,C],ue.push(L),M=C);break}}return M++,L}function it(G){re.push(G)}return{back:it,endOfFile:tt,nextToken:rt,position:et}},Vt}var Gt,Ai;function xr(){if(Ai)return Gt;Ai=1;let e=de();class t extends e{constructor(o){super(o),this.type="atrule"}append(...o){return this.proxyOf.nodes||(this.nodes=[]),super.append(...o)}prepend(...o){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...o)}}return Gt=t,t.default=t,e.registerAtRule(t),Gt}var Ht,Di;function Me(){if(Di)return Ht;Di=1;let e=de(),t,i;class o extends e{constructor(u){super(u),this.type="root",this.nodes||(this.nodes=[])}normalize(u,n,a){let h=super.normalize(u);if(n){if(a==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let c of h)c.raws.before=n.raws.before}return h}removeChild(u,n){let a=this.index(u);return!n&&a===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[a].raws.before),super.removeChild(u)}toResult(u={}){return new t(new i,this,u).stringify()}}return o.registerLazyResult=r=>{t=r},o.registerProcessor=r=>{i=r},Ht=o,o.default=o,e.registerRoot(o),Ht}var Yt,Oi;function ms(){if(Oi)return Yt;Oi=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let i=[" ",`
50
+ `," "];return e.split(t,i)},split(t,i,o){let r=[],u="",n=!1,a=0,h=!1,c="",s=!1;for(let d of t)s?s=!1:d==="\\"?s=!0:h?d===c&&(h=!1):d==='"'||d==="'"?(h=!0,c=d):d==="("?a+=1:d===")"?a>0&&(a-=1):a===0&&i.includes(d)&&(n=!0),n?(u!==""&&r.push(u.trim()),u="",n=!1):u+=d;return(o||u!=="")&&r.push(u.trim()),r}};return Yt=e,e.default=e,Yt}var Jt,Ti;function Er(){if(Ti)return Jt;Ti=1;let e=de(),t=ms();class i extends e{constructor(r){super(r),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(r){let u=this.selector?this.selector.match(/,\s*/):null,n=u?u[0]:","+this.raw("between","beforeOpen");this.selector=r.join(n)}}return Jt=i,i.default=i,e.registerRule(i),Jt}var Xt,_i;function kn(){if(_i)return Xt;_i=1;let e=Je(),t=In(),i=Qe(),o=xr(),r=Me(),u=Er();const n={empty:!0,space:!0};function a(c){for(let s=c.length-1;s>=0;s--){let d=c[s],l=d[3]||d[2];if(l)return l}}class h{constructor(s){this.input=s,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:s,start:{column:1,line:1,offset:0}}}atrule(s){let d=new o;d.name=s[1].slice(1),d.name===""&&this.unnamedAtrule(d,s),this.init(d,s[2]);let l,f,m,p=!1,y=!1,S=[],b=[];for(;!this.tokenizer.endOfFile();){if(s=this.tokenizer.nextToken(),l=s[0],l==="("||l==="["?b.push(l==="("?")":"]"):l==="{"&&b.length>0?b.push("}"):l===b[b.length-1]&&b.pop(),b.length===0)if(l===";"){d.source.end=this.getPosition(s[2]),d.source.end.offset++,this.semicolon=!0;break}else if(l==="{"){y=!0;break}else if(l==="}"){if(S.length>0){for(m=S.length-1,f=S[m];f&&f[0]==="space";)f=S[--m];f&&(d.source.end=this.getPosition(f[3]||f[2]),d.source.end.offset++)}this.end(s);break}else S.push(s);else S.push(s);if(this.tokenizer.endOfFile()){p=!0;break}}d.raws.between=this.spacesAndCommentsFromEnd(S),S.length?(d.raws.afterName=this.spacesAndCommentsFromStart(S),this.raw(d,"params",S),p&&(s=S[S.length-1],d.source.end=this.getPosition(s[3]||s[2]),d.source.end.offset++,this.spaces=d.raws.between,d.raws.between="")):(d.raws.afterName="",d.params=""),y&&(d.nodes=[],this.current=d)}checkMissedSemicolon(s){let d=this.colon(s);if(d===!1)return;let l=0,f;for(let m=d-1;m>=0&&(f=s[m],!(f[0]!=="space"&&(l+=1,l===2)));m--);throw this.input.error("Missed semicolon",f[0]==="word"?f[3]+1:f[2])}colon(s){let d=0,l,f,m;for(let[p,y]of s.entries()){if(l=y,f=l[0],f==="("&&(d+=1),f===")"&&(d-=1),d===0&&f===":")if(!m)this.doubleColon(l);else{if(m[0]==="word"&&m[1]==="progid")continue;return p}m=l}return!1}comment(s){let d=new i;this.init(d,s[2]),d.source.end=this.getPosition(s[3]||s[2]),d.source.end.offset++;let l=s[1].slice(2,-2);if(/^\s*$/.test(l))d.text="",d.raws.left=l,d.raws.right="";else{let f=l.match(/^(\s*)([^]*\S)(\s*)$/);d.text=f[2],d.raws.left=f[1],d.raws.right=f[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(s,d){let l=new e;this.init(l,s[0][2]);let f=s[s.length-1];for(f[0]===";"&&(this.semicolon=!0,s.pop()),l.source.end=this.getPosition(f[3]||f[2]||a(s)),l.source.end.offset++;s[0][0]!=="word";)s.length===1&&this.unknownWord(s),l.raws.before+=s.shift()[1];for(l.source.start=this.getPosition(s[0][2]),l.prop="";s.length;){let b=s[0][0];if(b===":"||b==="space"||b==="comment")break;l.prop+=s.shift()[1]}l.raws.between="";let m;for(;s.length;)if(m=s.shift(),m[0]===":"){l.raws.between+=m[1];break}else m[0]==="word"&&/\w/.test(m[1])&&this.unknownWord([m]),l.raws.between+=m[1];(l.prop[0]==="_"||l.prop[0]==="*")&&(l.raws.before+=l.prop[0],l.prop=l.prop.slice(1));let p=[],y;for(;s.length&&(y=s[0][0],!(y!=="space"&&y!=="comment"));)p.push(s.shift());this.precheckMissedSemicolon(s);for(let b=s.length-1;b>=0;b--){if(m=s[b],m[1].toLowerCase()==="!important"){l.important=!0;let v=this.stringFrom(s,b);v=this.spacesFromEnd(s)+v,v!==" !important"&&(l.raws.important=v);break}else if(m[1].toLowerCase()==="important"){let v=s.slice(0),g="";for(let w=b;w>0;w--){let x=v[w][0];if(g.trim().indexOf("!")===0&&x!=="space")break;g=v.pop()[1]+g}g.trim().indexOf("!")===0&&(l.important=!0,l.raws.important=g,s=v)}if(m[0]!=="space"&&m[0]!=="comment")break}s.some(b=>b[0]!=="space"&&b[0]!=="comment")&&(l.raws.between+=p.map(b=>b[1]).join(""),p=[]),this.raw(l,"value",p.concat(s),d),l.value.includes(":")&&!d&&this.checkMissedSemicolon(s)}doubleColon(s){throw this.input.error("Double colon",{offset:s[2]},{offset:s[2]+s[1].length})}emptyRule(s){let d=new u;this.init(d,s[2]),d.selector="",d.raws.between="",this.current=d}end(s){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(s[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(s)}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(s){if(this.spaces+=s[1],this.current.nodes){let d=this.current.nodes[this.current.nodes.length-1];d&&d.type==="rule"&&!d.raws.ownSemicolon&&(d.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(s){let d=this.input.fromOffset(s);return{column:d.col,line:d.line,offset:s}}init(s,d){this.current.push(s),s.source={input:this.input,start:this.getPosition(d)},s.raws.before=this.spaces,this.spaces="",s.type!=="comment"&&(this.semicolon=!1)}other(s){let d=!1,l=null,f=!1,m=null,p=[],y=s[1].startsWith("--"),S=[],b=s;for(;b;){if(l=b[0],S.push(b),l==="("||l==="[")m||(m=b),p.push(l==="("?")":"]");else if(y&&f&&l==="{")m||(m=b),p.push("}");else if(p.length===0)if(l===";")if(f){this.decl(S,y);return}else break;else if(l==="{"){this.rule(S);return}else if(l==="}"){this.tokenizer.back(S.pop()),d=!0;break}else l===":"&&(f=!0);else l===p[p.length-1]&&(p.pop(),p.length===0&&(m=null));b=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(d=!0),p.length>0&&this.unclosedBracket(m),d&&f){if(!y)for(;S.length&&(b=S[S.length-1][0],!(b!=="space"&&b!=="comment"));)this.tokenizer.back(S.pop());this.decl(S,y)}else this.unknownWord(S)}parse(){let s;for(;!this.tokenizer.endOfFile();)switch(s=this.tokenizer.nextToken(),s[0]){case"space":this.spaces+=s[1];break;case";":this.freeSemicolon(s);break;case"}":this.end(s);break;case"comment":this.comment(s);break;case"at-word":this.atrule(s);break;case"{":this.emptyRule(s);break;default:this.other(s);break}this.endFile()}precheckMissedSemicolon(){}raw(s,d,l,f){let m,p,y=l.length,S="",b=!0,v,g;for(let w=0;w<y;w+=1)m=l[w],p=m[0],p==="space"&&w===y-1&&!f?b=!1:p==="comment"?(g=l[w-1]?l[w-1][0]:"empty",v=l[w+1]?l[w+1][0]:"empty",!n[g]&&!n[v]?S.slice(-1)===","?b=!1:S+=m[1]:b=!1):S+=m[1];if(!b){let w=l.reduce((x,E)=>x+E[1],"");s.raws[d]={raw:w,value:S}}s[d]=S}rule(s){s.pop();let d=new u;this.init(d,s[0][2]),d.raws.between=this.spacesAndCommentsFromEnd(s),this.raw(d,"selector",s),this.current=d}spacesAndCommentsFromEnd(s){let d,l="";for(;s.length&&(d=s[s.length-1][0],!(d!=="space"&&d!=="comment"));)l=s.pop()[1]+l;return l}spacesAndCommentsFromStart(s){let d,l="";for(;s.length&&(d=s[0][0],!(d!=="space"&&d!=="comment"));)l+=s.shift()[1];return l}spacesFromEnd(s){let d,l="";for(;s.length&&(d=s[s.length-1][0],d==="space");)l=s.pop()[1]+l;return l}stringFrom(s,d){let l="";for(let f=d;f<s.length;f++)l+=s[f][1];return s.splice(d,s.length-d),l}unclosedBlock(){let s=this.current.source.start;throw this.input.error("Unclosed block",s.line,s.column)}unclosedBracket(s){throw this.input.error("Unclosed bracket",{offset:s[2]},{offset:s[2]+1})}unexpectedClose(s){throw this.input.error("Unexpected }",{offset:s[2]},{offset:s[2]+1})}unknownWord(s){throw this.input.error("Unknown word",{offset:s[0][2]},{offset:s[0][2]+s[0][1].length})}unnamedAtrule(s,d){throw this.input.error("At-rule without name",{offset:d[2]},{offset:d[2]+d[1].length})}}return Xt=h,Xt}var Qt,Pi;function Cr(){if(Pi)return Qt;Pi=1;let e=de(),t=kn(),i=Xe();function o(r,u){let n=new i(r,u),a=new t(n);try{a.parse()}catch(h){throw h}return a.root}return Qt=o,o.default=o,e.registerParse(o),Qt}var Kt,Ii;function gs(){if(Ii)return Kt;Ii=1;let{isClean:e,my:t}=vr(),i=ds(),o=He(),r=de(),u=br(),n=Sr(),a=Cr(),h=Me();const c={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},s={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},d={Once:!0,postcssPlugin:!0,prepare:!0},l=0;function f(v){return typeof v=="object"&&typeof v.then=="function"}function m(v){let g=!1,w=c[v.type];return v.type==="decl"?g=v.prop.toLowerCase():v.type==="atrule"&&(g=v.name.toLowerCase()),g&&v.append?[w,w+"-"+g,l,w+"Exit",w+"Exit-"+g]:g?[w,w+"-"+g,w+"Exit",w+"Exit-"+g]:v.append?[w,l,w+"Exit"]:[w,w+"Exit"]}function p(v){let g;return v.type==="document"?g=["Document",l,"DocumentExit"]:v.type==="root"?g=["Root",l,"RootExit"]:g=m(v),{eventIndex:0,events:g,iterator:0,node:v,visitorIndex:0,visitors:[]}}function y(v){return v[e]=!1,v.nodes&&v.nodes.forEach(g=>y(g)),v}let S={};class b{constructor(g,w,x){this.stringified=!1,this.processed=!1;let E;if(typeof w=="object"&&w!==null&&(w.type==="root"||w.type==="document"))E=y(w);else if(w instanceof b||w instanceof n)E=y(w.root),w.map&&(typeof x.map>"u"&&(x.map={}),x.map.inline||(x.map.inline=!1),x.map.prev=w.map);else{let N=a;x.syntax&&(N=x.syntax.parse),x.parser&&(N=x.parser),N.parse&&(N=N.parse);try{E=N(w,x)}catch(D){this.processed=!0,this.error=D}E&&!E[t]&&r.rebuild(E)}this.result=new n(g,E,x),this.helpers={...S,postcss:S,result:this.result},this.plugins=this.processor.plugins.map(N=>typeof N=="object"&&N.prepare?{...N,...N.prepare(this.result)}:N)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(g){return this.async().catch(g)}finally(g){return this.async().then(g,g)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(g,w){let x=this.result.lastPlugin;try{w&&w.addToError(g),this.error=g,g.name==="CssSyntaxError"&&!g.plugin?(g.plugin=x.postcssPlugin,g.setMessage()):x.postcssVersion}catch(E){console&&console.error&&console.error(E)}return g}prepareVisitors(){this.listeners={};let g=(w,x,E)=>{this.listeners[x]||(this.listeners[x]=[]),this.listeners[x].push([w,E])};for(let w of this.plugins)if(typeof w=="object")for(let x in w){if(!s[x]&&/^[A-Z]/.test(x))throw new Error(`Unknown event ${x} in ${w.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[x])if(typeof w[x]=="object")for(let E in w[x])E==="*"?g(w,x,w[x][E]):g(w,x+"-"+E.toLowerCase(),w[x][E]);else typeof w[x]=="function"&&g(w,x,w[x])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let g=0;g<this.plugins.length;g++){let w=this.plugins[g],x=this.runOnRoot(w);if(f(x))try{await x}catch(E){throw this.handleError(E)}}if(this.prepareVisitors(),this.hasListener){let g=this.result.root;for(;!g[e];){g[e]=!0;let w=[p(g)];for(;w.length>0;){let x=this.visitTick(w);if(f(x))try{await x}catch(E){let N=w[w.length-1].node;throw this.handleError(E,N)}}}if(this.listeners.OnceExit)for(let[w,x]of this.listeners.OnceExit){this.result.lastPlugin=w;try{if(g.type==="document"){let E=g.nodes.map(N=>x(N,this.helpers));await Promise.all(E)}else await x(g,this.helpers)}catch(E){throw this.handleError(E)}}}return this.processed=!0,this.stringify()}runOnRoot(g){this.result.lastPlugin=g;try{if(typeof g=="object"&&g.Once){if(this.result.root.type==="document"){let w=this.result.root.nodes.map(x=>g.Once(x,this.helpers));return f(w[0])?Promise.all(w):w}return g.Once(this.result.root,this.helpers)}else if(typeof g=="function")return g(this.result.root,this.result)}catch(w){throw this.handleError(w)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let g=this.result.opts,w=o;g.syntax&&(w=g.syntax.stringify),g.stringifier&&(w=g.stringifier),w.stringify&&(w=w.stringify);let E=new i(w,this.result.root,this.result.opts).generate();return this.result.css=E[0],this.result.map=E[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 g of this.plugins){let w=this.runOnRoot(g);if(f(w))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let g=this.result.root;for(;!g[e];)g[e]=!0,this.walkSync(g);if(this.listeners.OnceExit)if(g.type==="document")for(let w of g.nodes)this.visitSync(this.listeners.OnceExit,w);else this.visitSync(this.listeners.OnceExit,g)}return this.result}then(g,w){return this.async().then(g,w)}toString(){return this.css}visitSync(g,w){for(let[x,E]of g){this.result.lastPlugin=x;let N;try{N=E(w,this.helpers)}catch(D){throw this.handleError(D,w.proxyOf)}if(w.type!=="root"&&w.type!=="document"&&!w.parent)return!0;if(f(N))throw this.getAsyncError()}}visitTick(g){let w=g[g.length-1],{node:x,visitors:E}=w;if(x.type!=="root"&&x.type!=="document"&&!x.parent){g.pop();return}if(E.length>0&&w.visitorIndex<E.length){let[D,R]=E[w.visitorIndex];w.visitorIndex+=1,w.visitorIndex===E.length&&(w.visitors=[],w.visitorIndex=0),this.result.lastPlugin=D;try{return R(x.toProxy(),this.helpers)}catch(q){throw this.handleError(q,x)}}if(w.iterator!==0){let D=w.iterator,R;for(;R=x.nodes[x.indexes[D]];)if(x.indexes[D]+=1,!R[e]){R[e]=!0,g.push(p(R));return}w.iterator=0,delete x.indexes[D]}let N=w.events;for(;w.eventIndex<N.length;){let D=N[w.eventIndex];if(w.eventIndex+=1,D===l){x.nodes&&x.nodes.length&&(x[e]=!0,w.iterator=x.getIterator());return}else if(this.listeners[D]){w.visitors=this.listeners[D];return}}g.pop()}walkSync(g){g[e]=!0;let w=m(g);for(let x of w)if(x===l)g.nodes&&g.each(E=>{E[e]||this.walkSync(E)});else{let E=this.listeners[x];if(E&&this.visitSync(E,g.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return b.registerPostcss=v=>{S=v},Kt=b,b.default=b,h.registerLazyResult(b),u.registerLazyResult(b),Kt}var Zt,ki;function Ln(){if(ki)return Zt;ki=1;let e=ds(),t=He(),i=Cr();const o=Sr();class r{constructor(n,a,h){a=a.toString(),this.stringified=!1,this._processor=n,this._css=a,this._opts=h,this._map=void 0;let c,s=t;this.result=new o(this._processor,c,this._opts),this.result.css=a;let d=this;Object.defineProperty(this.result,"root",{get(){return d.root}});let l=new e(s,c,this._opts,a);if(l.isMap()){let[f,m]=l.generate();f&&(this.result.css=f),m&&(this.result.map=m)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(n){return this.async().catch(n)}finally(n){return this.async().then(n,n)}sync(){if(this.error)throw this.error;return this.result}then(n,a){return this.async().then(n,a)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let n,a=i;try{n=a(this._css,this._opts)}catch(h){this.error=h}if(this.error)throw this.error;return this._root=n,n}get[Symbol.toStringTag](){return"NoWorkResult"}}return Zt=r,r.default=r,Zt}var er,Li;function Fn(){if(Li)return er;Li=1;let e=Ln(),t=gs(),i=br(),o=Me();class r{constructor(n=[]){this.version="8.4.38",this.plugins=this.normalize(n)}normalize(n){let a=[];for(let h of n)if(h.postcss===!0?h=h():h.postcss&&(h=h.postcss),typeof h=="object"&&Array.isArray(h.plugins))a=a.concat(h.plugins);else if(typeof h=="object"&&h.postcssPlugin)a.push(h);else if(typeof h=="function")a.push(h);else if(!(typeof h=="object"&&(h.parse||h.stringify)))throw new Error(h+" is not a PostCSS plugin");return a}process(n,a={}){return!this.plugins.length&&!a.parser&&!a.stringifier&&!a.syntax?new e(this,n,a):new t(this,n,a)}use(n){return this.plugins=this.plugins.concat(this.normalize([n])),this}}return er=r,r.default=r,o.registerProcessor(r),i.registerProcessor(r),er}var tr,Fi;function Un(){if(Fi)return tr;Fi=1;let e=Je(),t=fs(),i=Qe(),o=xr(),r=Xe(),u=Me(),n=Er();function a(h,c){if(Array.isArray(h))return h.map(l=>a(l));let{inputs:s,...d}=h;if(s){c=[];for(let l of s){let f={...l,__proto__:r.prototype};f.map&&(f.map={...f.map,__proto__:t.prototype}),c.push(f)}}if(d.nodes&&(d.nodes=h.nodes.map(l=>a(l,c))),d.source){let{inputId:l,...f}=d.source;d.source=f,l!=null&&(d.source.input=c[l])}if(d.type==="root")return new u(d);if(d.type==="decl")return new e(d);if(d.type==="rule")return new n(d);if(d.type==="comment")return new i(d);if(d.type==="atrule")return new o(d);throw new Error("Unknown node type: "+h.type)}return tr=a,a.default=a,tr}var rr,Ui;function Bn(){if(Ui)return rr;Ui=1;let e=wr(),t=Je(),i=gs(),o=de(),r=Fn(),u=He(),n=Un(),a=br(),h=ps(),c=Qe(),s=xr(),d=Sr(),l=Xe(),f=Cr(),m=ms(),p=Er(),y=Me(),S=Ye();function b(...v){return v.length===1&&Array.isArray(v[0])&&(v=v[0]),new r(v)}return b.plugin=function(g,w){let x=!1;function E(...D){console&&console.warn&&!x&&(x=!0,console.warn(g+`: postcss.plugin was deprecated. Migration guide:
51
+ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),Le.LANG&&Le.LANG.startsWith("cn")&&console.warn(g+`: 里面 postcss.plugin 被弃用. 迁移指南:
52
+ https://www.w3ctech.com/topic/2226`));let R=w(...D);return R.postcssPlugin=g,R.postcssVersion=new r().version,R}let N;return Object.defineProperty(E,"postcss",{get(){return N||(N=E()),N}}),E.process=function(D,R,q){return b([E(q)]).process(D,R)},E},b.stringify=u,b.parse=f,b.fromJSON=n,b.list=m,b.comment=v=>new c(v),b.atRule=v=>new s(v),b.decl=v=>new t(v),b.rule=v=>new p(v),b.root=v=>new y(v),b.document=v=>new a(v),b.CssSyntaxError=e,b.Declaration=t,b.Container=o,b.Processor=r,b.Document=a,b.Comment=c,b.Warning=h,b.AtRule=s,b.Result=d,b.Input=l,b.Rule=p,b.Root=y,b.Node=S,i.registerPostcss(b),rr=b,b.default=b,rr}var $n=Bn();const U=An($n);U.stringify;U.fromJSON;U.plugin;U.parse;U.list;U.document;U.comment;U.atRule;U.rule;U.decl;U.root;U.CssSyntaxError;U.Declaration;U.Container;U.Processor;U.Document;U.Comment;U.Warning;U.AtRule;U.Result;U.Input;U.Rule;U.Root;U.Node;var _=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(_||{});function zn(e){const t={},i=/;(?![^(]*\))/g,o=/:(.+)/,r=/\/\*.*?\*\//g;return e.replace(r,"").split(i).forEach(function(u){if(u){const n=u.split(o);n.length>1&&(t[lr(n[0].trim())]=n[1].trim())}}),t}function Bi(e){const t=[];for(const i in e){const o=e[i];if(typeof o!="string")continue;const r=Vn(i);t.push(`${r}: ${o};`)}return t.join(" ")}const Wn=/-([a-z])/g,jn=/^--[a-zA-Z0-9-]+$/,lr=e=>jn.test(e)?e:e.replace(Wn,(t,i)=>i?i.toUpperCase():""),qn=/\B([A-Z])/g,Vn=e=>e.replace(qn,"-$1").toLowerCase();class Z{constructor(...t){A(this,"parentElement",null),A(this,"parentNode",null),A(this,"ownerDocument"),A(this,"firstChild",null),A(this,"lastChild",null),A(this,"previousSibling",null),A(this,"nextSibling",null),A(this,"ELEMENT_NODE",1),A(this,"TEXT_NODE",3),A(this,"nodeType"),A(this,"nodeName"),A(this,"RRNodeType")}get childNodes(){const t=[];let i=this.firstChild;for(;i;)t.push(i),i=i.nextSibling;return t}contains(t){if(t instanceof Z){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,i){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}class Rr extends Z{constructor(...t){super(t),A(this,"nodeType",9),A(this,"nodeName","#document"),A(this,"compatMode","CSS1Compat"),A(this,"RRNodeType",_.Document),A(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(t=>t.RRNodeType===_.Element&&t.tagName==="HTML")||null}get body(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(i=>i.RRNodeType===_.Element&&i.tagName==="BODY"))||null}get head(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(i=>i.RRNodeType===_.Element&&i.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(t){const i=t.RRNodeType;if((i===_.Element||i===_.DocumentType)&&this.childNodes.some(r=>r.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${i===_.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const o=Mr(this,t);return o.parentElement=null,o}insertBefore(t,i){const o=t.RRNodeType;if((o===_.Element||o===_.DocumentType)&&this.childNodes.some(u=>u.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===_.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const r=Ss(this,t,i);return r.parentElement=null,r}removeChild(t){return xs(this,t)}open(){this.firstChild=null,this.lastChild=null}close(){}write(t){let i;if(t==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?i="-//W3C//DTD XHTML 1.0 Transitional//EN":t==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(i="-//W3C//DTD HTML 4.0 Transitional//EN"),i){const o=this.createDocumentType("html",i,"");this.open(),this.appendChild(o)}}createDocument(t,i,o){return new Rr}createDocumentType(t,i,o){const r=new ys(t,i,o);return r.ownerDocument=this,r}createElement(t){const i=new Ke(t);return i.ownerDocument=this,i}createElementNS(t,i){return this.createElement(i)}createTextNode(t){const i=new ws(t);return i.ownerDocument=this,i}createComment(t){const i=new vs(t);return i.ownerDocument=this,i}createCDATASection(t){const i=new bs(t);return i.ownerDocument=this,i}toString(){return"RRDocument"}}class ys extends Z{constructor(t,i,o){super(),A(this,"nodeType",10),A(this,"RRNodeType",_.DocumentType),A(this,"name"),A(this,"publicId"),A(this,"systemId"),A(this,"textContent",null),this.name=t,this.publicId=i,this.systemId=o,this.nodeName=t}toString(){return"RRDocumentType"}}class Ke extends Z{constructor(t){super(),A(this,"nodeType",1),A(this,"RRNodeType",_.Element),A(this,"tagName"),A(this,"attributes",{}),A(this,"shadowRoot",null),A(this,"scrollLeft"),A(this,"scrollTop"),this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(i=>t+=i.textContent),t}set textContent(t){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(t))}get classList(){return new Yn(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?zn(this.attributes.style):{},i=/\B([A-Z])/g;return t.setProperty=(o,r,u)=>{if(i.test(o))return;const n=lr(o);r?t[n]=r:delete t[n],u==="important"&&(t[n]+=" !important"),this.attributes.style=Bi(t)},t.removeProperty=o=>{if(i.test(o))return"";const r=lr(o),u=t[r]||"";return delete t[r],this.attributes.style=Bi(t),u},t}getAttribute(t){return this.attributes[t]===void 0?null:this.attributes[t]}setAttribute(t,i){this.attributes[t]=i}setAttributeNS(t,i,o){this.setAttribute(i,o)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return Mr(this,t)}insertBefore(t,i){return Ss(this,t,i)}removeChild(t){return xs(this,t)}attachShadow(t){const i=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=i,i}dispatchEvent(t){return!0}toString(){let t="";for(const i in this.attributes)t+=`${i}="${this.attributes[i]}" `;return`${this.tagName} ${t}`}}class Gn extends Ke{constructor(){super(...arguments),A(this,"currentTime"),A(this,"volume"),A(this,"paused"),A(this,"muted"),A(this,"playbackRate"),A(this,"loop")}attachShadow(t){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 Hn extends Ke{constructor(){super(...arguments),A(this,"tagName","DIALOG"),A(this,"nodeName","DIALOG")}get isModal(){return this.getAttribute("rr_open_mode")==="modal"}get open(){return this.getAttribute("open")!==null}close(){this.removeAttribute("open"),this.removeAttribute("rr_open_mode")}show(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","non-modal")}showModal(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","modal")}}class ws extends Z{constructor(t){super(),A(this,"nodeType",3),A(this,"nodeName","#text"),A(this,"RRNodeType",_.Text),A(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class vs extends Z{constructor(t){super(),A(this,"nodeType",8),A(this,"nodeName","#comment"),A(this,"RRNodeType",_.Comment),A(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class bs extends Z{constructor(t){super(),A(this,"nodeName","#cdata-section"),A(this,"nodeType",4),A(this,"RRNodeType",_.CDATA),A(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class Yn{constructor(t,i){if(A(this,"onChange"),A(this,"classes",[]),A(this,"add",(...o)=>{for(const r of o){const u=String(r);this.classes.indexOf(u)>=0||this.classes.push(u)}this.onChange&&this.onChange(this.classes.join(" "))}),A(this,"remove",(...o)=>{this.classes=this.classes.filter(r=>o.indexOf(r)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),t){const o=t.trim().split(/\s+/);this.classes.push(...o)}this.onChange=i}}function Mr(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function Ss(e,t,i){if(!i)return Mr(e,t);if(i.parentNode!==e)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return t===i||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=i.previousSibling,i.previousSibling=t,t.nextSibling=i,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function xs(e,t){if(t.parentNode!==e)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var H=(e=>(e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",e))(H||{});const ur={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Jn={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 ee=null;function Fe(e,t,i,o=t.mirror||t.ownerDocument.mirror){e=Xn(e,t,i,o),Es(e,t,i,o),Qn(e,t,i)}function Xn(e,t,i,o){var r;if(i.afterAppend&&!ee&&(ee=new WeakSet,setTimeout(()=>{ee=null},0)),!Nr(e,t)){const u=Ue(t,i.mirror,o);(r=e.parentNode)==null||r.replaceChild(u,e),e=u}switch(t.RRNodeType){case _.Document:{if(!pe(e,t,i.mirror,o)){const u=o.getMeta(t);u&&(i.mirror.removeNodeFromMap(e),e.close(),e.open(),i.mirror.add(e,u),ee?.add(e))}break}case _.Element:{const u=e,n=t;switch(n.tagName){case"IFRAME":{const a=e.contentDocument;if(!a)break;Fe(a,t.contentDocument,i,o);break}}n.shadowRoot&&(u.shadowRoot||u.attachShadow({mode:"open"}),Es(u.shadowRoot,n.shadowRoot,i,o)),Kn(u,n,o);break}}return e}function Qn(e,t,i){var o;switch(t.RRNodeType){case _.Document:{const r=t.scrollData;r&&i.applyScroll(r,!0);break}case _.Element:{const r=e,u=t;switch(u.scrollData&&i.applyScroll(u.scrollData,!0),u.inputData&&i.applyInput(u.inputData),u.tagName){case"AUDIO":case"VIDEO":{const n=e,a=u;a.paused!==void 0&&(a.paused?n.pause():n.play()),a.muted!==void 0&&(n.muted=a.muted),a.volume!==void 0&&(n.volume=a.volume),a.currentTime!==void 0&&(n.currentTime=a.currentTime),a.playbackRate!==void 0&&(n.playbackRate=a.playbackRate),a.loop!==void 0&&(n.loop=a.loop);break}case"CANVAS":{const n=t;if(n.rr_dataURL!==null){const a=document.createElement("img");a.onload=()=>{const h=r.getContext("2d");h&&h.drawImage(a,0,0,a.width,a.height)},a.src=n.rr_dataURL}n.canvasMutations.forEach(a=>i.applyCanvas(a.event,a.mutation,e));break}case"STYLE":{const n=r.sheet;n&&t.rules.forEach(a=>i.applyStyleSheetMutation(a,n));break}case"DIALOG":{const n=r,a=u,h=n.open,c=n.matches("dialog:modal"),s=a.open,d=a.isModal,l=c!==d,f=h!==s;if((l||h&&f)&&n.close(),s&&(f||l))try{d?n.showModal():n.show()}catch(m){console.warn(m)}break}}break}case _.Text:case _.Comment:case _.CDATA:{e.textContent!==t.data&&(e.textContent=t.data);break}}ee?.has(e)&&(ee.delete(e),(o=i.afterAppend)==null||o.call(i,e,i.mirror.getId(e)))}function Kn(e,t,i){const o=e.attributes,r=t.attributes;for(const u in r){const n=r[u],a=i.getMeta(t);if(a?.isSVG&&ur[u])e.setAttributeNS(ur[u],u,n);else if(t.tagName==="CANVAS"&&u==="rr_dataURL"){const h=document.createElement("img");h.src=n,h.onload=()=>{const c=e.getContext("2d");c&&c.drawImage(h,0,0,h.width,h.height)}}else{if(t.tagName==="IFRAME"&&u==="srcdoc")continue;try{e.setAttribute(u,n)}catch(h){console.warn(h)}}}for(const{name:u}of Array.from(o))u in r||e.removeAttribute(u);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Es(e,t,i,o){const r=Array.from(e.childNodes),u=t.childNodes;if(r.length===0&&u.length===0)return;let n=0,a=r.length-1,h=0,c=u.length-1,s=r[n],d=r[a],l=u[h],f=u[c],m,p;for(;n<=a&&h<=c;)if(s===void 0)s=r[++n];else if(d===void 0)d=r[--a];else if(pe(s,l,i.mirror,o))s=r[++n],l=u[++h];else if(pe(d,f,i.mirror,o))d=r[--a],f=u[--c];else if(pe(s,f,i.mirror,o)){try{e.insertBefore(s,d.nextSibling)}catch(b){console.warn(b)}s=r[++n],f=u[--c]}else if(pe(d,l,i.mirror,o)){try{e.insertBefore(d,s)}catch(b){console.warn(b)}d=r[--a],l=u[++h]}else{if(!m){m={};for(let v=n;v<=a;v++){const g=r[v];g&&i.mirror.hasNode(g)&&(m[i.mirror.getId(g)]=v)}}p=m[o.getId(l)];const b=r[p];if(p!==void 0&&b&&pe(b,l,i.mirror,o)){try{e.insertBefore(b,s)}catch(v){console.warn(v)}r[p]=void 0}else{const v=Ue(l,i.mirror,o);e.nodeName==="#document"&&s&&(v.nodeType===v.DOCUMENT_TYPE_NODE&&s.nodeType===s.DOCUMENT_TYPE_NODE||v.nodeType===v.ELEMENT_NODE&&s.nodeType===s.ELEMENT_NODE)&&(e.removeChild(s),i.mirror.removeNodeFromMap(s),s=r[++n]);try{e.insertBefore(v,s||null)}catch(g){console.warn(g)}}l=u[++h]}if(n>a){const b=u[c+1];let v=null;for(b&&(v=i.mirror.getNode(o.getId(b)));h<=c;++h){const g=Ue(u[h],i.mirror,o);try{e.insertBefore(g,v)}catch(w){console.warn(w)}}}else if(h>c)for(;n<=a;n++){const b=r[n];if(!(!b||b.parentNode!==e))try{e.removeChild(b),i.mirror.removeNodeFromMap(b)}catch(v){console.warn(v)}}let y=e.firstChild,S=t.firstChild;for(;y!==null&&S!==null;)Fe(y,S,i,o),y=y.nextSibling,S=S.nextSibling}function Ue(e,t,i){const o=i.getId(e),r=i.getMeta(e);let u=null;if(o>-1&&(u=t.getNode(o)),u!==null&&Nr(u,e))return u;switch(e.RRNodeType){case _.Document:u=new Document;break;case _.DocumentType:u=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case _.Element:{let n=e.tagName.toLowerCase();n=Jn[n]||n,r&&"isSVG"in r&&r?.isSVG?u=document.createElementNS(ur.svg,n):u=document.createElement(e.tagName);break}case _.Text:u=document.createTextNode(e.data);break;case _.Comment:u=document.createComment(e.data);break;case _.CDATA:u=document.createCDATASection(e.data);break}r&&t.add(u,{...r});try{ee?.add(u)}catch{}return u}function Nr(e,t){return e.nodeType!==t.nodeType?!1:e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName}function pe(e,t,i,o){const r=i.getId(e),u=o.getId(t);return r===-1||r!==u?!1:Nr(e,t)}class we extends Rr{constructor(t){super(),A(this,"UNSERIALIZED_STARTING_ID",-2),A(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),A(this,"mirror",co()),A(this,"scrollData",null),t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,i,o){return new we}createDocumentType(t,i,o){const r=new Zn(t,i,o);return r.ownerDocument=this,r}createElement(t){const i=t.toUpperCase();let o;switch(i){case"AUDIO":case"VIDEO":o=new eo(i);break;case"IFRAME":o=new so(i,this.mirror);break;case"CANVAS":o=new ro(i);break;case"STYLE":o=new io(i);break;case"DIALOG":o=new to(i);break;default:o=new Ze(i);break}return o.ownerDocument=this,o}createComment(t){const i=new oo(t);return i.ownerDocument=this,i}createCDATASection(t){const i=new ao(t);return i.ownerDocument=this,i}createTextNode(t){const i=new no(t);return i.ownerDocument=this,i}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const Zn=ys;class Ze extends Ke{constructor(){super(...arguments),A(this,"inputData",null),A(this,"scrollData",null)}}class eo extends Gn{}class to extends Hn{}class ro extends Ze{constructor(){super(...arguments),A(this,"rr_dataURL",null),A(this,"canvasMutations",[])}getContext(){return null}}class io extends Ze{constructor(){super(...arguments),A(this,"rules",[])}}class so extends Ze{constructor(t,i){super(t),A(this,"contentDocument",new we),this.contentDocument.mirror=i}}const no=ws,oo=vs,ao=bs;function lo(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Cs(e,t,i,o){let r;switch(e.nodeType){case H.DOCUMENT_NODE:o&&o.nodeName==="IFRAME"?r=o.contentDocument:(r=t,r.compatMode=e.compatMode);break;case H.DOCUMENT_TYPE_NODE:{const n=e;r=t.createDocumentType(n.name,n.publicId,n.systemId);break}case H.ELEMENT_NODE:{const n=e,a=lo(n);r=t.createElement(a);const h=r;for(const{name:c,value:s}of Array.from(n.attributes))h.attributes[c]=s;n.scrollLeft&&(h.scrollLeft=n.scrollLeft),n.scrollTop&&(h.scrollTop=n.scrollTop);break}case H.TEXT_NODE:r=t.createTextNode(e.textContent||"");break;case H.CDATA_SECTION_NODE:r=t.createCDATASection(e.data);break;case H.COMMENT_NODE:r=t.createComment(e.textContent||"");break;case H.DOCUMENT_FRAGMENT_NODE:r=o.attachShadow({mode:"open"});break;default:return null}let u=i.getMeta(e);return t instanceof we&&(u||(u=Rs(r,t.unserializedId),i.add(e,u)),t.mirror.add(r,{...u})),r}function uo(e,t=Nn(),i=new we){function o(r,u){const n=Cs(r,i,t,u);if(n!==null)if(u?.nodeName!=="IFRAME"&&r.nodeType!==H.DOCUMENT_FRAGMENT_NODE&&(u?.appendChild(n),n.parentNode=u,n.parentElement=u),r.nodeName==="IFRAME"){const a=r.contentDocument;a&&o(a,n)}else(r.nodeType===H.DOCUMENT_NODE||r.nodeType===H.ELEMENT_NODE||r.nodeType===H.DOCUMENT_FRAGMENT_NODE)&&(r.nodeType===H.ELEMENT_NODE&&r.shadowRoot&&o(r.shadowRoot,n),r.childNodes.forEach(a=>o(a,n)))}return o(e,null),i}function co(){return new ho}class ho{constructor(){A(this,"idNodeMap",new Map),A(this,"nodeMetaMap",new WeakMap)}getId(t){var i;return t?((i=this.getMeta(t))==null?void 0:i.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 i=this.getId(t);this.idNodeMap.delete(i),t.childNodes&&t.childNodes.forEach(o=>this.removeNodeFromMap(o))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,i){const o=i.id;this.idNodeMap.set(o,t),this.nodeMetaMap.set(t,i)}replace(t,i){const o=this.getNode(t);if(o){const r=this.nodeMetaMap.get(o);r&&this.nodeMetaMap.set(i,r)}this.idNodeMap.set(t,i)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Rs(e,t){switch(e.RRNodeType){case _.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case _.DocumentType:{const i=e;return{id:t,type:e.RRNodeType,name:i.name,publicId:i.publicId,systemId:i.systemId}}case _.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case _.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case _.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case _.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}const $i={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},zi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Te={},Ms={},fo=()=>!!globalThis.Zone;function Ar(e){if(Te[e])return Te[e];const t=globalThis[e],i=t.prototype,o=e in $i?$i[e]:void 0,r=!!(o&&o.every(a=>{var h,c;return!!((c=(h=Object.getOwnPropertyDescriptor(i,a))==null?void 0:h.get)!=null&&c.toString().includes("[native code]"))})),u=e in zi?zi[e]:void 0,n=!!(u&&u.every(a=>{var h;return typeof i[a]=="function"&&((h=i[a])==null?void 0:h.toString().includes("[native code]"))}));if(r&&n&&!fo())return Te[e]=t.prototype,t.prototype;try{const a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);const h=a.contentWindow;if(!h)return t.prototype;const c=h[e].prototype;if(!c)return a.remove(),i;const s=navigator.userAgent;return s.includes("Safari")&&!s.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),Ms[e]=()=>a.remove()):a.remove(),Te[e]=c}catch{return i}}const ir={};function Y(e,t,i){var o,r;const u=(o=ir[e])==null?void 0:o[i];if(u)return u.call(t);const n=Ar(e),a=(r=Object.getOwnPropertyDescriptor(n,i))==null?void 0:r.get;return a?((ir[e]||(ir[e]={}))[i]=a,a.call(t)):t[i]}const sr={};function Ns(e,t,i){const o=`${e}.${String(i)}`;if(sr[o])return sr[o].bind(t);const u=Ar(e)[i];return typeof u!="function"?t[i]:(sr[o]=u,u.bind(t))}function po(e){return Y("Node",e,"ownerDocument")}function mo(e){return Y("Node",e,"childNodes")}function go(e){return Y("Node",e,"parentNode")}function yo(e){return Y("Node",e,"parentElement")}function wo(e){return Y("Node",e,"textContent")}function vo(e){return Y("Node",e,"firstChild")}function bo(e){return Y("Node",e,"lastChild")}function So(e){return Y("Node",e,"nextSibling")}function xo(e){return Y("Node",e,"previousSibling")}function Eo(e,t){return Ns("Node",e,"contains")(t)}function Co(e){return Ns("Node",e,"getRootNode")()}function Ro(e){return!e||!("host"in e)?null:Y("ShadowRoot",e,"host")}function Mo(e){return e.styleSheets}function No(e){return!e||!("shadowRoot"in e)?null:Y("Element",e,"shadowRoot")}function Ao(e,t){return Y("Element",e,"querySelector")(t)}function Do(e,t){return Y("Element",e,"querySelectorAll")(t)}function Oo(){return[Ar("MutationObserver").constructor,Ms.MutationObserver??(()=>{})]}let As=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(As=()=>new Date().getTime());function To(e,t,i){try{if(!(t in e))return()=>{};const o=e[t],r=i(o);return typeof r=="function"&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=r,()=>{e[t]=o}}catch{return()=>{}}}const _o={ownerDocument:po,childNodes:mo,parentNode:go,parentElement:yo,textContent:wo,firstChild:vo,lastChild:bo,nextSibling:So,previousSibling:xo,contains:Eo,getRootNode:Co,host:Ro,styleSheets:Mo,shadowRoot:No,querySelector:Ao,querySelectorAll:Do,nowTimestamp:As,mutationObserverCtor:Oo,patch:To},me=`Please stop import mirror directly. Instead of that,\r
53
+ now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
54
+ or you can use record.mirror to access the mirror instance during recording.`;let Wi={map:{},getId(){return console.error(me),-1},getNode(){return console.error(me),null},removeNodeFromMap(){console.error(me)},has(){return console.error(me),!1},reset(){console.error(me)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Wi=new Proxy(Wi,{get(e,t,i){return t==="map"&&console.error(me),Reflect.get(e,t,i)}}));function Po(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Io(e){const t={},i=(r,u)=>{const n={value:r,parent:u,children:[]};return t[r.node.id]=n,n},o=[];for(const r of e){const{nextId:u,parentId:n}=r;if(u&&u in t){const a=t[u];if(a.parent){const h=a.parent.children.indexOf(a);a.parent.children.splice(h,0,i(r,a.parent))}else{const h=o.indexOf(a);o.splice(h,0,i(r,null))}continue}if(n in t){const a=t[n];a.children.push(i(r,a));continue}o.push(i(r,null))}return o}function Ds(e,t){t(e.value);for(let i=e.children.length-1;i>=0;i--)Ds(e.children[i],t)}function nr(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Os(e,t){var i,o;const r=(o=(i=e.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.frameElement;if(!r||r===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const u=r.getBoundingClientRect(),n=Os(r,t),a=u.height/r.clientHeight;return{x:u.x*n.relativeScale+n.x,y:u.y*n.relativeScale+n.y,relativeScale:a,absoluteScale:n.absoluteScale*a}}function _e(e){return e?e instanceof Z&&"shadowRoot"in e?!!e.shadowRoot:!!_o.shadowRoot(e):!1}function xe(e,t){const i=e?.[t[0]];return i?t.length===1?i:xe(i.cssRules,t.slice(1)):null}function ji(e){const t=[...e],i=t.pop();return{positions:t,index:i}}function ko(e){const t=new Set,i=[];for(let o=e.length;o--;){const r=e[o];t.has(r.id)||(i.push(r),t.add(r.id))}return i}class Lo{constructor(){O(this,"id",1),O(this,"styleIDMap",new WeakMap),O(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,i){if(this.has(t))return this.getId(t);let o;return i===void 0?o=this.id++:o=i,this.styleIDMap.set(t,o),this.idStyleMap.set(o,t),o}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var B=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(B||{}),k=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(k||{}),j=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(j||{}),Be=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Be||{}),cr=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(cr||{}),I=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(I||{}),oe=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(oe||{}),qi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ee=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Pe=0;Pe<qi.length;Pe++)Ee[qi.charCodeAt(Pe)]=Pe;var Fo=function(e){var t=e.length*.75,i=e.length,o,r=0,u,n,a,h;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var c=new ArrayBuffer(t),s=new Uint8Array(c);for(o=0;o<i;o+=4)u=Ee[e.charCodeAt(o)],n=Ee[e.charCodeAt(o+1)],a=Ee[e.charCodeAt(o+2)],h=Ee[e.charCodeAt(o+3)],s[r++]=u<<2|n>>4,s[r++]=(n&15)<<4|a>>2,s[r++]=(a&3)<<6|h&63;return c};const Uo=`(function() {
55
+ "use strict";
56
+ var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
57
+ var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
58
+ for (var i = 0; i < chars.length; i++) {
59
+ lookup[chars.charCodeAt(i)] = i;
60
+ }
61
+ var encode = function(arraybuffer) {
62
+ var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";
63
+ for (i2 = 0; i2 < len; i2 += 3) {
64
+ base64 += chars[bytes[i2] >> 2];
65
+ base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];
66
+ base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];
67
+ base64 += chars[bytes[i2 + 2] & 63];
68
+ }
69
+ if (len % 3 === 2) {
70
+ base64 = base64.substring(0, base64.length - 1) + "=";
71
+ } else if (len % 3 === 1) {
72
+ base64 = base64.substring(0, base64.length - 2) + "==";
73
+ }
74
+ return base64;
75
+ };
76
+ const lastBlobMap = /* @__PURE__ */ new Map();
77
+ const transparentBlobMap = /* @__PURE__ */ new Map();
78
+ async function getTransparentBlobFor(width, height, dataURLOptions) {
79
+ const id = \`\${width}-\${height}\`;
80
+ if ("OffscreenCanvas" in globalThis) {
81
+ if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);
82
+ const offscreen = new OffscreenCanvas(width, height);
83
+ offscreen.getContext("2d");
84
+ const blob = await offscreen.convertToBlob(dataURLOptions);
85
+ const arrayBuffer = await blob.arrayBuffer();
86
+ const base64 = encode(arrayBuffer);
87
+ transparentBlobMap.set(id, base64);
88
+ return base64;
89
+ } else {
90
+ return "";
91
+ }
92
+ }
93
+ const worker = self;
94
+ worker.onmessage = async function(e) {
95
+ if ("OffscreenCanvas" in globalThis) {
96
+ const { id, bitmap, width, height, dataURLOptions } = e.data;
97
+ const transparentBase64 = getTransparentBlobFor(
98
+ width,
99
+ height,
100
+ dataURLOptions
101
+ );
102
+ const offscreen = new OffscreenCanvas(width, height);
103
+ const ctx = offscreen.getContext("2d");
104
+ ctx.drawImage(bitmap, 0, 0);
105
+ bitmap.close();
106
+ const blob = await offscreen.convertToBlob(dataURLOptions);
107
+ const type = blob.type;
108
+ const arrayBuffer = await blob.arrayBuffer();
109
+ const base64 = encode(arrayBuffer);
110
+ if (!lastBlobMap.has(id) && await transparentBase64 === base64) {
111
+ lastBlobMap.set(id, base64);
112
+ return worker.postMessage({ id });
113
+ }
114
+ if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });
115
+ worker.postMessage({
116
+ id,
117
+ type,
118
+ base64,
119
+ width,
120
+ height
121
+ });
122
+ lastBlobMap.set(id, base64);
123
+ } else {
124
+ return worker.postMessage({ id: e.data.id });
125
+ }
126
+ };
127
+ })();
128
+ //# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
129
+ `;typeof self<"u"&&self.Blob&&new Blob([Uo],{type:"text/javascript;charset=utf-8"});try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Or=e.contentWindow)==null?void 0:Or.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}is();function Bo(e){return{all:e=e||new Map,on:function(t,i){var o=e.get(t);o?o.push(i):e.set(t,[i])},off:function(t,i){var o=e.get(t);o&&(i?o.splice(o.indexOf(i)>>>0,1):e.set(t,[]))},emit:function(t,i){var o=e.get(t);o&&o.slice().map(function(r){r(i)}),(o=e.get("*"))&&o.slice().map(function(r){r(t,i)})}}}function $o(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const i=e.HTMLElement||e.Element,o=468,r={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:i.prototype.scroll||h,scrollIntoView:i.prototype.scrollIntoView},u=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function n(S){const b=["MSIE ","Trident/","Edge/"];return new RegExp(b.join("|")).test(S)}const a=n(e.navigator.userAgent)?1:0;function h(S,b){this.scrollLeft=S,this.scrollTop=b}function c(S){return .5*(1-Math.cos(Math.PI*S))}function s(S){if(S===null||typeof S!="object"||S.behavior===void 0||S.behavior==="auto"||S.behavior==="instant")return!0;if(typeof S=="object"&&S.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+S.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(S,b){if(b==="Y")return S.clientHeight+a<S.scrollHeight;if(b==="X")return S.clientWidth+a<S.scrollWidth}function l(S,b){const v=e.getComputedStyle(S,null)["overflow"+b];return v==="auto"||v==="scroll"}function f(S){const b=d(S,"Y")&&l(S,"Y"),v=d(S,"X")&&l(S,"X");return b||v}function m(S){for(;S!==t.body&&f(S)===!1;)S=S.parentNode||S.host;return S}function p(S){const b=u();let v,g,w,x=(b-S.startTime)/o;x=x>1?1:x,v=c(x),g=S.startX+(S.x-S.startX)*v,w=S.startY+(S.y-S.startY)*v,S.method.call(S.scrollable,g,w),(g!==S.x||w!==S.y)&&e.requestAnimationFrame(p.bind(e,S))}function y(S,b,v){let g,w,x,E;const N=u();S===t.body?(g=e,w=e.scrollX||e.pageXOffset,x=e.scrollY||e.pageYOffset,E=r.scroll):(g=S,w=S.scrollLeft,x=S.scrollTop,E=h),p({scrollable:g,method:E,startTime:N,startX:w,startY:x,x:b,y:v})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(s(arguments[0])===!0){r.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}y.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(s(arguments[0])){r.scrollBy.call(e,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}y.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},i.prototype.scroll=i.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(s(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");r.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 S=arguments[0].left,b=arguments[0].top;y.call(this,this,typeof S>"u"?this.scrollLeft:~~S,typeof b>"u"?this.scrollTop:~~b)},i.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(s(arguments[0])===!0){r.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})}},i.prototype.scrollIntoView=function(){if(s(arguments[0])===!0){r.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const S=m(this),b=S.getBoundingClientRect(),v=this.getBoundingClientRect();S!==t.body?(y.call(this,S,S.scrollLeft+v.left-b.left,S.scrollTop+v.top-b.top),e.getComputedStyle(S).position!=="fixed"&&e.scrollBy({left:b.left,top:b.top,behavior:"smooth"})):e.scrollBy({left:v.left,top:v.top,behavior:"smooth"})}}class zo{constructor(t=[],i){O(this,"timeOffset",0),O(this,"speed"),O(this,"actions"),O(this,"raf",null),O(this,"lastTimestamp"),this.actions=t,this.speed=i.speed}addAction(t){const i=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay)this.actions.push(t);else{const o=this.findActionIndex(t);this.actions.splice(o,0,t)}i&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}updateLiveTime(){this.raf===!0&&this.rafCheck()}rafCheck(){const t=performance.now();for(this.timeOffset+=(t-this.lastTimestamp)*this.speed,this.lastTimestamp=t;this.actions.length;){const i=this.actions[0];if(this.timeOffset>=i.delay)this.actions.shift(),i.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(t){this.speed=t}isActive(){return this.raf!==null}findActionIndex(t){let i=0,o=this.actions.length-1;for(;i<=o;){const r=Math.floor((i+o)/2);if(this.actions[r].delay<t.delay)i=r+1;else if(this.actions[r].delay>t.delay)o=r-1;else return r+1}return i}}function Vi(e,t){if(e.type===B.IncrementalSnapshot&&e.data.source===k.MouseMove&&e.data.positions&&e.data.positions.length){const i=e.data.positions[0].timeOffset,o=e.timestamp+i;return e.delay=o-t,o-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
130
+ Copyright (c) Microsoft Corporation.
131
+
132
+ Permission to use, copy, modify, and/or distribute this software for any
133
+ purpose with or without fee is hereby granted.
134
+
135
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
136
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
137
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
138
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
139
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
140
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
141
+ PERFORMANCE OF THIS SOFTWARE.
142
+ ***************************************************************************** */function Gi(e,t){var i=typeof Symbol=="function"&&e[Symbol.iterator];if(!i)return e;var o,r,u=i.call(e),n=[];try{for(;(t===void 0||t-- >0)&&!(o=u.next()).done;)n.push(o.value)}catch(a){r={error:a}}finally{try{o&&!o.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}return n}var ye;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(ye||(ye={}));var Ts={type:"xstate.init"};function or(e){return e===void 0?[]:[].concat(e)}function ge(e){return{type:"xstate.assign",assignment:e}}function Hi(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function $e(e){return function(t){return e===t}}function _s(e){return typeof e=="string"?{type:e}:e}function Yi(e,t){return{value:e,context:t,actions:[],changed:!1,matches:$e(e)}}function Ji(e,t,i){var o=t,r=!1;return[e.filter(function(u){if(u.type==="xstate.assign"){r=!0;var n=Object.assign({},o);return typeof u.assignment=="function"?n=u.assignment(o,i):Object.keys(u.assignment).forEach(function(a){n[a]=typeof u.assignment[a]=="function"?u.assignment[a](o,i):u.assignment[a]}),o=n,!1}return!0}),o,r]}function Ps(e,t){t===void 0&&(t={});var i=Gi(Ji(or(e.states[e.initial].entry).map(function(n){return Hi(n,t.actions)}),e.context,Ts),2),o=i[0],r=i[1],u={config:e,_options:t,initialState:{value:e.initial,actions:o,context:r,matches:$e(e.initial)},transition:function(n,a){var h,c,s=typeof n=="string"?{value:n,context:e.context}:n,d=s.value,l=s.context,f=_s(a),m=e.states[d];if(m.on){var p=or(m.on[f.type]);try{for(var y=(function(P){var V=typeof Symbol=="function"&&Symbol.iterator,se=V&&P[V],W=0;if(se)return se.call(P);if(P&&typeof P.length=="number")return{next:function(){return P&&W>=P.length&&(P=void 0),{value:P&&P[W++],done:!P}}};throw new TypeError(V?"Object is not iterable.":"Symbol.iterator is not defined.")})(p),S=y.next();!S.done;S=y.next()){var b=S.value;if(b===void 0)return Yi(d,l);var v=typeof b=="string"?{target:b}:b,g=v.target,w=v.actions,x=w===void 0?[]:w,E=v.cond,N=E===void 0?function(){return!0}:E,D=g===void 0,R=g??d,q=e.states[R];if(N(l,f)){var T=Gi(Ji((D?or(x):[].concat(m.exit,x,q.entry).filter(function(P){return P})).map(function(P){return Hi(P,u._options.actions)}),l,f),3),C=T[0],le=T[1],te=T[2],J=g??d;return{value:J,context:le,actions:C,changed:g!==d||C.length>0||te,matches:$e(J)}}}}catch(P){h={error:P}}finally{try{S&&!S.done&&(c=y.return)&&c.call(y)}finally{if(h)throw h.error}}}return Yi(d,l)}};return u}var Xi=function(e,t){return e.actions.forEach(function(i){var o=i.exec;return o&&o(e.context,t)})};function Is(e){var t=e.initialState,i=ye.NotStarted,o=new Set,r={_machine:e,send:function(u){i===ye.Running&&(t=e.transition(t,u),Xi(t,_s(u)),o.forEach(function(n){return n(t)}))},subscribe:function(u){return o.add(u),u(t),{unsubscribe:function(){return o.delete(u)}}},start:function(u){if(u){var n=typeof u=="object"?u:{context:e.config.context,value:u};t={value:n.value,actions:[],context:n.context,matches:$e(n.value)}}return i=ye.Running,Xi(t,Ts),r},stop:function(){return i=ye.Stopped,o.clear(),r},get state(){return t},get status(){return i}};return r}function Wo(e,t){for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.type===B.Meta&&o.timestamp<=t)return e.slice(i)}return e}function jo(e,{getCastFn:t,applyEventsSynchronously:i,emitter:o}){const r=Ps({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:ge({lastPlayedEvent:(u,n)=>n.type==="CAST_EVENT"?n.payload.event:u.lastPlayedEvent}),recordTimeOffset:ge((u,n)=>{let a=u.timeOffset;return"payload"in n&&"timeOffset"in n.payload&&(a=n.payload.timeOffset),{...u,timeOffset:a,baselineTime:u.events[0].timestamp+a}}),play(u){var n;const{timer:a,events:h,baselineTime:c,lastPlayedEvent:s}=u;a.clear();for(const m of h)Vi(m,c);const d=Wo(h,c);let l=s?.timestamp;s?.type===B.IncrementalSnapshot&&s.data.source===k.MouseMove&&(l=s.timestamp+((n=s.data.positions[0])==null?void 0:n.timeOffset)),c<(l||0)&&o.emit(I.PlayBack);const f=new Array;for(const m of d)if(!(l&&l<c&&(m.timestamp<=l||m===s)))if(m.timestamp<c)f.push(m);else{const p=t(m,!1);a.addAction({doAction:()=>{p()},delay:m.delay})}i(f),o.emit(I.Flush),a.start()},pause(u){u.timer.clear()},resetLastPlayedEvent:ge(u=>({...u,lastPlayedEvent:null})),startLive:ge({baselineTime:(u,n)=>(u.timer.start(),n.type==="TO_LIVE"&&n.payload.baselineTime?n.payload.baselineTime:Date.now())}),addEvent:ge((u,n)=>{const{baselineTime:a,timer:h,events:c}=u;if(n.type==="ADD_EVENT"){const{event:s}=n.payload;Vi(s,a);let d=c.length-1;if(!c[d]||c[d].timestamp<=s.timestamp)c.push(s);else{let m=-1,p=0;for(;p<=d;){const y=Math.floor((p+d)/2);c[y].timestamp<=s.timestamp?p=y+1:d=y-1}m===-1&&(m=p),c.splice(m,0,s)}const l=s.timestamp<a,f=t(s,l);l?f():h.isActive()&&h.addAction({doAction:()=>{f()},delay:s.delay})}return{...u,events:c}})}});return Is(r)}function qo(e){const t=Ps({id:"speed",context:e,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:(i,o)=>{"payload"in o&&i.timer.setSpeed(o.payload.speed)},recordSpeed:ge({normalSpeed:i=>i.timer.speed}),restoreSpeed:i=>{i.timer.setSpeed(i.normalSpeed)}}});return Is(t)}const Vo=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }"],Qi=new Map;function ks(e,t){let i=Qi.get(e);return i||(i=new Map,Qi.set(e,i)),i.has(t)||i.set(t,[]),i.get(t)}function ae(e,t,i){return async o=>{if(o&&typeof o=="object"&&"rr_type"in o)if(i&&(i.isUnchanged=!1),o.rr_type==="ImageBitmap"&&"args"in o){const r=await ae(e,t,i)(o.args);return await createImageBitmap.apply(null,r)}else if("index"in o){if(i||t===null)return o;const{rr_type:r,index:u}=o;return ks(t,r)[u]}else if("args"in o){const{rr_type:r,args:u}=o,n=window[r];return new n(...await Promise.all(u.map(ae(e,t,i))))}else{if("base64"in o)return Fo(o.base64);if("src"in o){const r=e.get(o.src);if(r)return r;{const u=new Image;return u.src=o.src,e.set(o.src,u),u}}else if("data"in o&&o.rr_type==="Blob"){const r=await Promise.all(o.data.map(ae(e,t,i)));return new Blob(r,{type:o.type})}}else if(Array.isArray(o))return await Promise.all(o.map(ae(e,t,i)));return o}}function Go(e,t){try{return t===Be.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const Ho=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Yo(e,t){if(!t?.constructor)return;const{name:i}=t.constructor;if(!Ho.includes(i))return;const o=ks(e,i);o.includes(t)||o.push(t)}async function Jo({mutation:e,target:t,type:i,imageMap:o,errorHandler:r}){try{const u=Go(t,i);if(!u)return;if(e.setter){u[e.property]=e.args[0];return}const n=u[e.property],a=await Promise.all(e.args.map(ae(o,u))),h=n.apply(u,a);Yo(u,h);const c=!1}catch(u){r(e,u)}}async function Xo({event:e,mutations:t,target:i,imageMap:o,errorHandler:r}){const u=i.getContext("2d");if(!u){r(t[0],new Error("Canvas context is null"));return}const n=t.map(async h=>Promise.all(h.args.map(ae(o,u))));(await Promise.all(n)).forEach((h,c)=>{const s=t[c];try{if(s.setter){u[s.property]=s.args[0];return}const d=u[s.property];s.property==="drawImage"&&typeof s.args[0]=="string"?(o.get(e),d.apply(u,s.args)):d.apply(u,h)}catch(d){r(s,d)}})}async function Ki({event:e,mutation:t,target:i,imageMap:o,canvasEventMap:r,errorHandler:u}){try{const n=r.get(e)||t,a="commands"in n?n.commands:[n];if([Be.WebGL,Be.WebGL2].includes(t.type)){for(let h=0;h<a.length;h++){const c=a[h];await Jo({mutation:c,type:t.type,target:i,imageMap:o,errorHandler:u})}return}await Xo({event:e,mutations:a,target:i,imageMap:o,errorHandler:u})}catch(n){u(t,n)}}class Qo{constructor(t){O(this,"mediaMap",new Map),O(this,"warn"),O(this,"service"),O(this,"speedService"),O(this,"emitter"),O(this,"getCurrentTime"),O(this,"metadataCallbackMap",new Map),this.warn=t.warn,this.service=t.service,this.speedService=t.speedService,this.emitter=t.emitter,this.getCurrentTime=t.getCurrentTime,this.emitter.on(I.Start,this.start.bind(this)),this.emitter.on(I.SkipStart,this.start.bind(this)),this.emitter.on(I.Pause,this.pause.bind(this)),this.emitter.on(I.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(t={pause:!1}){this.mediaMap.forEach((i,o)=>{this.syncTargetWithState(o),t.pause&&o.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:t,target:i,mediaState:o}){if(o.isPlaying){const u=(t-o.lastInteractionTimeOffset)/1e3*o.playbackRate,n="duration"in i&&i.duration;if(Number.isNaN(n)){this.waitForMetadata(i);return}let a=o.currentTimeAtLastInteraction+u;i.loop&&n!==!1&&(a=a%n),i.currentTime=a}else i.pause(),i.currentTime=o.currentTimeAtLastInteraction}waitForMetadata(t){if(this.metadataCallbackMap.has(t)||!("addEventListener"in t))return;const i=()=>{this.metadataCallbackMap.delete(t);const o=this.mediaMap.get(t);o&&this.seekTo({time:this.getCurrentTime(),target:t,mediaState:o})};this.metadataCallbackMap.set(t,i),t.addEventListener("loadedmetadata",i,{once:!0})}getMediaStateFromMutation({target:t,timeOffset:i,mutation:o}){const r=this.mediaMap.get(t),{type:u,playbackRate:n,currentTime:a,muted:h,volume:c,loop:s}=o;return{isPlaying:u===cr.Play||u!==cr.Pause&&(r?.isPlaying||t.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:a??r?.currentTimeAtLastInteraction??0,lastInteractionTimeOffset:i,playbackRate:n??r?.playbackRate??1,volume:c??r?.volume??1,muted:h??r?.muted??t.getAttribute("muted")===null,loop:s??r?.loop??t.getAttribute("loop")===null}}syncTargetWithState(t){const i=this.mediaMap.get(t);if(!i)return;const{muted:o,loop:r,volume:u,isPlaying:n}=i,a=this.service.state.matches("paused"),h=i.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:t,mediaState:i}),t.volume!==u&&(t.volume=u),t.muted=o,t.loop=r,t.playbackRate!==h&&(t.playbackRate=h),n&&!a?t.play():t.pause()}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}}addMediaElements(t,i,o){if(!["AUDIO","VIDEO"].includes(t.nodeName))return;const r=t,u=o.getMeta(r);if(!u||!("attributes"in u))return;const n=this.service.state.matches("paused"),a=u.attributes;let h=!1;a.rr_mediaState?h=a.rr_mediaState==="played":h=r.getAttribute("autoplay")!==null,h&&n&&r.pause();let c=1;typeof a.rr_mediaPlaybackRate=="number"&&(c=a.rr_mediaPlaybackRate);let s=!1;typeof a.rr_mediaMuted=="boolean"?s=a.rr_mediaMuted:s=r.getAttribute("muted")!==null;let d=!1;typeof a.rr_mediaLoop=="boolean"?d=a.rr_mediaLoop:d=r.getAttribute("loop")!==null;let l=1;typeof a.rr_mediaVolume=="number"&&(l=a.rr_mediaVolume);let f=0;typeof a.rr_mediaCurrentTime=="number"&&(f=a.rr_mediaCurrentTime),this.mediaMap.set(r,{isPlaying:h,currentTimeAtLastInteraction:f,lastInteractionTimeOffset:i,playbackRate:c,volume:l,muted:s,loop:d}),this.syncTargetWithState(r)}mediaMutation({target:t,timeOffset:i,mutation:o}){this.mediaMap.set(t,this.getMediaStateFromMutation({target:t,timeOffset:i,mutation:o})),this.syncTargetWithState(t)}isSupportedMediaElement(t){return["AUDIO","VIDEO"].includes(t.nodeName)}reset(){this.mediaMap.clear()}}function Ie(e,t){if(e.nodeName!=="DIALOG"||e instanceof Z)return;const i=e,o=i.open,r=o&&i.matches("dialog:modal"),u=i.getAttribute("rr_open_mode"),n=typeof t?.attributes.open=="string"||typeof i.getAttribute("open")=="string",a=u==="modal";if(!(o&&!(r&&u==="non-modal"||!r&&a))){if(!i.isConnected){console.warn("dialog is not attached to the dom",i);return}o&&i.close(),n&&(a?i.showModal():i.show())}}function Ko(e,t){if(e.nodeName!=="DIALOG"||e instanceof Z)return;const i=e;if(!i.isConnected){console.warn("dialog is not attached to the dom",i);return}t.attributes.open===null&&(i.removeAttribute("open"),i.removeAttribute("rr_open_mode"))}const Zo=5*1e3,ea=Bo,Zi="[replayer]",ar={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function es(e){return e.type==B.IncrementalSnapshot&&(e.data.source==k.TouchMove||e.data.source==k.MouseInteraction&&e.data.type==j.TouchStart)}class ta{constructor(t,i){if(O(this,"wrapper"),O(this,"iframe"),O(this,"UNSAFE_replayCanvas",!1),O(this,"service"),O(this,"speedService"),O(this,"config"),O(this,"usingVirtualDom",!1),O(this,"virtualDom",new we),O(this,"mouse"),O(this,"mouseTail",null),O(this,"tailPositions",[]),O(this,"emitter",ea()),O(this,"nextUserInteractionEvent"),O(this,"legacy_missingNodeRetryMap",{}),O(this,"cache",li()),O(this,"imageMap",new Map),O(this,"canvasEventMap",new Map),O(this,"mirror",is()),O(this,"styleMirror",new Lo),O(this,"mediaManager"),O(this,"firstFullSnapshot",null),O(this,"newDocumentQueue",[]),O(this,"mousePos",null),O(this,"touchActive",null),O(this,"lastMouseDownEvent",null),O(this,"lastHoveredRootNode"),O(this,"lastSelectionData",null),O(this,"constructedStyleMutations",[]),O(this,"adoptedStyleSheets",[]),O(this,"handleResize",a=>{this.iframe.style.display="inherit";for(const h of[this.mouseTail,this.iframe])h&&(h.setAttribute("width",String(a.width)),h.setAttribute("height",String(a.height)))}),O(this,"applyEventsSynchronously",a=>{for(const h of a){switch(h.type){case B.DomContentLoaded:case B.Load:continue;case B.FullSnapshot:case B.Meta:case B.Plugin:case B.IncrementalSnapshot:break}this.getCastFn(h,!0)()}}),O(this,"getCastFn",(a,h=!1)=>{let c;switch(a.type){case B.DomContentLoaded:case B.Load:break;case B.Custom:c=()=>{this.emitter.emit(I.CustomEvent,a)};break;case B.Meta:c=()=>this.emitter.emit(I.Resize,{width:a.data.width,height:a.data.height});break;case B.FullSnapshot:c=()=>{var d;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(a,h),(d=this.iframe.contentWindow)==null||d.scrollTo(a.data.initialOffset)};break;case B.IncrementalSnapshot:c=()=>{if(this.applyIncremental(a,h),!h&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const d of this.service.state.context.events)if(!(d.timestamp<=a.timestamp)&&this.isUserInteraction(d)){d.delay-a.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=d);break}if(this.nextUserInteractionEvent){const d=this.nextUserInteractionEvent.delay-a.delay,l={speed:Math.min(Math.round(d/Zo),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:l}),this.emitter.emit(I.SkipStart,l)}}};break}return()=>{c&&c();for(const l of this.config.plugins||[])l.handler&&l.handler(a,h,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});const d=this.service.state.context.events.length-1;if(!this.config.liveMode&&a===this.service.state.context.events[d]){const l=()=>{d<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(I.Finish))};let f=50;a.type===B.IncrementalSnapshot&&a.data.source===k.MouseMove&&a.data.positions.length&&(f+=Math.max(0,-a.data.positions[0].timeOffset)),setTimeout(l,f)}this.emitter.emit(I.EventCast,a)}}),!i?.liveMode&&t.length<2)throw new Error("Replayer need at least 2 events.");const o={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:ar,useVirtualDom:!0,logger:console};this.config=Object.assign({},o,i),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(I.Resize,this.handleResize),this.setupDom();for(const a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(I.Flush,()=>{if(this.usingVirtualDom){const a={mirror:this.mirror,applyCanvas:(h,c,s)=>{Ki({event:h,mutation:c,target:s,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(h,c)=>{h.source===k.StyleSheetRule?this.applyStyleSheetRule(h,c):h.source===k.StyleDeclaration&&this.applyStyleDeclaration(h,c)},afterAppend:(h,c)=>{for(const s of this.config.plugins||[])s.onBuild&&s.onBuild(h,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{Fe(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror)}catch(h){this.warn(h)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const h in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[h],s=Ue(c.node,this.mirror,this.virtualDom.mirror);Fe(s,c.node,a,this.virtualDom.mirror),c.node=s}catch(c){this.warn(c)}this.constructedStyleMutations.forEach(h=>{this.applyStyleSheetMutation(h)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(h=>{this.applyAdoptedStyleSheet(h)}),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[a,h]=this.lastMouseDownEvent;a.dispatchEvent(h)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(I.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const r=new zo([],{speed:this.config.speed});this.service=jo({events:t.map(a=>i&&i.unpackFn?i.unpackFn(a):a).sort((a,h)=>a.timestamp-h.timestamp),timer:r,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(I.StateChange,{player:a})}),this.speedService=qo({normalSpeed:-1,timer:r}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(I.StateChange,{speed:a})}),this.mediaManager=new Qo({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const u=this.service.state.context.events.find(a=>a.type===B.Meta),n=this.service.state.context.events.find(a=>a.type===B.FullSnapshot);if(u){const{width:a,height:h}=u.data;setTimeout(()=>{this.emitter.emit(I.Resize,{width:a,height:h})},0)}n&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=n,this.rebuildFullSnapshot(n),(a=this.iframe.contentWindow)==null||a.scrollTo(n.data.initialOffset))},1),this.service.state.context.events.find(es)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,i){return this.emitter.on(t,i),this}off(t,i){return this.emitter.off(t,i),this}setConfig(t){Object.keys(t).forEach(i=>{t[i],this.config[i]=t[i]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.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 t=this.service.state.context.events[0],i=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:i.timestamp,totalTime:i.timestamp-t.timestamp}}getCurrentTime(){return this.config.liveMode&&this.timer.updateLiveTime(),this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:i}=this.service.state.context;return t-i[0].timestamp}getMirror(){return this.mirror}play(t=0){var i,o;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(o=(i=this.iframe.contentDocument)==null?void 0:i.getElementsByTagName("html")[0])==null||o.classList.remove("rrweb-paused"),this.emitter.emit(I.Start)}pause(t){var i,o;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(o=(i=this.iframe.contentDocument)==null?void 0:i.getElementsByTagName("html")[0])==null||o.classList.add("rrweb-paused"),this.emitter.emit(I.Pause)}resume(t=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(I.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(I.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const i=this.config.unpackFn?this.config.unpackFn(t):t;es(i)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:i}}))}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=li()}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.config.UNSAFE_replayCanvas?(this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin allow-scripts"),this.wrapper.appendChild(this.iframe),this.UNSAFE_replayCanvas=!0):(this.iframe=Sn({root:this.wrapper}),this.UNSAFE_replayCanvas=!1),this.iframe.style.display="none",this.disableInteract(),this.iframe.contentWindow&&this.iframe.contentDocument&&($o(this.iframe.contentWindow,this.iframe.contentDocument),Po(this.iframe.contentWindow))}rebuildFullSnapshot(t,i=!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 o=[],r=new Set,u=(h,c)=>{if(h.nodeName==="DIALOG"&&r.add(h),this.collectIframeAndAttachDocument(o,h),this.mediaManager.isSupportedMediaElement(h)){const{events:s}=this.service.state.context;this.mediaManager.addMediaElements(h,t.timestamp-s[0].timestamp,this.mirror)}for(const s of this.config.plugins||[])s.onBuild&&s.onBuild(h,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),bn(t.data.node,{doc:this.iframe.contentDocument,afterAppend:u,cache:this.cache,mirror:this.mirror,UNSAFE_allowUnprotectedRebuild:this.UNSAFE_replayCanvas}),u(this.iframe.contentDocument,t.data.node.id);for(const{mutationInQueue:h,builtNode:c}of o)this.attachDocumentToIframe(h,c),this.newDocumentQueue=this.newDocumentQueue.filter(s=>s!==h);const{documentElement:n,head:a}=this.iframe.contentDocument;this.insertStyleRules(n,a),r.forEach(h=>Ie(h)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(I.FullsnapshotRebuilded,t),i||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,i){var o;const r=Vo(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!r.length)if(this.usingVirtualDom){const u=this.virtualDom.createElement("style");this.virtualDom.mirror.add(u,Rs(u,this.virtualDom.unserializedId)),t.insertBefore(u,i),u.rules.push({source:k.StyleSheetRule,adds:r.map((n,a)=>({rule:n,index:a}))})}else{const u=document.createElement("style");t.insertBefore(u,i);for(let n=0;n<r.length;n++)(o=u.sheet)==null||o.insertRule(r[n],n)}}attachDocumentToIframe(t,i){const o=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,r=[],u=new Set,n=(a,h)=>{a.nodeName==="DIALOG"&&u.add(a),this.collectIframeAndAttachDocument(r,a);const c=o.getMeta(a);if(c?.type===oe.Element&&c?.tagName.toUpperCase()==="HTML"){const{documentElement:s,head:d}=i.contentDocument;this.insertStyleRules(s,d)}if(!this.usingVirtualDom)for(const s of this.config.plugins||[])s.onBuild&&s.onBuild(a,{id:h,replayer:this})};Ce(t.node,{doc:i.contentDocument,mirror:o,hackCss:!0,skipChild:!1,afterAppend:n,cache:this.cache}),n(i.contentDocument,t.node.id);for(const{mutationInQueue:a,builtNode:h}of r)this.attachDocumentToIframe(a,h),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);u.forEach(a=>Ie(a))}collectIframeAndAttachDocument(t,i){if(nr(i,this.mirror)){const o=this.newDocumentQueue.find(r=>r.parentId===this.mirror.getId(i));o&&t.push({mutationInQueue:o,builtNode:i})}}waitForStylesheetLoad(){var t;const i=(t=this.iframe.contentDocument)==null?void 0:t.head;if(i){const o=new Set;let r,u=this.service.state;const n=()=>{u=this.service.state};this.emitter.on(I.Start,n),this.emitter.on(I.Pause,n);const a=()=>{this.emitter.off(I.Start,n),this.emitter.off(I.Pause,n)};i.querySelectorAll('link[rel="stylesheet"]').forEach(h=>{h.sheet||(o.add(h),h.addEventListener("load",()=>{o.delete(h),o.size===0&&r!==-1&&(u.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(I.LoadStylesheetEnd),r&&clearTimeout(r),a())}))}),o.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(I.LoadStylesheetStart),r=setTimeout(()=>{u.matches("playing")&&this.play(this.getCurrentTime()),r=-1,a()},this.config.loadTimeout))}}async preloadAllImages(){const t=[];for(const i of this.service.state.context.events)i.type===B.IncrementalSnapshot&&i.data.source===k.CanvasMutation&&(t.push(this.deserializeAndPreloadCanvasEvents(i.data,i)),("commands"in i.data?i.data.commands:[i.data]).forEach(r=>{this.preloadImages(r,i)}));return Promise.all(t)}preloadImages(t,i){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(i)){const o=document.createElement("canvas"),r=o.getContext("2d"),u=r?.createImageData(o.width,o.height);r?.putImageData(u,0,0)}}async deserializeAndPreloadCanvasEvents(t,i){if(!this.canvasEventMap.has(i)){const o={isUnchanged:!0};if("commands"in t){const r=await Promise.all(t.commands.map(async u=>{const n=await Promise.all(u.args.map(ae(this.imageMap,null,o)));return{...u,args:n}}));o.isUnchanged===!1&&this.canvasEventMap.set(i,{...t,commands:r})}else{const r=await Promise.all(t.args.map(ae(this.imageMap,null,o)));o.isUnchanged===!1&&this.canvasEventMap.set(i,{...t,args:r})}}}applyIncremental(t,i){var o,r,u;const{data:n}=t;switch(n.source){case k.Mutation:{try{this.applyMutation(n,i)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,n)}break}case k.Drag:case k.TouchMove:case k.MouseMove:if(i){const a=n.positions[n.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:n}}else n.positions.forEach(a=>{const h={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,i,n)},delay:a.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(h)}),this.timer.addAction({doAction(){},delay:t.delay-((o=n.positions[0])==null?void 0:o.timeOffset)});break;case k.MouseInteraction:{if(n.id===-1)break;const a=new Event(Vs(j[n.type])),h=this.mirror.getNode(n.id);if(!h)return this.debugNodeNotFound(n,n.id);this.emitter.emit(I.MouseInteraction,{type:n.type,target:h});const{triggerFocus:c}=this.config;switch(n.type){case j.Blur:"blur"in h&&h.blur();break;case j.Focus:c&&h.focus&&h.focus({preventScroll:!0});break;case j.Click:case j.TouchStart:case j.TouchEnd:case j.MouseDown:case j.MouseUp:i?(n.type===j.TouchStart?this.touchActive=!0:n.type===j.TouchEnd&&(this.touchActive=!1),n.type===j.MouseDown?this.lastMouseDownEvent=[h,a]:n.type===j.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:n.x||0,y:n.y||0,id:n.id,debugData:n}):(n.type===j.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(n.x||0,n.y||0,n.id,i,n),n.type===j.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):n.type===j.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):n.type===j.TouchEnd?this.mouse.classList.remove("touch-active"):h.dispatchEvent(a));break;case j.TouchCancel:i?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:h.dispatchEvent(a)}break}case k.Scroll:{if(n.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.scrollData=n;break}this.applyScroll(n,i);break}case k.ViewportResize:this.emitter.emit(I.Resize,{width:n.width,height:n.height});break;case k.Input:{if(n.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.inputData=n;break}this.applyInput(n);break}case k.MediaInteraction:{const a=this.usingVirtualDom?this.virtualDom.mirror.getNode(n.id):this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);const h=a,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:h,timeOffset:t.timestamp-c[0].timestamp,mutation:n});break}case k.StyleSheetRule:case k.StyleDeclaration:{this.usingVirtualDom?n.styleId?this.constructedStyleMutations.push(n):n.id&&((r=this.virtualDom.mirror.getNode(n.id))==null||r.rules.push(n)):this.applyStyleSheetMutation(n);break}case k.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.canvasMutations.push({event:t,mutation:n})}else{const a=this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);Ki({event:t,mutation:n,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case k.Font:{try{const a=new FontFace(n.family,n.buffer?new Uint8Array(JSON.parse(n.fontSource)):n.fontSource,n.descriptors);(u=this.iframe.contentDocument)==null||u.fonts.add(a)}catch(a){this.warn(a)}break}case k.Selection:{if(i){this.lastSelectionData=n;break}this.applySelection(n);break}case k.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(n):this.applyAdoptedStyleSheet(n);break}}}applyMutation(t,i){if(this.config.useVirtualDom&&!this.usingVirtualDom&&i&&(this.usingVirtualDom=!0,uo(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const s=this.legacy_missingNodeRetryMap[c],d=Cs(s.node,this.virtualDom,this.mirror);d&&(s.node=d)}catch(s){this.warn(s)}const o=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes=t.removes.filter(c=>o.getNode(c.id)?!0:(this.warnNodeNotFound(t,c.id),!1)),t.removes.forEach(c=>{var s;const d=o.getNode(c.id);if(!d)return;let l=o.getNode(c.parentId);if(!l)return this.warnNodeNotFound(t,c.parentId);if(c.isShadow&&_e(l)&&(l=l.shadowRoot),o.removeNodeFromMap(d),l)try{l.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&l.nodeName==="STYLE"&&((s=l.rules)==null?void 0:s.length)>0&&(l.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",l,d,t);else throw f}});const r={...this.legacy_missingNodeRetryMap},u=[],n=c=>{let s=null;return c.nextId&&(s=o.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!s},a=c=>{var s,d;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let l=o.getNode(c.parentId);if(!l)return c.node.type===oe.Document?this.newDocumentQueue.push(c):u.push(c);c.node.isShadow&&(_e(l)||l.attachShadow({mode:"open"}),l=l.shadowRoot);let f=null,m=null;if(c.previousId&&(f=o.getNode(c.previousId)),c.nextId&&(m=o.getNode(c.nextId)),n(c))return u.push(c);if(c.node.rootId&&!o.getNode(c.node.rootId))return;const p=c.node.rootId?o.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(nr(l,o)){this.attachDocumentToIframe(c,l);return}const y=(v,g)=>{if(!this.usingVirtualDom){Ie(v);for(const w of this.config.plugins||[])w.onBuild&&w.onBuild(v,{id:g,replayer:this})}},S=Ce(c.node,{doc:p,mirror:o,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:y});if(c.previousId===-1||c.nextId===-1){r[c.node.id]={node:S,mutation:c};return}const b=o.getMeta(l);if(b&&b.type===oe.Element&&c.node.type===oe.Text){const v=Array.isArray(l.childNodes)?l.childNodes:Array.from(l.childNodes);if(b.tagName==="textarea")for(const g of v)g.nodeType===l.TEXT_NODE&&l.removeChild(g);else if(b.tagName==="style"&&v.length===1)for(const g of v)g.nodeType===l.TEXT_NODE&&!o.hasNode(g)&&(S.textContent=g.textContent,l.removeChild(g))}else if(b?.type===oe.Document){const v=l;c.node.type===oe.DocumentType&&((s=v.childNodes[0])==null?void 0:s.nodeType)===Node.DOCUMENT_TYPE_NODE&&v.removeChild(v.childNodes[0]),S.nodeName==="HTML"&&v.documentElement&&v.removeChild(v.documentElement)}if(f&&f.nextSibling&&f.nextSibling.parentNode?l.insertBefore(S,f.nextSibling):m&&m.parentNode?l.contains(m)?l.insertBefore(S,m):l.insertBefore(S,null):l.appendChild(S),y(S,c.node.id),this.usingVirtualDom&&S.nodeName==="#text"&&l.nodeName==="STYLE"&&((d=l.rules)==null?void 0:d.length)>0&&(l.rules=[]),nr(S,this.mirror)){const v=this.mirror.getId(S),g=this.newDocumentQueue.find(w=>w.parentId===v);g&&(this.attachDocumentToIframe(g,S),this.newDocumentQueue=this.newDocumentQueue.filter(w=>w!==g))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(r,l,S,c)};t.adds.forEach(c=>{a(c)});const h=Date.now();for(;u.length;){const c=Io(u);if(u.length=0,Date.now()-h>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const s of c)o.getNode(s.value.parentId)?Ds(s,l=>{a(l)}):this.debug("Drop resolve tree since there is no parent for the root node.",s)}Object.keys(r).length&&Object.assign(this.legacy_missingNodeRetryMap,r),ko(t.texts).forEach(c=>{var s;const d=o.getNode(c.id);if(!d)return t.removes.find(f=>f.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);const l=d.parentElement;if(c.value&&l&&l.tagName==="STYLE"?d.textContent=Ge(c.value,this.cache):d.textContent=c.value,this.usingVirtualDom){const f=d.parentNode;((s=f?.rules)==null?void 0:s.length)>0&&(f.rules=[])}}),t.attributes.forEach(c=>{var s;const d=o.getNode(c.id);if(!d)return t.removes.find(l=>l.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);for(const l in c.attributes)if(typeof l=="string"){const f=c.attributes[l];if(f===null)d.removeAttribute(l),l==="open"&&Ko(d,c);else if(typeof f=="string")try{if(l==="_cssText"&&(d.nodeName==="LINK"||d.nodeName==="STYLE"))try{const m=o.getMeta(d),p=Ce({...m,attributes:{...m.attributes,...c.attributes}},{doc:d.ownerDocument,mirror:o,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(m.attributes,c.attributes);const y=d.nextSibling,S=d.parentNode;if(p&&S){S.removeChild(d),S.insertBefore(p,y),o.replace(c.id,p);break}}catch{}if(l==="value"&&d.nodeName==="TEXTAREA"){const m=d;m.childNodes.forEach(y=>m.removeChild(y));const p=(s=d.ownerDocument)==null?void 0:s.createTextNode(f);p&&m.appendChild(p)}else d.setAttribute(l,f);l==="rr_open_mode"&&d.nodeName==="DIALOG"&&Ie(d,c)}catch(m){this.warn("An error occurred may due to the checkout feature.",m)}else if(l==="style"){const m=f,p=d;for(const y in m)if(m[y]===!1)p.style.removeProperty(y);else if(m[y]instanceof Array){const S=m[y];p.style.setProperty(y,S[0],S[1])}else{const S=m[y];p.style.setProperty(y,S)}}}})}applyScroll(t,i){var o,r;const u=this.mirror.getNode(t.id);if(!u)return this.debugNodeNotFound(t,t.id);const n=this.mirror.getMeta(u);if(u===this.iframe.contentDocument)(o=this.iframe.contentWindow)==null||o.scrollTo({top:t.y,left:t.x,behavior:i?"auto":"smooth"});else if(n?.type===oe.Document)(r=u.defaultView)==null||r.scrollTo({top:t.y,left:t.x,behavior:i?"auto":"smooth"});else try{u.scrollTo({top:t.y,left:t.x,behavior:i?"auto":"smooth"})}catch{}}applyInput(t){const i=this.mirror.getNode(t.id);if(!i)return this.debugNodeNotFound(t,t.id);try{i.checked=t.isChecked,i.value=t.text}catch{}}applySelection(t){try{const i=new Set,o=t.ranges.map(({start:r,startOffset:u,end:n,endOffset:a})=>{const h=this.mirror.getNode(r),c=this.mirror.getNode(n);if(!h||!c)return;const s=new Range;s.setStart(h,u),s.setEnd(c,a);const d=h.ownerDocument,l=d?.getSelection();return l&&i.add(l),{range:s,selection:l}});i.forEach(r=>r.removeAllRanges()),o.forEach(r=>{var u;return r&&((u=r.selection)==null?void 0:u.addRange(r.range))})}catch{}}applyStyleSheetMutation(t){var i;let o=null;t.styleId?o=this.styleMirror.getStyle(t.styleId):t.id&&(o=((i=this.mirror.getNode(t.id))==null?void 0:i.sheet)||null),o&&(t.source===k.StyleSheetRule?this.applyStyleSheetRule(t,o):t.source===k.StyleDeclaration&&this.applyStyleDeclaration(t,o))}applyStyleSheetRule(t,i){var o,r,u,n;if((o=t.adds)==null||o.forEach(({rule:a,index:h})=>{try{if(Array.isArray(h)){const{positions:c,index:s}=ji(h),d=xe(i.cssRules,c);d?.insertRule(a,s)}else{const c=h===void 0?void 0:Math.min(h,i.cssRules.length);i?.insertRule(a,c)}}catch{}}),(r=t.removes)==null||r.forEach(({index:a})=>{try{if(Array.isArray(a)){const{positions:h,index:c}=ji(a),s=xe(i.cssRules,h);s?.deleteRule(c||0)}else i?.deleteRule(a)}catch{}}),typeof t.replace=="string")try{(u=i.replace)==null||u.call(i,t.replace)}catch{}if(typeof t.replaceSync=="string")try{(n=i.replaceSync)==null||n.call(i,t.replaceSync)}catch{}}applyStyleDeclaration(t,i){if(t.set){const o=xe(i.rules,t.index);o?.style&&o.style.setProperty(t.set.property,t.set.value,t.set.priority)}if(t.remove){const o=xe(i.rules,t.index);o?.style&&o.style.removeProperty(t.remove.property)}}applyAdoptedStyleSheet(t){var i;const o=this.mirror.getNode(t.id);if(!o)return;(i=t.styles)==null||i.forEach(a=>{var h;let c=null,s=null;if(_e(o)?s=((h=o.ownerDocument)==null?void 0:h.defaultView)||null:o.nodeName==="#document"&&(s=o.defaultView),!!s)try{c=new s.CSSStyleSheet,this.styleMirror.add(c,a.styleId),this.applyStyleSheetRule({source:k.StyleSheetRule,adds:a.rules},c)}catch{}});const r=10;let u=0;const n=(a,h)=>{const c=h.map(s=>this.styleMirror.getStyle(s)).filter(s=>s!==null);_e(a)?a.shadowRoot.adoptedStyleSheets=c:a.nodeName==="#document"&&(a.adoptedStyleSheets=c),c.length!==h.length&&u<r&&(setTimeout(()=>n(a,h),0+100*u),u++)};n(o,t.styleIds)}legacy_resolveMissingNode(t,i,o,r){const{previousId:u,nextId:n}=r,a=u&&t[u],h=n&&t[n];if(a){const{node:c,mutation:s}=a;i.insertBefore(c,o),delete t[s.node.id],delete this.legacy_missingNodeRetryMap[s.node.id],(s.previousId||s.nextId)&&this.legacy_resolveMissingNode(t,i,c,s)}if(h){const{node:c,mutation:s}=h;i.insertBefore(c,o.nextSibling),delete t[s.node.id],delete this.legacy_missingNodeRetryMap[s.node.id],(s.previousId||s.nextId)&&this.legacy_resolveMissingNode(t,i,c,s)}}moveAndHover(t,i,o,r,u){const n=this.mirror.getNode(o);if(!n)return this.debugNodeNotFound(u,o);const a=Os(n,this.iframe),h=t*a.absoluteScale+a.x,c=i*a.absoluteScale+a.y;this.mouse.style.left=`${h}px`,this.mouse.style.top=`${c}px`,r||this.drawMouseTail({x:h,y:c}),this.hoverElements(n)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:i,lineWidth:o,strokeStyle:r,duration:u}=this.config.mouseTail===!0?ar:Object.assign({},ar,this.config.mouseTail),n=()=>{if(!this.mouseTail)return;const a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=o,a.lineCap=i,a.strokeStyle=r,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(h=>a.lineTo(h.x,h.y)),a.stroke())};this.tailPositions.push(t),n(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==t),n()},u/this.speedService.state.context.timer.speed)}hoverElements(t){var i;(i=this.lastHoveredRootNode||this.iframe.contentDocument)==null||i.querySelectorAll(".\\:hover").forEach(r=>{r.classList.remove(":hover")}),this.lastHoveredRootNode=t.getRootNode();let o=t;for(;o;)o.classList&&o.classList.add(":hover"),o=o.parentElement}isUserInteraction(t){return t.type!==B.IncrementalSnapshot?!1:t.data.source>k.Mutation&&t.data.source<=k.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(I.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,i){this.warn(`Node with id '${i}' not found. `,t)}warnCanvasMutationFailed(t,i){this.warn("Has error on canvas update",i,"canvas mutation:",t)}debugNodeNotFound(t,i){this.debug(`Node with id '${i}' not found. `,t)}warn(...t){this.config.showWarning&&this.config.logger.warn(Zi,...t)}debug(...t){this.config.showDebug&&this.config.logger.log(Zi,...t)}}function Dr(e,t){const i=new URLSearchParams({replay:e,file:t});return`${Fs}/recording/replay-file?${i}`}async function Ls(e,t){const i=await fetch(Dr(e,t));if(!i.ok)throw new Error(`could not load replay ${t}: HTTP ${i.status}`);return i.text()}function ra(e){return new Promise((t,i)=>{const o=new FileReader;o.onload=()=>t(String(o.result)),o.onerror=()=>i(o.error??new Error("could not read replay asset")),o.readAsDataURL(e)})}async function ia(e){let t=await Ls(e,"events.json");const i=new Set(t.match(/https:\/\/replay-assets\.invalid\/\d{6}\.(?:png|jpg|webp|gif|svg)/g)??[]),o=await Promise.all([...i].map(async u=>{const n=u.split("/").at(-1),a=await fetch(Dr(e,`assets/${n}`));if(!a.ok)throw new Error(`could not load replay asset ${n}`);return[u,await ra(await a.blob())]}));for(const[u,n]of o)t=t.replaceAll(u,n);const r=JSON.parse(t);if(!Array.isArray(r)||r.length===0)throw new Error("replay contains no DOM events");return r}function sa(e,t,i){return Math.max(0,e.videoStartEpochMs+i-t[0].timestamp)}function na(e,t,i){const o=e.videoStartEpochMs+i;let r={rect:e.canvas,drawingWidth:e.canvas.drawingWidth,drawingHeight:e.canvas.drawingHeight};for(const u of t){if(u.timestamp>o)break;u.type===B.Custom&&u.data.tag==="vgai-canvas-layout"&&u.data.payload&&typeof u.data.payload=="object"&&"rect"in u.data.payload&&"drawingWidth"in u.data.payload&&"drawingHeight"in u.data.payload&&(r=u.data.payload)}return r}async function oa(e,t){await new Promise((i,o)=>{const r=()=>{clearTimeout(a),e.removeEventListener("loadeddata",u),e.removeEventListener("error",n)},u=()=>{r(),i()},n=()=>{r(),o(new Error("replay video failed to load"))},a=setTimeout(()=>{r(),o(new Error("replay video load timed out"))},15e3);e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?u():(e.addEventListener("loadeddata",u,{once:!0}),e.addEventListener("error",n,{once:!0}))}),!(Math.abs(e.currentTime-t)<.001)&&await new Promise((i,o)=>{const r=()=>{clearTimeout(a),e.removeEventListener("seeked",u),e.removeEventListener("error",n)},u=()=>{r(),i()},n=()=>{r(),o(new Error("replay video seek failed"))},a=setTimeout(()=>{r(),o(new Error("replay video seek timed out"))},15e3);e.addEventListener("seeked",u,{once:!0}),e.addEventListener("error",n,{once:!0}),e.currentTime=t})}async function aa(e){e.fonts.size>0&&e.fonts.status!=="loaded"&&await Promise.race([e.fonts.ready.then(()=>{}),new Promise(t=>setTimeout(t,3e3))]),await Promise.all(Array.from(e.images,t=>t.decode().catch(()=>{})))}async function la(e,t){const[i,o]=await Promise.all([Ls(e,"manifest.json"),ia(e)]),r=JSON.parse(i);if(r.status!=="complete"||r.format!=="canvas-dom"||r.version!==1||!r.capture||typeof r.capture.durationMs!="number")throw new Error("replay manifest is incomplete or unsupported");const u=document.createElement("div");u.setAttribute("data-vgai-replay-block",""),Object.assign(u.style,{position:"fixed",left:"-100000px",top:"0",width:`${r.viewport.width}px`,height:`${r.viewport.height}px`,overflow:"hidden",pointerEvents:"none"});const n=document.createElement("div");u.append(n),document.body.append(u);const a=document.createElement("video");a.muted=!0,a.preload="auto",a.playsInline=!0,a.src=Dr(e,"video"),u.append(a);let h;try{h=new ta(o,{root:n,showWarning:!1,showDebug:!1,mouseTail:!1,UNSAFE_replayCanvas:!0,insertStyleRules:["[data-vgai-replay-video] { visibility: hidden !important; }"]});const c=h;return await t({manifest:r,async render(s){const d=Math.max(0,Math.min(s,r.capture.durationMs));await oa(a,d/1e3),c.pause(sa(r,o,d)),await aa(c.iframe.contentDocument);const l=c.getMirror().getNode(r.canvas.nodeId),f=c.getMirror().getNode(r.surfaceNodeId);if(!l||l.tagName!=="CANVAS")throw new Error("replay canvas placeholder is unavailable");if(!f||typeof f.getBoundingClientRect!="function")throw new Error("replay game surface is unavailable");const m=l,p=f;m.setAttribute("data-vgai-root-surface","true");const y=na(r,o,d);m.width=y.drawingWidth,m.height=y.drawingHeight;const S=m.getContext("2d");if(!S)throw new Error("replay canvas has no 2D context");return S.drawImage(a,0,0,m.width,m.height),m.style.setProperty("visibility","visible","important"),p}})}finally{a.pause(),h?.destroy(),a.removeAttribute("src"),a.load(),u.remove()}}async function ua(e,t){return la(e,async({manifest:i,render:o})=>{const r=Math.max(0,Math.min(t,i.capture.durationMs)),u=await o(r),n=await Us(u),a=u.getBoundingClientRect();return{...n,replayPath:e,positionMs:r,width:Math.max(1,Math.round(a.width)),height:Math.max(1,Math.round(a.height))}})}function ts(e,t,i){return Math.max(0,e+i-(t??e))}function ke(e){const t=Math.max(0,Math.floor(e/1e3)),i=Math.floor(t/60),o=t%60;return`${i}:${String(o).padStart(2,"0")}`}function Sa(){const e=ie.useSyncExternalStore(ne.subscribe,ne.getSnapshot,ne.getSnapshot),t=ie.useRef(null),i=ie.useRef(null),[o,r]=ie.useState(null),u=ie.useSyncExternalStore(st.subscribe,st.getSnapshot,st.getSnapshot),n=e.selectedSession,a=n?.recording?.finalized?n.recording:null,[h,c]=ie.useState(null),s=ie.useRef(Promise.resolve());ie.useEffect(()=>{if(c(null),!a||a.format!=="canvas-dom"||!a.replay||!o)return;let v=!1;const g=a.replay,w=ts(n?.startedAt??0,a.startedAt??n?.startedAt??0,o.ms),x=setTimeout(()=>{s.current=s.current.catch(()=>{}).then(async()=>{if(!v)try{const E=await ua(g,w);v||c({src:`data:image/png;base64,${E.base64}`})}catch(E){v||c({error:E instanceof Error?E.message:String(E)})}})},180);return()=>{v=!0,clearTimeout(x)}},[a?.replay,a?.format,a?.startedAt,o?.ms,n?.startedAt]);const d=u?Date.parse(u.startedAt):Number.NaN,l=n?.status==="live"&&u&&Number.isFinite(d)&&d>=n.startedAt?u:null,f=n&&o?n.startedAt+o.ms:null,m=l&&f!==null?l.frames.reduce((v,g)=>{const w=Date.parse(g.capturedAt);return Number.isFinite(w)?v?Math.abs(w-f)<Math.abs(Date.parse(v.capturedAt)-f)?g:v:g:v},null)??null:null,p=m?Date.parse(m.capturedAt):Number.NaN,y=m&&f!==null&&Number.isFinite(p)&&Math.abs(p-f)<=Math.max(1e3,2e3/(l?.sampleFps??1))?m:null;function S(v,g){if(!Number.isFinite(v.duration))return;const w=n?.startedAt??0,x=ts(w,a?.startedAt??w,g.ms);v.currentTime=Math.min(x/1e3,Math.max(0,v.duration-.01))}ie.useEffect(()=>{const v=i.current;!v||!o||S(v,o)},[o,a?.startedAt,n?.startedAt]);function b(v){const g=t.current?.getBoundingClientRect();if(!g||g.width<=0)return{ms:0,x:0};const w=Math.max(0,Math.min(v-g.left,g.width));return{ms:w/g.width*e.liveEdgeMs,x:w}}return e.loading&&e.sessions.length===0?z.jsx("div",{style:{padding:`4px ${Se[3]}`,fontSize:11},children:"Loading sessions…"}):e.error&&e.sessions.length===0?z.jsxs("div",{role:"alert",style:{padding:`4px ${Se[3]}`,fontSize:11,color:X.semantic.danger},children:["Gameplay Sessions unavailable: ",e.error]}):z.jsxs("div",{style:{height:28,minHeight:28,display:"flex",alignItems:"center",gap:Se[2],padding:`0 ${Se[3]}`,borderBottom:`1px solid ${X.boundary.default}`,background:X.surface.inset,position:"relative",zIndex:2},children:[z.jsxs("select",{"aria-label":"Gameplay Session",value:e.selectedSessionId??"",onChange:v=>ne.select(v.currentTarget.value),style:{maxWidth:180,height:20,fontSize:11},children:[e.sessions.length===0?z.jsx("option",{value:"",children:"No sessions yet"}):null,e.sessions.map((v,g)=>z.jsx("option",{value:v.id,children:v.status==="live"?"Live":v.run??`Session ${e.sessions.length-g}`},v.id))]}),z.jsx("span",{style:{width:34,fontVariantNumeric:"tabular-nums",fontSize:11},children:ke(e.cursorMs)}),z.jsxs("div",{ref:t,role:"slider","aria-label":"Session time","aria-valuemin":0,"aria-valuemax":e.liveEdgeMs,"aria-valuenow":e.cursorMs,tabIndex:0,onPointerDown:v=>{v.currentTarget.setPointerCapture(v.pointerId),ne.seek(b(v.clientX).ms)},onPointerMove:v=>{const g=b(v.clientX);r(g),v.currentTarget.hasPointerCapture(v.pointerId)&&ne.seek(g.ms)},onPointerLeave:()=>r(null),onKeyDown:v=>{v.key==="ArrowLeft"&&ne.seek(e.cursorMs-1e3),v.key==="ArrowRight"&&ne.seek(e.cursorMs+1e3)},style:{flex:1,height:12,position:"relative",cursor:"ew-resize",outline:"none"},children:[z.jsx("div",{style:{position:"absolute",left:0,right:0,top:5,height:2,background:X.boundary.strong}}),z.jsx("div",{style:{position:"absolute",left:`${e.liveEdgeMs>0?e.cursorMs/e.liveEdgeMs*100:0}%`,top:1,width:2,height:10,background:X.accent.default}}),o&&(a||l)?z.jsxs("div",{style:{position:"absolute",left:Math.max(0,o.x-80),top:16,width:160,padding:3,background:X.surface.raised,border:`1px solid ${X.boundary.strong}`,boxShadow:"0 6px 18px rgba(0,0,0,.35)",pointerEvents:"none"},children:[a?.format==="canvas-dom"?h?.src?z.jsx("img",{src:h.src,alt:"Recorded gameplay with HUD",style:{width:"100%",display:"block"}}):z.jsx("div",{role:"status",style:{padding:Se[4],fontSize:Bs.sm},children:h?.error??"Reconstructing frame…"}):a?z.jsx("video",{ref:i,src:a.url,muted:!0,preload:"metadata",onLoadedMetadata:v=>{o&&S(v.currentTarget,o)},style:{width:"100%",display:"block"}}):y?z.jsx("img",{src:y.src,alt:"Live gameplay recording preview",style:{width:"100%",display:"block"}}):z.jsx("div",{style:{padding:8,fontSize:10,color:X.content.muted},children:l?.frames.length===0?"Frame previews are available after recording stops.":`This point is outside the ${ke(l?.retentionMs??0)} live preview window.`}),z.jsx("div",{style:{fontSize:10,textAlign:"center",paddingTop:2},children:ke(o.ms)})]}):null]}),z.jsx("span",{style:{width:34,fontVariantNumeric:"tabular-nums",fontSize:11},children:ke(e.liveEdgeMs)}),n?.status==="live"?z.jsxs("span",{style:{color:X.semantic.danger,fontSize:10},children:["● LIVE",l?" VIDEO":""]}):a?z.jsx("span",{style:{fontSize:10,color:X.content.muted},children:"VIDEO"}):null,e.error?z.jsx("span",{role:"status",title:e.error,style:{color:X.semantic.warning,fontSize:11},children:"⚠"}):null]})}export{Sa as GameplaySessionTimeline};