@mindstudio-ai/browser-agent 0.1.57 → 0.1.58

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 (2) hide show
  1. package/dist/index.js +21 -21
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,22 +1,22 @@
1
- "use strict";var __MindStudioBrowserAgent=(()=>{var Tr=Object.defineProperty;var ss=Object.getOwnPropertyDescriptor;var ls=Object.getOwnPropertyNames;var cs=Object.prototype.hasOwnProperty;var Nr=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var us=(e,t)=>{for(var r in t)Tr(e,r,{get:t[r],enumerable:!0})},ds=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ls(t))!cs.call(e,o)&&o!==r&&Tr(e,o,{get:()=>t[o],enumerable:!(n=ss(t,o))||n.enumerable});return e};var fs=e=>ds(Tr({},"__esModule",{value:!0}),e);var nf={};us(nf,{executeSteps:()=>nr,getRefMap:()=>Je,resolveElement:()=>Me,takeSnapshot:()=>Qe,takeSnapshotSync:()=>Dr});var Lr="__ms";function ms(){return{ws:{ws:null,clientId:null,reconnectDelay:1e3,closing:!1,busy:!1},cursor:{el:null,rippleEl:null,x:-100,y:-100,hasPosition:!1,hideTimer:null,executing:!1,targetElement:null,trackingFrame:null,settledResolve:null,visibilityState:"hidden",preSnapshotState:null},snapshot:{refCounter:0,refMap:new Map},networkIdle:{activeRequests:0},transport:{buffer:[],flushTimer:null,capturing:!1,captured:[],wsGetter:null},noteLayer:{overlay:null,cursorEl:null,notes:[],currentNote:null,pointerDown:!1,startX:0,startY:0,didDrag:!1,consumedByDeactivation:!1,dragPreview:null,movingNote:null,moveOffsetX:0,moveOffsetY:0},noteElement:{counter:0},notesMode:{active:!1,wasTouchActive:!1},messages:{handler:null},screenshot:{cameraEl:null,flashEl:null,capturing:!1},fonts:{initialized:!1,observer:null},zoom:{pipMode:!1,mobilePreview:!1},touch:{circleEl:null,active:!1,pressed:!1,dragging:!1,startX:0,startY:0,lastX:0,lastY:0,onMouseMove:null,onMouseDown:null,onMouseUp:null,onMouseLeave:null,onDragStart:null,momentumFrame:null,overscrollY:0,bouncing:!1,bounceTimer:null,scrollContainer:null,velocityX:0,velocityY:0,lastMoveTime:0},mirror:{recording:!1,stopFn:null}}}function A(){let e=window;return e[Lr]||(e[Lr]=ms()),e[Lr]}var Wn="/__mindstudio_dev__/logs",ps=2e3;function Bn(e){A().transport.wsGetter=e}function Un(){let e=A().transport;if(e.buffer.length===0)return;let t=e.buffer;e.buffer=[];let r=e.wsGetter?.();if(r&&r.readyState===WebSocket.OPEN)try{r.send(JSON.stringify({type:"log",entries:t}));return}catch{}try{let n=new XMLHttpRequest;n.open("POST",Wn,!0),n.setRequestHeader("Content-Type","application/json"),n.send(JSON.stringify(t))}catch{}}function hs(){let e=A().transport;e.flushTimer||(e.flushTimer=setTimeout(()=>{e.flushTimer=null,Un()},ps))}function gs(){let e=A().transport;e.flushTimer&&(clearTimeout(e.flushTimer),e.flushTimer=null),Un()}function pe(e){let t=A().transport;t.buffer.push(e),t.capturing&&t.captured.push(e),hs()}function Rr(e){let t=A().transport;t.buffer.push(e),t.capturing&&t.captured.push(e),gs()}function Fr(){let e=A().transport;e.capturing=!0,e.captured=[]}function _r(){let e=A().transport;e.capturing=!1;let t=e.captured;return e.captured=[],t}function Hn(){window.addEventListener("beforeunload",()=>{let e=A().transport;e.buffer.length>0&&navigator.sendBeacon&&navigator.sendBeacon(Wn,JSON.stringify(e.buffer))})}var ys={a:"link",button:"button",input:"textbox",textarea:"textbox",select:"combobox",option:"option",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",nav:"navigation",main:"main",header:"banner",footer:"contentinfo",aside:"complementary",dialog:"dialog",details:"group",summary:"button",img:"img",ul:"list",ol:"list",li:"listitem",table:"table",tr:"row",th:"columnheader",td:"cell",form:"form",article:"article",section:"region",label:"label",fieldset:"group",legend:"legend",p:"paragraph",blockquote:"blockquote",pre:"code",code:"code",hr:"separator",progress:"progressbar"};function $e(e){let t=e.getAttribute("role");if(t)return t==="presentation"||t==="none"?null:t;let r=e.tagName.toLowerCase();if(r==="a")return e.hasAttribute("href")?"link":null;if(r==="section")return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?"region":null;if(r==="form")return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?"form":null;if(r==="img")return e.alt===""?null:"img";if(r==="input")switch(e.type){case"checkbox":return"checkbox";case"radio":return"radio";case"range":return"slider";case"submit":case"button":case"reset":return"button";case"hidden":return null;default:return"textbox"}return ys[r]??null}function Vn(e){if(e.hasAttribute("onclick")||e.hasAttribute("tabindex")&&e.getAttribute("tabindex")!=="-1")return!0;try{if(getComputedStyle(e).cursor==="pointer")return!0}catch{}return!1}function Ke(e){let t=e.getAttribute("aria-label");if(t)return t.trim();let r=e.getAttribute("aria-labelledby");if(r){let a=r.split(/\s+/).map(s=>{let c=document.getElementById(s);return c?Pe(c):""}).filter(Boolean).join(" ");if(a)return a}let n=e.tagName.toLowerCase();if(n==="input"||n==="textarea"||n==="select"){let a=bs(e);if(a)return a}if(n==="img"){let a=e.alt;if(a)return a.trim()}if(n==="fieldset"){let a=e.querySelector("legend");if(a)return Pe(a)}let o=Pe(e);if(o)return o;let i=e.getAttribute("title");return i?i.trim():""}function Pe(e){if(!e.children.length)return(e.textContent||"").trim();let t=[];for(let r of Array.from(e.childNodes))if(r.nodeType===Node.TEXT_NODE){let n=(r.textContent||"").trim();n&&t.push(n)}else if(r.nodeType===Node.ELEMENT_NODE){let n=r;if(vs(n))continue;let o=ws(n),i=Pe(n);i&&(o&&t.length>0&&t.push(" "),t.push(i),o&&t.push(" "))}return t.join("").replace(/\s+/g," ").trim()}function bs(e){if(e.id){let r=document.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(r)return Pe(r)}let t=e.closest("label");if(t){let r=t.cloneNode(!0),n=r.querySelector("input, textarea, select");n&&n.remove();let o=r.textContent?.trim();if(o)return o}return null}function ws(e){try{return!getComputedStyle(e).display.includes("inline")}catch{let t=e.tagName.toLowerCase();return["div","p","h1","h2","h3","h4","h5","h6","li","section","article","header","footer","nav","main","aside","blockquote","pre","form","fieldset","table","tr","br"].includes(t)}}function vs(e){let t=e.tagName.toLowerCase();if(t==="script"||t==="style"||t==="noscript"||t==="template"||e.getAttribute("aria-hidden")==="true")return!0;try{let r=getComputedStyle(e);if(r.display==="none"||r.visibility==="hidden")return!0}catch{}return!1}function Or(e,t){try{let r=getComputedStyle(e,t).content;if(!r||r==="none"||r==="normal")return"";let n=r.match(/^["'](.*)["']$/);return n?n[1]:""}catch{return""}}function Ot(){A().networkIdle.activeRequests++}function pt(){let e=A().networkIdle;e.activeRequests=Math.max(0,e.activeRequests-1)}function Gn(e=5e3,t=200){return new Promise((r,n)=>{let o=Date.now()+e,i=null;function a(){if(Date.now()>o){i&&clearTimeout(i),r();return}A().networkIdle.activeRequests===0?i||(i=setTimeout(()=>{A().networkIdle.activeRequests===0?r():(i=null,a())},t)):(i&&(clearTimeout(i),i=null),setTimeout(a,50))}a()})}function Je(){return A().snapshot.refMap}async function Qe(){return await Gn(),Dr()}function Dr(){let e=A().snapshot;e.refCounter=0,e.refMap=new Map;let t=document.body;if(!t)return"(empty page)";let r=zn(t);return $r(r,0).trimEnd()}function he(e){let t=$e(e),r=Ke(e),n=r.length>60?r.slice(0,57)+"...":r;if(t&&n)return`${t} "${n}"`;if(t)return t;if(n)return`"${n}"`;let o=e.tagName.toLowerCase();return e.id?`${o}#${e.id}`:o}function zn(e){if(Ss(e))return[];let t=$e(e),r=!t&&Vn(e),n=t||(r?"clickable":null),o="";if(n){o=Ke(e);let u=Or(e,"::before"),d=Or(e,"::after");(u||d)&&(o=[u,o,d].filter(Boolean).join(" ")),o.length>80&&(o=o.slice(0,77)+"...")}let i=xs(e),a=t==="button"||t==="link"||t==="textbox"||t==="combobox"||t==="checkbox"||t==="radio"||t==="slider"||t==="tab"||t==="menuitem"||r,s=n&&o&&!a,c=null;if(a||s){let u=A().snapshot;u.refCounter++,c=`e${u.refCounter}`,u.refMap.set(c,e)}let l=Cs(e);if(n){let u=l.length===0?"":$r(l,0).trim();return[{tag:n,name:o,attrs:i,ref:c,children:u&&u===o?[]:l,element:e}]}if(l.length===0){let u=Pe(e);if(u)return[{tag:null,name:u.length>80?u.slice(0,77)+"...":u,attrs:[],ref:null,children:[],element:e}]}return l}function Cs(e){let t=[];for(let r of Array.from(e.childNodes))r.nodeType===Node.ELEMENT_NODE&&t.push(...zn(r));return t}function Ss(e){let t=e.tagName.toLowerCase();if(t==="script"||t==="style"||t==="noscript"||t==="template"||t==="head"||e.getAttribute("aria-hidden")==="true"||e.id==="__mindstudio-browser-agent"||e.id==="__mindstudio-cursor"||e.id==="__mindstudio-cursor-ripple"||e.id==="__mindstudio-notes-overlay"||e.id==="__mindstudio-notes-cursor")return!0;try{let r=getComputedStyle(e);if(r.display==="none"||r.visibility==="hidden"&&r.position!=="static")return!0}catch{}return!1}function xs(e){let t=[],r=e.tagName.toLowerCase();if((r==="dialog"&&e.open||r==="details"&&e.open)&&t.push("open"),e.disabled&&t.push("disabled"),r==="input"){let i=e;(i.type==="checkbox"||i.type==="radio")&&i.checked&&t.push("checked")}if(r==="input"){let i=e;i.type!=="checkbox"&&i.type!=="radio"&&i.type!=="hidden"&&i.type!=="submit"&&i.type!=="button"&&i.type!=="reset"&&(t.push(`value="${i.value}"`),i.placeholder&&t.push(`placeholder="${i.placeholder}"`))}if(r==="textarea"){let i=e;t.push(`value="${i.value}"`),i.placeholder&&t.push(`placeholder="${i.placeholder}"`)}if(r==="select"){let i=e,a=i.options[i.selectedIndex];a&&t.push(`value="${a.text}"`)}let n=r.match(/^h([1-6])$/);n&&t.push(`level=${n[1]}`);let o=e.getAttribute("aria-expanded");return o==="true"&&t.push("expanded"),o==="false"&&t.push("collapsed"),e.getAttribute("aria-selected")==="true"&&t.push("selected"),e.getAttribute("aria-pressed")==="true"&&t.push("pressed"),t}function $r(e,t){let r="";for(let n of e)r+=Is(n,t);return r}function Is(e,t){let r=" ".repeat(t),n=[];e.tag&&n.push(e.tag),e.name&&n.push(`"${e.name}"`);for(let a of e.attrs)n.push(`[${a}]`);e.ref&&n.push(`[ref=${e.ref}]`);let o="";n.length>0&&(o+=`${r}${n.join(" ")}
2
- `);let i=n.length>0?t+1:t;return o+=$r(e.children,i),o}function Yn(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e instanceof Error)return e.stack||e.message||String(e);if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function oe(e){return new Promise(t=>setTimeout(t,e))}function We(){let e=null,t=0;for(let r of document.querySelectorAll("*")){let n=r,o=getComputedStyle(n).overflowY;if(o!=="auto"&&o!=="scroll")continue;let i=n.scrollHeight-n.clientHeight;i<=20||i>t&&(t=i,e=n)}return e??document.documentElement}var As=["log","info","warn","error","debug"];function qn(){if(!console.__ms_patched){console.__ms_patched=!0;for(let e of As){let t=console[e];console[e]=(...r)=>{t&&t.apply(console,r),pe({type:"console",level:e,args:r.map(Yn),url:location.href})}}}}function jn(){window.__ms_error_patched||(window.__ms_error_patched=!0,window.addEventListener("error",e=>{Rr({type:"error",message:e.message,stack:e.error&&e.error.stack||"",source:e.filename,line:e.lineno,column:e.colno,url:location.href})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason||{};Rr({type:"error",message:t.message||String(t),stack:t.stack||"",url:location.href})}))}function Zn(){if(!window.fetch||window.fetch.__ms_patched)return;let e=window.fetch;window.fetch=function(t,r){let n=(r?.method||"GET").toUpperCase(),o=typeof t=="string"?t:t instanceof URL?t.href:t.url||String(t);if(o.includes("/__mindstudio_dev__/"))return e.apply(this,[t,r]);let i=Date.now();return Ot(),e.apply(this,[t,r]).then(a=>{pt();let s={type:"network",method:n,url:o,status:a.status,statusText:a.statusText,duration:Date.now()-i,ok:a.ok};if(a.ok)pe(s);else try{a.clone().text().then(c=>{s.body=c.slice(0,1e3),pe(s)}).catch(()=>pe(s))}catch{pe(s)}return a},a=>{throw pt(),pe({type:"network",method:n,url:o,error:a.message||String(a),duration:Date.now()-i,ok:!1}),a})},window.fetch.__ms_patched=!0}function Xn(){document.__ms_click_patched||(document.__ms_click_patched=!0,document.addEventListener("click",e=>{let t=e.target,r=(t?.textContent||"").trim().slice(0,100);pe({type:"interaction",event:"click",target:he(t),text:r,url:location.href})},!0))}function Kn(){if(XMLHttpRequest.prototype.open.__ms_patched)return;let e=window.XMLHttpRequest,t=e.prototype.open,r=e.prototype.send;e.prototype.open=function(n,o,...i){return this.__ms_method=n.toUpperCase(),this.__ms_url=String(o),t.apply(this,[n,o,...i])},e.prototype.send=function(n){let o=this.__ms_method||"GET",i=this.__ms_url||"";if(i.includes("/__mindstudio_dev__/"))return r.apply(this,[n]);let a=Date.now();return Ot(),this.addEventListener("loadend",function(){pt(),pe({type:"network",method:o,url:i,status:this.status,statusText:this.statusText,duration:Date.now()-a,ok:this.status>=200&&this.status<300,...this.status>=400?{body:(this.responseText||"").slice(0,1e3)}:{},via:"xhr"})},{once:!0}),r.apply(this,[n])},XMLHttpRequest.prototype.open.__ms_patched=!0}function Me(e){let t=null;if(e.ref){let r=Je(),n=r.get(e.ref);if(n&&n.isConnected)if(ke(n))t={element:n,matched:`${he(n)} [ref=${e.ref}]`};else throw new Error(`Element [ref=${e.ref}] exists but is hidden (${Pr(n)}). It may be inside a closed dialog or collapsed section.`);else{let o=[...r.entries()].filter(([,i])=>i.isConnected&&ke(i)).slice(0,10).map(([i,a])=>`${he(a)} [ref=${i}]`).join(", ");throw new Error(`Element [ref=${e.ref}] not found. `+(o?`Available refs: ${o}`:"No refs available \u2014 take a snapshot first."))}}if(!t&&(e.text||e.role&&e.text)){let r=e.text,n=e.role,o=Jn(r,n);if(o.length===0){let i=Jn(r,n,!0);if(i.length>0)throw new Error(`Found ${n?n+" ":""}"${r}" but it is hidden (${Pr(i[0])}). Wait for it to become visible or check if a dialog/modal needs to be opened first.`);let a=n?`${n} "${r}"`:`"${r}"`,s=Qn(n);throw new Error(`No element found matching ${a}. `+(s?`Visible ${n||"element"}s: ${s}`:"The page may still be loading \u2014 try a wait command first."))}if(o.length>1){let i=o.filter(eo),a=i.length===1?i[0]:o[0];t={element:a,matched:he(a)}}else t={element:o[0],matched:he(o[0])}}if(!t&&e.role&&!e.text){let r=e.role,n=Es(r);if(n.length===0){let o=Qn(r);throw new Error(`No visible element with role "${r}" found. `+(o?`Visible ${r}s: ${o}`:"The page may still be loading \u2014 try a wait command first."))}t={element:n[0],matched:he(n[0])}}if(!t&&e.label){let r=e.label,n=ks(r);if(!n){let o=[...document.querySelectorAll("label")].filter(ke).map(i=>`"${(i.textContent||"").trim().slice(0,40)}"`).slice(0,8).join(", ");throw new Error(`No input found with label "${r}". `+(o?`Visible labels: ${o}`:"No labels found on the page."))}t={element:n,matched:`${he(n)} via label "${r}"`}}if(!t&&e.selector){let r=e.selector,n=document.querySelector(r);if(!n)throw new Error(`No element found for selector "${r}".`);if(!ke(n))throw new Error(`Found element for selector "${r}" but it is hidden (${Pr(n)}).`);t={element:n,matched:`${he(n)} via selector "${r}"`}}if(!t)throw new Error("No targeting field provided (need ref, text, role, label, or selector)");return t}function Jn(e,t,r=!1){let n=[],o=e.toLowerCase();for(let i of document.querySelectorAll("*")){if(!r&&!ke(i)||r&&!i.isConnected||t&&$e(i)!==t)continue;if(Ke(i).toLowerCase().includes(o)){n.push(i);continue}i.children.length||(i.textContent||"").trim().toLowerCase().includes(o)&&n.push(i)}return n}function Es(e){let t=[];for(let r of document.querySelectorAll("*"))ke(r)&&$e(r)===e&&t.push(r);return t}function ks(e){let t=e.toLowerCase();for(let r of document.querySelectorAll("label")){if(!(r.textContent||"").trim().toLowerCase().includes(t))continue;let o=r.getAttribute("for");if(o){let a=document.getElementById(o);if(a&&ke(a))return a}let i=r.querySelector("input, textarea, select");if(i&&ke(i))return i}return null}function ke(e){if(!e.isConnected)return!1;try{let t=getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden")return!1}catch{return!1}return!0}function eo(e){if(e.matches('a, button, input, textarea, select, [role="button"], [role="link"], [tabindex]'))return!0;try{return getComputedStyle(e).cursor==="pointer"}catch{return!1}}function Pr(e){try{let t=getComputedStyle(e);if(t.display==="none")return"display: none";if(t.visibility==="hidden")return"visibility: hidden"}catch{}return e.getAttribute("aria-hidden")==="true"?'aria-hidden="true"':"hidden"}function Qn(e){let t=[];for(let r of document.querySelectorAll("*"))if(ke(r)&&(e?$e(r)===e&&t.push(r):eo(r)&&t.push(r),t.length>=10))break;return t.length===0?"":t.map(r=>`"${Ke(r).slice(0,40)||he(r)}"`).join(", ")}function Wr(e){let t=e.getBoundingClientRect(),r=t.left+t.width/2,n=t.top+t.height/2,o={bubbles:!0,cancelable:!0,clientX:r,clientY:n,button:0};e.dispatchEvent(new PointerEvent("pointerdown",{...o,pointerId:1})),e.dispatchEvent(new MouseEvent("mousedown",o)),e instanceof HTMLElement&&e.focus(),e.dispatchEvent(new PointerEvent("pointerup",{...o,pointerId:1})),e.dispatchEvent(new MouseEvent("mouseup",o)),e.dispatchEvent(new MouseEvent("click",o))}var Ms=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set,Ts=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value")?.set;async function no(e,t,r={}){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new Error("type command requires an input or textarea element");e.focus(),Wr(e),r.clear&&(to(e,""),e.dispatchEvent(new Event("input",{bubbles:!0})));for(let n=0;n<t.length;n++){let o=t[n];e.dispatchEvent(new KeyboardEvent("keydown",{key:o,code:`Key${o.toUpperCase()}`,bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keypress",{key:o,code:`Key${o.toUpperCase()}`,bubbles:!0})),to(e,e.value+o),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keyup",{key:o,code:`Key${o.toUpperCase()}`,bubbles:!0})),await oe(Ns(o,t.length))}e.dispatchEvent(new Event("change",{bubbles:!0}))}function Ns(e,t){let r=Math.random()*50-25,n;if(e===" "?n=120+r:/[.,!?;:\-]/.test(e)?n=140+r:/[A-Z]/.test(e)?n=115+r:n=85+r,t<=20)return n;let o=Math.max(.1,20/t);return n*o}function to(e,t){let r=e instanceof HTMLTextAreaElement?Ts:Ms;r?r.call(e,t):e.value=t}async function oo(e){let t=e.timeout||5e3,r=Date.now(),n=r+t;for(;Date.now()<n;)try{return{...Me(e),elapsed:Date.now()-r}}catch{await oe(100)}let o=e.text?`"${e.text}"`:e.role?`role "${e.role}"`:e.selector?`selector "${e.selector}"`:"element";throw new Error(`Timed out waiting for ${o} after ${t}ms`)}var ro=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set;function io(e,t){if(!(e instanceof HTMLSelectElement))throw new Error("select command requires a <select> element");let r=t.toLowerCase(),n=null;for(let o of e.options)if(o.text.toLowerCase().includes(r)||o.value.toLowerCase()===r||o.label.toLowerCase().includes(r)){n=o;break}if(!n){let o=[...e.options].map(i=>`"${i.text}"`).join(", ");throw new Error(`No option matching "${t}" in select. Available options: ${o}`)}return ro?ro.call(e,n.value):e.value=n.value,e.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new Event("input",{bubbles:!0})),n.text}async function ao(e){try{let r=!/\b(return|;|\{)\b/.test(e.trim())?`return (${e})`:e,o=new Function(r)();return o instanceof Promise?await o:o}catch(t){throw new Error(`evaluate failed: ${t instanceof Error?t.message:String(t)}`)}}var Rs=Object.defineProperty,fe=(e,t)=>()=>(e&&(t=e(e=0)),t),Ct=(e,t)=>{for(var r in t)Rs(e,r,{get:t[r],enumerable:!0})};function Fs(e){if(e===!0)return"soft";if(e===!1)return"disabled";if(typeof e=="string"){let t=e.toLowerCase().trim();if(t==="auto")return"auto";if(t==="full")return"full";if(t==="soft"||t==="disabled")return t}return"soft"}function _s(e="soft"){switch(E.session.__counterEpoch=(E.session.__counterEpoch||0)+1,e){case"auto":{E.session.styleMap=new Map,E.session.nodeMap=new Map;return}case"soft":{E.session.styleMap=new Map,E.session.nodeMap=new Map,E.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{E.session.styleMap=new Map,E.session.nodeMap=new Map,E.session.styleCache=new WeakMap,E.computedStyle=new WeakMap,E.baseStyle=new ge(50),E.defaultStyle=new ge(30),E.image=new ge(100),E.background=new ge(100),E.resource=new ge(150),E.font=new Set;return}default:{E.session.styleMap=new Map,E.session.nodeMap=new Map,E.session.styleCache=new WeakMap;return}}}var ge,E,be=fe(()=>{ge=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,t)}},E={image:new ge(100),background:new ge(100),resource:new ge(150),defaultStyle:new ge(30),baseStyle:new ge(50),computedStyle:new WeakMap,measureHints:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function en(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let r=t[2].trim();return r.startsWith("#")?null:r}function Os(e){if(!e||e==="none")return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(r,n)=>{let o=n.split(",").map(i=>i.trim());return o.length!==6?`matrix(${n})`:(o[4]="0",o[5]="0",`matrix(${o.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(r,n)=>{let o=n.split(",").map(i=>i.trim());return o.length!==16?`matrix3d(${n})`:(o[12]="0",o[13]="0",`matrix3d(${o.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function Vt(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function Ds(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let r=t||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(e,r).href}catch{return e}}var zt=fe(()=>{});function $s(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:r=12}={}){let n=new Map,o=0;function i(a,s,c){if(o>=r)return;let l=Date.now();(n.get(s)||0)>l||(n.set(s,l+t),o++,a==="warn"&&console&&console.warn?console.warn(`${e} ${c}`):console&&console.error&&console.error(`${e} ${c}`))}return{warnOnce(a,s){i("warn",a,s)},errorOnce(a,s){i("error",a,s)},reset(){n.clear(),o=0}}}function Ps(e){return/^data:|^blob:|^about:blank$/i.test(e)}function Ws(e,t){try{let r=typeof location<"u"&&location.href?location.href:"http://localhost/",n=t.includes("{url}")?t.split("{url}")[0]:t,o=new URL(n||".",r),i=new URL(e,r);if(i.origin===o.origin)return!0;let a=i.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}function Bs(e,t){if(!t||Ps(e)||Ws(e,t))return!1;try{let r=typeof location<"u"&&location.href?location.href:"http://localhost/",n=new URL(e,r);return typeof location<"u"?n.origin!==location.origin:!0}catch{return!!t}}function Us(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",Vt(e)).replace("{url}",encodeURIComponent(e));if(/[?&]url=?$/.test(t))return`${t}${encodeURIComponent(e)}`;if(t.endsWith("?"))return`${t}url=${encodeURIComponent(e)}`;if(t.endsWith("/"))return`${t}${Vt(e)}`;let r=t.includes("?")?"&":"?";return`${t}${r}url=${encodeURIComponent(e)}`}function so(e){return new Promise((t,r)=>{let n=new FileReader;n.onload=()=>t(String(n.result||"")),n.onerror=()=>r(new Error("read_failed")),n.readAsDataURL(e)})}function Hs(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function ye(e,t={}){let r=t.as??"blob",n=t.timeout??3e3,o=t.useProxy||"",i=t.errorTTL??8e3,a=t.headers||{},s=!!t.silent;if(/^data:/i.test(e))try{if(r==="text")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(r==="dataURL")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,h="",y=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],v=/;base64/i.test(h)?atob(y):decodeURIComponent(y),w=new Uint8Array([...v].map(S=>S.charCodeAt(0))),b=new Blob([w],{type:(h||"").split(";")[0]||""});return{ok:!0,data:b,status:200,url:e,fromCache:!1,mime:b.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let h=await fetch(e);if(!h.ok)return{ok:!1,data:null,status:h.status,url:e,fromCache:!1,reason:"http_error"};let y=await h.blob(),v=y.type||h.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:await so(y),status:h.status,url:e,fromCache:!1,mime:v}:r==="text"?{ok:!0,data:await y.text(),status:h.status,url:e,fromCache:!1,mime:v}:{ok:!0,data:y,status:h.status,url:e,fromCache:!1,mime:v}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(e))return r==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:r==="text"?"":new Blob([]),status:200,url:e,fromCache:!1};let c=Hs(e,{as:r,timeout:n,useProxy:o,errorTTL:i}),l=gt.get(c);if(l&&l.until>Date.now())return{...l.result,fromCache:!0};l&&gt.delete(c);let u=$t.get(c);if(u)return u;let d=Bs(e,o)?Us(e,o):e,f=t.credentials;if(!f)try{let h=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(e,h);f=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{f="omit"}let m=new AbortController,p=setTimeout(()=>m.abort("timeout"),n),g=(async()=>{try{let h=await fetch(d,{signal:m.signal,credentials:f,headers:a});if(!h.ok){let w={ok:!1,data:null,status:h.status,url:d,fromCache:!1,reason:"http_error"};if(i>0&&gt.set(c,{until:Date.now()+i,result:w}),!s){let b=`${h.status} ${h.statusText||""}`.trim();Hr.warnOnce(`http:${h.status}:${r}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${b} while fetching ${r} ${e}`)}return t.onError&&t.onError(w),w}if(r==="text")return{ok:!0,data:await h.text(),status:h.status,url:d,fromCache:!1};let y=await h.blob(),v=y.type||h.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:await so(y),status:h.status,url:d,fromCache:!1,mime:v}:{ok:!0,data:y,status:h.status,url:d,fromCache:!1,mime:v}}catch(h){let y=h&&typeof h=="object"&&"name"in h&&h.name==="AbortError"?String(h.message||"").includes("timeout")?"timeout":"abort":"network",v={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:y};if(!/^blob:/i.test(e)&&i>0&&gt.set(c,{until:Date.now()+i,result:v}),!s){let w=`${y}:${r}:${new URL(e,location?.href??"http://localhost/").origin}`,b=y==="timeout"?`Timeout after ${n}ms. Consider increasing timeout or using a proxy for ${e}`:y==="abort"?`Request aborted while fetching ${r} ${e}`:`Network/CORS issue while fetching ${r} ${e}. A proxy may be required`;Hr.errorOnce(w,b)}return t.onError&&t.onError(v),v}finally{clearTimeout(p),$t.delete(c)}})();return $t.set(c,g),g}var Hr,$t,gt,ot=fe(()=>{zt(),Hr=$s("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),$t=new Map,gt=new Map});async function Ro(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let r=en(e);if(!r)return e;let n=Ds(r),o=Vt(n);if(E.background.has(o)){let i=E.background.get(o);return i?`url("${i}")`:"none"}try{let i=await ye(o,{as:"dataURL",useProxy:t.useProxy});return i.ok?(E.background.set(o,i.data),`url("${i.data}")`):(E.background.set(o,null),"none")}catch{return E.background.set(o,null),"none"}}var Vs=fe(()=>{be(),zt(),ot()});function Gs(e){if(e=String(e).toLowerCase(),rn.has(e)){let i={};return E.defaultStyle.set(e,i),i}if(E.defaultStyle.has(e))return E.defaultStyle.get(e);let t=document.getElementById("snapdom-sandbox");t||(t=document.createElement("div"),t.id="snapdom-sandbox",t.setAttribute("data-snapdom-sandbox","true"),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0px",t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t));let r=document.createElement(e);r.style.all="initial",t.appendChild(r);let n=getComputedStyle(r),o={};for(let i of n){if(tn(i))continue;let a=n.getPropertyValue(i);o[i]=a}return t.removeChild(r),E.defaultStyle.set(e,o),o}function tn(e){let t=String(e).toLowerCase();return!!(Do.has(t)||Oo.test(t)||_o.test(t))}function Vr(e,t){if(t=String(t||"").toLowerCase(),rn.has(t))return"";let r=[],n=Gs(t),o=(e.display||"").toLowerCase()==="inline"||new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]).has(t);for(let[i,a]of Object.entries(e)){if(tn(i)||o&&(i==="width"||i==="min-width"||i==="max-width"))continue;let s=n[i];a&&a!==s&&r.push(`${i}:${a}`)}return r.sort(),r.join(";")}function zs(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),typeof e.querySelectorAll=="function"&&e.querySelectorAll("*").forEach(r=>t.add(r.tagName.toLowerCase())),Array.from(t))}function Ys(e){let t=new Map;for(let n of e){let o=E.defaultStyle.get(n);if(!o)continue;let i=Object.entries(o).map(([a,s])=>`${a}:${s};`).sort().join("");i&&(t.has(i)||t.set(i,[]),t.get(i).push(n))}let r="";for(let[n,o]of t.entries())r+=`${o.join(",")} { ${n} }
3
- `;return r}function qs(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),r=new Map,n=1;for(let o of t)r.set(o,`c${n++}`);return r}function js(e){try{let t=e?.ownerDocument;if(!t)return typeof window<"u"?window:null;let r=t.defaultView;if(r&&typeof r.getComputedStyle=="function")return r;if(typeof window<"u"&&window.frames)for(let n=0;n<window.frames.length;n++)try{if(window.frames[n]?.document===t)return window.frames[n]}catch{}}catch{}return typeof window<"u"?window:null}function Ne(e,t=null){let r=()=>{let i={length:0,getPropertyValue:()=>"",item:()=>""};return i[Symbol.iterator]=function*(){},i};if(!(e instanceof Element)){let i=typeof window<"u"?window:null;if(i&&typeof i.getComputedStyle=="function")try{return i.getComputedStyle(e,t)||r()}catch{return r()}return r()}let n=E.computedStyle.get(e);n||(n=new Map,E.computedStyle.set(e,n));let o=n.get(t);if(!o){let i=js(e),a=null;try{a=i&&typeof i.getComputedStyle=="function"?i.getComputedStyle(e,t):null}catch{}if(!a&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{e.ownerDocument===document&&(a=window.getComputedStyle(e,t))}catch{}o=a||r(),n.set(t,o)}return o}function lo(e){let t={};for(let r of e)t[r]=e.getPropertyValue(r);return t}function Gr(e){let t=[],r=0,n=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("&&r++,i===")"&&r--,i===","&&r===0&&(t.push(e.slice(n,o).trim()),n=o+1)}return t.push(e.slice(n).trim()),t}var Fo,rn,Zs,_o,Oo,Do,$o=fe(()=>{be(),Fo=new Set(["meta","script","noscript","title","link","template"]),rn=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),Zs=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"],_o=/(?:^|-)(animation|transition)(?:-|$)/i,Oo=/^(--.+|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Do=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom"])});function rt(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function Xs(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let e=navigator.userAgent||"",t=/iPhone|iPad|iPod/.test(e),r=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||r}function Ue(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"",t=e.toLowerCase(),r=t.includes("safari")&&!t.includes("chrome")&&!t.includes("crios")&&!t.includes("fxios")&&!t.includes("android"),n=/applewebkit/i.test(e),o=/mobile/i.test(e),i=!/safari/i.test(e),a=n&&o&&i,s=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),l=/ipad|iphone|ipod/.test(t)&&n;return r||a||s||c||l}function Ks(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}var St=fe(()=>{});function q(e,t,r){let n=e&&typeof e=="object"&&(e.options||e);n&&n.debug&&(r!==void 0?console.warn("[snapdom]",t,r):console.warn("[snapdom]",t))}var Po=fe(()=>{}),Se=fe(()=>{Vs(),$o(),St(),zt(),Po()}),Wo={};Ct(Wo,{toCanvas:()=>Yt});function Js(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function Qs(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function el(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function tl(e){let t=[],r="",n=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("&&n++,i===")"&&(n=Math.max(0,n-1)),i===";"&&n===0?(t.push(r),r=""):r+=i}return r.trim()&&t.push(r),t.map(o=>o.trim()).filter(Boolean)}function rl(e){let t=[],r="",n=0;for(let i=0;i<e.length;i++){let a=e[i];a==="("&&n++,a===")"&&(n=Math.max(0,n-1)),a===","&&n===0?(t.push(r.trim()),r=""):r+=a}r.trim()&&t.push(r.trim());let o=[];for(let i of t){if(/\binset\b/i.test(i))continue;let a=i.match(/-?\d+(?:\.\d+)?px/gi)||[],[s="0px",c="0px",l="0px"]=a,u=i.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),d=!!u&&u!==",";o.push(`drop-shadow(${s} ${c} ${l}${d?` ${u}`:""})`)}return o.join(" ")}function Bo(e){let t=tl(e),r=null,n=null,o=null,i=[];for(let s of t){let c=s.indexOf(":");if(c<0)continue;let l=s.slice(0,c).trim().toLowerCase(),u=s.slice(c+1).trim();l==="box-shadow"?o=u:l==="filter"?r=u:l==="-webkit-filter"?n=u:i.push([l,u])}if(o){let s=rl(o);s&&(r=r?`${r} ${s}`:s,n=n?`${n} ${s}`:s)}let a=[...i];return r&&a.push(["filter",r]),n&&a.push(["-webkit-filter",n]),a.map(([s,c])=>`${s}:${c}`).join(";")}function nl(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(t,r,n)=>`${r}{${Bo(n)}}`)}function ol(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,r)=>t.replace(r,nl(r))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(t,r,n)=>`style=${r}${Bo(n)}${r}`),e}function il(e){if(!Ue()||!Js(e))return e;try{let t=Qs(e),r=ol(t);return el(r)}catch{return e}}async function Yt(e,t){let{width:r,height:n,scale:o=1,dpr:i=1,meta:a={},backgroundColor:s}=t;e=il(e);let c=new Image;c.loading="eager",c.decoding="sync",c.crossOrigin="anonymous",c.src=e,await c.decode();let l=c.naturalWidth,u=c.naturalHeight,d=Number.isFinite(a.w0)?a.w0:l,f=Number.isFinite(a.h0)?a.h0:u,m,p,g=Number.isFinite(r),h=Number.isFinite(n);if(g&&h)m=Math.max(1,r),p=Math.max(1,n);else if(g){let w=r/Math.max(1,d);m=r,p=f*w}else if(h){let w=n/Math.max(1,f);p=n,m=d*w}else m=l,p=u;m=m*o,p=p*o;let y=document.createElement("canvas");y.width=m*i,y.height=p*i,y.style.width=`${m}px`,y.style.height=`${p}px`;let v=y.getContext("2d");return i!==1&&v.scale(i,i),s&&(v.save(),v.fillStyle=s,v.fillRect(0,0,m,p),v.restore()),v.drawImage(c,0,0,m,p),y}var qt=fe(()=>{St()}),Pt={};Ct(Pt,{rasterize:()=>Uo});async function Uo(e,t){let r=await Yt(e,t),n=new Image;return n.src=r.toDataURL(`image/${t.format}`,t.quality),await n.decode(),n.style.width=`${r.width/t.dpr}px`,n.style.height=`${r.height/t.dpr}px`,n}var Wt=fe(()=>{qt()}),zr={};Ct(zr,{toImg:()=>co,toSvg:()=>co});async function co(e,t){let{scale:r=1,width:n,height:o,meta:i={}}=t,a=Number.isFinite(n),s=Number.isFinite(o),c=Number.isFinite(r)&&r!==1||a||s;if(Ue()&&c)return await Uo(e,{...t,format:"png",quality:1,meta:i});let l=new Image;if(l.decoding="sync",l.loading="eager",l.src=e,await l.decode(),a&&s)l.style.width=`${n}px`,l.style.height=`${o}px`;else if(a){let u=Number.isFinite(i.w0)?i.w0:l.naturalWidth,d=Number.isFinite(i.h0)?i.h0:l.naturalHeight,f=n/Math.max(1,u);l.style.width=`${n}px`,l.style.height=`${Math.round(d*f)}px`}else if(s){let u=Number.isFinite(i.w0)?i.w0:l.naturalWidth,d=Number.isFinite(i.h0)?i.h0:l.naturalHeight,f=o/Math.max(1,d);l.style.height=`${o}px`,l.style.width=`${Math.round(u*f)}px`}else{let u=Math.round(l.naturalWidth*r),d=Math.round(l.naturalHeight*r);if(l.style.width=`${u}px`,l.style.height=`${d}px`,typeof e=="string"&&e.startsWith("data:image/svg+xml"))try{let f=decodeURIComponent(e.split(",")[1]).replace(/width="[^"]*"/,`width="${u}"`).replace(/height="[^"]*"/,`height="${d}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,l.src=e}catch(f){q(t,"SVG width/height patch in toImg failed",f)}}return l}var uo=fe(()=>{Se(),Wt()}),Ho={};Ct(Ho,{toBlob:()=>Vo});async function Vo(e,t){let r=t.type;if(r==="svg"){let o=decodeURIComponent(e.split(",")[1]);return new Blob([o],{type:"image/svg+xml"})}let n=await Yt(e,t);return new Promise(o=>n.toBlob(i=>o(i),`image/${r}`,t.quality))}var Go=fe(()=>{qt()}),zo={};Ct(zo,{download:()=>al});async function fo(e,t){let r=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[r]}))return!1;try{await navigator.share({files:[r],title:t})}catch(n){if(n.name!=="AbortError")return!1}return!0}async function al(e,t){let r=new Set(["png","jpeg","jpg","webp","svg"]),n=(t?.type||"").toLowerCase(),o=r.has(n)?n:"",i=(t?.format||o||"").toLowerCase(),a=i==="jpg"?"jpeg":i||"png",s=t?.filename||`snapdom.${a}`,c={...t||{},format:a,type:a};c.dpr=1;let l=Xs();if(a==="svg"){let f=await Vo(e,{...c,type:"svg"});if(l&&await fo(f,s))return;let m=URL.createObjectURL(f),p=document.createElement("a");p.href=m,p.download=s,document.body.appendChild(p),p.click(),URL.revokeObjectURL(m),p.remove();return}let u=await Yt(e,c);if(l){let f=`image/${a}`,m=await new Promise(p=>u.toBlob(p,f,t?.quality));if(m&&await fo(m,s))return}let d=document.createElement("a");d.href=u.toDataURL(`image/${a}`,t?.quality),d.download=s,document.body.appendChild(d),d.click(),d.remove()}var sl=fe(()=>{Go(),qt(),St()});Se();Se();be();var mo=new WeakMap,wt=new Map,ll=2e3,Yr=0;function yt(){Yr++,wt.size>ll&&wt.clear()}var po=!1;function cl(e=document.documentElement){if(!po){po=!0;try{new MutationObserver(()=>yt()).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>yt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let t=document.fonts;t&&(t.addEventListener?.("loadingdone",yt),t.ready?.then(()=>yt()).catch(()=>{}))}catch{}}}function ul(e,t={}){let r={},n=e.getPropertyValue("visibility"),o=t.excludeStyleProps;for(let d=0;d<e.length;d++){let f=e[d];if(tn(f)||o&&(o instanceof RegExp&&o.test(f)||typeof o=="function"&&o(f)))continue;let m=e.getPropertyValue(f);(f==="background-image"||f==="content")&&m.includes("url(")&&!m.includes("data:")&&(m="none"),r[f]=m}let i=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let d of i)if(!r[d])try{let f=e.getPropertyValue(d);f&&(r[d]=f)}catch{}let a=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let d of a)if(!r[d])try{let f=e.getPropertyValue(d);f&&(r[d]=f)}catch{}if(t.embedFonts){let d=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let f of d)if(!r[f])try{let m=e.getPropertyValue(f);m&&(r[f]=m)}catch{}}n==="hidden"&&(r.opacity="0");try{(r["content-visibility"]||e.getPropertyValue("content-visibility"))==="hidden"&&(r.visibility="hidden")}catch{}let s=parseFloat(e.getPropertyValue("border-top-width")||0)||0,c=parseFloat(e.getPropertyValue("border-right-width")||0)||0,l=parseFloat(e.getPropertyValue("border-bottom-width")||0)||0,u=parseFloat(e.getPropertyValue("border-left-width")||0)||0;if(s===0&&c===0&&l===0&&u===0){let d=(e.getPropertyValue("border-image-source")||"").trim(),f=d&&d!=="none",m=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color"];for(let p of m)delete r[p];f||(r.border="none")}return r}var ho=new WeakMap;function dl(e){let t=ho.get(e);return t||(t=Object.entries(e).sort((r,n)=>r[0]<n[0]?-1:r[0]>n[0]?1:0).map(([r,n])=>`${r}:${n}`).join(";"),ho.set(e,t),t)}function fl(e,t=null,r={}){let n=mo.get(e);if(n&&n.epoch===Yr)return n.snapshot;let o=t||getComputedStyle(e),i=ul(o,r);return wl(e,o,i),mo.set(e,{epoch:Yr,snapshot:i}),i}function ml(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:wt,defaultStyle:E.defaultStyle,baseStyle:E.baseStyle,image:E.image,resource:E.resource,background:E.background,font:E.font},options:t||{}}:{session:E.session,persist:{snapshotKeyCache:wt,defaultStyle:E.defaultStyle,baseStyle:E.baseStyle,image:E.image,resource:E.resource,background:E.background,font:E.font},options:e||t||{}}}function pl(e,t,r){if(!(!e.style||e.style.length===0))for(let n=0;n<e.style.length;n++){let o=e.style[n],i=r.getPropertyValue(o);i&&t.style.setProperty(o,i)}}async function Be(e,t,r,n){if(e.tagName==="STYLE")return;let o=ml(r,n),i=o.options&&o.options.cache||"auto";i!=="disabled"&&cl(document.documentElement),i==="disabled"&&!o.session.__bumpedForDisabled&&(yt(),wt.clear(),o.session.__bumpedForDisabled=!0);let{session:a,persist:s}=o;if(!a.styleCache.has(e)){let f=null;try{f=getComputedStyle(e)}catch{}a.styleCache.set(e,f||getComputedStyle(document.documentElement))}let c=a.styleCache.get(e);e.getAttribute?.("style")&&pl(e,t,c);let l=fl(e,c,o.options),u=dl(l),d=s.snapshotKeyCache.get(u);if(!d){let f=e.tagName?.toLowerCase()||"div";d=Vr(l,f),s.snapshotKeyCache.set(u,d)}a.styleMap.set(t,d)}function hl(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function gl(e){return e.backgroundImage&&e.backgroundImage!=="none"||e.backgroundColor&&e.backgroundColor!=="rgba(0, 0, 0, 0)"&&e.backgroundColor!=="transparent"||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0?!0:(e.overflowBlock||e.overflowY||"visible")!=="visible"}function yl(e){let t=e.parentElement;if(!t)return!1;let r=getComputedStyle(t).display||"";return r.includes("flex")||r.includes("grid")}function bl(e,t){if(e.textContent&&/\S/.test(e.textContent))return!0;let r=e.firstElementChild,n=e.lastElementChild;if(r&&r.tagName==="BR"||n&&n.tagName==="BR")return!0;let o=e.scrollHeight;if(o===0)return!1;let i=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingBottom)||0;return o>i+a}function wl(e,t,r){if(e instanceof HTMLElement&&e.style&&e.style.height)return;let n=e.tagName&&e.tagName.toLowerCase();if(!n||!["div","section","article","main","aside","header","footer","nav"].includes(n))return;let o=parseFloat(t.height);if(Number.isFinite(o)&&e.scrollHeight>0&&Math.abs(o-e.scrollHeight)>2||t.aspectRatio&&t.aspectRatio!=="none"&&t.aspectRatio!=="auto")return;let i=t.display||"";if(i.includes("flex")||i.includes("grid")||hl(e))return;let a=t.position;if(a==="absolute"||a==="fixed"||a==="sticky"||t.transform!=="none"||gl(t)||yl(e))return;let s=t.overflowX||t.overflow||"visible",c=t.overflowY||t.overflow||"visible";if(s!=="visible"||c!=="visible")return;let l=t.clip;l&&l!=="auto"&&l!=="rect(auto, auto, auto, auto)"||t.visibility==="hidden"||t.opacity==="0"||bl(e,t)&&(delete r.height,delete r["block-size"])}$o();var Yo=["fill","stroke","color","background-color","stop-color"],go=new Map;function vl(e,t){let r=t+"::"+e.toLowerCase(),n=go.get(r);if(n)return n;let o=document,i=t==="http://www.w3.org/2000/svg"?o.createElementNS(t,e):o.createElement(e),a=o.createElement("div");a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(i),o.documentElement.appendChild(a);let s=getComputedStyle(i),c={};for(let l of Yo)c[l]=s.getPropertyValue(l)||"";return a.remove(),go.set(r,c),c}function Cl(e,t){if(!(e instanceof Element)||!(t instanceof Element))return;let r=e.getAttribute?.("style"),n=!!(r&&r.includes("var("));if(!n&&e.attributes?.length){let i=e.attributes;for(let a=0;a<i.length;a++){let s=i[a];if(s&&typeof s.value=="string"&&s.value.includes("var(")){n=!0;break}}}let o=null;if(n)try{o=getComputedStyle(e)}catch{}if(n){let i=e.style;if(i&&i.length){let a=new Set;for(let s=0;s<i.length;s++){let c=i[s];if(a.has(c))continue;a.add(c);let l=i.getPropertyValue(c);if(!l||!l.includes("var("))continue;let u=o&&o.getPropertyValue(c);if(u)try{t.style.setProperty(c,u.trim(),i.getPropertyPriority(c))}catch{}}}}if(n&&e.attributes?.length){let i=e.attributes;for(let a=0;a<i.length;a++){let s=i[a];if(!s||typeof s.value!="string"||!s.value.includes("var("))continue;let c=s.name,l=o&&o.getPropertyValue(c);if(l)try{t.style.setProperty(c,l.trim())}catch{}}}if(!n){if(!o)try{o=getComputedStyle(e)}catch{o=null}if(!o)return;let i=e.namespaceURI||"html",a=vl(e.tagName,i);for(let s of Yo){let c=o.getPropertyValue(s)||"",l=a[s]||"";if(c&&c!==l)try{t.style.setProperty(s,c.trim())}catch{}}}}Se();Se();be();ot();function Br(e,t,r){return Promise.all(e.map(n=>new Promise(o=>{function i(){rt(a=>{!(a&&typeof a.timeRemaining=="function")||a.timeRemaining()>0?t(n,o):i()},{fast:r})}i()})))}function Sl(e){return e=e.trim(),!e||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(e)?e:`${e}:not([data-sd-slotted])`}function xl(e,t,r=!0){return e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>{if(n.startsWith(":where(")||n.startsWith("@"))return n;let o=r?Sl(n):n;return`:where(${t} ${o})`}).join(", ")}function Il(e,t){return e?(e=e.replace(/:host\(([^)]+)\)/g,(r,n)=>`:where(${t}:is(${n.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/:host-context\(([^)]+)\)/g,(r,n)=>`:where(:where(${n.trim()}) ${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(r,n)=>`:where(${t} ${n.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(r,n,o,i)=>{let a=xl(i,t,!0);return`${n}${o}${a}{`}),e):""}function Al(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function El(e){let t="";try{e.querySelectorAll("style").forEach(n=>{t+=(n.textContent||"")+`
1
+ "use strict";var __MindStudioBrowserAgent=(()=>{var Mr=Object.defineProperty;var ss=Object.getOwnPropertyDescriptor;var ls=Object.getOwnPropertyNames;var cs=Object.prototype.hasOwnProperty;var Tr=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var us=(e,t)=>{for(var r in t)Mr(e,r,{get:t[r],enumerable:!0})},ds=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ls(t))!cs.call(e,o)&&o!==r&&Mr(e,o,{get:()=>t[o],enumerable:!(n=ss(t,o))||n.enumerable});return e};var fs=e=>ds(Mr({},"__esModule",{value:!0}),e);var nf={};us(nf,{executeSteps:()=>rr,getRefMap:()=>Ke,resolveElement:()=>Me,takeSnapshot:()=>Je,takeSnapshotSync:()=>Or});var Nr="__ms";function ms(){return{ws:{ws:null,clientId:null,reconnectDelay:1e3,closing:!1,busy:!1},cursor:{el:null,rippleEl:null,x:-100,y:-100,hasPosition:!1,hideTimer:null,executing:!1,targetElement:null,trackingFrame:null,settledResolve:null,visibilityState:"hidden",preSnapshotState:null},snapshot:{refCounter:0,refMap:new Map},networkIdle:{activeRequests:0},transport:{buffer:[],flushTimer:null,capturing:!1,captured:[],wsGetter:null},noteLayer:{overlay:null,cursorEl:null,notes:[],currentNote:null,pointerDown:!1,startX:0,startY:0,didDrag:!1,consumedByDeactivation:!1,dragPreview:null,movingNote:null,moveOffsetX:0,moveOffsetY:0},noteElement:{counter:0},notesMode:{active:!1,wasTouchActive:!1},messages:{handler:null},screenshot:{cameraEl:null,flashEl:null,capturing:!1},fonts:{initialized:!1,observer:null},zoom:{pipMode:!1,mobilePreview:!1},touch:{circleEl:null,active:!1,pressed:!1,dragging:!1,startX:0,startY:0,lastX:0,lastY:0,onMouseMove:null,onMouseDown:null,onMouseUp:null,onMouseLeave:null,onDragStart:null,momentumFrame:null,overscrollY:0,bouncing:!1,bounceTimer:null,scrollContainer:null,velocityX:0,velocityY:0,lastMoveTime:0},mirror:{recording:!1,stopFn:null}}}function A(){let e=window;return e[Nr]||(e[Nr]=ms()),e[Nr]}var Wn="/__mindstudio_dev__/logs",ps=2e3;function Bn(e){A().transport.wsGetter=e}function Un(){let e=A().transport;if(e.buffer.length===0)return;let t=e.buffer;e.buffer=[];let r=e.wsGetter?.();if(r&&r.readyState===WebSocket.OPEN)try{r.send(JSON.stringify({type:"log",entries:t}));return}catch{}try{let n=new XMLHttpRequest;n.open("POST",Wn,!0),n.setRequestHeader("Content-Type","application/json"),n.send(JSON.stringify(t))}catch{}}function hs(){let e=A().transport;e.flushTimer||(e.flushTimer=setTimeout(()=>{e.flushTimer=null,Un()},ps))}function gs(){let e=A().transport;e.flushTimer&&(clearTimeout(e.flushTimer),e.flushTimer=null),Un()}function pe(e){let t=A().transport;t.buffer.push(e),t.capturing&&t.captured.push(e),hs()}function Lr(e){let t=A().transport;t.buffer.push(e),t.capturing&&t.captured.push(e),gs()}function Rr(){let e=A().transport;e.capturing=!0,e.captured=[]}function Fr(){let e=A().transport;e.capturing=!1;let t=e.captured;return e.captured=[],t}function Hn(){window.addEventListener("beforeunload",()=>{let e=A().transport;e.buffer.length>0&&navigator.sendBeacon&&navigator.sendBeacon(Wn,JSON.stringify(e.buffer))})}var ys={a:"link",button:"button",input:"textbox",textarea:"textbox",select:"combobox",option:"option",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",nav:"navigation",main:"main",header:"banner",footer:"contentinfo",aside:"complementary",dialog:"dialog",details:"group",summary:"button",img:"img",ul:"list",ol:"list",li:"listitem",table:"table",tr:"row",th:"columnheader",td:"cell",form:"form",article:"article",section:"region",label:"label",fieldset:"group",legend:"legend",p:"paragraph",blockquote:"blockquote",pre:"code",code:"code",hr:"separator",progress:"progressbar"};function $e(e){let t=e.getAttribute("role");if(t)return t==="presentation"||t==="none"?null:t;let r=e.tagName.toLowerCase();if(r==="a")return e.hasAttribute("href")?"link":null;if(r==="section")return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?"region":null;if(r==="form")return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?"form":null;if(r==="img")return e.alt===""?null:"img";if(r==="input")switch(e.type){case"checkbox":return"checkbox";case"radio":return"radio";case"range":return"slider";case"submit":case"button":case"reset":return"button";case"hidden":return null;default:return"textbox"}return ys[r]??null}function Vn(e){if(e.hasAttribute("onclick")||e.hasAttribute("tabindex")&&e.getAttribute("tabindex")!=="-1")return!0;try{if(getComputedStyle(e).cursor==="pointer")return!0}catch{}return!1}function Xe(e){let t=e.getAttribute("aria-label");if(t)return t.trim();let r=e.getAttribute("aria-labelledby");if(r){let a=r.split(/\s+/).map(s=>{let c=document.getElementById(s);return c?Pe(c):""}).filter(Boolean).join(" ");if(a)return a}let n=e.tagName.toLowerCase();if(n==="input"||n==="textarea"||n==="select"){let a=bs(e);if(a)return a}if(n==="img"){let a=e.alt;if(a)return a.trim()}if(n==="fieldset"){let a=e.querySelector("legend");if(a)return Pe(a)}let o=Pe(e);if(o)return o;let i=e.getAttribute("title");return i?i.trim():""}function Pe(e){if(!e.children.length)return(e.textContent||"").trim();let t=[];for(let r of Array.from(e.childNodes))if(r.nodeType===Node.TEXT_NODE){let n=(r.textContent||"").trim();n&&t.push(n)}else if(r.nodeType===Node.ELEMENT_NODE){let n=r;if(vs(n))continue;let o=ws(n),i=Pe(n);i&&(o&&t.length>0&&t.push(" "),t.push(i),o&&t.push(" "))}return t.join("").replace(/\s+/g," ").trim()}function bs(e){if(e.id){let r=document.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(r)return Pe(r)}let t=e.closest("label");if(t){let r=t.cloneNode(!0),n=r.querySelector("input, textarea, select");n&&n.remove();let o=r.textContent?.trim();if(o)return o}return null}function ws(e){try{return!getComputedStyle(e).display.includes("inline")}catch{let t=e.tagName.toLowerCase();return["div","p","h1","h2","h3","h4","h5","h6","li","section","article","header","footer","nav","main","aside","blockquote","pre","form","fieldset","table","tr","br"].includes(t)}}function vs(e){let t=e.tagName.toLowerCase();if(t==="script"||t==="style"||t==="noscript"||t==="template"||e.getAttribute("aria-hidden")==="true")return!0;try{let r=getComputedStyle(e);if(r.display==="none"||r.visibility==="hidden")return!0}catch{}return!1}function _r(e,t){try{let r=getComputedStyle(e,t).content;if(!r||r==="none"||r==="normal")return"";let n=r.match(/^["'](.*)["']$/);return n?n[1]:""}catch{return""}}function Ot(){A().networkIdle.activeRequests++}function pt(){let e=A().networkIdle;e.activeRequests=Math.max(0,e.activeRequests-1)}function Gn(e=5e3,t=200){return new Promise((r,n)=>{let o=Date.now()+e,i=null;function a(){if(Date.now()>o){i&&clearTimeout(i),r();return}A().networkIdle.activeRequests===0?i||(i=setTimeout(()=>{A().networkIdle.activeRequests===0?r():(i=null,a())},t)):(i&&(clearTimeout(i),i=null),setTimeout(a,50))}a()})}function Ke(){return A().snapshot.refMap}async function Je(){return await Gn(),Or()}function Or(){let e=A().snapshot;e.refCounter=0,e.refMap=new Map;let t=document.body;if(!t)return"(empty page)";let r=zn(t);return Dr(r,0).trimEnd()}function he(e){let t=$e(e),r=Xe(e),n=r.length>60?r.slice(0,57)+"...":r;if(t&&n)return`${t} "${n}"`;if(t)return t;if(n)return`"${n}"`;let o=e.tagName.toLowerCase();return e.id?`${o}#${e.id}`:o}function zn(e){if(Ss(e))return[];let t=$e(e),r=!t&&Vn(e),n=t||(r?"clickable":null),o="";if(n){o=Xe(e);let u=_r(e,"::before"),d=_r(e,"::after");(u||d)&&(o=[u,o,d].filter(Boolean).join(" ")),o.length>80&&(o=o.slice(0,77)+"...")}let i=xs(e),a=t==="button"||t==="link"||t==="textbox"||t==="combobox"||t==="checkbox"||t==="radio"||t==="slider"||t==="tab"||t==="menuitem"||r,s=n&&o&&!a,c=null;if(a||s){let u=A().snapshot;u.refCounter++,c=`e${u.refCounter}`,u.refMap.set(c,e)}let l=Cs(e);if(n){let u=l.length===0?"":Dr(l,0).trim();return[{tag:n,name:o,attrs:i,ref:c,children:u&&u===o?[]:l,element:e}]}if(l.length===0){let u=Pe(e);if(u)return[{tag:null,name:u.length>80?u.slice(0,77)+"...":u,attrs:[],ref:null,children:[],element:e}]}return l}function Cs(e){let t=[];for(let r of Array.from(e.childNodes))r.nodeType===Node.ELEMENT_NODE&&t.push(...zn(r));return t}function Ss(e){let t=e.tagName.toLowerCase();if(t==="script"||t==="style"||t==="noscript"||t==="template"||t==="head"||e.getAttribute("aria-hidden")==="true"||e.id==="__mindstudio-browser-agent"||e.id==="__mindstudio-cursor"||e.id==="__mindstudio-cursor-ripple"||e.id==="__mindstudio-notes-overlay"||e.id==="__mindstudio-notes-cursor")return!0;try{let r=getComputedStyle(e);if(r.display==="none"||r.visibility==="hidden"&&r.position!=="static")return!0}catch{}return!1}function xs(e){let t=[],r=e.tagName.toLowerCase();if((r==="dialog"&&e.open||r==="details"&&e.open)&&t.push("open"),e.disabled&&t.push("disabled"),r==="input"){let i=e;(i.type==="checkbox"||i.type==="radio")&&i.checked&&t.push("checked")}if(r==="input"){let i=e;i.type!=="checkbox"&&i.type!=="radio"&&i.type!=="hidden"&&i.type!=="submit"&&i.type!=="button"&&i.type!=="reset"&&(t.push(`value="${i.value}"`),i.placeholder&&t.push(`placeholder="${i.placeholder}"`))}if(r==="textarea"){let i=e;t.push(`value="${i.value}"`),i.placeholder&&t.push(`placeholder="${i.placeholder}"`)}if(r==="select"){let i=e,a=i.options[i.selectedIndex];a&&t.push(`value="${a.text}"`)}let n=r.match(/^h([1-6])$/);n&&t.push(`level=${n[1]}`);let o=e.getAttribute("aria-expanded");return o==="true"&&t.push("expanded"),o==="false"&&t.push("collapsed"),e.getAttribute("aria-selected")==="true"&&t.push("selected"),e.getAttribute("aria-pressed")==="true"&&t.push("pressed"),t}function Dr(e,t){let r="";for(let n of e)r+=Is(n,t);return r}function Is(e,t){let r=" ".repeat(t),n=[];e.tag&&n.push(e.tag),e.name&&n.push(`"${e.name}"`);for(let a of e.attrs)n.push(`[${a}]`);e.ref&&n.push(`[ref=${e.ref}]`);let o="";n.length>0&&(o+=`${r}${n.join(" ")}
2
+ `);let i=n.length>0?t+1:t;return o+=Dr(e.children,i),o}function Yn(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e instanceof Error)return e.stack||e.message||String(e);if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function ie(e){return new Promise(t=>setTimeout(t,e))}function We(){let e=null,t=0;for(let r of document.querySelectorAll("*")){let n=r,o=getComputedStyle(n).overflowY;if(o!=="auto"&&o!=="scroll")continue;let i=n.scrollHeight-n.clientHeight;i<=20||i>t&&(t=i,e=n)}return e??document.documentElement}var As=["log","info","warn","error","debug"];function qn(){if(!console.__ms_patched){console.__ms_patched=!0;for(let e of As){let t=console[e];console[e]=(...r)=>{t&&t.apply(console,r),pe({type:"console",level:e,args:r.map(Yn),url:location.href})}}}}function jn(){window.__ms_error_patched||(window.__ms_error_patched=!0,window.addEventListener("error",e=>{Lr({type:"error",message:e.message,stack:e.error&&e.error.stack||"",source:e.filename,line:e.lineno,column:e.colno,url:location.href})}),window.addEventListener("unhandledrejection",e=>{let t=e.reason||{};Lr({type:"error",message:t.message||String(t),stack:t.stack||"",url:location.href})}))}function Zn(){if(!window.fetch||window.fetch.__ms_patched)return;let e=window.fetch;window.fetch=function(t,r){let n=(r?.method||"GET").toUpperCase(),o=typeof t=="string"?t:t instanceof URL?t.href:t.url||String(t);if(o.includes("/__mindstudio_dev__/"))return e.apply(this,[t,r]);let i=Date.now();return Ot(),e.apply(this,[t,r]).then(a=>{pt();let s={type:"network",method:n,url:o,status:a.status,statusText:a.statusText,duration:Date.now()-i,ok:a.ok};if(a.ok)pe(s);else try{a.clone().text().then(c=>{s.body=c.slice(0,1e3),pe(s)}).catch(()=>pe(s))}catch{pe(s)}return a},a=>{throw pt(),pe({type:"network",method:n,url:o,error:a.message||String(a),duration:Date.now()-i,ok:!1}),a})},window.fetch.__ms_patched=!0}function Xn(){document.__ms_click_patched||(document.__ms_click_patched=!0,document.addEventListener("click",e=>{let t=e.target,r=(t?.textContent||"").trim().slice(0,100);pe({type:"interaction",event:"click",target:he(t),text:r,url:location.href})},!0))}function Kn(){if(XMLHttpRequest.prototype.open.__ms_patched)return;let e=window.XMLHttpRequest,t=e.prototype.open,r=e.prototype.send;e.prototype.open=function(n,o,...i){return this.__ms_method=n.toUpperCase(),this.__ms_url=String(o),t.apply(this,[n,o,...i])},e.prototype.send=function(n){let o=this.__ms_method||"GET",i=this.__ms_url||"";if(i.includes("/__mindstudio_dev__/"))return r.apply(this,[n]);let a=Date.now();return Ot(),this.addEventListener("loadend",function(){pt(),pe({type:"network",method:o,url:i,status:this.status,statusText:this.statusText,duration:Date.now()-a,ok:this.status>=200&&this.status<300,...this.status>=400?{body:(this.responseText||"").slice(0,1e3)}:{},via:"xhr"})},{once:!0}),r.apply(this,[n])},XMLHttpRequest.prototype.open.__ms_patched=!0}function Me(e){let t=null;if(e.ref){let r=Ke(),n=r.get(e.ref);if(n&&n.isConnected)if(ke(n))t={element:n,matched:`${he(n)} [ref=${e.ref}]`};else throw new Error(`Element [ref=${e.ref}] exists but is hidden (${$r(n)}). It may be inside a closed dialog or collapsed section.`);else{let o=[...r.entries()].filter(([,i])=>i.isConnected&&ke(i)).slice(0,10).map(([i,a])=>`${he(a)} [ref=${i}]`).join(", ");throw new Error(`Element [ref=${e.ref}] not found. `+(o?`Available refs: ${o}`:"No refs available \u2014 take a snapshot first."))}}if(!t&&(e.text||e.role&&e.text)){let r=e.text,n=e.role,o=Jn(r,n);if(o.length===0){let i=Jn(r,n,!0);if(i.length>0)throw new Error(`Found ${n?n+" ":""}"${r}" but it is hidden (${$r(i[0])}). Wait for it to become visible or check if a dialog/modal needs to be opened first.`);let a=n?`${n} "${r}"`:`"${r}"`,s=Qn(n);throw new Error(`No element found matching ${a}. `+(s?`Visible ${n||"element"}s: ${s}`:"The page may still be loading \u2014 try a wait command first."))}if(o.length>1){let i=o.filter(eo),a=i.length===1?i[0]:o[0];t={element:a,matched:he(a)}}else t={element:o[0],matched:he(o[0])}}if(!t&&e.role&&!e.text){let r=e.role,n=Es(r);if(n.length===0){let o=Qn(r);throw new Error(`No visible element with role "${r}" found. `+(o?`Visible ${r}s: ${o}`:"The page may still be loading \u2014 try a wait command first."))}t={element:n[0],matched:he(n[0])}}if(!t&&e.label){let r=e.label,n=ks(r);if(!n){let o=[...document.querySelectorAll("label")].filter(ke).map(i=>`"${(i.textContent||"").trim().slice(0,40)}"`).slice(0,8).join(", ");throw new Error(`No input found with label "${r}". `+(o?`Visible labels: ${o}`:"No labels found on the page."))}t={element:n,matched:`${he(n)} via label "${r}"`}}if(!t&&e.selector){let r=e.selector,n=document.querySelector(r);if(!n)throw new Error(`No element found for selector "${r}".`);if(!ke(n))throw new Error(`Found element for selector "${r}" but it is hidden (${$r(n)}).`);t={element:n,matched:`${he(n)} via selector "${r}"`}}if(!t)throw new Error("No targeting field provided (need ref, text, role, label, or selector)");return t}function Jn(e,t,r=!1){let n=[],o=e.toLowerCase();for(let i of document.querySelectorAll("*")){if(!r&&!ke(i)||r&&!i.isConnected||t&&$e(i)!==t)continue;if(Xe(i).toLowerCase().includes(o)){n.push(i);continue}i.children.length||(i.textContent||"").trim().toLowerCase().includes(o)&&n.push(i)}return n}function Es(e){let t=[];for(let r of document.querySelectorAll("*"))ke(r)&&$e(r)===e&&t.push(r);return t}function ks(e){let t=e.toLowerCase();for(let r of document.querySelectorAll("label")){if(!(r.textContent||"").trim().toLowerCase().includes(t))continue;let o=r.getAttribute("for");if(o){let a=document.getElementById(o);if(a&&ke(a))return a}let i=r.querySelector("input, textarea, select");if(i&&ke(i))return i}return null}function ke(e){if(!e.isConnected)return!1;try{let t=getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden")return!1}catch{return!1}return!0}function eo(e){if(e.matches('a, button, input, textarea, select, [role="button"], [role="link"], [tabindex]'))return!0;try{return getComputedStyle(e).cursor==="pointer"}catch{return!1}}function $r(e){try{let t=getComputedStyle(e);if(t.display==="none")return"display: none";if(t.visibility==="hidden")return"visibility: hidden"}catch{}return e.getAttribute("aria-hidden")==="true"?'aria-hidden="true"':"hidden"}function Qn(e){let t=[];for(let r of document.querySelectorAll("*"))if(ke(r)&&(e?$e(r)===e&&t.push(r):eo(r)&&t.push(r),t.length>=10))break;return t.length===0?"":t.map(r=>`"${Xe(r).slice(0,40)||he(r)}"`).join(", ")}function Pr(e){let t=e.getBoundingClientRect(),r=t.left+t.width/2,n=t.top+t.height/2,o={bubbles:!0,cancelable:!0,clientX:r,clientY:n,button:0};e.dispatchEvent(new PointerEvent("pointerdown",{...o,pointerId:1})),e.dispatchEvent(new MouseEvent("mousedown",o)),e instanceof HTMLElement&&e.focus(),e.dispatchEvent(new PointerEvent("pointerup",{...o,pointerId:1})),e.dispatchEvent(new MouseEvent("mouseup",o)),e.dispatchEvent(new MouseEvent("click",o))}var Ms=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set,Ts=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value")?.set;async function no(e,t,r={}){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new Error("type command requires an input or textarea element");e.focus(),Pr(e),r.clear&&(to(e,""),e.dispatchEvent(new Event("input",{bubbles:!0})));for(let n=0;n<t.length;n++){let o=t[n];e.dispatchEvent(new KeyboardEvent("keydown",{key:o,code:`Key${o.toUpperCase()}`,bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keypress",{key:o,code:`Key${o.toUpperCase()}`,bubbles:!0})),to(e,e.value+o),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new KeyboardEvent("keyup",{key:o,code:`Key${o.toUpperCase()}`,bubbles:!0})),await ie(Ns(o,t.length))}e.dispatchEvent(new Event("change",{bubbles:!0}))}function Ns(e,t){let r=Math.random()*50-25,n;if(e===" "?n=120+r:/[.,!?;:\-]/.test(e)?n=140+r:/[A-Z]/.test(e)?n=115+r:n=85+r,t<=20)return n;let o=Math.max(.1,20/t);return n*o}function to(e,t){let r=e instanceof HTMLTextAreaElement?Ts:Ms;r?r.call(e,t):e.value=t}async function oo(e){let t=e.timeout||5e3,r=Date.now(),n=r+t;for(;Date.now()<n;)try{return{...Me(e),elapsed:Date.now()-r}}catch{await ie(100)}let o=e.text?`"${e.text}"`:e.role?`role "${e.role}"`:e.selector?`selector "${e.selector}"`:"element";throw new Error(`Timed out waiting for ${o} after ${t}ms`)}var ro=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set;function io(e,t){if(!(e instanceof HTMLSelectElement))throw new Error("select command requires a <select> element");let r=t.toLowerCase(),n=null;for(let o of e.options)if(o.text.toLowerCase().includes(r)||o.value.toLowerCase()===r||o.label.toLowerCase().includes(r)){n=o;break}if(!n){let o=[...e.options].map(i=>`"${i.text}"`).join(", ");throw new Error(`No option matching "${t}" in select. Available options: ${o}`)}return ro?ro.call(e,n.value):e.value=n.value,e.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new Event("input",{bubbles:!0})),n.text}async function ao(e){try{let r=!/\b(return|;|\{)\b/.test(e.trim())?`return (${e})`:e,o=new Function(r)();return o instanceof Promise?await o:o}catch(t){throw new Error(`evaluate failed: ${t instanceof Error?t.message:String(t)}`)}}var Rs=Object.defineProperty,fe=(e,t)=>()=>(e&&(t=e(e=0)),t),Ct=(e,t)=>{for(var r in t)Rs(e,r,{get:t[r],enumerable:!0})};function Fs(e){if(e===!0)return"soft";if(e===!1)return"disabled";if(typeof e=="string"){let t=e.toLowerCase().trim();if(t==="auto")return"auto";if(t==="full")return"full";if(t==="soft"||t==="disabled")return t}return"soft"}function _s(e="soft"){switch(E.session.__counterEpoch=(E.session.__counterEpoch||0)+1,e){case"auto":{E.session.styleMap=new Map,E.session.nodeMap=new Map;return}case"soft":{E.session.styleMap=new Map,E.session.nodeMap=new Map,E.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{E.session.styleMap=new Map,E.session.nodeMap=new Map,E.session.styleCache=new WeakMap,E.computedStyle=new WeakMap,E.baseStyle=new ge(50),E.defaultStyle=new ge(30),E.image=new ge(100),E.background=new ge(100),E.resource=new ge(150),E.font=new Set;return}default:{E.session.styleMap=new Map,E.session.nodeMap=new Map,E.session.styleCache=new WeakMap;return}}}var ge,E,be=fe(()=>{ge=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let r=this.keys().next().value;r!==void 0&&this.delete(r)}return super.set(e,t)}},E={image:new ge(100),background:new ge(100),resource:new ge(150),defaultStyle:new ge(30),baseStyle:new ge(50),computedStyle:new WeakMap,measureHints:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});function Qr(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let r=t[2].trim();return r.startsWith("#")?null:r}function Os(e){if(!e||e==="none")return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(r,n)=>{let o=n.split(",").map(i=>i.trim());return o.length!==6?`matrix(${n})`:(o[4]="0",o[5]="0",`matrix(${o.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(r,n)=>{let o=n.split(",").map(i=>i.trim());return o.length!==16?`matrix3d(${n})`:(o[12]="0",o[13]="0",`matrix3d(${o.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function Vt(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function Ds(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let r=t||typeof document<"u"&&(document.baseURI||document.location?.href)||"http://localhost/";return new URL(e,r).href}catch{return e}}var zt=fe(()=>{});function $s(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:r=12}={}){let n=new Map,o=0;function i(a,s,c){if(o>=r)return;let l=Date.now();(n.get(s)||0)>l||(n.set(s,l+t),o++,a==="warn"&&console&&console.warn?console.warn(`${e} ${c}`):console&&console.error&&console.error(`${e} ${c}`))}return{warnOnce(a,s){i("warn",a,s)},errorOnce(a,s){i("error",a,s)},reset(){n.clear(),o=0}}}function Ps(e){return/^data:|^blob:|^about:blank$/i.test(e)}function Ws(e,t){try{let r=typeof location<"u"&&location.href?location.href:"http://localhost/",n=t.includes("{url}")?t.split("{url}")[0]:t,o=new URL(n||".",r),i=new URL(e,r);if(i.origin===o.origin)return!0;let a=i.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}function Bs(e,t){if(!t||Ps(e)||Ws(e,t))return!1;try{let r=typeof location<"u"&&location.href?location.href:"http://localhost/",n=new URL(e,r);return typeof location<"u"?n.origin!==location.origin:!0}catch{return!!t}}function Us(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",Vt(e)).replace("{url}",encodeURIComponent(e));if(/[?&]url=?$/.test(t))return`${t}${encodeURIComponent(e)}`;if(t.endsWith("?"))return`${t}url=${encodeURIComponent(e)}`;if(t.endsWith("/"))return`${t}${Vt(e)}`;let r=t.includes("?")?"&":"?";return`${t}${r}url=${encodeURIComponent(e)}`}function so(e){return new Promise((t,r)=>{let n=new FileReader;n.onload=()=>t(String(n.result||"")),n.onerror=()=>r(new Error("read_failed")),n.readAsDataURL(e)})}function Hs(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function ye(e,t={}){let r=t.as??"blob",n=t.timeout??3e3,o=t.useProxy||"",i=t.errorTTL??8e3,a=t.headers||{},s=!!t.silent;if(/^data:/i.test(e))try{if(r==="text")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(r==="dataURL")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,h="",y=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],v=/;base64/i.test(h)?atob(y):decodeURIComponent(y),w=new Uint8Array([...v].map(S=>S.charCodeAt(0))),b=new Blob([w],{type:(h||"").split(";")[0]||""});return{ok:!0,data:b,status:200,url:e,fromCache:!1,mime:b.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let h=await fetch(e);if(!h.ok)return{ok:!1,data:null,status:h.status,url:e,fromCache:!1,reason:"http_error"};let y=await h.blob(),v=y.type||h.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:await so(y),status:h.status,url:e,fromCache:!1,mime:v}:r==="text"?{ok:!0,data:await y.text(),status:h.status,url:e,fromCache:!1,mime:v}:{ok:!0,data:y,status:h.status,url:e,fromCache:!1,mime:v}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(e))return r==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:r==="text"?"":new Blob([]),status:200,url:e,fromCache:!1};let c=Hs(e,{as:r,timeout:n,useProxy:o,errorTTL:i}),l=gt.get(c);if(l&&l.until>Date.now())return{...l.result,fromCache:!0};l&&gt.delete(c);let u=$t.get(c);if(u)return u;let d=Bs(e,o)?Us(e,o):e,f=t.credentials;if(!f)try{let h=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(e,h);f=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{f="omit"}let m=new AbortController,p=setTimeout(()=>m.abort("timeout"),n),g=(async()=>{try{let h=await fetch(d,{signal:m.signal,credentials:f,headers:a});if(!h.ok){let w={ok:!1,data:null,status:h.status,url:d,fromCache:!1,reason:"http_error"};if(i>0&&gt.set(c,{until:Date.now()+i,result:w}),!s){let b=`${h.status} ${h.statusText||""}`.trim();Ur.warnOnce(`http:${h.status}:${r}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${b} while fetching ${r} ${e}`)}return t.onError&&t.onError(w),w}if(r==="text")return{ok:!0,data:await h.text(),status:h.status,url:d,fromCache:!1};let y=await h.blob(),v=y.type||h.headers.get("content-type")||"";return r==="dataURL"?{ok:!0,data:await so(y),status:h.status,url:d,fromCache:!1,mime:v}:{ok:!0,data:y,status:h.status,url:d,fromCache:!1,mime:v}}catch(h){let y=h&&typeof h=="object"&&"name"in h&&h.name==="AbortError"?String(h.message||"").includes("timeout")?"timeout":"abort":"network",v={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:y};if(!/^blob:/i.test(e)&&i>0&&gt.set(c,{until:Date.now()+i,result:v}),!s){let w=`${y}:${r}:${new URL(e,location?.href??"http://localhost/").origin}`,b=y==="timeout"?`Timeout after ${n}ms. Consider increasing timeout or using a proxy for ${e}`:y==="abort"?`Request aborted while fetching ${r} ${e}`:`Network/CORS issue while fetching ${r} ${e}. A proxy may be required`;Ur.errorOnce(w,b)}return t.onError&&t.onError(v),v}finally{clearTimeout(p),$t.delete(c)}})();return $t.set(c,g),g}var Ur,$t,gt,nt=fe(()=>{zt(),Ur=$s("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),$t=new Map,gt=new Map});async function Ro(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let r=Qr(e);if(!r)return e;let n=Ds(r),o=Vt(n);if(E.background.has(o)){let i=E.background.get(o);return i?`url("${i}")`:"none"}try{let i=await ye(o,{as:"dataURL",useProxy:t.useProxy});return i.ok?(E.background.set(o,i.data),`url("${i.data}")`):(E.background.set(o,null),"none")}catch{return E.background.set(o,null),"none"}}var Vs=fe(()=>{be(),zt(),nt()});function Gs(e){if(e=String(e).toLowerCase(),tn.has(e)){let i={};return E.defaultStyle.set(e,i),i}if(E.defaultStyle.has(e))return E.defaultStyle.get(e);let t=document.getElementById("snapdom-sandbox");t||(t=document.createElement("div"),t.id="snapdom-sandbox",t.setAttribute("data-snapdom-sandbox","true"),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0px",t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t));let r=document.createElement(e);r.style.all="initial",t.appendChild(r);let n=getComputedStyle(r),o={};for(let i of n){if(en(i))continue;let a=n.getPropertyValue(i);o[i]=a}return t.removeChild(r),E.defaultStyle.set(e,o),o}function en(e){let t=String(e).toLowerCase();return!!(Do.has(t)||Oo.test(t)||_o.test(t))}function Hr(e,t){if(t=String(t||"").toLowerCase(),tn.has(t))return"";let r=[],n=Gs(t),o=(e.display||"").toLowerCase()==="inline"||new Set(["span","small","em","strong","b","i","u","s","code","cite","mark","sub","sup"]).has(t);for(let[i,a]of Object.entries(e)){if(en(i)||o&&(i==="width"||i==="min-width"||i==="max-width"))continue;let s=n[i];a&&a!==s&&r.push(`${i}:${a}`)}return r.sort(),r.join(";")}function zs(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),typeof e.querySelectorAll=="function"&&e.querySelectorAll("*").forEach(r=>t.add(r.tagName.toLowerCase())),Array.from(t))}function Ys(e){let t=new Map;for(let n of e){let o=E.defaultStyle.get(n);if(!o)continue;let i=Object.entries(o).map(([a,s])=>`${a}:${s};`).sort().join("");i&&(t.has(i)||t.set(i,[]),t.get(i).push(n))}let r="";for(let[n,o]of t.entries())r+=`${o.join(",")} { ${n} }
3
+ `;return r}function qs(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),r=new Map,n=1;for(let o of t)r.set(o,`c${n++}`);return r}function js(e){try{let t=e?.ownerDocument;if(!t)return typeof window<"u"?window:null;let r=t.defaultView;if(r&&typeof r.getComputedStyle=="function")return r;if(typeof window<"u"&&window.frames)for(let n=0;n<window.frames.length;n++)try{if(window.frames[n]?.document===t)return window.frames[n]}catch{}}catch{}return typeof window<"u"?window:null}function Ne(e,t=null){let r=()=>{let i={length:0,getPropertyValue:()=>"",item:()=>""};return i[Symbol.iterator]=function*(){},i};if(!(e instanceof Element)){let i=typeof window<"u"?window:null;if(i&&typeof i.getComputedStyle=="function")try{return i.getComputedStyle(e,t)||r()}catch{return r()}return r()}let n=E.computedStyle.get(e);n||(n=new Map,E.computedStyle.set(e,n));let o=n.get(t);if(!o){let i=js(e),a=null;try{a=i&&typeof i.getComputedStyle=="function"?i.getComputedStyle(e,t):null}catch{}if(!a&&typeof window<"u"&&typeof window.getComputedStyle=="function")try{e.ownerDocument===document&&(a=window.getComputedStyle(e,t))}catch{}o=a||r(),n.set(t,o)}return o}function lo(e){let t={};for(let r of e)t[r]=e.getPropertyValue(r);return t}function Vr(e){let t=[],r=0,n=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("&&r++,i===")"&&r--,i===","&&r===0&&(t.push(e.slice(n,o).trim()),n=o+1)}return t.push(e.slice(n).trim()),t}var Fo,tn,Zs,_o,Oo,Do,$o=fe(()=>{be(),Fo=new Set(["meta","script","noscript","title","link","template"]),tn=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),Zs=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"],_o=/(?:^|-)(animation|transition)(?:-|$)/i,Oo=/^(--.+|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Do=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope","zoom"])});function tt(e,{fast:t=!1}={}){if(t)return e();"requestIdleCallback"in window?requestIdleCallback(e,{timeout:50}):setTimeout(e,1)}function Xs(){if(typeof navigator>"u")return!1;if(navigator.userAgentData)return navigator.userAgentData.platform==="iOS";let e=navigator.userAgent||"",t=/iPhone|iPad|iPod/.test(e),r=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||r}function Ue(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"",t=e.toLowerCase(),r=t.includes("safari")&&!t.includes("chrome")&&!t.includes("crios")&&!t.includes("fxios")&&!t.includes("android"),n=/applewebkit/i.test(e),o=/mobile/i.test(e),i=!/safari/i.test(e),a=n&&o&&i,s=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),l=/ipad|iphone|ipod/.test(t)&&n;return r||a||s||c||l}function Ks(){if(typeof navigator>"u")return!1;let e=(navigator.userAgent||"").toLowerCase();return e.includes("firefox")||e.includes("fxios")}var St=fe(()=>{});function q(e,t,r){let n=e&&typeof e=="object"&&(e.options||e);n&&n.debug&&(r!==void 0?console.warn("[snapdom]",t,r):console.warn("[snapdom]",t))}var Po=fe(()=>{}),Se=fe(()=>{Vs(),$o(),St(),zt(),Po()}),Wo={};Ct(Wo,{toCanvas:()=>Yt});function Js(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function Qs(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function el(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function tl(e){let t=[],r="",n=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("&&n++,i===")"&&(n=Math.max(0,n-1)),i===";"&&n===0?(t.push(r),r=""):r+=i}return r.trim()&&t.push(r),t.map(o=>o.trim()).filter(Boolean)}function rl(e){let t=[],r="",n=0;for(let i=0;i<e.length;i++){let a=e[i];a==="("&&n++,a===")"&&(n=Math.max(0,n-1)),a===","&&n===0?(t.push(r.trim()),r=""):r+=a}r.trim()&&t.push(r.trim());let o=[];for(let i of t){if(/\binset\b/i.test(i))continue;let a=i.match(/-?\d+(?:\.\d+)?px/gi)||[],[s="0px",c="0px",l="0px"]=a,u=i.replace(/-?\d+(?:\.\d+)?px/gi,"").replace(/\binset\b/ig,"").trim().replace(/\s{2,}/g," "),d=!!u&&u!==",";o.push(`drop-shadow(${s} ${c} ${l}${d?` ${u}`:""})`)}return o.join(" ")}function Bo(e){let t=tl(e),r=null,n=null,o=null,i=[];for(let s of t){let c=s.indexOf(":");if(c<0)continue;let l=s.slice(0,c).trim().toLowerCase(),u=s.slice(c+1).trim();l==="box-shadow"?o=u:l==="filter"?r=u:l==="-webkit-filter"?n=u:i.push([l,u])}if(o){let s=rl(o);s&&(r=r?`${r} ${s}`:s,n=n?`${n} ${s}`:s)}let a=[...i];return r&&a.push(["filter",r]),n&&a.push(["-webkit-filter",n]),a.map(([s,c])=>`${s}:${c}`).join(";")}function nl(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(t,r,n)=>`${r}{${Bo(n)}}`)}function ol(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(t,r)=>t.replace(r,nl(r))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(t,r,n)=>`style=${r}${Bo(n)}${r}`),e}function il(e){if(!Ue()||!Js(e))return e;try{let t=Qs(e),r=ol(t);return el(r)}catch{return e}}async function Yt(e,t){let{width:r,height:n,scale:o=1,dpr:i=1,meta:a={},backgroundColor:s}=t;e=il(e);let c=new Image;c.loading="eager",c.decoding="sync",c.crossOrigin="anonymous",c.src=e,await c.decode();let l=c.naturalWidth,u=c.naturalHeight,d=Number.isFinite(a.w0)?a.w0:l,f=Number.isFinite(a.h0)?a.h0:u,m,p,g=Number.isFinite(r),h=Number.isFinite(n);if(g&&h)m=Math.max(1,r),p=Math.max(1,n);else if(g){let w=r/Math.max(1,d);m=r,p=f*w}else if(h){let w=n/Math.max(1,f);p=n,m=d*w}else m=l,p=u;m=m*o,p=p*o;let y=document.createElement("canvas");y.width=m*i,y.height=p*i,y.style.width=`${m}px`,y.style.height=`${p}px`;let v=y.getContext("2d");return i!==1&&v.scale(i,i),s&&(v.save(),v.fillStyle=s,v.fillRect(0,0,m,p),v.restore()),v.drawImage(c,0,0,m,p),y}var qt=fe(()=>{St()}),Pt={};Ct(Pt,{rasterize:()=>Uo});async function Uo(e,t){let r=await Yt(e,t),n=new Image;return n.src=r.toDataURL(`image/${t.format}`,t.quality),await n.decode(),n.style.width=`${r.width/t.dpr}px`,n.style.height=`${r.height/t.dpr}px`,n}var Wt=fe(()=>{qt()}),Gr={};Ct(Gr,{toImg:()=>co,toSvg:()=>co});async function co(e,t){let{scale:r=1,width:n,height:o,meta:i={}}=t,a=Number.isFinite(n),s=Number.isFinite(o),c=Number.isFinite(r)&&r!==1||a||s;if(Ue()&&c)return await Uo(e,{...t,format:"png",quality:1,meta:i});let l=new Image;if(l.decoding="sync",l.loading="eager",l.src=e,await l.decode(),a&&s)l.style.width=`${n}px`,l.style.height=`${o}px`;else if(a){let u=Number.isFinite(i.w0)?i.w0:l.naturalWidth,d=Number.isFinite(i.h0)?i.h0:l.naturalHeight,f=n/Math.max(1,u);l.style.width=`${n}px`,l.style.height=`${Math.round(d*f)}px`}else if(s){let u=Number.isFinite(i.w0)?i.w0:l.naturalWidth,d=Number.isFinite(i.h0)?i.h0:l.naturalHeight,f=o/Math.max(1,d);l.style.height=`${o}px`,l.style.width=`${Math.round(u*f)}px`}else{let u=Math.round(l.naturalWidth*r),d=Math.round(l.naturalHeight*r);if(l.style.width=`${u}px`,l.style.height=`${d}px`,typeof e=="string"&&e.startsWith("data:image/svg+xml"))try{let f=decodeURIComponent(e.split(",")[1]).replace(/width="[^"]*"/,`width="${u}"`).replace(/height="[^"]*"/,`height="${d}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,l.src=e}catch(f){q(t,"SVG width/height patch in toImg failed",f)}}return l}var uo=fe(()=>{Se(),Wt()}),Ho={};Ct(Ho,{toBlob:()=>Vo});async function Vo(e,t){let r=t.type;if(r==="svg"){let o=decodeURIComponent(e.split(",")[1]);return new Blob([o],{type:"image/svg+xml"})}let n=await Yt(e,t);return new Promise(o=>n.toBlob(i=>o(i),`image/${r}`,t.quality))}var Go=fe(()=>{qt()}),zo={};Ct(zo,{download:()=>al});async function fo(e,t){let r=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[r]}))return!1;try{await navigator.share({files:[r],title:t})}catch(n){if(n.name!=="AbortError")return!1}return!0}async function al(e,t){let r=new Set(["png","jpeg","jpg","webp","svg"]),n=(t?.type||"").toLowerCase(),o=r.has(n)?n:"",i=(t?.format||o||"").toLowerCase(),a=i==="jpg"?"jpeg":i||"png",s=t?.filename||`snapdom.${a}`,c={...t||{},format:a,type:a};c.dpr=1;let l=Xs();if(a==="svg"){let f=await Vo(e,{...c,type:"svg"});if(l&&await fo(f,s))return;let m=URL.createObjectURL(f),p=document.createElement("a");p.href=m,p.download=s,document.body.appendChild(p),p.click(),URL.revokeObjectURL(m),p.remove();return}let u=await Yt(e,c);if(l){let f=`image/${a}`,m=await new Promise(p=>u.toBlob(p,f,t?.quality));if(m&&await fo(m,s))return}let d=document.createElement("a");d.href=u.toDataURL(`image/${a}`,t?.quality),d.download=s,document.body.appendChild(d),d.click(),d.remove()}var sl=fe(()=>{Go(),qt(),St()});Se();Se();be();var mo=new WeakMap,wt=new Map,ll=2e3,zr=0;function yt(){zr++,wt.size>ll&&wt.clear()}var po=!1;function cl(e=document.documentElement){if(!po){po=!0;try{new MutationObserver(()=>yt()).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>yt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let t=document.fonts;t&&(t.addEventListener?.("loadingdone",yt),t.ready?.then(()=>yt()).catch(()=>{}))}catch{}}}function ul(e,t={}){let r={},n=e.getPropertyValue("visibility"),o=t.excludeStyleProps;for(let d=0;d<e.length;d++){let f=e[d];if(en(f)||o&&(o instanceof RegExp&&o.test(f)||typeof o=="function"&&o(f)))continue;let m=e.getPropertyValue(f);(f==="background-image"||f==="content")&&m.includes("url(")&&!m.includes("data:")&&(m="none"),r[f]=m}let i=["text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness","text-underline-offset","text-decoration-skip-ink"];for(let d of i)if(!r[d])try{let f=e.getPropertyValue(d);f&&(r[d]=f)}catch{}let a=["-webkit-text-stroke","-webkit-text-stroke-width","-webkit-text-stroke-color","paint-order"];for(let d of a)if(!r[d])try{let f=e.getPropertyValue(d);f&&(r[d]=f)}catch{}if(t.embedFonts){let d=["font-feature-settings","font-variation-settings","font-kerning","font-variant","font-variant-ligatures","font-optical-sizing"];for(let f of d)if(!r[f])try{let m=e.getPropertyValue(f);m&&(r[f]=m)}catch{}}n==="hidden"&&(r.opacity="0");try{(r["content-visibility"]||e.getPropertyValue("content-visibility"))==="hidden"&&(r.visibility="hidden")}catch{}let s=parseFloat(e.getPropertyValue("border-top-width")||0)||0,c=parseFloat(e.getPropertyValue("border-right-width")||0)||0,l=parseFloat(e.getPropertyValue("border-bottom-width")||0)||0,u=parseFloat(e.getPropertyValue("border-left-width")||0)||0;if(s===0&&c===0&&l===0&&u===0){let d=(e.getPropertyValue("border-image-source")||"").trim(),f=d&&d!=="none",m=["border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-top-width","border-top-style","border-top-color","border-right-width","border-right-style","border-right-color","border-bottom-width","border-bottom-style","border-bottom-color","border-left-width","border-left-style","border-left-color","border-block","border-block-width","border-block-style","border-block-color","border-inline","border-inline-width","border-inline-style","border-inline-color"];for(let p of m)delete r[p];f||(r.border="none")}return r}var ho=new WeakMap;function dl(e){let t=ho.get(e);return t||(t=Object.entries(e).sort((r,n)=>r[0]<n[0]?-1:r[0]>n[0]?1:0).map(([r,n])=>`${r}:${n}`).join(";"),ho.set(e,t),t)}function fl(e,t=null,r={}){let n=mo.get(e);if(n&&n.epoch===zr)return n.snapshot;let o=t||getComputedStyle(e),i=ul(o,r);return wl(e,o,i),mo.set(e,{epoch:zr,snapshot:i}),i}function ml(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:wt,defaultStyle:E.defaultStyle,baseStyle:E.baseStyle,image:E.image,resource:E.resource,background:E.background,font:E.font},options:t||{}}:{session:E.session,persist:{snapshotKeyCache:wt,defaultStyle:E.defaultStyle,baseStyle:E.baseStyle,image:E.image,resource:E.resource,background:E.background,font:E.font},options:e||t||{}}}function pl(e,t,r){if(!(!e.style||e.style.length===0))for(let n=0;n<e.style.length;n++){let o=e.style[n],i=r.getPropertyValue(o);i&&t.style.setProperty(o,i)}}async function Be(e,t,r,n){if(e.tagName==="STYLE")return;let o=ml(r,n),i=o.options&&o.options.cache||"auto";i!=="disabled"&&cl(document.documentElement),i==="disabled"&&!o.session.__bumpedForDisabled&&(yt(),wt.clear(),o.session.__bumpedForDisabled=!0);let{session:a,persist:s}=o;if(!a.styleCache.has(e)){let f=null;try{f=getComputedStyle(e)}catch{}a.styleCache.set(e,f||getComputedStyle(document.documentElement))}let c=a.styleCache.get(e);e.getAttribute?.("style")&&pl(e,t,c);let l=fl(e,c,o.options),u=dl(l),d=s.snapshotKeyCache.get(u);if(!d){let f=e.tagName?.toLowerCase()||"div";d=Hr(l,f),s.snapshotKeyCache.set(u,d)}a.styleMap.set(t,d)}function hl(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function gl(e){return e.backgroundImage&&e.backgroundImage!=="none"||e.backgroundColor&&e.backgroundColor!=="rgba(0, 0, 0, 0)"&&e.backgroundColor!=="transparent"||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0?!0:(e.overflowBlock||e.overflowY||"visible")!=="visible"}function yl(e){let t=e.parentElement;if(!t)return!1;let r=getComputedStyle(t).display||"";return r.includes("flex")||r.includes("grid")}function bl(e,t){if(e.textContent&&/\S/.test(e.textContent))return!0;let r=e.firstElementChild,n=e.lastElementChild;if(r&&r.tagName==="BR"||n&&n.tagName==="BR")return!0;let o=e.scrollHeight;if(o===0)return!1;let i=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingBottom)||0;return o>i+a}function wl(e,t,r){if(e instanceof HTMLElement&&e.style&&e.style.height)return;let n=e.tagName&&e.tagName.toLowerCase();if(!n||!["div","section","article","main","aside","header","footer","nav"].includes(n))return;let o=parseFloat(t.height);if(Number.isFinite(o)&&e.scrollHeight>0&&Math.abs(o-e.scrollHeight)>2||t.aspectRatio&&t.aspectRatio!=="none"&&t.aspectRatio!=="auto")return;let i=t.display||"";if(i.includes("flex")||i.includes("grid")||hl(e))return;let a=t.position;if(a==="absolute"||a==="fixed"||a==="sticky"||t.transform!=="none"||gl(t)||yl(e))return;let s=t.overflowX||t.overflow||"visible",c=t.overflowY||t.overflow||"visible";if(s!=="visible"||c!=="visible")return;let l=t.clip;l&&l!=="auto"&&l!=="rect(auto, auto, auto, auto)"||t.visibility==="hidden"||t.opacity==="0"||bl(e,t)&&(delete r.height,delete r["block-size"])}$o();var Yo=["fill","stroke","color","background-color","stop-color"],go=new Map;function vl(e,t){let r=t+"::"+e.toLowerCase(),n=go.get(r);if(n)return n;let o=document,i=t==="http://www.w3.org/2000/svg"?o.createElementNS(t,e):o.createElement(e),a=o.createElement("div");a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(i),o.documentElement.appendChild(a);let s=getComputedStyle(i),c={};for(let l of Yo)c[l]=s.getPropertyValue(l)||"";return a.remove(),go.set(r,c),c}function Cl(e,t){if(!(e instanceof Element)||!(t instanceof Element))return;let r=e.getAttribute?.("style"),n=!!(r&&r.includes("var("));if(!n&&e.attributes?.length){let i=e.attributes;for(let a=0;a<i.length;a++){let s=i[a];if(s&&typeof s.value=="string"&&s.value.includes("var(")){n=!0;break}}}let o=null;if(n)try{o=getComputedStyle(e)}catch{}if(n){let i=e.style;if(i&&i.length){let a=new Set;for(let s=0;s<i.length;s++){let c=i[s];if(a.has(c))continue;a.add(c);let l=i.getPropertyValue(c);if(!l||!l.includes("var("))continue;let u=o&&o.getPropertyValue(c);if(u)try{t.style.setProperty(c,u.trim(),i.getPropertyPriority(c))}catch{}}}}if(n&&e.attributes?.length){let i=e.attributes;for(let a=0;a<i.length;a++){let s=i[a];if(!s||typeof s.value!="string"||!s.value.includes("var("))continue;let c=s.name,l=o&&o.getPropertyValue(c);if(l)try{t.style.setProperty(c,l.trim())}catch{}}}if(!n){if(!o)try{o=getComputedStyle(e)}catch{o=null}if(!o)return;let i=e.namespaceURI||"html",a=vl(e.tagName,i);for(let s of Yo){let c=o.getPropertyValue(s)||"",l=a[s]||"";if(c&&c!==l)try{t.style.setProperty(s,c.trim())}catch{}}}}Se();Se();be();nt();function Wr(e,t,r){return Promise.all(e.map(n=>new Promise(o=>{function i(){tt(a=>{!(a&&typeof a.timeRemaining=="function")||a.timeRemaining()>0?t(n,o):i()},{fast:r})}i()})))}function Sl(e){return e=e.trim(),!e||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(e)?e:`${e}:not([data-sd-slotted])`}function xl(e,t,r=!0){return e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>{if(n.startsWith(":where(")||n.startsWith("@"))return n;let o=r?Sl(n):n;return`:where(${t} ${o})`}).join(", ")}function Il(e,t){return e?(e=e.replace(/:host\(([^)]+)\)/g,(r,n)=>`:where(${t}:is(${n.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/:host-context\(([^)]+)\)/g,(r,n)=>`:where(:where(${n.trim()}) ${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(r,n)=>`:where(${t} ${n.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(r,n,o,i)=>{let a=xl(i,t,!0);return`${n}${o}${a}{`}),e):""}function Al(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function El(e){let t="";try{e.querySelectorAll("style").forEach(n=>{t+=(n.textContent||"")+`
4
4
  `});let r=e.adoptedStyleSheets||[];for(let n of r)try{if(n&&n.cssRules)for(let o of n.cssRules)t+=o.cssText+`
5
5
  `}catch{}}catch{}return t}function kl(e,t,r){if(!t)return;let n=document.createElement("style");n.setAttribute("data-sd",r),n.textContent=t,e.insertBefore(n,e.firstChild||null)}function Ml(e,t){try{let r=e.currentSrc||e.src||"";if(!r)return;t.setAttribute("src",r),t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.loading="eager",t.decoding="sync"}catch{}}function Tl(e){let t=new Set;if(!e)return t;let r=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,n;for(;n=r.exec(e);)t.add(n[1]);return t}function Nl(e,t){try{let r=getComputedStyle(e).getPropertyValue(t).trim();if(r)return r}catch{}try{let r=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(r)return r}catch{}return""}function Ll(e,t,r){let n=[];for(let o of t){let i=Nl(e,o);i&&n.push(`${o}: ${i};`)}return n.length?`${r}{${n.join("")}}
6
- `:""}function Rl(e){e&&(e.nodeType===Node.ELEMENT_NODE&&e.setAttribute("data-sd-slotted",""),e.querySelectorAll&&e.querySelectorAll("*").forEach(t=>t.setAttribute("data-sd-slotted","")))}async function Fl(e,t=3){let r=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},n=r(),o=0;for(;o<t&&(!n||!n.body&&!n.documentElement);)await new Promise(i=>setTimeout(i,0)),n=r(),o++;return n&&(n.body||n.documentElement)?n:null}function _l(e){let t=e.getBoundingClientRect(),r=0,n=0,o=0,i=0;try{let c=getComputedStyle(e);r=parseFloat(c.borderLeftWidth)||0,n=parseFloat(c.borderRightWidth)||0,o=parseFloat(c.borderTopWidth)||0,i=parseFloat(c.borderBottomWidth)||0}catch{}let a=Math.max(0,Math.round(t.width-(r+n))),s=Math.max(0,Math.round(t.height-(o+i)));return{contentWidth:a,contentHeight:s,rect:t}}function Ce(e){let t=0,r=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(r=e.offsetHeight),t===0||r===0)try{let n=getComputedStyle(e);if(t===0){let o=parseFloat(n.width);!isNaN(o)&&o>0&&(t=o)}if(r===0){let o=parseFloat(n.height);!isNaN(o)&&o>0&&(r=o)}}catch{}if(t===0||r===0)try{if(t===0){let n=parseFloat(e.getAttribute("width"));!isNaN(n)&&n>0&&(t=n)}if(r===0){let n=parseFloat(e.getAttribute("height"));!isNaN(n)&&n>0&&(r=n)}}catch{}if((t===0||r===0)&&(e.naturalWidth||e.naturalHeight))try{t===0&&e.naturalWidth>0&&(t=e.naturalWidth),r===0&&e.naturalHeight>0&&(r=e.naturalHeight)}catch{}return{width:t,height:r}}function Ol(e,t,r){let n=e.createElement("style");return n.setAttribute("data-sd-iframe-pin",""),n.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${r}px !important;min-width: ${t}px !important;min-height: ${r}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(e.head||e.documentElement).appendChild(n),()=>{try{n.remove()}catch{}}}async function Dl(e,t,r){let n=await Fl(e,3);if(!n)throw new Error("iframe document not accessible/ready");let{contentWidth:o,contentHeight:i,rect:a}=_l(e),s=r?.snap;if(!s&&typeof window<"u"&&window.snapdom&&(s=window.snapdom),!s||typeof s.toPng!="function")throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let c={...r,scale:1},l=Ol(n,o,i),u;try{u=await s.toPng(n.documentElement,c)}finally{l()}u.style.display="block",u.style.width=`${o}px`,u.style.height=`${i}px`;let d=document.createElement("div");return t.nodeMap.set(d,e),Be(e,d,t,r),d.style.overflow="hidden",d.style.display="block",d.style.width||(d.style.width=`${Math.round(a.width)}px`),d.style.height||(d.style.height=`${Math.round(a.height)}px`),d.appendChild(u),d}function $l(e){let{width:t,height:r}=Ce(e),n=e.getBoundingClientRect(),o;try{o=window.getComputedStyle(e)}catch{}let i=o?parseFloat(o.width):NaN,a=o?parseFloat(o.height):NaN,s=Math.round(t||n.width||0),c=Math.round(r||n.height||0),l=Number.isFinite(i)&&i>0?Math.round(i):Math.max(12,s||16),u=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,c||16),d=(e.type||"text").toLowerCase()==="checkbox",f=!!e.checked,m=!!e.indeterminate,p=Math.max(Math.min(l,u),12),g="middle";try{o&&o.verticalAlign&&(g=o.verticalAlign)}catch{}let h=document.createElement("div");h.setAttribute("data-snapdom-input-replacement",e.type||"checkbox"),h.style.cssText=`display:inline-block;width:${p}px;height:${p}px;vertical-align:${g};flex-shrink:0;line-height:0;`;let y=document.createElementNS("http://www.w3.org/2000/svg","svg");y.setAttribute("width",String(p)),y.setAttribute("height",String(p)),y.setAttribute("viewBox",`0 0 ${p} ${p}`),h.appendChild(y);function v(){let w="#0a6ed1";try{o&&(w=o.accentColor||o.color||w)}catch{}let b=2,S=b/2,I=p-b;if(y.innerHTML="",d){let C=document.createElementNS("http://www.w3.org/2000/svg","rect");if(C.setAttribute("x",String(S)),C.setAttribute("y",String(S)),C.setAttribute("width",String(I)),C.setAttribute("height",String(I)),C.setAttribute("rx","2"),C.setAttribute("ry","2"),C.setAttribute("fill",f?w:"none"),C.setAttribute("stroke",w),C.setAttribute("stroke-width",String(b)),y.appendChild(C),f){let x=document.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d",`M ${S+2} ${p/2} L ${p/2-1} ${p-S-2} L ${p-S-2} ${S+2}`),x.setAttribute("stroke","white"),x.setAttribute("stroke-width",String(Math.max(1.5,b))),x.setAttribute("fill","none"),x.setAttribute("stroke-linecap","round"),x.setAttribute("stroke-linejoin","round"),y.appendChild(x)}else if(m){let x=document.createElementNS("http://www.w3.org/2000/svg","rect"),N=Math.max(6,I-4);x.setAttribute("x",String((p-N)/2)),x.setAttribute("y",String((p-b)/2)),x.setAttribute("width",String(N)),x.setAttribute("height",String(b)),x.setAttribute("fill",w),x.setAttribute("rx","1"),y.appendChild(x)}}else{let C=document.createElementNS("http://www.w3.org/2000/svg","circle");if(C.setAttribute("cx",String(p/2)),C.setAttribute("cy",String(p/2)),C.setAttribute("r",String((p-b)/2)),C.setAttribute("fill",f?w:"none"),C.setAttribute("stroke",w),C.setAttribute("stroke-width",String(b)),y.appendChild(C),f){let x=document.createElementNS("http://www.w3.org/2000/svg","circle"),N=Math.max(2,(p-b*2)*.35);x.setAttribute("cx",String(p/2)),x.setAttribute("cy",String(p/2)),x.setAttribute("r",String(N)),x.setAttribute("fill","white"),y.appendChild(x)}}h.style.setProperty("width",`${p}px`,"important"),h.style.setProperty("height",`${p}px`,"important"),h.style.setProperty("min-width",`${p}px`,"important"),h.style.setProperty("min-height",`${p}px`,"important")}return v(),{el:h,applyVisual:v}}var ht=new ge(80);async function bt(e){if(E.resource?.has(e))return E.resource.get(e);if(ht.has(e))return ht.get(e);let t=(async()=>{let r=await ye(e,{as:"dataURL",silent:!0});if(!r.ok||typeof r.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return E.resource?.set(e,r.data),r.data})();ht.set(e,t);try{let r=await t;return ht.set(e,r),r}catch(r){throw ht.delete(e),r}}var Pl=/\bblob:[^)"'\s]+/g;async function yo(e){if(!e||e.indexOf("blob:")===-1)return e;let t=Array.from(new Set(e.match(Pl)||[]));if(t.length===0)return e;let r=e;for(let n of t)try{let o=await bt(n);r=r.split(n).join(o)}catch{}return r}function Dt(e){return typeof e=="string"&&e.startsWith("blob:")}function Wl(e){return(e||"").split(",").map(t=>t.trim()).filter(Boolean).map(t=>{let r=t.match(/^(\S+)(\s+.+)?$/);return r?{url:r[1],desc:r[2]||""}:null}).filter(Boolean)}function Bl(e){return e.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}async function Ul(e,t=null){if(!e)return;let r=t,n=e.querySelectorAll?e.querySelectorAll("img"):[];for(let c of n)try{let l=c.getAttribute("src")||c.currentSrc||"";if(Dt(l)){let d=await bt(l);c.setAttribute("src",d)}let u=c.getAttribute("srcset");if(u&&u.includes("blob:")){let d=Wl(u),f=!1;for(let m of d)if(Dt(m.url))try{m.url=await bt(m.url),f=!0}catch(p){q(r,"blobUrlToDataUrl for srcset item failed",p)}f&&c.setAttribute("srcset",Bl(d))}}catch(l){q(r,"resolveBlobUrls for img failed",l)}let o=e.querySelectorAll?e.querySelectorAll("image"):[];for(let c of o)try{let l="http://www.w3.org/1999/xlink",u=c.getAttribute("href")||c.getAttributeNS?.(l,"href");if(Dt(u)){let d=await bt(u);c.setAttribute("href",d),c.removeAttributeNS?.(l,"href")}}catch(l){q(r,"resolveBlobUrls for SVG image href failed",l)}let i=e.querySelectorAll?e.querySelectorAll("[style*='blob:']"):[];for(let c of i)try{let l=c.getAttribute("style");if(l&&l.includes("blob:")){let u=await yo(l);c.setAttribute("style",u)}}catch(l){q(r,"replaceBlobUrls in inline style failed",l)}let a=e.querySelectorAll?e.querySelectorAll("style"):[];for(let c of a)try{let l=c.textContent||"";l.includes("blob:")&&(c.textContent=await yo(l))}catch(l){q(r,"replaceBlobUrls in style tag failed",l)}let s=["poster"];for(let c of s){let l=e.querySelectorAll?e.querySelectorAll(`[${c}^='blob:']`):[];for(let u of l)try{let d=u.getAttribute(c);Dt(d)&&u.setAttribute(c,await bt(d))}catch(d){q(r,`resolveBlobUrls for ${c} failed`,d)}}}St();async function Bt(e,t,r){if(!e)throw new Error("Invalid node");let n=new Set,o=null,i=null;if(e.nodeType===Node.ELEMENT_NODE){let u=(e.localName||e.tagName||"").toLowerCase();if(e.id==="snapdom-sandbox"||e.hasAttribute("data-snapdom-sandbox")||Fo.has(u))return null;if(u==="foreignobject"&&e.parentElement?.closest?.("foreignObject"))return q(t,"Nested <foreignObject> skipped (SVG spec limitation \u2014 not rendered by browsers)"),null}if(e.nodeType===Node.TEXT_NODE||e.nodeType!==Node.ELEMENT_NODE)return e.cloneNode(!0);if(e.getAttribute("data-capture")==="exclude"){if(r.excludeMode==="hide"){let u=document.createElement("div"),{width:d,height:f}=Ce(e),m=d||e.getBoundingClientRect().width||0,p=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${m}px;height:${p}px;visibility:hidden;`,u}else if(r.excludeMode==="remove")return null}if(r.exclude&&Array.isArray(r.exclude))for(let u of r.exclude)try{if(e.matches?.(u)){if(r.excludeMode==="hide"){let d=document.createElement("div"),{width:f,height:m}=Ce(e),p=f||e.getBoundingClientRect().width||0,g=m||e.getBoundingClientRect().height||0;return d.style.cssText=`display:inline-block;width:${p}px;height:${g}px;visibility:hidden;`,d}else if(r.excludeMode==="remove")return null}}catch(d){console.warn(`Invalid selector in exclude option: ${u}`,d)}if(typeof r.filter=="function")try{if(!r.filter(e)){if(r.filterMode==="hide"){let u=document.createElement("div"),{width:d,height:f}=Ce(e),m=d||e.getBoundingClientRect().width||0,p=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${m}px;height:${p}px;visibility:hidden;`,u}else if(r.filterMode==="remove")return null}}catch(u){console.warn("Error in filter function:",u)}if(e.tagName==="IFRAME"){let u=!1;try{u=!!(e.contentDocument||e.contentWindow?.document)}catch(d){q(t,"iframe same-origin probe failed",d)}if(u)try{return await Dl(e,t,r)}catch(d){console.warn("[SnapDOM] iframe rasterization failed, fallback:",d)}if(u||console.warn("[snapdom] cross-origin <iframe> skipped (cannot access content). Use options.placeholders to show a placeholder instead.",e),r.placeholders){let{width:d,height:f}=Ce(e),m=document.createElement("div");return m.style.cssText=`width:${d}px;height:${f}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,Be(e,m,t,r),m}else{let{width:d,height:f}=Ce(e),m=document.createElement("div");return m.style.cssText=`display:inline-block;width:${d}px;height:${f}px;visibility:hidden;`,Be(e,m,t,r),m}}if(e.getAttribute("data-capture")==="placeholder"){let u=e.cloneNode(!1);t.nodeMap.set(u,e),Be(e,u,t,r);let d=document.createElement("div");return d.textContent=e.getAttribute("data-placeholder-text")||"",d.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",u.appendChild(d),u}if(e.tagName==="CANVAS"){let u="";try{let p=e.getContext("2d",{willReadFrequently:!0});try{p&&p.getImageData(0,0,1,1)}catch{}if(await new Promise(g=>requestAnimationFrame(g)),u=e.toDataURL("image/png"),!u||u==="data:,"){try{p&&p.getImageData(0,0,1,1)}catch{}if(await new Promise(g=>requestAnimationFrame(g)),u=e.toDataURL("image/png"),!u||u==="data:,"){let g=document.createElement("canvas");g.width=e.width,g.height=e.height;let h=g.getContext("2d");h&&(h.drawImage(e,0,0),u=g.toDataURL("image/png"))}}}catch(p){q(t,"Canvas toDataURL failed, using empty/fallback",p)}let d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch(p){q(t,"img decoding/loading hints failed",p)}u&&(d.src=u),d.width=e.width,d.height=e.height;let{width:f,height:m}=Ce(e);return f>0&&(d.style.width=`${f}px`),m>0&&(d.style.height=`${m}px`),t.nodeMap.set(d,e),Be(e,d,t,r),d}if(e.tagName==="VIDEO"){let u="";try{let p=document.createElement("canvas");p.width=e.videoWidth||e.offsetWidth||320,p.height=e.videoHeight||e.offsetHeight||240;let g=p.getContext("2d");g&&(g.drawImage(e,0,0,p.width,p.height),u=p.toDataURL("image/png"),(!u||u==="data:,")&&(u=""))}catch(p){q(t,"Video frame capture failed, using poster fallback",p)}let d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch{}u?d.src=u:e.poster&&(d.src=e.poster),d.width=e.videoWidth||e.offsetWidth||0,d.height=e.videoHeight||e.offsetHeight||0;let{width:f,height:m}=Ce(e);return f>0&&(d.style.width=`${f}px`),m>0&&(d.style.height=`${m}px`),d.style.objectFit="contain",t.nodeMap.set(d,e),Be(e,d,t,r),d}let a;try{if(a=e.cloneNode(!1),a.attributes?.length)try{for(let u of a.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(u.value)&&a.setAttribute(u.name,u.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(Cl(e,a),t.nodeMap.set(a,e),e.tagName==="IMG"){Ml(e,a);try{let{width:u,height:d}=Ce(e),f=Math.round(u||0),m=Math.round(d||0);f&&(a.dataset.snapdomWidth=String(f)),m&&(a.dataset.snapdomHeight=String(m))}catch(u){q(t,"getUnscaledDimensions for IMG failed",u)}try{let u=e.getAttribute("style")||"",d=window.getComputedStyle(e),f=w=>{let b=u.match(new RegExp(`${w}\\s*:\\s*([^;]+)`,"i")),S=b?b[1].trim():d.getPropertyValue(w);return/%|auto/i.test(String(S||""))},m=parseInt(a.dataset.snapdomWidth||"0",10),p=parseInt(a.dataset.snapdomHeight||"0",10),g=f("width")||!m,h=f("height")||!p;g&&m&&(a.style.width=`${m}px`),h&&p&&(a.style.height=`${p}px`);let y=d.getPropertyValue("object-fit"),v=d.getPropertyValue("object-position");y&&y!=="fill"?(a.style.objectFit=y,v&&(a.style.objectPosition=v)):(m&&(a.style.minWidth=`${m}px`),p&&(a.style.minHeight=`${p}px`))}catch(u){q(t,"IMG dimension freeze failed",u)}}}catch(u){throw console.error("[Snapdom] Failed to clone node:",e,u),u}let s=null;if(e instanceof HTMLTextAreaElement){let{width:u,height:d}=Ce(e),f=u||e.getBoundingClientRect().width||0,m=d||e.getBoundingClientRect().height||0;f&&(a.style.width=`${f}px`),m&&(a.style.height=`${m}px`)}if(e instanceof HTMLInputElement){let u=(e.type||"text").toLowerCase();if((u==="checkbox"||u==="radio")&&Ks()){let{el:d,applyVisual:f}=$l(e);t.nodeMap.set(d,e),s=f,a=d}else a.value=e.value,a.setAttribute("value",e.value),e.checked!==void 0&&(a.checked=e.checked,e.checked&&a.setAttribute("checked",""),e.indeterminate&&(a.indeterminate=e.indeterminate))}if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&!e.value&&e.placeholder)try{let u=window.getComputedStyle(e,"::placeholder"),d=u&&u.color;if(d&&d!=="rgba(0, 0, 0, 0)"){let f="snapdom-ph-"+(Math.random()*1e6|0);a.classList.add(f);let m=document.createElement("style");m.textContent=`.${f}::placeholder{color:${d}!important;opacity:${u.opacity||"1"}!important;}`,a.prepend(m)}}catch{}if(e instanceof HTMLSelectElement&&(o=e.value),e instanceof HTMLTextAreaElement&&(i=e.value),e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement){e.disabled&&a.setAttribute("disabled",""),e.required&&a.setAttribute("required",""),e.readOnly&&a.setAttribute("readonly","");let u=e;u.min!==void 0&&u.min!==""&&a.setAttribute("min",u.min),u.max!==void 0&&u.max!==""&&a.setAttribute("max",u.max),u.pattern!==void 0&&u.pattern!==""&&a.setAttribute("pattern",u.pattern);let d=e.getAttribute("aria-invalid");d!==null&&a.setAttribute("aria-invalid",d)}if(Be(e,a,t,r),s&&s(),e instanceof SVGElement){let u=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display"];try{let d=window.getComputedStyle(e);for(let f of u){let m=d.getPropertyValue(f);m&&a.style.setProperty(f,m)}}catch{}}if(e.shadowRoot){let u=function(w,b){if(w.nodeType===Node.ELEMENT_NODE&&w.tagName==="STYLE")return b(null);Bt(w,t,r).then(S=>{b(S||null)}).catch(()=>{b(null)})};try{let w=e.shadowRoot.querySelectorAll("slot");for(let b of w){let S=[];try{S=b.assignedNodes?.({flatten:!0})||b.assignedNodes?.()||[]}catch{S=b.assignedNodes?.()||[]}for(let I of S)n.add(I)}}catch{}let d=Al(t),f=`[data-sd="${d}"]`;try{a.setAttribute("data-sd",d)}catch{}let m=El(e.shadowRoot),p=Il(m,f),g=Tl(m),h=Ll(e,g,f);kl(a,h+p,d);let y=document.createDocumentFragment(),v=await Br(Array.from(e.shadowRoot.childNodes),u,r.fast);y.append(...v.filter(w=>!!w)),a.appendChild(y)}if(e.tagName==="SLOT"){let u=function(g,h){Bt(g,t,r).then(y=>{y&&Rl(y),h(y||null)}).catch(()=>{h(null)})},d=e.assignedNodes?.({flatten:!0})||[],f=d.length>0?d:Array.from(e.childNodes),m=document.createDocumentFragment(),p=await Br(Array.from(f),u,r.fast);return m.append(...p.filter(g=>!!g)),m}function c(u,d){if(n.has(u))return d(null);Bt(u,t,r).then(f=>{d(f||null)}).catch(()=>{d(null)})}let l=await Br(Array.from(e.childNodes),c,r.fast);if(a.append(...l.filter(u=>!!u)),o!==null&&a instanceof HTMLSelectElement){a.value=o;for(let u of a.options)u.value===o?u.setAttribute("selected",""):u.removeAttribute("selected")}return i!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=i),a}Se();zt();be();var Hl=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],et=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{}),qr=[];function Vl(e){let t=Array.isArray(e)?e:[e];for(let r of t)r instanceof RegExp?qr.push(r):typeof r=="string"?qr.push(new RegExp(r,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",r)}function Te(e){let t=typeof e=="string"?e:"",r=[...Hl,...qr];for(let n of r)if(n instanceof RegExp&&n.test(t))return!0;return!!(/icon/i.test(t)||/glyph/i.test(t)||/symbols/i.test(t)||/feather/i.test(t)||/fontawesome/i.test(t))}function Gl(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var bo=new Map;function zl(e=""){let t=Object.create(null),r=String(e||""),n=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,o;for(;o=n.exec(r);)t[o[1].toUpperCase()]=Number(o[2]);return t}async function Yl(e,t,r){let n=String(e||""),o=n.toLowerCase(),i=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(o)&&!/\bsymbols\b/.test(o))return{familyForMeasure:n,familyForCanvas:n};if(!/\bmaterial\s*symbols\b/.test(o))return{familyForMeasure:n,familyForCanvas:n};let a=r&&(r.FILL??r.fill),s="outlined";/\brounded\b/.test(i)||/\bround\b/.test(i)?s="rounded":/\bsharp\b/.test(i)?s="sharp":/\boutlined\b/.test(i)&&(s="outlined");let c=a===1,l=null;if(c&&(s==="outlined"&&et.materialIconsFilled?l={url:et.materialIconsFilled,alias:"snapdom-mi-filled"}:s==="rounded"&&et.materialIconsRound?l={url:et.materialIconsRound,alias:"snapdom-mi-round"}:s==="sharp"&&et.materialIconsSharp&&(l={url:et.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:n,familyForCanvas:n};if(!bo.has(l.alias))try{let d=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});document.fonts.add(d),await d.load(),bo.set(l.alias,!0)}catch{return{familyForMeasure:n,familyForCanvas:n}}let u=`"${l.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function ql(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function jl(e){let t=e.getPropertyValue("-webkit-text-fill-color")?.trim()||"",r=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!r&&t.toLowerCase()!=="currentcolor")return t;let n=e.color?.trim();return n&&n!=="inherit"?n:"#000"}async function Zl(e,{family:t="Material Icons",weight:r="normal",fontSize:n=32,color:o="#000",variation:i="",className:a=""}={}){let s=String(t||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,l=zl(i),{familyForMeasure:u,familyForCanvas:d}=await Yl(s,a,l);await ql(d.replace(/^["']+|["']+$/g,""),n);let f=document.createElement("span");f.textContent=e,f.style.position="absolute",f.style.visibility="hidden",f.style.left="-99999px",f.style.whiteSpace="nowrap",f.style.fontFamily=u,f.style.fontWeight=String(r||"normal"),f.style.fontSize=`${n}px`,f.style.lineHeight="1",f.style.margin="0",f.style.padding="0",f.style.fontFeatureSettings="'liga' 1",f.style.fontVariantLigatures="normal",f.style.color=o,document.body.appendChild(f);let m=f.getBoundingClientRect(),p=Math.max(1,Math.ceil(m.width)),g=Math.max(1,Math.ceil(m.height));document.body.removeChild(f);let h=document.createElement("canvas");h.width=p*c,h.height=g*c;let y=h.getContext("2d");y.scale(c,c),y.font=`${r?`${r} `:""}${n}px ${d}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=o;try{y.fontKerning="normal"}catch{}return y.fillText(e,0,0),{dataUrl:h.toDataURL(),width:p,height:g}}async function Xl(e,t){if(!(e instanceof Element))return 0;let r='.material-icons, [class*="material-symbols"]',n=Array.from(e.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim());if(n.length===0)return 0;let o=t instanceof Element?Array.from(t.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim()):[],i=0;for(let a=0;a<n.length;a++){let s=n[a],c=o[a]||null;try{let l=getComputedStyle(c||s),u=l.fontFamily||"Material Icons";if(!Gl(u))continue;let d=(c||s).textContent.trim();if(!d)continue;let f=parseInt(l.fontSize,10)||24,m=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",p=jl(l),g=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",h=(c||s).className||"",{dataUrl:y,width:v,height:w}=await Zl(d,{family:u,weight:m,fontSize:f,color:p,variation:g,className:h});s.textContent="";let b=s.ownerDocument.createElement("img");b.src=y,b.alt=d,b.style.height=`${f}px`,b.style.width=`${Math.max(1,Math.round(v/w*f))}px`,b.style.objectFit="contain",b.style.verticalAlign=getComputedStyle(s).verticalAlign||"baseline",s.appendChild(b),i++}catch{}}return i}ot();async function Kl(e,t,r,n=32,o="#000"){t=t.replace(/^['"]+|['"]+$/g,"");let i=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");a.textContent=e,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${t}"`,a.style.fontWeight=r||"normal",a.style.fontSize=`${n}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let s=a.getBoundingClientRect(),c=Math.ceil(s.width),l=Math.ceil(s.height);document.body.removeChild(a);let u=document.createElement("canvas");u.width=Math.max(1,c*i),u.height=Math.max(1,l*i);let d=u.getContext("2d");return d.scale(i,i),d.font=r?`${r} ${n}px "${t}"`:`${n}px "${t}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=o,d.fillText(e,0,0),{dataUrl:u.toDataURL(),width:c,height:l}}var qo=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),Jl=["katex","mathjax","mathml"];function nn(e){if(!e)return"";for(let t of e.split(",")){let r=t.trim().replace(/^['"]+|['"]+$/g,"");if(r&&!qo.has(r.toLowerCase()))return r}return""}function Ql(e){if(!e)return[];let t=[];for(let r of e.split(",")){let n=r.trim().replace(/^['"]+|['"]+$/g,"");n&&(qo.has(n.toLowerCase())||t.push(n))}return t}function Ut(e){let t=String(e??"400").trim().toLowerCase();if(t==="normal")return 400;if(t==="bold")return 700;let r=parseInt(t,10);return Number.isFinite(r)?Math.min(900,Math.max(100,r)):400}function Ht(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function ec(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function tc(e){let t=String(e||"400").trim(),r=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(r){let o=Ut(r[1]),i=Ut(r[2]);return{min:Math.min(o,i),max:Math.max(o,i)}}let n=Ut(t);return{min:n,max:n}}function rc(e){let t=String(e||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function nc(e){let t=String(e||"100%").trim(),r=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(r){let i=parseFloat(r[1]),a=parseFloat(r[2]);return{min:Math.min(i,a),max:Math.max(i,a)}}let n=t.match(/(\d+(?:\.\d+)?)\s*%/),o=n?parseFloat(n[1]):100;return{min:o,max:o}}function oc(e){return!e||typeof e!="string"?"":e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function ic(e,t,r=[]){if(!e)return!1;try{let n=new URL(e,location.href);if(n.origin===location.origin)return!0;let o=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(a=>o.endsWith(a))||r.some(a=>o===a.toLowerCase()||o.endsWith("."+a.toLowerCase())))return!0;let i=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(i)||/\.woff2?(\b|$)/.test(i)||Jl.some(a=>i.includes(a)))return!0;for(let a of t){let s=a.toLowerCase().replace(/\s+/g,"+"),c=a.toLowerCase().replace(/\s+/g,"-"),l=oc(a);if(i.includes(s)||i.includes(c)||l&&i.includes(l))return!0}return!1}catch{return!1}}function ac(e){let t=new Set;for(let r of e||[]){let n=String(r).split("__")[0]?.trim();n&&t.add(n)}return t}function wo(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(r,n,o)=>{let i=(o||"").trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return r;let a=i;try{a=new URL(i,t||location.href).href}catch{}return`url("${a}")`})}var jr=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Gt=4;async function sc(e,t,r){if(!e)return e;let n=new Set;function o(s,c){try{return new URL(s,c||location.href).href}catch{return s}}async function i(s,c,l=0){if(l>Gt)return console.warn(`[snapDOM] @import depth exceeded (${Gt}) at ${c}`),s;let u="",d=0,f;for(;f=jr.exec(s);){u+=s.slice(d,f.index),d=jr.lastIndex;let m=(f[2]||f[4]||"").trim(),p=o(m,c);if(n.has(p)){console.warn(`[snapDOM] Skipping circular @import: ${p}`);continue}n.add(p);let g="";try{let h=await ye(p,{as:"text",useProxy:r,silent:!0});h.ok&&typeof h.data=="string"&&(g=h.data)}catch{}g?(g=wo(g,p),g=await i(g,p,l+1),u+=`
6
+ `:""}function Rl(e){e&&(e.nodeType===Node.ELEMENT_NODE&&e.setAttribute("data-sd-slotted",""),e.querySelectorAll&&e.querySelectorAll("*").forEach(t=>t.setAttribute("data-sd-slotted","")))}async function Fl(e,t=3){let r=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},n=r(),o=0;for(;o<t&&(!n||!n.body&&!n.documentElement);)await new Promise(i=>setTimeout(i,0)),n=r(),o++;return n&&(n.body||n.documentElement)?n:null}function _l(e){let t=e.getBoundingClientRect(),r=0,n=0,o=0,i=0;try{let c=getComputedStyle(e);r=parseFloat(c.borderLeftWidth)||0,n=parseFloat(c.borderRightWidth)||0,o=parseFloat(c.borderTopWidth)||0,i=parseFloat(c.borderBottomWidth)||0}catch{}let a=Math.max(0,Math.round(t.width-(r+n))),s=Math.max(0,Math.round(t.height-(o+i)));return{contentWidth:a,contentHeight:s,rect:t}}function Ce(e){let t=0,r=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(r=e.offsetHeight),t===0||r===0)try{let n=getComputedStyle(e);if(t===0){let o=parseFloat(n.width);!isNaN(o)&&o>0&&(t=o)}if(r===0){let o=parseFloat(n.height);!isNaN(o)&&o>0&&(r=o)}}catch{}if(t===0||r===0)try{if(t===0){let n=parseFloat(e.getAttribute("width"));!isNaN(n)&&n>0&&(t=n)}if(r===0){let n=parseFloat(e.getAttribute("height"));!isNaN(n)&&n>0&&(r=n)}}catch{}if((t===0||r===0)&&(e.naturalWidth||e.naturalHeight))try{t===0&&e.naturalWidth>0&&(t=e.naturalWidth),r===0&&e.naturalHeight>0&&(r=e.naturalHeight)}catch{}return{width:t,height:r}}function Ol(e,t,r){let n=e.createElement("style");return n.setAttribute("data-sd-iframe-pin",""),n.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${r}px !important;min-width: ${t}px !important;min-height: ${r}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(e.head||e.documentElement).appendChild(n),()=>{try{n.remove()}catch{}}}async function Dl(e,t,r){let n=await Fl(e,3);if(!n)throw new Error("iframe document not accessible/ready");let{contentWidth:o,contentHeight:i,rect:a}=_l(e),s=r?.snap;if(!s&&typeof window<"u"&&window.snapdom&&(s=window.snapdom),!s||typeof s.toPng!="function")throw new Error("[snapdom] iframe capture requires snapdom.toPng. Use snapdom(el) or pass options.snap. With ESM, assign window.snapdom = snapdom after import if using iframes.");let c={...r,scale:1},l=Ol(n,o,i),u;try{u=await s.toPng(n.documentElement,c)}finally{l()}u.style.display="block",u.style.width=`${o}px`,u.style.height=`${i}px`;let d=document.createElement("div");return t.nodeMap.set(d,e),Be(e,d,t,r),d.style.overflow="hidden",d.style.display="block",d.style.width||(d.style.width=`${Math.round(a.width)}px`),d.style.height||(d.style.height=`${Math.round(a.height)}px`),d.appendChild(u),d}function $l(e){let{width:t,height:r}=Ce(e),n=e.getBoundingClientRect(),o;try{o=window.getComputedStyle(e)}catch{}let i=o?parseFloat(o.width):NaN,a=o?parseFloat(o.height):NaN,s=Math.round(t||n.width||0),c=Math.round(r||n.height||0),l=Number.isFinite(i)&&i>0?Math.round(i):Math.max(12,s||16),u=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,c||16),d=(e.type||"text").toLowerCase()==="checkbox",f=!!e.checked,m=!!e.indeterminate,p=Math.max(Math.min(l,u),12),g="middle";try{o&&o.verticalAlign&&(g=o.verticalAlign)}catch{}let h=document.createElement("div");h.setAttribute("data-snapdom-input-replacement",e.type||"checkbox"),h.style.cssText=`display:inline-block;width:${p}px;height:${p}px;vertical-align:${g};flex-shrink:0;line-height:0;`;let y=document.createElementNS("http://www.w3.org/2000/svg","svg");y.setAttribute("width",String(p)),y.setAttribute("height",String(p)),y.setAttribute("viewBox",`0 0 ${p} ${p}`),h.appendChild(y);function v(){let w="#0a6ed1";try{o&&(w=o.accentColor||o.color||w)}catch{}let b=2,S=b/2,I=p-b;if(y.innerHTML="",d){let C=document.createElementNS("http://www.w3.org/2000/svg","rect");if(C.setAttribute("x",String(S)),C.setAttribute("y",String(S)),C.setAttribute("width",String(I)),C.setAttribute("height",String(I)),C.setAttribute("rx","2"),C.setAttribute("ry","2"),C.setAttribute("fill",f?w:"none"),C.setAttribute("stroke",w),C.setAttribute("stroke-width",String(b)),y.appendChild(C),f){let x=document.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d",`M ${S+2} ${p/2} L ${p/2-1} ${p-S-2} L ${p-S-2} ${S+2}`),x.setAttribute("stroke","white"),x.setAttribute("stroke-width",String(Math.max(1.5,b))),x.setAttribute("fill","none"),x.setAttribute("stroke-linecap","round"),x.setAttribute("stroke-linejoin","round"),y.appendChild(x)}else if(m){let x=document.createElementNS("http://www.w3.org/2000/svg","rect"),N=Math.max(6,I-4);x.setAttribute("x",String((p-N)/2)),x.setAttribute("y",String((p-b)/2)),x.setAttribute("width",String(N)),x.setAttribute("height",String(b)),x.setAttribute("fill",w),x.setAttribute("rx","1"),y.appendChild(x)}}else{let C=document.createElementNS("http://www.w3.org/2000/svg","circle");if(C.setAttribute("cx",String(p/2)),C.setAttribute("cy",String(p/2)),C.setAttribute("r",String((p-b)/2)),C.setAttribute("fill",f?w:"none"),C.setAttribute("stroke",w),C.setAttribute("stroke-width",String(b)),y.appendChild(C),f){let x=document.createElementNS("http://www.w3.org/2000/svg","circle"),N=Math.max(2,(p-b*2)*.35);x.setAttribute("cx",String(p/2)),x.setAttribute("cy",String(p/2)),x.setAttribute("r",String(N)),x.setAttribute("fill","white"),y.appendChild(x)}}h.style.setProperty("width",`${p}px`,"important"),h.style.setProperty("height",`${p}px`,"important"),h.style.setProperty("min-width",`${p}px`,"important"),h.style.setProperty("min-height",`${p}px`,"important")}return v(),{el:h,applyVisual:v}}var ht=new ge(80);async function bt(e){if(E.resource?.has(e))return E.resource.get(e);if(ht.has(e))return ht.get(e);let t=(async()=>{let r=await ye(e,{as:"dataURL",silent:!0});if(!r.ok||typeof r.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return E.resource?.set(e,r.data),r.data})();ht.set(e,t);try{let r=await t;return ht.set(e,r),r}catch(r){throw ht.delete(e),r}}var Pl=/\bblob:[^)"'\s]+/g;async function yo(e){if(!e||e.indexOf("blob:")===-1)return e;let t=Array.from(new Set(e.match(Pl)||[]));if(t.length===0)return e;let r=e;for(let n of t)try{let o=await bt(n);r=r.split(n).join(o)}catch{}return r}function Dt(e){return typeof e=="string"&&e.startsWith("blob:")}function Wl(e){return(e||"").split(",").map(t=>t.trim()).filter(Boolean).map(t=>{let r=t.match(/^(\S+)(\s+.+)?$/);return r?{url:r[1],desc:r[2]||""}:null}).filter(Boolean)}function Bl(e){return e.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}async function Ul(e,t=null){if(!e)return;let r=t,n=e.querySelectorAll?e.querySelectorAll("img"):[];for(let c of n)try{let l=c.getAttribute("src")||c.currentSrc||"";if(Dt(l)){let d=await bt(l);c.setAttribute("src",d)}let u=c.getAttribute("srcset");if(u&&u.includes("blob:")){let d=Wl(u),f=!1;for(let m of d)if(Dt(m.url))try{m.url=await bt(m.url),f=!0}catch(p){q(r,"blobUrlToDataUrl for srcset item failed",p)}f&&c.setAttribute("srcset",Bl(d))}}catch(l){q(r,"resolveBlobUrls for img failed",l)}let o=e.querySelectorAll?e.querySelectorAll("image"):[];for(let c of o)try{let l="http://www.w3.org/1999/xlink",u=c.getAttribute("href")||c.getAttributeNS?.(l,"href");if(Dt(u)){let d=await bt(u);c.setAttribute("href",d),c.removeAttributeNS?.(l,"href")}}catch(l){q(r,"resolveBlobUrls for SVG image href failed",l)}let i=e.querySelectorAll?e.querySelectorAll("[style*='blob:']"):[];for(let c of i)try{let l=c.getAttribute("style");if(l&&l.includes("blob:")){let u=await yo(l);c.setAttribute("style",u)}}catch(l){q(r,"replaceBlobUrls in inline style failed",l)}let a=e.querySelectorAll?e.querySelectorAll("style"):[];for(let c of a)try{let l=c.textContent||"";l.includes("blob:")&&(c.textContent=await yo(l))}catch(l){q(r,"replaceBlobUrls in style tag failed",l)}let s=["poster"];for(let c of s){let l=e.querySelectorAll?e.querySelectorAll(`[${c}^='blob:']`):[];for(let u of l)try{let d=u.getAttribute(c);Dt(d)&&u.setAttribute(c,await bt(d))}catch(d){q(r,`resolveBlobUrls for ${c} failed`,d)}}}St();async function Bt(e,t,r){if(!e)throw new Error("Invalid node");let n=new Set,o=null,i=null;if(e.nodeType===Node.ELEMENT_NODE){let u=(e.localName||e.tagName||"").toLowerCase();if(e.id==="snapdom-sandbox"||e.hasAttribute("data-snapdom-sandbox")||Fo.has(u))return null;if(u==="foreignobject"&&e.parentElement?.closest?.("foreignObject"))return q(t,"Nested <foreignObject> skipped (SVG spec limitation \u2014 not rendered by browsers)"),null}if(e.nodeType===Node.TEXT_NODE||e.nodeType!==Node.ELEMENT_NODE)return e.cloneNode(!0);if(e.getAttribute("data-capture")==="exclude"){if(r.excludeMode==="hide"){let u=document.createElement("div"),{width:d,height:f}=Ce(e),m=d||e.getBoundingClientRect().width||0,p=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${m}px;height:${p}px;visibility:hidden;`,u}else if(r.excludeMode==="remove")return null}if(r.exclude&&Array.isArray(r.exclude))for(let u of r.exclude)try{if(e.matches?.(u)){if(r.excludeMode==="hide"){let d=document.createElement("div"),{width:f,height:m}=Ce(e),p=f||e.getBoundingClientRect().width||0,g=m||e.getBoundingClientRect().height||0;return d.style.cssText=`display:inline-block;width:${p}px;height:${g}px;visibility:hidden;`,d}else if(r.excludeMode==="remove")return null}}catch(d){console.warn(`Invalid selector in exclude option: ${u}`,d)}if(typeof r.filter=="function")try{if(!r.filter(e)){if(r.filterMode==="hide"){let u=document.createElement("div"),{width:d,height:f}=Ce(e),m=d||e.getBoundingClientRect().width||0,p=f||e.getBoundingClientRect().height||0;return u.style.cssText=`display:inline-block;width:${m}px;height:${p}px;visibility:hidden;`,u}else if(r.filterMode==="remove")return null}}catch(u){console.warn("Error in filter function:",u)}if(e.tagName==="IFRAME"){let u=!1;try{u=!!(e.contentDocument||e.contentWindow?.document)}catch(d){q(t,"iframe same-origin probe failed",d)}if(u)try{return await Dl(e,t,r)}catch(d){console.warn("[SnapDOM] iframe rasterization failed, fallback:",d)}if(u||console.warn("[snapdom] cross-origin <iframe> skipped (cannot access content). Use options.placeholders to show a placeholder instead.",e),r.placeholders){let{width:d,height:f}=Ce(e),m=document.createElement("div");return m.style.cssText=`width:${d}px;height:${f}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,Be(e,m,t,r),m}else{let{width:d,height:f}=Ce(e),m=document.createElement("div");return m.style.cssText=`display:inline-block;width:${d}px;height:${f}px;visibility:hidden;`,Be(e,m,t,r),m}}if(e.getAttribute("data-capture")==="placeholder"){let u=e.cloneNode(!1);t.nodeMap.set(u,e),Be(e,u,t,r);let d=document.createElement("div");return d.textContent=e.getAttribute("data-placeholder-text")||"",d.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",u.appendChild(d),u}if(e.tagName==="CANVAS"){let u="";try{let p=e.getContext("2d",{willReadFrequently:!0});try{p&&p.getImageData(0,0,1,1)}catch{}if(await new Promise(g=>requestAnimationFrame(g)),u=e.toDataURL("image/png"),!u||u==="data:,"){try{p&&p.getImageData(0,0,1,1)}catch{}if(await new Promise(g=>requestAnimationFrame(g)),u=e.toDataURL("image/png"),!u||u==="data:,"){let g=document.createElement("canvas");g.width=e.width,g.height=e.height;let h=g.getContext("2d");h&&(h.drawImage(e,0,0),u=g.toDataURL("image/png"))}}}catch(p){q(t,"Canvas toDataURL failed, using empty/fallback",p)}let d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch(p){q(t,"img decoding/loading hints failed",p)}u&&(d.src=u),d.width=e.width,d.height=e.height;let{width:f,height:m}=Ce(e);return f>0&&(d.style.width=`${f}px`),m>0&&(d.style.height=`${m}px`),t.nodeMap.set(d,e),Be(e,d,t,r),d}if(e.tagName==="VIDEO"){let u="";try{let p=document.createElement("canvas");p.width=e.videoWidth||e.offsetWidth||320,p.height=e.videoHeight||e.offsetHeight||240;let g=p.getContext("2d");g&&(g.drawImage(e,0,0,p.width,p.height),u=p.toDataURL("image/png"),(!u||u==="data:,")&&(u=""))}catch(p){q(t,"Video frame capture failed, using poster fallback",p)}let d=document.createElement("img");try{d.decoding="sync",d.loading="eager"}catch{}u?d.src=u:e.poster&&(d.src=e.poster),d.width=e.videoWidth||e.offsetWidth||0,d.height=e.videoHeight||e.offsetHeight||0;let{width:f,height:m}=Ce(e);return f>0&&(d.style.width=`${f}px`),m>0&&(d.style.height=`${m}px`),d.style.objectFit="contain",t.nodeMap.set(d,e),Be(e,d,t,r),d}let a;try{if(a=e.cloneNode(!1),a.attributes?.length)try{for(let u of a.attributes)/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/.test(u.value)&&a.setAttribute(u.name,u.value.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]/g,""))}catch{}if(Cl(e,a),t.nodeMap.set(a,e),e.tagName==="IMG"){Ml(e,a);try{let{width:u,height:d}=Ce(e),f=Math.round(u||0),m=Math.round(d||0);f&&(a.dataset.snapdomWidth=String(f)),m&&(a.dataset.snapdomHeight=String(m))}catch(u){q(t,"getUnscaledDimensions for IMG failed",u)}try{let u=e.getAttribute("style")||"",d=window.getComputedStyle(e),f=w=>{let b=u.match(new RegExp(`${w}\\s*:\\s*([^;]+)`,"i")),S=b?b[1].trim():d.getPropertyValue(w);return/%|auto/i.test(String(S||""))},m=parseInt(a.dataset.snapdomWidth||"0",10),p=parseInt(a.dataset.snapdomHeight||"0",10),g=f("width")||!m,h=f("height")||!p;g&&m&&(a.style.width=`${m}px`),h&&p&&(a.style.height=`${p}px`);let y=d.getPropertyValue("object-fit"),v=d.getPropertyValue("object-position");y&&y!=="fill"?(a.style.objectFit=y,v&&(a.style.objectPosition=v)):(m&&(a.style.minWidth=`${m}px`),p&&(a.style.minHeight=`${p}px`))}catch(u){q(t,"IMG dimension freeze failed",u)}}}catch(u){throw console.error("[Snapdom] Failed to clone node:",e,u),u}let s=null;if(e instanceof HTMLTextAreaElement){let{width:u,height:d}=Ce(e),f=u||e.getBoundingClientRect().width||0,m=d||e.getBoundingClientRect().height||0;f&&(a.style.width=`${f}px`),m&&(a.style.height=`${m}px`)}if(e instanceof HTMLInputElement){let u=(e.type||"text").toLowerCase();if((u==="checkbox"||u==="radio")&&Ks()){let{el:d,applyVisual:f}=$l(e);t.nodeMap.set(d,e),s=f,a=d}else a.value=e.value,a.setAttribute("value",e.value),e.checked!==void 0&&(a.checked=e.checked,e.checked&&a.setAttribute("checked",""),e.indeterminate&&(a.indeterminate=e.indeterminate))}if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&!e.value&&e.placeholder)try{let u=window.getComputedStyle(e,"::placeholder"),d=u&&u.color;if(d&&d!=="rgba(0, 0, 0, 0)"){let f="snapdom-ph-"+(Math.random()*1e6|0);a.classList.add(f);let m=document.createElement("style");m.textContent=`.${f}::placeholder{color:${d}!important;opacity:${u.opacity||"1"}!important;}`,a.prepend(m)}}catch{}if(e instanceof HTMLSelectElement&&(o=e.value),e instanceof HTMLTextAreaElement&&(i=e.value),e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement){e.disabled&&a.setAttribute("disabled",""),e.required&&a.setAttribute("required",""),e.readOnly&&a.setAttribute("readonly","");let u=e;u.min!==void 0&&u.min!==""&&a.setAttribute("min",u.min),u.max!==void 0&&u.max!==""&&a.setAttribute("max",u.max),u.pattern!==void 0&&u.pattern!==""&&a.setAttribute("pattern",u.pattern);let d=e.getAttribute("aria-invalid");d!==null&&a.setAttribute("aria-invalid",d)}if(Be(e,a,t,r),s&&s(),e instanceof SVGElement){let u=["fill","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","opacity","fill-opacity","stroke-opacity","fill-rule","clip-rule","marker","marker-start","marker-mid","marker-end","visibility","display"];try{let d=window.getComputedStyle(e);for(let f of u){let m=d.getPropertyValue(f);m&&a.style.setProperty(f,m)}}catch{}}if(e.shadowRoot){let u=function(w,b){if(w.nodeType===Node.ELEMENT_NODE&&w.tagName==="STYLE")return b(null);Bt(w,t,r).then(S=>{b(S||null)}).catch(()=>{b(null)})};try{let w=e.shadowRoot.querySelectorAll("slot");for(let b of w){let S=[];try{S=b.assignedNodes?.({flatten:!0})||b.assignedNodes?.()||[]}catch{S=b.assignedNodes?.()||[]}for(let I of S)n.add(I)}}catch{}let d=Al(t),f=`[data-sd="${d}"]`;try{a.setAttribute("data-sd",d)}catch{}let m=El(e.shadowRoot),p=Il(m,f),g=Tl(m),h=Ll(e,g,f);kl(a,h+p,d);let y=document.createDocumentFragment(),v=await Wr(Array.from(e.shadowRoot.childNodes),u,r.fast);y.append(...v.filter(w=>!!w)),a.appendChild(y)}if(e.tagName==="SLOT"){let u=function(g,h){Bt(g,t,r).then(y=>{y&&Rl(y),h(y||null)}).catch(()=>{h(null)})},d=e.assignedNodes?.({flatten:!0})||[],f=d.length>0?d:Array.from(e.childNodes),m=document.createDocumentFragment(),p=await Wr(Array.from(f),u,r.fast);return m.append(...p.filter(g=>!!g)),m}function c(u,d){if(n.has(u))return d(null);Bt(u,t,r).then(f=>{d(f||null)}).catch(()=>{d(null)})}let l=await Wr(Array.from(e.childNodes),c,r.fast);if(a.append(...l.filter(u=>!!u)),o!==null&&a instanceof HTMLSelectElement){a.value=o;for(let u of a.options)u.value===o?u.setAttribute("selected",""):u.removeAttribute("selected")}return i!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=i),a}Se();zt();be();var Hl=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],Qe=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{}),Yr=[];function Vl(e){let t=Array.isArray(e)?e:[e];for(let r of t)r instanceof RegExp?Yr.push(r):typeof r=="string"?Yr.push(new RegExp(r,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",r)}function Te(e){let t=typeof e=="string"?e:"",r=[...Hl,...Yr];for(let n of r)if(n instanceof RegExp&&n.test(t))return!0;return!!(/icon/i.test(t)||/glyph/i.test(t)||/symbols/i.test(t)||/feather/i.test(t)||/fontawesome/i.test(t))}function Gl(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var bo=new Map;function zl(e=""){let t=Object.create(null),r=String(e||""),n=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,o;for(;o=n.exec(r);)t[o[1].toUpperCase()]=Number(o[2]);return t}async function Yl(e,t,r){let n=String(e||""),o=n.toLowerCase(),i=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(o)&&!/\bsymbols\b/.test(o))return{familyForMeasure:n,familyForCanvas:n};if(!/\bmaterial\s*symbols\b/.test(o))return{familyForMeasure:n,familyForCanvas:n};let a=r&&(r.FILL??r.fill),s="outlined";/\brounded\b/.test(i)||/\bround\b/.test(i)?s="rounded":/\bsharp\b/.test(i)?s="sharp":/\boutlined\b/.test(i)&&(s="outlined");let c=a===1,l=null;if(c&&(s==="outlined"&&Qe.materialIconsFilled?l={url:Qe.materialIconsFilled,alias:"snapdom-mi-filled"}:s==="rounded"&&Qe.materialIconsRound?l={url:Qe.materialIconsRound,alias:"snapdom-mi-round"}:s==="sharp"&&Qe.materialIconsSharp&&(l={url:Qe.materialIconsSharp,alias:"snapdom-mi-sharp"})),!l)return{familyForMeasure:n,familyForCanvas:n};if(!bo.has(l.alias))try{let d=new FontFace(l.alias,`url(${l.url})`,{style:"normal",weight:"400"});document.fonts.add(d),await d.load(),bo.set(l.alias,!0)}catch{return{familyForMeasure:n,familyForCanvas:n}}let u=`"${l.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function ql(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function jl(e){let t=e.getPropertyValue("-webkit-text-fill-color")?.trim()||"",r=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!r&&t.toLowerCase()!=="currentcolor")return t;let n=e.color?.trim();return n&&n!=="inherit"?n:"#000"}async function Zl(e,{family:t="Material Icons",weight:r="normal",fontSize:n=32,color:o="#000",variation:i="",className:a=""}={}){let s=String(t||"").replace(/^['"]+|['"]+$/g,""),c=window.devicePixelRatio||1,l=zl(i),{familyForMeasure:u,familyForCanvas:d}=await Yl(s,a,l);await ql(d.replace(/^["']+|["']+$/g,""),n);let f=document.createElement("span");f.textContent=e,f.style.position="absolute",f.style.visibility="hidden",f.style.left="-99999px",f.style.whiteSpace="nowrap",f.style.fontFamily=u,f.style.fontWeight=String(r||"normal"),f.style.fontSize=`${n}px`,f.style.lineHeight="1",f.style.margin="0",f.style.padding="0",f.style.fontFeatureSettings="'liga' 1",f.style.fontVariantLigatures="normal",f.style.color=o,document.body.appendChild(f);let m=f.getBoundingClientRect(),p=Math.max(1,Math.ceil(m.width)),g=Math.max(1,Math.ceil(m.height));document.body.removeChild(f);let h=document.createElement("canvas");h.width=p*c,h.height=g*c;let y=h.getContext("2d");y.scale(c,c),y.font=`${r?`${r} `:""}${n}px ${d}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=o;try{y.fontKerning="normal"}catch{}return y.fillText(e,0,0),{dataUrl:h.toDataURL(),width:p,height:g}}async function Xl(e,t){if(!(e instanceof Element))return 0;let r='.material-icons, [class*="material-symbols"]',n=Array.from(e.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim());if(n.length===0)return 0;let o=t instanceof Element?Array.from(t.querySelectorAll(r)).filter(a=>a&&a.textContent&&a.textContent.trim()):[],i=0;for(let a=0;a<n.length;a++){let s=n[a],c=o[a]||null;try{let l=getComputedStyle(c||s),u=l.fontFamily||"Material Icons";if(!Gl(u))continue;let d=(c||s).textContent.trim();if(!d)continue;let f=parseInt(l.fontSize,10)||24,m=l.fontWeight&&l.fontWeight!=="normal"?l.fontWeight:"normal",p=jl(l),g=l.fontVariationSettings&&l.fontVariationSettings!=="normal"?l.fontVariationSettings:"",h=(c||s).className||"",{dataUrl:y,width:v,height:w}=await Zl(d,{family:u,weight:m,fontSize:f,color:p,variation:g,className:h});s.textContent="";let b=s.ownerDocument.createElement("img");b.src=y,b.alt=d,b.style.height=`${f}px`,b.style.width=`${Math.max(1,Math.round(v/w*f))}px`,b.style.objectFit="contain",b.style.verticalAlign=getComputedStyle(s).verticalAlign||"baseline",s.appendChild(b),i++}catch{}}return i}nt();async function Kl(e,t,r,n=32,o="#000"){t=t.replace(/^['"]+|['"]+$/g,"");let i=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let a=document.createElement("span");a.textContent=e,a.style.position="absolute",a.style.visibility="hidden",a.style.fontFamily=`"${t}"`,a.style.fontWeight=r||"normal",a.style.fontSize=`${n}px`,a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.padding="0",a.style.margin="0",document.body.appendChild(a);let s=a.getBoundingClientRect(),c=Math.ceil(s.width),l=Math.ceil(s.height);document.body.removeChild(a);let u=document.createElement("canvas");u.width=Math.max(1,c*i),u.height=Math.max(1,l*i);let d=u.getContext("2d");return d.scale(i,i),d.font=r?`${r} ${n}px "${t}"`:`${n}px "${t}"`,d.textAlign="left",d.textBaseline="top",d.fillStyle=o,d.fillText(e,0,0),{dataUrl:u.toDataURL(),width:c,height:l}}var qo=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),Jl=["katex","mathjax","mathml"];function rn(e){if(!e)return"";for(let t of e.split(",")){let r=t.trim().replace(/^['"]+|['"]+$/g,"");if(r&&!qo.has(r.toLowerCase()))return r}return""}function Ql(e){if(!e)return[];let t=[];for(let r of e.split(",")){let n=r.trim().replace(/^['"]+|['"]+$/g,"");n&&(qo.has(n.toLowerCase())||t.push(n))}return t}function Ut(e){let t=String(e??"400").trim().toLowerCase();if(t==="normal")return 400;if(t==="bold")return 700;let r=parseInt(t,10);return Number.isFinite(r)?Math.min(900,Math.max(100,r)):400}function Ht(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function ec(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function tc(e){let t=String(e||"400").trim(),r=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(r){let o=Ut(r[1]),i=Ut(r[2]);return{min:Math.min(o,i),max:Math.max(o,i)}}let n=Ut(t);return{min:n,max:n}}function rc(e){let t=String(e||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function nc(e){let t=String(e||"100%").trim(),r=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(r){let i=parseFloat(r[1]),a=parseFloat(r[2]);return{min:Math.min(i,a),max:Math.max(i,a)}}let n=t.match(/(\d+(?:\.\d+)?)\s*%/),o=n?parseFloat(n[1]):100;return{min:o,max:o}}function oc(e){return!e||typeof e!="string"?"":e.replace(/\s+(variable|vf|v[0-9]+)$/i,"").trim().toLowerCase().replace(/\s+/g,"-")}function ic(e,t,r=[]){if(!e)return!1;try{let n=new URL(e,location.href);if(n.origin===location.origin)return!0;let o=n.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com","cdn.jsdelivr.net","unpkg.com","cdnjs.cloudflare.com","esm.sh"].some(a=>o.endsWith(a))||r.some(a=>o===a.toLowerCase()||o.endsWith("."+a.toLowerCase())))return!0;let i=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(i)||/\.woff2?(\b|$)/.test(i)||Jl.some(a=>i.includes(a)))return!0;for(let a of t){let s=a.toLowerCase().replace(/\s+/g,"+"),c=a.toLowerCase().replace(/\s+/g,"-"),l=oc(a);if(i.includes(s)||i.includes(c)||l&&i.includes(l))return!0}return!1}catch{return!1}}function ac(e){let t=new Set;for(let r of e||[]){let n=String(r).split("__")[0]?.trim();n&&t.add(n)}return t}function wo(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(r,n,o)=>{let i=(o||"").trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return r;let a=i;try{a=new URL(i,t||location.href).href}catch{}return`url("${a}")`})}var qr=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Gt=4;async function sc(e,t,r){if(!e)return e;let n=new Set;function o(s,c){try{return new URL(s,c||location.href).href}catch{return s}}async function i(s,c,l=0){if(l>Gt)return console.warn(`[snapDOM] @import depth exceeded (${Gt}) at ${c}`),s;let u="",d=0,f;for(;f=qr.exec(s);){u+=s.slice(d,f.index),d=qr.lastIndex;let m=(f[2]||f[4]||"").trim(),p=o(m,c);if(n.has(p)){console.warn(`[snapDOM] Skipping circular @import: ${p}`);continue}n.add(p);let g="";try{let h=await ye(p,{as:"text",useProxy:r,silent:!0});h.ok&&typeof h.data=="string"&&(g=h.data)}catch{}g?(g=wo(g,p),g=await i(g,p,l+1),u+=`
7
7
  /* inlined: ${p} */
8
8
  ${g}
9
- `):u+=f[0]}return u+=s.slice(d),u}let a=wo(e,t||location.href);return a=await i(a,t||location.href,0),a}var jo=/url\((["']?)([^"')]+)\1\)/g,lc=/@font-face[^{}]*\{[^}]*\}/g;function Zo(e){if(!e)return[];let t=[],r=e.split(",").map(n=>n.trim()).filter(Boolean);for(let n of r){let o=n.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!o)continue;let i=o[1],a=o[2],s=c=>{if(!c.includes("?"))return parseInt(c,16);let l=parseInt(c.replace(/\?/g,"0"),16),u=parseInt(c.replace(/\?/g,"F"),16);return[l,u]};if(a){let c=s(i),l=s(a),u=Array.isArray(c)?c[0]:c,d=Array.isArray(l)?l[1]:l;t.push([Math.min(u,d),Math.max(u,d)])}else{let c=s(i);Array.isArray(c)?t.push([c[0],c[1]]):t.push([c,c])}}return t}function Xo(e,t){if(!t.length||!e||e.size===0)return!0;for(let r of e)for(let[n,o]of t)if(r>=n&&r<=o)return!0;return!1}function on(e,t){let r=[];if(!e)return r;for(let n of e.matchAll(jo)){let o=(n[2]||"").trim();if(!(!o||o.startsWith("data:"))){if(!/^https?:/i.test(o))try{o=new URL(o,t||location.href).href}catch{}r.push(o)}}return r}async function Ko(e,t,r=""){let n=e;for(let o of e.matchAll(jo)){let i=en(o[0]);if(!i)continue;let a=i;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,t||location.href).href}catch{}if(!Te(a)){if(E.resource?.has(a)){E.font?.add(a),n=n.replace(o[0],`url(${E.resource.get(a)})`);continue}if(!E.font?.has(a))try{let s=await ye(a,{as:"dataURL",useProxy:r,silent:!0});if(s.ok&&typeof s.data=="string"){let c=s.data;E.resource?.set(a,c),E.font?.add(a),n=n.replace(o[0],`url(${c})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return n}function cc(e){if(!e.length)return null;let t=(a,s)=>e.some(([c,l])=>!(l<a||c>s)),r=t(0,255)||t(305,305),n=t(256,591)||t(7680,7935),o=t(880,1023),i=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":i?"cyrillic":o?"greek":n?"latin-ext":r?"latin":null}function vo(e={}){let t=new Set((e.families||[]).map(o=>String(o).toLowerCase())),r=new Set((e.domains||[]).map(o=>String(o).toLowerCase())),n=new Set((e.subsets||[]).map(o=>String(o).toLowerCase()));return(o,i)=>{if(t.size&&t.has(o.family.toLowerCase()))return!0;if(r.size)for(let a of o.srcUrls)try{if(r.has(new URL(a).host.toLowerCase()))return!0}catch{}if(n.size){let a=cc(i);if(a&&n.has(a))return!0}return!1}}function uc(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,r=new Set,n=[];for(let i of e.match(t)||[]){let a=i.match(/font-family:\s*([^;]+);/i)?.[1]||"",s=nn(a),c=(i.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),l=(i.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),u=(i.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),d=(i.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),f=(i.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),m=on(f,location.href),p=m.length?m.map(h=>String(h).toLowerCase()).sort().join("|"):f.toLowerCase(),g=[String(s||"").toLowerCase(),c,l,u,d.toLowerCase(),p].join("|");r.has(g)||(r.add(g),n.push(i))}if(n.length===0)return e;let o=0;return e.replace(t,()=>n[o++]||"")}function dc(e,t,r,n,o){let i=Array.from(e||[]).sort().join("|"),a=t?JSON.stringify({families:(t.families||[]).map(u=>String(u).toLowerCase()).sort(),domains:(t.domains||[]).map(u=>String(u).toLowerCase()).sort(),subsets:(t.subsets||[]).map(u=>String(u).toLowerCase()).sort()}):"",s=(r||[]).map(u=>`${(u.family||"").toLowerCase()}::${u.weight||"normal"}::${u.style||"normal"}::${u.src||""}`).sort().join("|"),c=n||"",l=(o||[]).map(u=>String(u).toLowerCase()).sort().join("|");return`fonts-embed-css::req=${i}::ex=${a}::lf=${s}::px=${c}::fd=${l}`}async function Jo(e,t,r,n){let o;try{o=e.cssRules||[]}catch{return}let i=(a,s)=>{try{return new URL(a,s||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let s=a.href?i(a.href,t):t;if(n.depth>=Gt){console.warn(`[snapDOM] CSSOM import depth exceeded (${Gt}) at ${s}`);continue}if(s&&n.visitedSheets.has(s)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${s}`);continue}s&&n.visitedSheets.add(s);let c={...n,depth:(n.depth||0)+1};await Jo(a.styleSheet,s,r,c);continue}if(a.type===CSSRule.FONT_FACE_RULE){let s=(a.style.getPropertyValue("font-family")||"").trim(),c=nn(s);if(!c||Te(c))continue;let l=(a.style.getPropertyValue("font-weight")||"400").trim(),u=(a.style.getPropertyValue("font-style")||"normal").trim(),d=(a.style.getPropertyValue("font-stretch")||"100%").trim(),f=(a.style.getPropertyValue("src")||"").trim(),m=(a.style.getPropertyValue("unicode-range")||"").trim();if(!n.faceMatchesRequired(c,u,l,d))continue;let p=Zo(m);if(!Xo(n.usedCodepoints,p))continue;let g={family:c,weightSpec:l,styleSpec:u,stretchSpec:d,unicodeRange:m,srcRaw:f,srcUrls:on(f,t||location.href),href:t||location.href};if(n.simpleExcluder&&n.simpleExcluder(g,p))continue;if(/url\(/i.test(f)){let h=await Ko(f,t||location.href,n.useProxy);await r(`@font-face{font-family:${c};src:${h};font-style:${u};font-weight:${l};font-stretch:${d};${m?`unicode-range:${m};`:""}}`)}else await r(`@font-face{font-family:${c};src:${f};font-style:${u};font-weight:${l};font-stretch:${d};${m?`unicode-range:${m};`:""}}`)}}}async function fc({required:e,usedCodepoints:t,exclude:r=void 0,localFonts:n=[],useProxy:o="",fontStylesheetDomains:i=[]}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let a=new Map;for(let h of e){let[y,v,w,b]=String(h).split("__");if(!y)continue;let S=a.get(y)||[];S.push({w:parseInt(v,10),s:w,st:parseInt(b,10)}),a.set(y,S)}function s(h,y,v,w){if(!a.has(h))return!1;let b=a.get(h),S=tc(v),I=rc(y),C=nc(w),x=S.min!==S.max,N=S.min,B=M=>I.kind==="normal"&&M==="normal"||I.kind!=="normal"&&(M==="italic"||M==="oblique"),$=!1;for(let M of b){let k=x?M.w>=S.min&&M.w<=S.max:M.w===N,O=B(Ht(M.s)),V=M.st>=C.min&&M.st<=C.max;if(k&&O&&V){$=!0;break}}if($)return!0;if(!x)for(let M of b){let k=B(Ht(M.s)),O=M.st>=C.min&&M.st<=C.max;if(Math.abs(N-M.w)<=300&&k&&O)return!0}if(!x&&I.kind==="normal"&&b.some(M=>Ht(M.s)!=="normal"))for(let M of b){let k=Math.abs(N-M.w)<=300,O=M.st>=C.min&&M.st<=C.max;if(k&&O)return!0}return!1}let c=vo(r),l=dc(e,r,n,o,i);if(E.resource?.has(l))return E.resource.get(l);let u=ac(e),d=[],f=jr;for(let h of document.querySelectorAll("style")){let y=h.textContent||"";for(let v of y.matchAll(f)){let w=(v[2]||v[4]||"").trim();!w||Te(w)||document.querySelector(`link[rel="stylesheet"][href="${w}"]`)||d.push(w)}}d.length&&await Promise.all(d.map(h=>new Promise(y=>{if(document.querySelector(`link[rel="stylesheet"][href="${h}"]`))return y(null);let v=document.createElement("link");v.rel="stylesheet",v.href=h,v.setAttribute("data-snapdom","injected-import"),v.onload=()=>y(v),v.onerror=()=>y(null),document.head.appendChild(v)})));let m="",p=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(h=>!!h.href);for(let h of p)try{if(Te(h.href))continue;let y="",v=!1;try{v=new URL(h.href,location.href).origin===location.origin}catch{}if(!v){let b=Array.isArray(i)?i:[];if(!ic(h.href,u,b))continue}if(v){let b=Array.from(document.styleSheets).find(S=>S.href===h.href);if(b)try{let S=b.cssRules||[];y=Array.from(S).map(I=>I.cssText).join("")}catch{}}if(!y){let b=await ye(h.href,{as:"text",useProxy:o});if(b?.ok&&typeof b.data=="string"&&(y=b.data),Te(h.href))continue}y=await sc(y,h.href,o);let w="";for(let b of y.match(lc)||[]){let S=(b.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),I=nn(S);if(!I||Te(I))continue;let C=(b.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),x=(b.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),N=(b.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),B=(b.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),$=(b.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),M=on($,h.href);if(!s(I,x,C,N))continue;let k=Zo(B);if(!Xo(t,k))continue;let O={family:I,weightSpec:C,styleSpec:x,stretchSpec:N,unicodeRange:B,srcRaw:$,srcUrls:M,href:h.href};if(r&&c(O,k))continue;let V=/url\(/i.test($)?await Ko(b,h.href,o):b;w+=V}w.trim()&&(m+=w)}catch{console.warn("[snapDOM] Failed to process stylesheet:",h.href)}let g={requiredIndex:a,usedCodepoints:t,faceMatchesRequired:s,simpleExcluder:r?vo(r):null,useProxy:o,visitedSheets:new Set,depth:0};for(let h of document.styleSheets)if(!(h.href&&p.some(y=>y.href===h.href)))try{let y=h.href||location.origin+"/";y&&g.visitedSheets.add(y),await Jo(h,y,async v=>{m+=v},g)}catch{}try{for(let h of document.fonts||[]){if(!h||!h.family||h.status!=="loaded"||!h._snapdomSrc)continue;let y=String(h.family).replace(/^['"]+|['"]+$/g,"");if(Te(y)||!a.has(y)||r?.families&&r.families.some(w=>String(w).toLowerCase()===y.toLowerCase()))continue;let v=h._snapdomSrc;if(!String(v).startsWith("data:")){if(E.resource?.has(h._snapdomSrc))v=E.resource.get(h._snapdomSrc),E.font?.add(h._snapdomSrc);else if(!E.font?.has(h._snapdomSrc))try{let w=await ye(h._snapdomSrc,{as:"dataURL",useProxy:o,silent:!0});if(w.ok&&typeof w.data=="string")v=w.data,E.resource?.set(h._snapdomSrc,v),E.font?.add(h._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",h._snapdomSrc);continue}}m+=`@font-face{font-family:'${y}';src:url(${v});font-style:${h.style||"normal"};font-weight:${h.weight||"normal"};}`}}catch{}for(let h of n){if(!h||typeof h!="object")continue;let y=String(h.family||"").replace(/^['"]+|['"]+$/g,"");if(!y||Te(y)||!a.has(y)||r?.families&&r.families.some(C=>String(C).toLowerCase()===y.toLowerCase()))continue;let v=h.weight!=null?String(h.weight):"normal",w=h.style!=null?String(h.style):"normal",b=h.stretchPct!=null?`${h.stretchPct}%`:"100%",S=String(h.src||""),I=S;if(!I.startsWith("data:")){if(E.resource?.has(S))I=E.resource.get(S),E.font?.add(S);else if(!E.font?.has(S))try{let C=await ye(S,{as:"dataURL",useProxy:o,silent:!0});if(C.ok&&typeof C.data=="string")I=C.data,E.resource?.set(S,I),E.font?.add(S);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",S);continue}}m+=`@font-face{font-family:'${y}';src:url(${I});font-style:${w};font-weight:${v};font-stretch:${b};}`}return m&&(m=uc(m),E.resource?.set(l,m)),m}function Qo(e){let t=new Set;if(!e)return t;let r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null),n=a=>{let s=Ql(a.fontFamily);if(s.length)for(let c of s){let l=(u,d,f)=>`${c}__${Ut(u)}__${Ht(d)}__${ec(f)}`;t.add(l(a.fontWeight,a.fontStyle,a.fontStretch))}};n(getComputedStyle(e));let o=getComputedStyle(e,"::before");o&&o.content&&o.content!=="none"&&n(o);let i=getComputedStyle(e,"::after");for(i&&i.content&&i.content!=="none"&&n(i);r.nextNode();){let a=r.currentNode,s=getComputedStyle(a);n(s);let c=getComputedStyle(a,"::before");c&&c.content&&c.content!=="none"&&n(c);let l=getComputedStyle(a,"::after");l&&l.content&&l.content!=="none"&&n(l)}return t}function mc(e){let t=new Set,r=o=>{if(o)for(let i of o)t.add(i.codePointAt(0))},n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;n.nextNode();){let o=n.currentNode;if(o.nodeType===Node.TEXT_NODE)r(o.nodeValue||"");else if(o.nodeType===Node.ELEMENT_NODE){let i=o;for(let a of["::before","::after"]){let s=getComputedStyle(i,a)?.getPropertyValue("content");if(!(!s||s==="none"))if(/^"/.test(s)||/^'/.test(s))r(s.slice(1,-1));else{let c=s.match(/\\[0-9A-Fa-f]{1,6}/g);if(c)for(let l of c)try{t.add(parseInt(l.slice(1),16))}catch{}}}}}return t}async function ei(e,t=2){try{await document.fonts.ready}catch{}let r=Array.from(e||[]).filter(Boolean);if(r.length===0)return;let n=()=>{let o=document.createElement("div");o.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let i of r){let a=document.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${i}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",o.appendChild(a)}document.body.appendChild(o),o.offsetWidth,document.body.removeChild(o)};for(let o=0;o<Math.max(1,t);o++)n(),await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i)))}be();function pc(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function hc(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Co(e,t=!1){let r="",n=Math.max(1,e);for(;n>0;)n--,r=String.fromCharCode(97+n%26)+r,n=Math.floor(n/26);return t?r.toUpperCase():r}function So(e,t=!0){let r=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],n=Math.max(1,Math.min(3999,e)),o="";for(let[i,a]of r)for(;n>=i;)o+=a,n-=i;return t?o:o.toLowerCase()}function xo(e,t){switch((t||"decimal").toLowerCase()){case"decimal":return String(e);case"decimal-leading-zero":{let r=Math.abs(e);return(e<0?"-":"")+(r<10?"0":"")+String(r)}case"lower-alpha":return Co(e,!1);case"upper-alpha":return Co(e,!0);case"lower-roman":return So(e,!1);case"upper-roman":return So(e,!0);default:return String(e)}}function gc(e){let t=()=>E?.session?.__counterEpoch??0,r=t(),n=new WeakMap,o=e instanceof Document?e.documentElement:e,i=f=>f&&f.tagName==="LI",a=f=>{let m=0,p=f?.parentElement;if(!p)return 0;for(let g of p.children){if(g===f)break;g.tagName==="LI"&&m++}return m},s=f=>{let m=new Map;for(let[p,g]of f)m.set(p,g.slice());return m},c=(f,m,p)=>{let g=s(f),h;try{h=p.style?.counterReset||getComputedStyle(p).counterReset}catch{}if(h&&h!=="none")for(let w of h.split(",")){let b=w.trim().split(/\s+/),S=b[0],I=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!S)continue;let C=m.get(S);if(C&&C.length){let x=C.slice();x.push(I),g.set(S,x)}else g.set(S,[I])}let y;try{y=p.style?.counterSet||getComputedStyle(p).counterSet}catch{}if(y&&y!=="none")for(let w of y.split(",")){let b=w.trim().split(/\s+/),S=b[0],I=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!S)continue;let C=g.get(S)||[];C.length===0&&C.push(0),C[C.length-1]=I,g.set(S,C)}let v;try{v=p.style?.counterIncrement||getComputedStyle(p).counterIncrement}catch{}if(v&&v!=="none")for(let w of v.split(",")){let b=w.trim().split(/\s+/),S=b[0],I=Number.isFinite(Number(b[1]))?Number(b[1]):1;if(!S)continue;let C=g.get(S)||[];C.length===0&&C.push(0),C[C.length-1]+=I,g.set(S,C)}try{if(getComputedStyle(p).display==="list-item"&&i(p)){let w=p.parentElement,b=1;if(w&&w.tagName==="OL"){let I=w.getAttribute("start"),C=Number.isFinite(Number(I))?Number(I):1,x=a(p),N=p.getAttribute("value");b=Number.isFinite(Number(N))?Number(N):C+x}else b=1+a(p);let S=g.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=b,g.set("list-item",S)}}catch{}return g},l=(f,m,p)=>{let g=c(p,m,f);n.set(f,g);let h=g;for(let v of f.children)h=l(v,g,h);let y=new Map;for(let[v,w]of p){let b=w.length,S=h.get(v);y.set(v,S&&S.length?S.slice(0,b):w.slice())}for(let[v,w]of h)!y.has(v)&&w.length&&!m.has(v)&&y.set(v,w.slice(0,1));return y},u=new Map;l(o,u,u);function d(){let f=t();if(f!==r){r=f;let m=new Map;l(o,m,m)}}return{get(f,m){d();let p=n.get(f)?.get(m);return p&&p.length?p[p.length-1]:0},getStack(f,m){d();let p=n.get(f)?.get(m);return p?p.slice():[]}}}function yc(e,t,r){if(!e||e==="none")return e;try{let n=/\b(counter|counters)\s*\(([^)]+)\)/g,o=e.replace(n,(i,a,s)=>{let c=String(s).split(",").map(l=>l.trim());if(a==="counter"){let l=c[0]?.replace(/^["']|["']$/g,""),u=(c[1]||"decimal").toLowerCase(),d=r.get(t,l);return xo(d,u)}else{let l=c[0]?.replace(/^["']|["']$/g,""),u=c[1]?.replace(/^["']|["']$/g,"")??"",d=(c[2]||"decimal").toLowerCase(),f=r.getStack(t,l);return f.length?f.map(m=>xo(m,d)).join(u):""}});return hc(o)}catch{return"- "}}ot();be();var tt=new WeakMap,Io=1e3;function bc(e,t){let r=ti(e);return t?(t.__pseudoPreflightFp!==r&&(t.__pseudoPreflight=Eo(e),t.__pseudoPreflightFp=r),!!t.__pseudoPreflight):Eo(e)}function Zr(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function ti(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),r=`n:${t.length}|`,n=0;for(let i=0;i<t.length;i++){let a=t[i];if(a.tagName==="STYLE"){let s=a.textContent?a.textContent.length:0;r+=`S${s}|`;let c=a.sheet,l=c?Zr(c):null;l&&(n+=l.length)}else{let s=a.getAttribute("href")||"",c=a.getAttribute("media")||"all";r+=`L${s}|m:${c}|`;let l=a.sheet,u=l?Zr(l):null;u&&(n+=u.length)}}let o=e.adoptedStyleSheets;return r+=`ass:${Array.isArray(o)?o.length:0}|tr:${n}`,r}function Ao(e,t,r){let n=Zr(e);if(!n)return!1;for(let o=0;o<n.length;o++){if(r.budget<=0)return!1;let i=n[o],a=i&&i.cssText?i.cssText:"";r.budget--;for(let s of t)if(a.includes(s))return!0;if(i&&i.cssRules&&i.cssRules.length)for(let s=0;s<i.cssRules.length&&r.budget>0;s++){let c=i.cssRules[s],l=c&&c.cssText?c.cssText:"";r.budget--;for(let u of t)if(l.includes(u))return!0}if(r.budget<=0)return!1}return!1}function Eo(e=document){let t=ti(e),r=tt.get(e);if(r&&r.fingerprint===t)return r.result;let n=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],o=e.querySelectorAll("style");for(let a=0;a<o.length;a++){let s=o[a].textContent||"";for(let c of n)if(s.includes(c))return tt.set(e,{fingerprint:t,result:!0}),!0}let i=e.adoptedStyleSheets;if(Array.isArray(i)&&i.length){let a={budget:Io};try{for(let s of i)if(Ao(s,n,a))return tt.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let a=e.querySelectorAll('style,link[rel~="stylesheet"]'),s={budget:Io};for(let c=0;c<a.length&&s.budget>0;c++){let l=a[c],u=null;if(l.tagName,u=l.sheet||null,u&&Ao(u,n,s))return tt.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(tt.set(e,{fingerprint:t,result:!0}),!0):(tt.set(e,{fingerprint:t,result:!1}),!1)}var nt=new WeakMap,ko=-1;function wc(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function vc(e){if(!e)return"";let t=[],r=/"([^"]*)"/g,n;for(;n=r.exec(e);)t.push(n[1]);return t.length?t.join(""):wc(e)}function Xr(e,t){let r=e.parentElement,n=r?nt.get(r):null;return n?{get(o,i){let a=t.get(o,i),s=n.get(i);return typeof s=="number"?Math.max(a,s):a},getStack(o,i){let a=t.getStack(o,i);if(!a.length)return a;let s=n.get(i);if(typeof s=="number"){let c=a.slice();return c[c.length-1]=Math.max(c[c.length-1],s),c}return a}}:t}function Kr(e,t,r){let n=new Map;function o(c){let l=[];if(!c||c==="none")return l;for(let u of String(c).split(",")){let d=u.trim().split(/\s+/),f=d[0],m=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;f&&l.push({name:f,num:m})}return l}let i=o(t?.counterReset),a=o(t?.counterIncrement);function s(c){if(n.has(c))return n.get(c).slice();let l=r.getStack(e,c);l=l.length?l.slice():[];let u=i.find(f=>f.name===c);if(u){let f=Number.isFinite(u.num)?u.num:0;l=l.length?[...l,f]:[f]}let d=a.find(f=>f.name===c);if(d){let f=Number.isFinite(d.num)?d.num:1;l.length===0&&(l=[0]),l[l.length-1]+=f}return n.set(c,l.slice()),l}return{get(c,l){let u=s(l);return u.length?u[u.length-1]:0},getStack(c,l){return s(l)},__incs:a}}function Cc(e,t,r){let n;try{n=Ne(e,t)}catch{}let o=n?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};let i=Xr(e,r),a=Kr(e,n,i),s=pc(o)?yc(o,e,a):o;return{text:vc(s),incs:a.__incs||[]}}async function Jr(e,t,r,n){if(!(e instanceof Element)||!(t instanceof Element))return;let o=e.ownerDocument||document;if(!bc(o,r))return;let i=E?.session?.__counterEpoch??0;if(ko!==i&&(nt=new WeakMap,r&&(r.__counterCtx=null),ko=i),!r.__counterCtx)try{r.__counterCtx=gc(e.ownerDocument||document)}catch(c){q(r,"buildCounterContext failed",c)}let a=r.__counterCtx;for(let c of["::before","::after","::first-letter"])try{let l=Ne(e,c);if(!l||l.content==="none"&&l.backgroundImage==="none"&&l.backgroundColor==="transparent"&&(l.borderStyle==="none"||parseFloat(l.borderWidth)===0)&&(!l.transform||l.transform==="none")&&l.display==="inline")continue;if(c==="::first-letter"){let R=Ne(e);if(!(l.color!==R.color||l.fontSize!==R.fontSize||l.fontWeight!==R.fontWeight||l.fontFamily!==R.fontFamily||l.fontStyle!==R.fontStyle||l.textTransform!==R.textTransform||l.float!==R.float||l.paddingTop!==R.paddingTop||l.paddingRight!==R.paddingRight||l.paddingBottom!==R.paddingBottom||l.paddingLeft!==R.paddingLeft||l.marginTop!==R.marginTop||l.marginRight!==R.marginRight||l.marginBottom!==R.marginBottom||l.marginLeft!==R.marginLeft))continue;let F=Array.from(t.childNodes).find(T=>T.nodeType===Node.TEXT_NODE&&T.textContent?.trim().length>0);if(!F)continue;let D=F.textContent,_=D.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],ee=D.slice(_?.length||0);if(!_||/[\uD800-\uDFFF]/.test(_))continue;let P=document.createElement("span");P.textContent=_,P.dataset.snapdomPseudo="::first-letter";let z=lo(l),X=Vr(z,"span");r.styleMap.set(P,X);let ne=document.createTextNode(ee);t.replaceChild(ne,F),t.insertBefore(P,ne);continue}let u=l.content??"",d=u===""||u==="none"||u==="normal",{text:f,incs:m}=Cc(e,c,a),p=l.backgroundImage,g=l.backgroundColor,h=l.fontFamily,y=parseInt(l.fontSize)||32,v=parseInt(l.fontWeight)||!1,w=l.color||"#000",b=l.borderStyle,S=parseFloat(l.borderWidth),I=l.transform,C=Te(h),x=!d&&f!=="",N=p&&p!=="none",B=g&&g!=="transparent"&&g!=="rgba(0, 0, 0, 0)",$=b&&b!=="none"&&S>0,M=I&&I!=="none";if(!(x||N||B||$||M)){if(m&&m.length&&e.parentElement){let R=nt.get(e.parentElement)||new Map;for(let{name:F}of m){if(!F)continue;let D=Xr(e,a),_=Kr(e,Ne(e,c),D).get(e,F);R.set(F,_)}nt.set(e.parentElement,R)}continue}let k=document.createElement("span");k.dataset.snapdomPseudo=c,k.style.pointerEvents="none";let O=lo(l),V=Vr(O,"span");if(r.styleMap.set(k,V),C&&f&&f.length===1){let{dataUrl:R,width:F,height:D}=await Kl(f,h,v,y,w),_=document.createElement("img");_.src=R,_.style=`height:${y}px;width:${F/D*y}px;object-fit:contain;`,k.appendChild(_),t.dataset.snapdomHasIcon="true"}else if(f&&f.startsWith("url(")){let R=en(f);if(R?.trim())try{let F=await ye(Vt(R),{as:"dataURL",useProxy:n.useProxy});if(F?.ok&&typeof F.data=="string"){let D=document.createElement("img");D.src=F.data,D.style=`width:${y}px;height:auto;object-fit:contain;`,k.appendChild(D)}}catch(F){console.error(`[snapdom] Error in pseudo ${c} for`,e,F)}}else!C&&x&&(k.textContent=f);k.style.backgroundImage="none","maskImage"in k.style&&(k.style.maskImage="none"),"webkitMaskImage"in k.style&&(k.style.webkitMaskImage="none");try{k.style.backgroundRepeat=l.backgroundRepeat,k.style.backgroundSize=l.backgroundSize,l.backgroundPositionX&&l.backgroundPositionY?(k.style.backgroundPositionX=l.backgroundPositionX,k.style.backgroundPositionY=l.backgroundPositionY):k.style.backgroundPosition=l.backgroundPosition,k.style.backgroundOrigin=l.backgroundOrigin,k.style.backgroundClip=l.backgroundClip,k.style.backgroundAttachment=l.backgroundAttachment,k.style.backgroundBlendMode=l.backgroundBlendMode}catch{}if(N)try{let R=Gr(p),F=await Promise.all(R.map(Ro));k.style.backgroundImage=F.join(", ")}catch(R){console.warn(`[snapdom] Failed to inline background-image for ${c}`,R)}B&&(k.style.backgroundColor=g);let K=k.childNodes.length>0||k.textContent?.trim()!==""||N||B||$||M;if(m&&m.length&&e.parentElement){let R=nt.get(e.parentElement)||new Map,F=Xr(e,a),D=Kr(e,Ne(e,c),F);for(let{name:_}of m){if(!_)continue;let ee=D.get(e,_);R.set(_,ee)}nt.set(e.parentElement,R)}if(!K)continue;c==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore(k,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(k))}catch(l){console.warn(`[snapdom] Failed to capture ${c} for`,e,l)}let s=Array.from(t.children).filter(c=>!c.dataset.snapdomPseudo);if(r.nodeMap)for(let c of s){let l=r.nodeMap.get(c);l instanceof Element&&await Jr(l,c,r,n)}else{let c=Array.from(e.children);for(let l=0;l<Math.min(c.length,s.length);l++)await Jr(c[l],s[l],r,n)}}function Sc(e,t){if(!e||!(e instanceof Element))return;let r=e.ownerDocument||document,n=t||r,o=e instanceof SVGSVGElement?[e]:Array.from(e.querySelectorAll("svg"));if(o.length===0)return;let i=/url\(\s*#([^)]+)\)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],s=b=>window.CSS&&CSS.escape?CSS.escape(b):b.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),c="http://www.w3.org/1999/xlink",l=b=>{if(!b||!b.getAttribute)return null;let S=b.getAttribute("href")||b.getAttribute("xlink:href")||(typeof b.getAttributeNS=="function"?b.getAttributeNS(c,"href"):null);if(S)return S;let I=b.attributes;if(!I)return null;for(let C=0;C<I.length;C++){let x=I[C];if(!x||!x.name)continue;if(x.name==="href")return x.value;let N=x.name.indexOf(":");if(N!==-1&&x.name.slice(N+1)==="href")return x.value}return null},u=new Set(Array.from(e.querySelectorAll("[id]")).map(b=>b.id)),d=new Set,f=!1,m=(b,S=null)=>{if(!b)return;i.lastIndex=0;let I;for(;I=i.exec(b);){f=!0;let C=(I[1]||"").trim();C&&(u.has(C)||(d.add(C),S&&!S.has(C)&&S.add(C)))}},p=b=>{let S=b.querySelectorAll("use");for(let C of S){let x=l(C);if(!x||!x.startsWith("#"))continue;f=!0;let N=x.slice(1).trim();N&&!u.has(N)&&d.add(N)}let I=b.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]');for(let C of I){m(C.getAttribute("style")||"");for(let x of a)m(C.getAttribute(x))}};for(let b of o)p(b);if(!f)return;let g=e.querySelector("svg.inline-defs-container");g||(g=r.createElementNS("http://www.w3.org/2000/svg","svg"),g.classList.add("inline-defs-container"),g.setAttribute("aria-hidden","true"),g.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(g,e.firstChild||null));let h=g.querySelector("defs")||null,y=b=>{if(!b||u.has(b))return null;let S=s(b),I=C=>{let x=n.querySelector(C);return x&&!e.contains(x)?x:null};return I(`svg defs > *#${S}`)||I(`svg > symbol#${S}`)||I(`*#${S}`)};if(!d.size)return;let v=new Set(d),w=new Set;for(;v.size;){let b=v.values().next().value;if(v.delete(b),!b||u.has(b)||w.has(b))continue;let S=y(b);if(!S){w.add(b);continue}h||(h=r.createElementNS("http://www.w3.org/2000/svg","defs"),g.appendChild(h));let I=S.cloneNode(!0);I.id||I.setAttribute("id",b),h.appendChild(I),w.add(b),u.add(b);let C=[I,...I.querySelectorAll("*")];for(let x of C){let N=l(x);if(N&&N.startsWith("#")){let $=N.slice(1).trim();$&&!u.has($)&&!w.has($)&&v.add($)}let B=x.getAttribute?.("style")||"";B&&m(B,v);for(let $ of a){let M=x.getAttribute?.($);M&&m(M,v)}}}}be();function xc(e,t){if(!e||!t)return;let r=e.scrollTop||0;if(!r)return;getComputedStyle(t).position==="static"&&(t.style.position="relative");let n=e.getBoundingClientRect(),o=e.clientHeight,i="data-snap-ph",a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let s=a.currentNode,c=getComputedStyle(s),l=c.position;if(l!=="sticky"&&l!=="-webkit-sticky")continue;let u=Mo(c.top),d=Mo(c.bottom);if(u==null&&d==null)continue;let f=Ic(s,e),m=Ac(t,f,i);if(!m)continue;let p=s.getBoundingClientRect(),g=p.width,h=p.height,y=p.left-n.left;if(!(g>0&&h>0)||!Number.isFinite(y))continue;let v=u!=null?u+r:r+(o-h-d);if(!Number.isFinite(v))continue;let w=Number.parseInt(c.zIndex,10),b=Number.isFinite(w),S=b?Math.max(w,1)+1:2,I=b?w-1:0,C=m.cloneNode(!1);C.setAttribute(i,"1"),C.style.position="sticky",C.style.left=`${y}px`,C.style.top=`${v}px`,C.style.width=`${g}px`,C.style.height=`${h}px`,C.style.visibility="hidden",C.style.zIndex=String(I),C.style.overflow="hidden",C.style.background="transparent",C.style.boxShadow="none",C.style.filter="none",m.parentElement?.insertBefore(C,m),m.style.position="absolute",m.style.left=`${y}px`,m.style.top=`${v}px`,m.style.bottom="auto",m.style.zIndex=String(S),m.style.pointerEvents="none"}}function Mo(e){if(!e||e==="auto")return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}function Ic(e,t){let r=[];for(let n=e;n&&n!==t;){let o=n.parentElement;if(!o)break;r.push(Array.prototype.indexOf.call(o.children,n)),n=o}return r.reverse()}function Ac(e,t,r){let n=e;for(let o=0;o<t.length;o++)if(n=Ec(n,r)[t[o]],!n)return null;return n instanceof HTMLElement?n:null}function Ec(e,t){let r=[],n=e.children;for(let o=0;o<n.length;o++){let i=n[o];i.hasAttribute(t)||r.push(i)}return r}function kc(e){let t=getComputedStyle(e),r=t.outlineStyle,n=t.outlineWidth,o=t.borderStyle,i=t.borderWidth,a=r!=="none"&&parseFloat(n)>0,s=o==="none"||parseFloat(i)===0;a&&s&&(e.style.border=`${n} solid transparent`)}function Mc(e){let t=[];try{let r=e.querySelectorAll("*");for(let n of r){if(!(n instanceof HTMLElement))continue;let o=n.style.contentVisibility||"",i=getComputedStyle(n),a=i.contentVisibility||i.getPropertyValue("content-visibility")||"";(a==="auto"||a==="hidden")&&(t.push({el:n,original:o}),n.style.contentVisibility="visible")}if(e instanceof HTMLElement){let n=getComputedStyle(e),o=n.contentVisibility||n.getPropertyValue("content-visibility")||"";(o==="auto"||o==="hidden")&&(t.push({el:e,original:e.style.contentVisibility||""}),e.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:r,original:n}of t)try{r.style.contentVisibility=n}catch{}}}async function Tc(e,t={}){let r={styleMap:E.session.styleMap,styleCache:E.session.styleCache,nodeMap:E.session.nodeMap,options:t},n,o="",i="";kc(e);let a=Mc(e);try{Sc(e)}catch(l){console.warn("inlineExternal defs or symbol failed:",l)}try{n=await Bt(e,r,t)}catch(l){throw console.warn("deepClone failed:",l),l}finally{a()}try{await Jr(e,n,r,t)}catch(l){console.warn("inlinePseudoElements failed:",l)}await Ul(n,r);try{let l=n.querySelectorAll("style[data-sd]");for(let u of l)i+=u.textContent||"",u.remove()}catch(l){q(r,"Failed to extract shadow CSS from style[data-sd]",l)}let s=qs(r.styleMap);o=Array.from(s.entries()).map(([l,u])=>`.${u}{${l}}`).join(""),o=i+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+o;for(let[l,u]of r.styleMap.entries()){if(l.tagName==="STYLE")continue;if(l.getRootNode&&l.getRootNode()instanceof ShadowRoot){l.setAttribute("style",u.replace(/;/g,"; "));continue}let d=s.get(u);d&&l.classList.add(d);let f=l.style?.backgroundImage,m=l.dataset?.snapdomHasIcon;f&&f!=="none"&&(l.style.backgroundImage=f),m&&(l.style.verticalAlign="middle",l.style.display="inline")}for(let[l,u]of r.nodeMap.entries()){let d=u.scrollLeft,f=u.scrollTop;if((d||f)&&l instanceof HTMLElement){l.style.overflow="hidden",l.style.scrollbarWidth="none",l.style.msOverflowStyle="none";try{let p=l.querySelectorAll("*");for(let g of p){if(!(g instanceof HTMLElement))continue;let h=g.style.position;if(h==="fixed"||h==="absolute"){let y=parseFloat(g.style.top)||0,v=parseFloat(g.style.left)||0;g.style.top=`${y+f}px`,g.style.left=`${v+d}px`,h==="fixed"&&(g.style.position="absolute")}}}catch{}let m=document.createElement("div");for(m.style.transform=`translate(${-d}px, ${-f}px)`,m.style.willChange="transform",m.style.display="inline-block",m.style.width="100%";l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m)}}let c=n instanceof HTMLElement&&n.firstElementChild instanceof HTMLElement?n.firstElementChild:n;if(xc(e,c),e===r.nodeMap.get(n)){let l=r.styleCache.get(e)||Ne(e);r.styleCache.set(e,l);let u=Os(l.transform);n.style.margin="0",n.style.top="auto",n.style.left="auto",n.style.right="auto",n.style.bottom="auto",n.style.animation="none",n.style.transition="none",n.style.willChange="auto",n.style.float="none",n.style.clear="none",n.style.transform=u||""}for(let[l,u]of r.nodeMap.entries())u.tagName==="PRE"&&(l.style.marginTop="0",l.style.marginBlockStart="0");return{clone:n,classCSS:o,styleCache:r.styleCache}}ot();var ri="http://www.w3.org/1999/xlink";function Nc(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(ri,"href"):null)}function Lc(e){let t=parseInt(e.dataset?.snapdomWidth||"",10)||0,r=parseInt(e.dataset?.snapdomHeight||"",10)||0,n=parseInt(e.getAttribute("width")||"",10)||0,o=parseInt(e.getAttribute("height")||"",10)||0,i=parseFloat(e.style?.width||"")||0,a=parseFloat(e.style?.height||"")||0,s=t||i||n||e.width||e.naturalWidth||100,c=r||a||o||e.height||e.naturalHeight||100;return{width:s,height:c}}async function Rc(e,t={}){let r=Array.from(e.querySelectorAll("img")),n=async a=>{if(!a.getAttribute("src")){let f=a.currentSrc||a.src||"";f&&a.setAttribute("src",f)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let s=a.src||"";if(!s)return;let c=await ye(s,{as:"dataURL",useProxy:t.useProxy});if(c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")){a.src=c.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:l,height:u}=Lc(a),{fallbackURL:d}=t||{};if(d)try{let f=typeof d=="function"?await d({width:l,height:u,src:s,element:a}):d;if(f){let m=await ye(f,{as:"dataURL",useProxy:t.useProxy});if(m?.ok&&typeof m.data=="string"){a.src=m.data,a.width||(a.width=l),a.height||(a.height=u);return}}}catch{}if(t.placeholders!==!1){let f=document.createElement("div");f.style.cssText=[`width:${l}px`,`height:${u}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${u}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),f.textContent="img",a.replaceWith(f)}else{let f=document.createElement("div");f.style.cssText=`display:inline-block;width:${l}px;height:${u}px;visibility:hidden;`,a.replaceWith(f)}};for(let a=0;a<r.length;a+=4){let s=r.slice(a,a+4).map(n);await Promise.allSettled(s)}let o=Array.from(e.querySelectorAll("image")),i=async a=>{let s=Nc(a);if(!s||s.startsWith("data:")||s.startsWith("blob:"))return;let c=await ye(s,{as:"dataURL",useProxy:t.useProxy});c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")&&(a.setAttribute("href",c.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(ri,"href"))};for(let a=0;a<o.length;a+=4){let s=o.slice(a,a+4).map(i);await Promise.allSettled(s)}}Se();async function Fc(e,t,r,n={}){let o=[[e,t]],i=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],a=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],s=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],c=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;o.length;){let[l,u]=o.shift();if(!u)continue;let d=r.get(l)||Ne(l);r.has(l)||r.set(l,d);let f=(()=>{let g=d.getPropertyValue("border-image"),h=d.getPropertyValue("border-image-source");return g&&g!=="none"||h&&h!=="none"})();for(let g of s){let h=d.getPropertyValue(g);h&&u.style.setProperty(g,h)}for(let g of i){let h=d.getPropertyValue(g);if(g==="background-image"&&(!h||h==="none")){let w=d.getPropertyValue("background");w&&/url\s*\(/.test(w)&&(h=Gr(w).filter(b=>/url\s*\(/.test(b)).join(", ")||h)}if(!h||h==="none")continue;let y=Gr(h),v=await Promise.all(y.map(w=>Ro(w,n)));v.some(w=>w&&w!=="none"&&!/^url\(undefined/.test(w))&&u.style.setProperty(g,v.join(", "))}for(let g of a){let h=d.getPropertyValue(g);!h||h==="initial"||u.style.setProperty(g,h)}if(f)for(let g of c){let h=d.getPropertyValue(g);!h||h==="initial"||u.style.setProperty(g,h)}let m=l.shadowRoot?Array.from(l.shadowRoot.children).filter(g=>g.tagName!=="STYLE"):Array.from(l.children),p=Array.from(u.children).filter(g=>!(g.dataset?.snapdomPseudo||g.tagName==="STYLE"&&g.dataset?.sd));for(let g=0;g<Math.min(m.length,p.length);g++)o.push([m[g],p[g]])}}Se();be();function _c(e){if(!e)return()=>{};let t=[];function r(n){let o=Oc(n);o&&t.push(o);for(let i of n.children||[])r(i)}return r(e),()=>t.forEach(n=>n())}function Oc(e){if(!e)return()=>{};let t=Dc(e);if(t<=0)return()=>{};if(!Wc(e))return()=>{};let r=getComputedStyle(e),n=Math.round($c(r)*t+Pc(r)),o=e.textContent??"",i=o;if(e.scrollHeight<=n+.5)return()=>{};let a=0,s=o.length,c=-1;for(;a<=s;){let l=a+s>>1;e.textContent=o.slice(0,l)+"\u2026",e.scrollHeight<=n+.5?(c=l,a=l+1):s=l-1}return e.textContent=(c>=0?o.slice(0,c):"")+"\u2026",()=>{e.textContent=i}}function Dc(e){let t=getComputedStyle(e),r=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");r=(r||"").trim();let n=parseInt(r,10);return Number.isFinite(n)&&n>0?n:0}function $c(e){let t=(e.lineHeight||"").trim(),r=parseFloat(e.fontSize)||16;return!t||t==="normal"?Math.round(r*1.2):t.endsWith("px")?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*r):t.endsWith("%")?Math.round(parseFloat(t)/100*r):Math.round(r*1.2)}function Pc(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function Wc(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}var vt=[];function ni(e){if(!e)return null;if(Array.isArray(e)){let[t,r]=e;return typeof t=="function"?t(r):t}if(typeof e=="object"&&"plugin"in e){let{plugin:t,options:r}=e;return typeof t=="function"?t(r):t}return typeof e=="function"?e():e}function Bc(...e){let t=e.flat();for(let r of t){let n=ni(r);n&&(vt.some(o=>o&&o.name&&n.name&&o.name===n.name)||vt.push(n))}}function oi(e){return(e&&Array.isArray(e.plugins)?e.plugins:vt)||vt}async function Fe(e,t,r){let n=r,o=oi(t);for(let i of o){let a=i&&typeof i[e]=="function"?i[e]:null;if(!a)continue;let s=await a(t,n);typeof s<"u"&&(n=s)}return n}async function Uc(e,t,r){let n=[],o=oi(t);for(let i of o){let a=i&&typeof i[e]=="function"?i[e]:null;if(!a)continue;let s=await a(t,r);typeof s<"u"&&n.push(s)}return n}function Hc(e){let t=[];if(Array.isArray(e))for(let r of e){let n=ni(r);if(!n||!n.name)continue;let o=t.findIndex(i=>i&&i.name===n.name);o>=0&&t.splice(o,1),t.push(n)}for(let r of vt)r&&r.name&&!t.some(n=>n.name===r.name)&&t.push(r);return Object.freeze(t)}function Vc(e,t,r=!1){return!e||e.plugins&&!r||(e.plugins=Hc(t)),e}Se();function Gc(e,t,r={}){if(!e||!t||!t.style)return;let n=getComputedStyle(e);try{t.style.boxShadow="none"}catch(i){q(r,"stripRootShadows boxShadow",i)}try{t.style.textShadow="none"}catch(i){q(r,"stripRootShadows textShadow",i)}try{t.style.outline="none"}catch(i){q(r,"stripRootShadows outline",i)}let o=(n.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=o.length?o:"none"}catch(i){q(r,"stripRootShadows filter",i)}}function zc(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),r=[];for(;t.nextNode();)r.push(t.currentNode);for(let n of r)n.remove()}function Yc(e,t={}){let{stripFrameworkDirectives:r=!0}=t,n=new Set(["xml","xlink"]),o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;o.nextNode();){let i=o.currentNode;for(let a of Array.from(i.attributes)){let s=a.name;if(s.includes("@")){i.removeAttribute(s);continue}if(s.includes(":")){let c=s.split(":",1)[0];if(!n.has(c)){i.removeAttribute(s);continue}}if(r&&(s.startsWith("x-")||s.startsWith("v-")||s.startsWith(":")||s.startsWith("on:")||s.startsWith("bind:")||s.startsWith("let:")||s.startsWith("class:"))){i.removeAttribute(s);continue}}}}function qc(e,t={}){e&&(Yc(e,t),zc(e))}function jc(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function Zc(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function Xc(e,t){if(!(e instanceof Element)||jc(e)||Zc(e))return!1;let r=t.position;if(r==="absolute"||r==="fixed"||r==="sticky")return!1;let n=t.display||"";return!(n.includes("flex")||n.includes("grid")||n.startsWith("table")||t.transform&&t.transform!=="none")}function Kc(e,t,r=new Map){function n(o,i){if(!(o instanceof Element)||!(i instanceof Element))return;let a=o.childElementCount>i.childElementCount,s=r.get(o)||getComputedStyle(o);if(r.has(o)||r.set(o,s),a&&Xc(o,s)){i.style.height||(i.style.height="auto"),i.style.width||(i.style.width="auto"),i.style.removeProperty("block-size"),i.style.removeProperty("inline-size"),i.style.minHeight||(i.style.minHeight="0"),i.style.minWidth||(i.style.minWidth="0"),i.style.maxHeight||(i.style.maxHeight="none"),i.style.maxWidth||(i.style.maxWidth="none");let u=s.overflowY||s.overflowBlock||"visible",d=s.overflowX||s.overflowInline||"visible";(u!=="visible"||d!=="visible")&&(i.style.overflow="visible")}let c=Array.from(o.children),l=Array.from(i.children);for(let u=0;u<Math.min(c.length,l.length);u++)n(c[u],l[u])}n(e,t)}function Jc(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function Qc(e,t){if(!(e instanceof Element))return!1;if(e.getAttribute("data-capture")==="exclude"&&t?.excludeMode==="remove")return!0;if(Array.isArray(t?.exclude))for(let r of t.exclude)try{if(e.matches(r))return t.excludeMode==="remove"}catch(n){q(t,"exclude selector match failed",n)}return!1}function eu(e,t){let r=getComputedStyle(e),n=e.getBoundingClientRect(),o=1/0,i=-1/0,a=!1,s=Array.from(e.children);for(let m of s){if(Qc(m,t)||!Jc(m))continue;let p=m.getBoundingClientRect(),g=p.top-n.top,h=p.bottom-n.top;h<=g||(g<o&&(o=g),h>i&&(i=h),a=!0)}let c=a?Math.max(0,i-o):0,l=parseFloat(r.borderTopWidth)||0,u=parseFloat(r.borderBottomWidth)||0,d=parseFloat(r.paddingTop)||0,f=parseFloat(r.paddingBottom)||0;return l+u+d+f+c}var L=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,tu=/::-webkit-scrollbar(-[a-z]+)?\b/i;function Qr(e,t=new Set){let r="";if(!e)return r;for(let n=0;n<e.length;n++){let o=e[n];try{if(o.type===CSSRule.IMPORT_RULE&&o.styleSheet){r+=Qr(o.styleSheet.cssRules,t);continue}if(o.type===CSSRule.MEDIA_RULE&&o.cssRules){let i=Qr(o.cssRules,t);i&&(r+=`@media ${o.conditionText}{${i}}`);continue}if(o.type===CSSRule.STYLE_RULE){let i=o.selectorText||"";if(tu.test(i)){let a=o.cssText;a&&!t.has(a)&&(t.add(a),r+=a)}}}catch{}}return r}function ru(e){if(!e||!e.styleSheets)return"";let t=new Set,r="";for(let n of Array.from(e.styleSheets))try{let o=n.cssRules;o&&(r+=Qr(o,t))}catch{}return r}function nu(e){let t=e.boxShadow||"";if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let r=t.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(s=>s.trim()),n=0,o=0,i=0,a=0;for(let s of r){let c=s.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(c.length<2)continue;let[l,u,d=0,f=0]=c,m=Math.abs(l)+d+f,p=Math.abs(u)+d+f;o=Math.max(o,m+Math.max(l,0)),a=Math.max(a,m+Math.max(-l,0)),i=Math.max(i,p+Math.max(u,0)),n=Math.max(n,p+Math.max(-u,0))}return{top:Math.ceil(n),right:Math.ceil(o),bottom:Math.ceil(i),left:Math.ceil(a)}}function ou(e){let t=(e.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),r=t?Math.ceil(parseFloat(t[1])||0):0;return{top:r,right:r,bottom:r,left:r}}function iu(e){if((e.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0),r=parseFloat(e.outlineOffset||"0")||0,n=t+Math.max(0,Math.ceil(r));return{top:n,right:n,bottom:n,left:n}}function au(e){let t=`${e.filter||""} ${e.webkitFilter||""}`.trim();if(!t||t==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let r=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],n=0,o=0,i=0,a=0,s=!1;for(let c of r){s=!0;let l=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(g=>parseFloat(g))||[],[u=0,d=0,f=0]=l,m=Math.abs(u)+f,p=Math.abs(d)+f;o=Math.max(o,m+Math.max(u,0)),a=Math.max(a,m+Math.max(-u,0)),i=Math.max(i,p+Math.max(d,0)),n=Math.max(n,p+Math.max(-d,0))}return{bleed:{top:L(n),right:L(o),bottom:L(i),left:L(a)},has:s}}function su(e,t){if(!e||!t||!t.style)return null;let r=getComputedStyle(e);try{t.style.transformOrigin="0 0"}catch{}try{"translate"in t.style&&(t.style.translate="none"),"rotate"in t.style&&(t.style.rotate="none")}catch{}let n=r.transform||"none";if(!n||n==="none")try{let s=ii(e);if(s.a===1&&s.b===0&&s.c===0&&s.d===1)return t.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}function o(s,c,l,u){let d=Math.sqrt(s*s+c*c)||0,f=0,m=0;if(d>0){let p=s/d,g=c/d;f=p*l+g*u;let h=l-p*f,y=u-g*f;m=Math.sqrt(h*h+y*y)||0,m>0?f=f/m:f=0}return{a:d,b:0,c:f*m,d:m}}let i=n.match(/^matrix\(\s*([^)]+)\)$/i);if(i){let s=i[1].split(",").map(c=>parseFloat(c.trim()));if(s.length===6&&s.every(Number.isFinite)){let[c,l,u,d]=s,f=o(c,l,u,d);try{t.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return f}}let a=n.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let s=a[1].split(",").map(c=>parseFloat(c.trim()));if(s.length===16&&s.every(Number.isFinite)){let c=s[0],l=s[1],u=s[4],d=s[5],f=o(c,l,u,d);try{t.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return f}}try{let s=new DOMMatrix(n),c=o(s.a,s.b,s.c,s.d);try{t.style.transform=`matrix(${c.a}, ${c.b}, ${c.c}, ${c.d}, 0, 0)`}catch{}return c}catch{return null}}function To(e,t,r,n,o){let i=r.a,a=r.b,s=r.c,c=r.d,l=r.e||0,u=r.f||0;function d(y,v){let w=y-n,b=v-o,S=i*w+s*b,I=a*w+c*b;return S+=n+l,I+=o+u,[S,I]}let f=[d(0,0),d(e,0),d(0,t),d(e,t)],m=1/0,p=1/0,g=-1/0,h=-1/0;for(let[y,v]of f)y<m&&(m=y),v<p&&(p=v),y>g&&(g=y),v>h&&(h=v);return{minX:m,minY:p,maxX:g,maxY:h,width:g-m,height:h-p}}function lu(e,t,r){let n=(e.transformOrigin||"0 0").trim().split(/\s+/),[o,i]=[n[0]||"0",n[1]||"0"],a=(s,c)=>{let l=s.toLowerCase();return l==="left"||l==="top"?0:l==="center"?c/2:l==="right"||l==="bottom"?c:l.endsWith("px")?parseFloat(l)||0:l.endsWith("%")?(parseFloat(l)||0)*c/100:/^-?\d+(\.\d+)?$/.test(l)&&parseFloat(l)||0};return{ox:a(o,t),oy:a(i,r)}}function cu(e){let t={rotate:"0deg",scale:null,translate:null},r=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(r){let o=c=>{try{return typeof r.has=="function"&&!r.has(c)||typeof r.get!="function"?null:r.get(c)}catch{return null}},i=o("rotate");if(i)if(i.angle){let c=i.angle;t.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit}else i.unit?t.rotate=i.unit==="rad"?i.value*180/Math.PI+"deg":i.value+i.unit:t.rotate=String(i);else{let c=getComputedStyle(e);t.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let a=o("scale");if(a){let c="x"in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1,l="y"in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:c;t.scale=`${c} ${l}`}else{let c=getComputedStyle(e);t.scale=c.scale&&c.scale!=="none"?c.scale:null}let s=o("translate");if(s){let c="x"in s&&"value"in s.x?s.x.value:Array.isArray(s)?s[0]?.value:0,l="y"in s&&"value"in s.y?s.y.value:Array.isArray(s)?s[1]?.value:0,u="x"in s&&s.x?.unit?s.x.unit:"px",d="y"in s&&s.y?.unit?s.y.unit:"px";t.translate=`${c}${u} ${l}${d}`}else{let c=getComputedStyle(e);t.translate=c.translate&&c.translate!=="none"?c.translate:null}return t}let n=getComputedStyle(e);return t.rotate=n.rotate&&n.rotate!=="none"?n.rotate:"0deg",t.scale=n.scale&&n.scale!=="none"?n.scale:null,t.translate=n.translate&&n.translate!=="none"?n.translate:null,t}var Ur=null;function uu(){if(Ur)return Ur;let e=document.createElement("div");return e.id="snapdom-measure-slot",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(e),Ur=e,e}function du(e){let t=uu(),r=document.createElement("div");r.style.transformOrigin="0 0",e.baseTransform&&(r.style.transform=e.baseTransform),e.rotate&&(r.style.rotate=e.rotate),e.scale&&(r.style.scale=e.scale),e.translate&&(r.style.translate=e.translate),t.appendChild(r);let n=ii(r);return t.removeChild(r),n}function fu(e){let t=getComputedStyle(e),r=t.transform||"none";if(r!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(r))return!0;let n=t.rotate&&t.rotate!=="none"&&t.rotate!=="0deg",o=t.scale&&t.scale!=="none"&&t.scale!=="1",i=t.translate&&t.translate!=="none"&&t.translate!=="0px 0px";return!!(n||o||i)}function ii(e){let t=getComputedStyle(e).transform;if(!t||t==="none")return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}async function ai(e,t){if(!e)throw new Error("Element cannot be null or undefined");_s(t.cache);let r=t.fast,n=t.outerTransforms!==!1,o=!!t.outerShadows,i={element:e,options:t,plugins:t.plugins},a,s,c,l="",u="",d,f,m=null;await Fe("beforeSnap",i),await Fe("beforeClone",i);let p=_c(i.element);try{({clone:a,classCSS:s,styleCache:c}=await Tc(i.element,i.options)),!n&&a&&(m=su(i.element,a)),!o&&a&&Gc(i.element,a,i.options)}finally{p()}if(i={clone:a,classCSS:s,styleCache:c,...i},await Fe("afterClone",i),qc(i.clone),i.options?.excludeMode==="remove")try{Kc(i.element,i.clone,i.styleCache)}catch(w){console.warn("[snapdom] shrink pass failed:",w)}try{await Xl(i.clone,i.element)}catch{}await new Promise(w=>{rt(async()=>{await Rc(i.clone,i.options),w()},{fast:r})}),await new Promise(w=>{rt(async()=>{await Fc(i.element,i.clone,i.styleCache,i.options),w()},{fast:r})}),t.embedFonts&&await new Promise(w=>{rt(async()=>{let b=Qo(i.element),S=mc(i.element);if(Ue()){let I=new Set(Array.from(b).map(C=>String(C).split("__")[0]).filter(Boolean));await ei(I,1)}l=await fc({required:b,usedCodepoints:S,preCached:!1,exclude:i.options.excludeFonts,useProxy:i.options.useProxy,fontStylesheetDomains:i.options.fontStylesheetDomains}),w()},{fast:r})});let g=zs(i.clone).sort(),h=g.join(",");E.baseStyle.has(h)?u=E.baseStyle.get(h):await new Promise(w=>{rt(()=>{u=Ys(g),E.baseStyle.set(h,u),w()},{fast:r})});let y=ru(i.element?.ownerDocument||document);i={fontsCSS:l,baseCSS:u,scrollbarCSS:y,...i},await Fe("beforeRender",i),await new Promise(w=>{rt(()=>{let b=Ne(i.element),S=i.element.getBoundingClientRect(),I=Math.max(1,L(i.element.offsetWidth||parseFloat(b.width)||S.width||1)),C=Math.max(1,L(i.element.offsetHeight||parseFloat(b.height)||S.height||1)),x=i.element.ownerDocument||document;if(i.element===x.body||i.element===x.documentElement){let ue=Math.max(i.element.scrollHeight||0,x.documentElement?.scrollHeight||0,x.body?.scrollHeight||0),de=Math.max(i.element.scrollWidth||0,x.documentElement?.scrollWidth||0,x.body?.scrollWidth||0);ue>0&&(C=Math.max(C,L(ue))),de>0&&(I=Math.max(I,L(de)));try{let Ie=(i.scrollbarCSS||"").length+(i.baseCSS||"").length+(i.fontsCSS||"").length+(i.classCSS||"").length,Ae=E.measureHints.get(i.element);if(Ae&&Ae.cssLen===Ie&&Ae.w0===I)Ae.csh>0&&(C=Math.max(C,L(Ae.csh))),Ae.csw>0&&(I=Math.max(I,L(Ae.csw)));else{let Ee=x.createElement("div");Ee.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+I+"px!important;overflow:visible!important;visibility:hidden!important;";let _t=x.createElement("style");_t.textContent=(i.scrollbarCSS||"")+i.baseCSS+i.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+i.classCSS,Ee.appendChild(_t),Ee.appendChild(i.clone.cloneNode(!0)),x.body.appendChild(Ee);let Re=Ee.scrollHeight,Mr=Ee.scrollWidth;x.body.removeChild(Ee),E.measureHints.set(i.element,{cssLen:Ie,w0:I,csh:Re,csw:Mr}),Re>0&&(C=Math.max(C,L(Re))),Mr>0&&(I=Math.max(I,L(Mr)))}}catch{}}if(i.options?.excludeMode==="remove"){let ue=eu(i.element,i.options);Number.isFinite(ue)&&ue>0&&(C=Math.max(1,Math.min(C,L(ue+1))))}let N=(ue,de=NaN)=>{let Ie=typeof ue=="string"?parseFloat(ue):ue;return Number.isFinite(Ie)?Ie:de},B=N(i.options.width),$=N(i.options.height),M=I,k=C,O=Number.isFinite(B),V=Number.isFinite($),K=C>0?I/C:1;O&&V?(M=Math.max(1,L(B)),k=Math.max(1,L($))):O?(M=Math.max(1,L(B)),k=Math.max(1,L(M/(K||1)))):V?(k=Math.max(1,L($)),M=Math.max(1,L(k*(K||1)))):(M=I,k=C);let R=0,F=0,D=I,_=C;if(!n&&m&&Number.isFinite(m.a)){let ue={a:m.a,b:m.b||0,c:m.c||0,d:m.d||1,e:0,f:0},de=To(I,C,ue,0,0);R=L(de.minX),F=L(de.minY),D=L(de.maxX),_=L(de.maxY)}else if(n&&No(i.element)){let ue=b.transform&&b.transform!=="none"?b.transform:"",de=cu(i.element),Ie=du({baseTransform:ue,rotate:de.rotate||"0deg",scale:de.scale,translate:de.translate}),{ox:Ae,oy:Ee}=lu(b,I,C),_t=Ie.is2D?Ie:new DOMMatrix(Ie.toString()),Re=To(I,C,_t,Ae,Ee);R=L(Re.minX),F=L(Re.minY),D=L(Re.maxX),_=L(Re.maxY)}let ee=nu(b),P=ou(b),z=iu(b),X=au(b),ne=o?{top:L(ee.top+P.top+z.top+X.bleed.top),right:L(ee.right+P.right+z.right+X.bleed.right),bottom:L(ee.bottom+P.bottom+z.bottom+X.bleed.bottom),left:L(ee.left+P.left+z.left+X.bleed.left)}:{top:0,right:0,bottom:0,left:0};R=L(R-ne.left),F=L(F-ne.top),D=L(D+ne.right),_=L(_+ne.bottom);let T=Math.max(1,L(D-R)),G=Math.max(1,L(_-F)),J=O||V?L(M/I):1,Y=V||O?L(k/C):1,ce=Math.max(1,L(T*J)),H=Math.max(1,L(G*Y)),se="http://www.w3.org/2000/svg",De=Ue()&&No(i.element)?1:0,Q=L(De+(n?0:1)),me=document.createElementNS(se,"foreignObject"),es=L(R),ts=L(F);me.setAttribute("x",String(L(-(es-Q)))),me.setAttribute("y",String(L(-(ts-Q)))),me.setAttribute("width",String(L(I+Q*2))),me.setAttribute("height",String(L(C+Q*2))),me.style.overflow="visible";let $n=document.createElement("style"),rs='svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject *{min-width:0;} foreignObject pre,foreignObject [style*="white-space"]{white-space:inherit;}';$n.textContent=(i.scrollbarCSS||"")+i.baseCSS+i.fontsCSS+rs+i.classCSS,me.appendChild($n);let Ft=document.createElement("div");Ft.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Ft.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${L(I)}px;height:${L(C)}px`,Ft.appendChild(i.clone),me.appendChild(Ft);let ns=new XMLSerializer().serializeToString(me),Er=L(T+Q*2),kr=L(G+Q*2),Pn=O||V;t.meta={w0:I,h0:C,vbW:Er,vbH:kr,targetW:M,targetH:k};let os=Ue()&&Pn?Er:L(ce+Q*2),is=Ue()&&Pn?kr:L(H+Q*2),as=parseFloat(Ne(x.documentElement)?.fontSize)||16;f=`<svg xmlns="${se}" width="${os}" height="${is}" viewBox="0 0 ${Er} ${kr}" font-size="${as}px">`+ns+"</svg>",d=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,i={svgString:f,dataURL:d,...i},w()},{fast:r})}),await Fe("afterRender",i);let v=document.getElementById("snapdom-sandbox");return v&&v.style.position==="absolute"&&v.remove(),i.dataURL}function No(e){return fu(e)}be();function mu(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let r=Fs(e.cache);return{debug:e.debug??!1,fast:e.fast??!0,scale:e.scale??1,exclude:e.exclude??[],excludeMode:e.excludeMode??"hide",filter:e.filter??null,filterMode:e.filterMode??"hide",placeholders:e.placeholders!==!1,embedFonts:e.embedFonts??!1,iconFonts:Array.isArray(e.iconFonts)?e.iconFonts:e.iconFonts?[e.iconFonts]:[],localFonts:Array.isArray(e.localFonts)?e.localFonts:[],excludeFonts:e.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(e.fontStylesheetDomains)?e.fontStylesheetDomains:[],fallbackURL:e.fallbackURL??void 0,cache:r,useProxy:typeof e.useProxy=="string"?e.useProxy:"",width:e.width??null,height:e.height??null,format:t,type:e.type??"svg",quality:e.quality??.92,dpr:e.dpr??(window.devicePixelRatio||1),backgroundColor:e.backgroundColor??(["jpeg","webp"].includes(t)?"#ffffff":null),filename:e.filename??"snapDOM",outerTransforms:e.outerTransforms??!0,outerShadows:e.outerShadows??!1,safariWarmupAttempts:Math.min(3,Math.max(1,(e.safariWarmupAttempts??3)|0)),excludeStyleProps:e.excludeStyleProps??null}}St();Po();Se();ot();be();function pu(...e){return Bc(...e),j}var j=Object.assign(gu,{plugins:pu}),si=Symbol("snapdom.internal"),hu=Symbol("snapdom.internal.silent"),Lo=!1;async function gu(e,t){if(!e)throw new Error("Element cannot be null or undefined");let r=mu(t);if(Vc(r,t&&t.plugins),Ue()&&(r.embedFonts===!0||bu(e))){if(r.embedFonts)try{let o=Qo(e),i=new Set([...o].map(a=>String(a).split("__")[0]).filter(Boolean));await ei(i,1)}catch{}let n=r.safariWarmupAttempts??3;for(let o=0;o<n;o++)try{await yu(e,t)}catch{}}return r.iconFonts&&r.iconFonts.length>0&&Vl(r.iconFonts),r.snap||(r.snap={toPng:(n,o)=>j.toPng(n,o),toSvg:(n,o)=>j.toSvg(n,o)}),j.capture(e,r,si)}j.capture=async(e,t,r)=>{if(r!==si)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let n=await ai(e,t),o={img:async(g,h)=>{let{toImg:y}=await Promise.resolve().then(()=>(uo(),zr));return y(n,{...g,...h||{}})},svg:async(g,h)=>{let{toSvg:y}=await Promise.resolve().then(()=>(uo(),zr));return y(n,{...g,...h||{}})},canvas:async(g,h)=>{let{toCanvas:y}=await Promise.resolve().then(()=>(qt(),Wo));return y(n,{...g,...h||{}})},blob:async(g,h)=>{let{toBlob:y}=await Promise.resolve().then(()=>(Go(),Ho));return y(n,{...g,...h||{}})},png:async(g,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Wt(),Pt));return y(n,{...g,...h||{},format:"png"})},jpeg:async(g,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Wt(),Pt));return y(n,{...g,...h||{},format:"jpeg"})},webp:async(g,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Wt(),Pt));return y(n,{...g,...h||{},format:"webp"})},download:async(g,h)=>{let{download:y}=await Promise.resolve().then(()=>(sl(),zo));return y(n,{...g,...h||{}})}},i={};for(let g of["img","svg","canvas","blob","png","jpeg","webp"])i[g]=async h=>o[g](t,{...h||{},[hu]:!0});i.jpg=i.jpeg;let a={...t,export:{url:n},exports:i},s=await Uc("defineExports",a),c=Object.assign({},...s.filter(g=>g&&typeof g=="object")),l={...o,...c};l.jpeg&&!l.jpg&&(l.jpg=(g,h)=>l.jpeg(g,h));function u(g,h){let y={...t,...h||{}};return(g==="jpeg"||g==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let d=!1,f=Promise.resolve();async function m(g,h){let y=async()=>{let v=l[g];if(!v)throw new Error(`[snapdom] Unknown export type: ${g}`);let w=u(g,h),b={...t,export:{type:g,options:w,url:n}};await Fe("beforeExport",b);let S=await v(b,w);return await Fe("afterExport",b,S),d||(d=!0,await Fe("afterSnap",t)),S};return f=f.then(y)}let p={url:n,toRaw:()=>n,to:(g,h)=>m(g,h),toImg:g=>m("img",g),toSvg:g=>m("svg",g),toCanvas:g=>m("canvas",g),toBlob:g=>m("blob",g),toPng:g=>m("png",g),toJpg:g=>m("jpg",g),toWebp:g=>m("webp",g),download:g=>m("download",g)};for(let g of Object.keys(l)){let h="to"+g.charAt(0).toUpperCase()+g.slice(1);p[h]||(p[h]=y=>m(g,y))}return p};j.toRaw=(e,t)=>j(e,t).then(r=>r.toRaw());j.toImg=(e,t)=>j(e,t).then(r=>r.toImg());j.toSvg=(e,t)=>j(e,t).then(r=>r.toSvg());j.toCanvas=(e,t)=>j(e,t).then(r=>r.toCanvas());j.toBlob=(e,t)=>j(e,t).then(r=>r.toBlob());j.toPng=(e,t)=>j(e,{...t,format:"png"}).then(r=>r.toPng());j.toJpg=(e,t)=>j(e,{...t,format:"jpeg"}).then(r=>r.toJpg());j.toWebp=(e,t)=>j(e,{...t,format:"webp"}).then(r=>r.toWebp());j.download=(e,t)=>j(e,t).then(r=>r.download());async function yu(e,t){if(Lo)return;let r={...t,fast:!0,embedFonts:!0,scale:.2},n;try{n=await ai(e,r)}catch(o){q(t,"safariWarmup pre-capture failed",o)}await new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(o))),n&&await new Promise(o=>{let i=new Image;try{i.decoding="sync",i.loading="eager"}catch(a){q(t,"safariWarmup img hints failed",a)}i.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",i.src=n,document.body.appendChild(i),(async()=>{try{typeof i.decode=="function"&&await i.decode()}catch(s){q(t,"safariWarmup img.decode failed",s)}let a=performance.now();for(;!(i.complete&&i.naturalWidth>0)&&performance.now()-a<900;)await new Promise(s=>setTimeout(s,200));await new Promise(s=>requestAnimationFrame(s));try{let s=document.createElement("canvas");s.width=Math.max(1,i.naturalWidth||10),s.height=Math.max(1,i.naturalHeight||10);let c=s.getContext("2d");c&&c.drawImage(i,0,0)}catch{}await new Promise(s=>requestAnimationFrame(s));try{i.remove()}catch(s){q(t,"safariWarmup img.remove failed",s)}o()})()}),e.querySelectorAll("canvas").forEach(o=>{try{let i=o.getContext("2d",{willReadFrequently:!0});i&&i.getImageData(0,0,1,1)}catch(i){q(t,"safariWarmup canvas poke failed",i)}}),Lo=!0}function bu(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;t.nextNode();){let r=t.currentNode,n=getComputedStyle(r),o=n.backgroundImage&&n.backgroundImage!=="none",i=n.maskImage&&n.maskImage!=="none"||n.webkitMaskImage&&n.webkitMaskImage!=="none";if(o||i||r.tagName==="CANVAS")return!0}return!1}function li(e){if(e.dataset.fontProxied||!e.rel||!e.rel.includes("stylesheet"))return!1;let t=e.href||"";try{return new URL(t).origin!==window.location.origin}catch{return!1}}function ci(e){let t=`/__mindstudio_dev__/font-proxy?url=${encodeURIComponent(e.href)}`,r=document.createElement("link");r.rel="stylesheet",r.href=t,r.dataset.fontProxied="true",e.media&&(r.media=e.media),r.onload=()=>{e.remove()},r.onerror=()=>{r.remove()},e.parentNode?.insertBefore(r,e.nextSibling)}function ui(){let e=document.querySelectorAll('link[rel~="stylesheet"]');for(let t of e)li(t)&&ci(t)}function wu(){let e=A().fonts;e.observer||(e.observer=new MutationObserver(t=>{for(let r of t)for(let n of r.addedNodes)n instanceof HTMLLinkElement&&li(n)&&ci(n)}),e.observer.observe(document.documentElement,{childList:!0,subtree:!0}))}function vu(e){try{let t=new URL(e,window.location.origin);return t.origin===window.location.origin?!1:!!(/\.(css|woff2?|ttf|otf|eot)(\?|$)/i.test(t.pathname)||t.pathname.includes("/css"))}catch{return!1}}function Cu(){if(window.fetch.__ms_font_proxied)return;let e=window.fetch;window.fetch=function(t,r){let n=typeof t=="string"?t:t instanceof URL?t.href:t.url||String(t);if(vu(n)){let o=`/__mindstudio_dev__/font-proxy?url=${encodeURIComponent(n)}`;return e.apply(this,[o,r])}return e.apply(this,[t,r])},window.fetch.__ms_font_proxied=!0}function di(){let e=A().fonts;e.initialized||(e.initialized=!0,Cu(),ui(),wu())}async function fi(){ui();try{await document.fonts.ready}catch{}}var mi="__mindstudio-touch-circle",an="__mindstudio-touch-style",pi=44,hi=5,gi=.95,jt=.5,sn=.45,yi=600;function Su(){document.getElementById(mi)?.remove();let e=document.createElement("div");return e.id=mi,e.style.cssText=["position: fixed","z-index: 2147483647","pointer-events: none",`width: ${pi}px`,`height: ${pi}px`,"border-radius: 50%","background: rgba(255, 255, 255, 0.08)","border: 2px solid rgba(255, 255, 255, 0.85)","box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 0 0 0.5px rgba(0, 0, 0, 0.1)","backdrop-filter: blur(1px)","-webkit-backdrop-filter: blur(1.5px)","transform: translate(-50%, -50%) scale(1)","transition: transform 100ms ease, opacity 100ms ease, background 100ms ease","opacity: 0","will-change: left, top, transform, opacity"].join("; "),document.documentElement.appendChild(e),e}function xu(e){e.style.transform="translate(-50%, -50%) scale(0.88)",e.style.background="rgba(255, 255, 255, 0.18)"}function bi(e){e.style.transform="translate(-50%, -50%) scale(1)",e.style.background="rgba(255, 255, 255, 0.08)"}function wi(){window.location.search.includes("mode=iframe")&&A().zoom.mobilePreview&&xt()}function xt(){let e=A().touch;if(e.active)return;e.active=!0,e.scrollContainer=We(),ku();let t=Su();e.circleEl=t,e.onMouseMove=r=>{let n=A();if(n.cursor.executing||n.screenshot.capturing){t.style.opacity="0";return}if(t.style.left=`${r.clientX}px`,t.style.top=`${r.clientY}px`,t.style.opacity="1",e.pressed){let o=Math.abs(r.clientX-e.startX),i=Math.abs(r.clientY-e.startY);if(!e.dragging&&(o>hi||i>hi)&&(e.dragging=!0),e.dragging){let a=e.scrollContainer||document.documentElement,s=performance.now(),c=s-e.lastMoveTime||16,l=e.lastX-r.clientX,u=e.lastY-r.clientY;e.bouncing&&Eu();let d=a.scrollTop;a.scrollTop+=u,a.scrollLeft+=l;let m=a.scrollTop-d,p=u-m;if(Math.abs(p)>.5){let g=sn/(1+Math.abs(e.overscrollY)/200);e.overscrollY+=p*g,ln()}else if(e.overscrollY!==0){let g=sn/(1+Math.abs(e.overscrollY)/200);e.overscrollY+=p*g,(e.overscrollY>0&&u<0||e.overscrollY<0&&u>0)&&(e.overscrollY*=.7),ln()}e.velocityX=.8*(l/c)+.2*e.velocityX,e.velocityY=.8*(u/c)+.2*e.velocityY,e.lastMoveTime=s,r.preventDefault()}e.lastX=r.clientX,e.lastY=r.clientY}},e.onMouseDown=r=>{A().cursor.executing||(Zt(),e.pressed=!0,e.dragging=!1,e.startX=r.clientX,e.startY=r.clientY,e.lastX=r.clientX,e.lastY=r.clientY,e.velocityX=0,e.velocityY=0,e.lastMoveTime=performance.now(),xu(t))},e.onMouseUp=()=>{let r=e.dragging;r&&document.addEventListener("click",Iu,{capture:!0,once:!0}),e.pressed=!1,e.dragging=!1,bi(t),r&&(e.overscrollY!==0&&Si(),(Math.abs(e.velocityX)>jt/16||Math.abs(e.velocityY)>jt/16)&&Au())},e.onMouseLeave=()=>{e.pressed=!1,e.dragging=!1,Zt(),t.style.opacity="0",bi(t)},e.onDragStart=r=>r.preventDefault(),document.addEventListener("mousemove",e.onMouseMove),document.addEventListener("mousedown",e.onMouseDown),document.addEventListener("mouseup",e.onMouseUp),document.addEventListener("mouseleave",e.onMouseLeave),document.addEventListener("dragstart",e.onDragStart)}function Xt(){let e=A().touch;e.active&&(e.active=!1,e.pressed=!1,e.dragging=!1,Zt(),e.overscrollY!==0&&(e.overscrollY=0,document.body.style.transition="",document.body.style.transform=""),Mu(),e.circleEl&&(e.circleEl.remove(),e.circleEl=null),e.onMouseMove&&document.removeEventListener("mousemove",e.onMouseMove),e.onMouseDown&&document.removeEventListener("mousedown",e.onMouseDown),e.onMouseUp&&document.removeEventListener("mouseup",e.onMouseUp),e.onMouseLeave&&document.removeEventListener("mouseleave",e.onMouseLeave),e.onDragStart&&document.removeEventListener("dragstart",e.onDragStart),e.onMouseMove=null,e.onMouseDown=null,e.onMouseUp=null,e.onMouseLeave=null,e.onDragStart=null)}function vi(){let{circleEl:e}=A().touch;e&&(e.style.opacity="0")}function Ci(){let e=A().touch;e.active&&e.circleEl&&(e.circleEl.style.opacity="1")}function Iu(e){e.preventDefault(),e.stopPropagation()}function Au(){Zt();let e=A().touch,t=e.scrollContainer||document.documentElement,r=e.velocityX*16,n=e.velocityY*16;function o(){let i=A().touch;if(r*=gi,n*=gi,Math.abs(r)<jt&&Math.abs(n)<jt){i.momentumFrame=null,i.overscrollY!==0&&Si();return}let a=t.scrollTop;t.scrollTop+=n,t.scrollLeft+=r;let s=t.scrollTop-a,c=n-s;if(Math.abs(c)>.5){let l=sn*.5/(1+Math.abs(i.overscrollY)/200);i.overscrollY+=c*l,ln(),n*=.7}i.momentumFrame=requestAnimationFrame(o)}e.momentumFrame=requestAnimationFrame(o)}function Zt(){let e=A().touch;e.momentumFrame!==null&&(cancelAnimationFrame(e.momentumFrame),e.momentumFrame=null)}function ln(){let e=A().touch;document.body.style.transition="none",document.body.style.transform=`translateY(${-e.overscrollY}px)`}function Si(){let e=A().touch;e.bouncing=!0,e.overscrollY=0,document.body.style.transition=`transform ${yi}ms cubic-bezier(0.2, 0.9, 0.3, 1)`,document.body.style.transform="",e.bounceTimer&&clearTimeout(e.bounceTimer),e.bounceTimer=setTimeout(()=>{let t=A().touch;t.bouncing=!1,t.bounceTimer=null,document.body.style.transition="",document.body.style.transform=""},yi)}function Eu(){let e=A().touch;e.bouncing&&(e.bouncing=!1,e.bounceTimer&&(clearTimeout(e.bounceTimer),e.bounceTimer=null),document.body.style.transition="")}function ku(){document.getElementById(an)?.remove();let e=document.createElement("style");e.id=an,e.textContent=`
9
+ `):u+=f[0]}return u+=s.slice(d),u}let a=wo(e,t||location.href);return a=await i(a,t||location.href,0),a}var jo=/url\((["']?)([^"')]+)\1\)/g,lc=/@font-face[^{}]*\{[^}]*\}/g;function Zo(e){if(!e)return[];let t=[],r=e.split(",").map(n=>n.trim()).filter(Boolean);for(let n of r){let o=n.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!o)continue;let i=o[1],a=o[2],s=c=>{if(!c.includes("?"))return parseInt(c,16);let l=parseInt(c.replace(/\?/g,"0"),16),u=parseInt(c.replace(/\?/g,"F"),16);return[l,u]};if(a){let c=s(i),l=s(a),u=Array.isArray(c)?c[0]:c,d=Array.isArray(l)?l[1]:l;t.push([Math.min(u,d),Math.max(u,d)])}else{let c=s(i);Array.isArray(c)?t.push([c[0],c[1]]):t.push([c,c])}}return t}function Xo(e,t){if(!t.length||!e||e.size===0)return!0;for(let r of e)for(let[n,o]of t)if(r>=n&&r<=o)return!0;return!1}function nn(e,t){let r=[];if(!e)return r;for(let n of e.matchAll(jo)){let o=(n[2]||"").trim();if(!(!o||o.startsWith("data:"))){if(!/^https?:/i.test(o))try{o=new URL(o,t||location.href).href}catch{}r.push(o)}}return r}async function Ko(e,t,r=""){let n=e;for(let o of e.matchAll(jo)){let i=Qr(o[0]);if(!i)continue;let a=i;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,t||location.href).href}catch{}if(!Te(a)){if(E.resource?.has(a)){E.font?.add(a),n=n.replace(o[0],`url(${E.resource.get(a)})`);continue}if(!E.font?.has(a))try{let s=await ye(a,{as:"dataURL",useProxy:r,silent:!0});if(s.ok&&typeof s.data=="string"){let c=s.data;E.resource?.set(a,c),E.font?.add(a),n=n.replace(o[0],`url(${c})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return n}function cc(e){if(!e.length)return null;let t=(a,s)=>e.some(([c,l])=>!(l<a||c>s)),r=t(0,255)||t(305,305),n=t(256,591)||t(7680,7935),o=t(880,1023),i=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":i?"cyrillic":o?"greek":n?"latin-ext":r?"latin":null}function vo(e={}){let t=new Set((e.families||[]).map(o=>String(o).toLowerCase())),r=new Set((e.domains||[]).map(o=>String(o).toLowerCase())),n=new Set((e.subsets||[]).map(o=>String(o).toLowerCase()));return(o,i)=>{if(t.size&&t.has(o.family.toLowerCase()))return!0;if(r.size)for(let a of o.srcUrls)try{if(r.has(new URL(a).host.toLowerCase()))return!0}catch{}if(n.size){let a=cc(i);if(a&&n.has(a))return!0}return!1}}function uc(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,r=new Set,n=[];for(let i of e.match(t)||[]){let a=i.match(/font-family:\s*([^;]+);/i)?.[1]||"",s=rn(a),c=(i.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),l=(i.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),u=(i.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),d=(i.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),f=(i.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),m=nn(f,location.href),p=m.length?m.map(h=>String(h).toLowerCase()).sort().join("|"):f.toLowerCase(),g=[String(s||"").toLowerCase(),c,l,u,d.toLowerCase(),p].join("|");r.has(g)||(r.add(g),n.push(i))}if(n.length===0)return e;let o=0;return e.replace(t,()=>n[o++]||"")}function dc(e,t,r,n,o){let i=Array.from(e||[]).sort().join("|"),a=t?JSON.stringify({families:(t.families||[]).map(u=>String(u).toLowerCase()).sort(),domains:(t.domains||[]).map(u=>String(u).toLowerCase()).sort(),subsets:(t.subsets||[]).map(u=>String(u).toLowerCase()).sort()}):"",s=(r||[]).map(u=>`${(u.family||"").toLowerCase()}::${u.weight||"normal"}::${u.style||"normal"}::${u.src||""}`).sort().join("|"),c=n||"",l=(o||[]).map(u=>String(u).toLowerCase()).sort().join("|");return`fonts-embed-css::req=${i}::ex=${a}::lf=${s}::px=${c}::fd=${l}`}async function Jo(e,t,r,n){let o;try{o=e.cssRules||[]}catch{return}let i=(a,s)=>{try{return new URL(a,s||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let s=a.href?i(a.href,t):t;if(n.depth>=Gt){console.warn(`[snapDOM] CSSOM import depth exceeded (${Gt}) at ${s}`);continue}if(s&&n.visitedSheets.has(s)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${s}`);continue}s&&n.visitedSheets.add(s);let c={...n,depth:(n.depth||0)+1};await Jo(a.styleSheet,s,r,c);continue}if(a.type===CSSRule.FONT_FACE_RULE){let s=(a.style.getPropertyValue("font-family")||"").trim(),c=rn(s);if(!c||Te(c))continue;let l=(a.style.getPropertyValue("font-weight")||"400").trim(),u=(a.style.getPropertyValue("font-style")||"normal").trim(),d=(a.style.getPropertyValue("font-stretch")||"100%").trim(),f=(a.style.getPropertyValue("src")||"").trim(),m=(a.style.getPropertyValue("unicode-range")||"").trim();if(!n.faceMatchesRequired(c,u,l,d))continue;let p=Zo(m);if(!Xo(n.usedCodepoints,p))continue;let g={family:c,weightSpec:l,styleSpec:u,stretchSpec:d,unicodeRange:m,srcRaw:f,srcUrls:nn(f,t||location.href),href:t||location.href};if(n.simpleExcluder&&n.simpleExcluder(g,p))continue;if(/url\(/i.test(f)){let h=await Ko(f,t||location.href,n.useProxy);await r(`@font-face{font-family:${c};src:${h};font-style:${u};font-weight:${l};font-stretch:${d};${m?`unicode-range:${m};`:""}}`)}else await r(`@font-face{font-family:${c};src:${f};font-style:${u};font-weight:${l};font-stretch:${d};${m?`unicode-range:${m};`:""}}`)}}}async function fc({required:e,usedCodepoints:t,exclude:r=void 0,localFonts:n=[],useProxy:o="",fontStylesheetDomains:i=[]}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let a=new Map;for(let h of e){let[y,v,w,b]=String(h).split("__");if(!y)continue;let S=a.get(y)||[];S.push({w:parseInt(v,10),s:w,st:parseInt(b,10)}),a.set(y,S)}function s(h,y,v,w){if(!a.has(h))return!1;let b=a.get(h),S=tc(v),I=rc(y),C=nc(w),x=S.min!==S.max,N=S.min,B=M=>I.kind==="normal"&&M==="normal"||I.kind!=="normal"&&(M==="italic"||M==="oblique"),$=!1;for(let M of b){let k=x?M.w>=S.min&&M.w<=S.max:M.w===N,O=B(Ht(M.s)),V=M.st>=C.min&&M.st<=C.max;if(k&&O&&V){$=!0;break}}if($)return!0;if(!x)for(let M of b){let k=B(Ht(M.s)),O=M.st>=C.min&&M.st<=C.max;if(Math.abs(N-M.w)<=300&&k&&O)return!0}if(!x&&I.kind==="normal"&&b.some(M=>Ht(M.s)!=="normal"))for(let M of b){let k=Math.abs(N-M.w)<=300,O=M.st>=C.min&&M.st<=C.max;if(k&&O)return!0}return!1}let c=vo(r),l=dc(e,r,n,o,i);if(E.resource?.has(l))return E.resource.get(l);let u=ac(e),d=[],f=qr;for(let h of document.querySelectorAll("style")){let y=h.textContent||"";for(let v of y.matchAll(f)){let w=(v[2]||v[4]||"").trim();!w||Te(w)||document.querySelector(`link[rel="stylesheet"][href="${w}"]`)||d.push(w)}}d.length&&await Promise.all(d.map(h=>new Promise(y=>{if(document.querySelector(`link[rel="stylesheet"][href="${h}"]`))return y(null);let v=document.createElement("link");v.rel="stylesheet",v.href=h,v.setAttribute("data-snapdom","injected-import"),v.onload=()=>y(v),v.onerror=()=>y(null),document.head.appendChild(v)})));let m="",p=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(h=>!!h.href);for(let h of p)try{if(Te(h.href))continue;let y="",v=!1;try{v=new URL(h.href,location.href).origin===location.origin}catch{}if(!v){let b=Array.isArray(i)?i:[];if(!ic(h.href,u,b))continue}if(v){let b=Array.from(document.styleSheets).find(S=>S.href===h.href);if(b)try{let S=b.cssRules||[];y=Array.from(S).map(I=>I.cssText).join("")}catch{}}if(!y){let b=await ye(h.href,{as:"text",useProxy:o});if(b?.ok&&typeof b.data=="string"&&(y=b.data),Te(h.href))continue}y=await sc(y,h.href,o);let w="";for(let b of y.match(lc)||[]){let S=(b.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),I=rn(S);if(!I||Te(I))continue;let C=(b.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),x=(b.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),N=(b.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),B=(b.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),$=(b.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),M=nn($,h.href);if(!s(I,x,C,N))continue;let k=Zo(B);if(!Xo(t,k))continue;let O={family:I,weightSpec:C,styleSpec:x,stretchSpec:N,unicodeRange:B,srcRaw:$,srcUrls:M,href:h.href};if(r&&c(O,k))continue;let V=/url\(/i.test($)?await Ko(b,h.href,o):b;w+=V}w.trim()&&(m+=w)}catch{console.warn("[snapDOM] Failed to process stylesheet:",h.href)}let g={requiredIndex:a,usedCodepoints:t,faceMatchesRequired:s,simpleExcluder:r?vo(r):null,useProxy:o,visitedSheets:new Set,depth:0};for(let h of document.styleSheets)if(!(h.href&&p.some(y=>y.href===h.href)))try{let y=h.href||location.origin+"/";y&&g.visitedSheets.add(y),await Jo(h,y,async v=>{m+=v},g)}catch{}try{for(let h of document.fonts||[]){if(!h||!h.family||h.status!=="loaded"||!h._snapdomSrc)continue;let y=String(h.family).replace(/^['"]+|['"]+$/g,"");if(Te(y)||!a.has(y)||r?.families&&r.families.some(w=>String(w).toLowerCase()===y.toLowerCase()))continue;let v=h._snapdomSrc;if(!String(v).startsWith("data:")){if(E.resource?.has(h._snapdomSrc))v=E.resource.get(h._snapdomSrc),E.font?.add(h._snapdomSrc);else if(!E.font?.has(h._snapdomSrc))try{let w=await ye(h._snapdomSrc,{as:"dataURL",useProxy:o,silent:!0});if(w.ok&&typeof w.data=="string")v=w.data,E.resource?.set(h._snapdomSrc,v),E.font?.add(h._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",h._snapdomSrc);continue}}m+=`@font-face{font-family:'${y}';src:url(${v});font-style:${h.style||"normal"};font-weight:${h.weight||"normal"};}`}}catch{}for(let h of n){if(!h||typeof h!="object")continue;let y=String(h.family||"").replace(/^['"]+|['"]+$/g,"");if(!y||Te(y)||!a.has(y)||r?.families&&r.families.some(C=>String(C).toLowerCase()===y.toLowerCase()))continue;let v=h.weight!=null?String(h.weight):"normal",w=h.style!=null?String(h.style):"normal",b=h.stretchPct!=null?`${h.stretchPct}%`:"100%",S=String(h.src||""),I=S;if(!I.startsWith("data:")){if(E.resource?.has(S))I=E.resource.get(S),E.font?.add(S);else if(!E.font?.has(S))try{let C=await ye(S,{as:"dataURL",useProxy:o,silent:!0});if(C.ok&&typeof C.data=="string")I=C.data,E.resource?.set(S,I),E.font?.add(S);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",S);continue}}m+=`@font-face{font-family:'${y}';src:url(${I});font-style:${w};font-weight:${v};font-stretch:${b};}`}return m&&(m=uc(m),E.resource?.set(l,m)),m}function Qo(e){let t=new Set;if(!e)return t;let r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null),n=a=>{let s=Ql(a.fontFamily);if(s.length)for(let c of s){let l=(u,d,f)=>`${c}__${Ut(u)}__${Ht(d)}__${ec(f)}`;t.add(l(a.fontWeight,a.fontStyle,a.fontStretch))}};n(getComputedStyle(e));let o=getComputedStyle(e,"::before");o&&o.content&&o.content!=="none"&&n(o);let i=getComputedStyle(e,"::after");for(i&&i.content&&i.content!=="none"&&n(i);r.nextNode();){let a=r.currentNode,s=getComputedStyle(a);n(s);let c=getComputedStyle(a,"::before");c&&c.content&&c.content!=="none"&&n(c);let l=getComputedStyle(a,"::after");l&&l.content&&l.content!=="none"&&n(l)}return t}function mc(e){let t=new Set,r=o=>{if(o)for(let i of o)t.add(i.codePointAt(0))},n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;n.nextNode();){let o=n.currentNode;if(o.nodeType===Node.TEXT_NODE)r(o.nodeValue||"");else if(o.nodeType===Node.ELEMENT_NODE){let i=o;for(let a of["::before","::after"]){let s=getComputedStyle(i,a)?.getPropertyValue("content");if(!(!s||s==="none"))if(/^"/.test(s)||/^'/.test(s))r(s.slice(1,-1));else{let c=s.match(/\\[0-9A-Fa-f]{1,6}/g);if(c)for(let l of c)try{t.add(parseInt(l.slice(1),16))}catch{}}}}}return t}async function ei(e,t=2){try{await document.fonts.ready}catch{}let r=Array.from(e||[]).filter(Boolean);if(r.length===0)return;let n=()=>{let o=document.createElement("div");o.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let i of r){let a=document.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${i}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",o.appendChild(a)}document.body.appendChild(o),o.offsetWidth,document.body.removeChild(o)};for(let o=0;o<Math.max(1,t);o++)n(),await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i)))}be();function pc(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function hc(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Co(e,t=!1){let r="",n=Math.max(1,e);for(;n>0;)n--,r=String.fromCharCode(97+n%26)+r,n=Math.floor(n/26);return t?r.toUpperCase():r}function So(e,t=!0){let r=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],n=Math.max(1,Math.min(3999,e)),o="";for(let[i,a]of r)for(;n>=i;)o+=a,n-=i;return t?o:o.toLowerCase()}function xo(e,t){switch((t||"decimal").toLowerCase()){case"decimal":return String(e);case"decimal-leading-zero":{let r=Math.abs(e);return(e<0?"-":"")+(r<10?"0":"")+String(r)}case"lower-alpha":return Co(e,!1);case"upper-alpha":return Co(e,!0);case"lower-roman":return So(e,!1);case"upper-roman":return So(e,!0);default:return String(e)}}function gc(e){let t=()=>E?.session?.__counterEpoch??0,r=t(),n=new WeakMap,o=e instanceof Document?e.documentElement:e,i=f=>f&&f.tagName==="LI",a=f=>{let m=0,p=f?.parentElement;if(!p)return 0;for(let g of p.children){if(g===f)break;g.tagName==="LI"&&m++}return m},s=f=>{let m=new Map;for(let[p,g]of f)m.set(p,g.slice());return m},c=(f,m,p)=>{let g=s(f),h;try{h=p.style?.counterReset||getComputedStyle(p).counterReset}catch{}if(h&&h!=="none")for(let w of h.split(",")){let b=w.trim().split(/\s+/),S=b[0],I=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!S)continue;let C=m.get(S);if(C&&C.length){let x=C.slice();x.push(I),g.set(S,x)}else g.set(S,[I])}let y;try{y=p.style?.counterSet||getComputedStyle(p).counterSet}catch{}if(y&&y!=="none")for(let w of y.split(",")){let b=w.trim().split(/\s+/),S=b[0],I=Number.isFinite(Number(b[1]))?Number(b[1]):0;if(!S)continue;let C=g.get(S)||[];C.length===0&&C.push(0),C[C.length-1]=I,g.set(S,C)}let v;try{v=p.style?.counterIncrement||getComputedStyle(p).counterIncrement}catch{}if(v&&v!=="none")for(let w of v.split(",")){let b=w.trim().split(/\s+/),S=b[0],I=Number.isFinite(Number(b[1]))?Number(b[1]):1;if(!S)continue;let C=g.get(S)||[];C.length===0&&C.push(0),C[C.length-1]+=I,g.set(S,C)}try{if(getComputedStyle(p).display==="list-item"&&i(p)){let w=p.parentElement,b=1;if(w&&w.tagName==="OL"){let I=w.getAttribute("start"),C=Number.isFinite(Number(I))?Number(I):1,x=a(p),N=p.getAttribute("value");b=Number.isFinite(Number(N))?Number(N):C+x}else b=1+a(p);let S=g.get("list-item")||[];S.length===0&&S.push(0),S[S.length-1]=b,g.set("list-item",S)}}catch{}return g},l=(f,m,p)=>{let g=c(p,m,f);n.set(f,g);let h=g;for(let v of f.children)h=l(v,g,h);let y=new Map;for(let[v,w]of p){let b=w.length,S=h.get(v);y.set(v,S&&S.length?S.slice(0,b):w.slice())}for(let[v,w]of h)!y.has(v)&&w.length&&!m.has(v)&&y.set(v,w.slice(0,1));return y},u=new Map;l(o,u,u);function d(){let f=t();if(f!==r){r=f;let m=new Map;l(o,m,m)}}return{get(f,m){d();let p=n.get(f)?.get(m);return p&&p.length?p[p.length-1]:0},getStack(f,m){d();let p=n.get(f)?.get(m);return p?p.slice():[]}}}function yc(e,t,r){if(!e||e==="none")return e;try{let n=/\b(counter|counters)\s*\(([^)]+)\)/g,o=e.replace(n,(i,a,s)=>{let c=String(s).split(",").map(l=>l.trim());if(a==="counter"){let l=c[0]?.replace(/^["']|["']$/g,""),u=(c[1]||"decimal").toLowerCase(),d=r.get(t,l);return xo(d,u)}else{let l=c[0]?.replace(/^["']|["']$/g,""),u=c[1]?.replace(/^["']|["']$/g,"")??"",d=(c[2]||"decimal").toLowerCase(),f=r.getStack(t,l);return f.length?f.map(m=>xo(m,d)).join(u):""}});return hc(o)}catch{return"- "}}nt();be();var et=new WeakMap,Io=1e3;function bc(e,t){let r=ti(e);return t?(t.__pseudoPreflightFp!==r&&(t.__pseudoPreflight=Eo(e),t.__pseudoPreflightFp=r),!!t.__pseudoPreflight):Eo(e)}function jr(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function ti(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),r=`n:${t.length}|`,n=0;for(let i=0;i<t.length;i++){let a=t[i];if(a.tagName==="STYLE"){let s=a.textContent?a.textContent.length:0;r+=`S${s}|`;let c=a.sheet,l=c?jr(c):null;l&&(n+=l.length)}else{let s=a.getAttribute("href")||"",c=a.getAttribute("media")||"all";r+=`L${s}|m:${c}|`;let l=a.sheet,u=l?jr(l):null;u&&(n+=u.length)}}let o=e.adoptedStyleSheets;return r+=`ass:${Array.isArray(o)?o.length:0}|tr:${n}`,r}function Ao(e,t,r){let n=jr(e);if(!n)return!1;for(let o=0;o<n.length;o++){if(r.budget<=0)return!1;let i=n[o],a=i&&i.cssText?i.cssText:"";r.budget--;for(let s of t)if(a.includes(s))return!0;if(i&&i.cssRules&&i.cssRules.length)for(let s=0;s<i.cssRules.length&&r.budget>0;s++){let c=i.cssRules[s],l=c&&c.cssText?c.cssText:"";r.budget--;for(let u of t)if(l.includes(u))return!0}if(r.budget<=0)return!1}return!1}function Eo(e=document){let t=ti(e),r=et.get(e);if(r&&r.fingerprint===t)return r.result;let n=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],o=e.querySelectorAll("style");for(let a=0;a<o.length;a++){let s=o[a].textContent||"";for(let c of n)if(s.includes(c))return et.set(e,{fingerprint:t,result:!0}),!0}let i=e.adoptedStyleSheets;if(Array.isArray(i)&&i.length){let a={budget:Io};try{for(let s of i)if(Ao(s,n,a))return et.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let a=e.querySelectorAll('style,link[rel~="stylesheet"]'),s={budget:Io};for(let c=0;c<a.length&&s.budget>0;c++){let l=a[c],u=null;if(l.tagName,u=l.sheet||null,u&&Ao(u,n,s))return et.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(et.set(e,{fingerprint:t,result:!0}),!0):(et.set(e,{fingerprint:t,result:!1}),!1)}var rt=new WeakMap,ko=-1;function wc(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function vc(e){if(!e)return"";let t=[],r=/"([^"]*)"/g,n;for(;n=r.exec(e);)t.push(n[1]);return t.length?t.join(""):wc(e)}function Zr(e,t){let r=e.parentElement,n=r?rt.get(r):null;return n?{get(o,i){let a=t.get(o,i),s=n.get(i);return typeof s=="number"?Math.max(a,s):a},getStack(o,i){let a=t.getStack(o,i);if(!a.length)return a;let s=n.get(i);if(typeof s=="number"){let c=a.slice();return c[c.length-1]=Math.max(c[c.length-1],s),c}return a}}:t}function Xr(e,t,r){let n=new Map;function o(c){let l=[];if(!c||c==="none")return l;for(let u of String(c).split(",")){let d=u.trim().split(/\s+/),f=d[0],m=Number.isFinite(Number(d[1]))?Number(d[1]):void 0;f&&l.push({name:f,num:m})}return l}let i=o(t?.counterReset),a=o(t?.counterIncrement);function s(c){if(n.has(c))return n.get(c).slice();let l=r.getStack(e,c);l=l.length?l.slice():[];let u=i.find(f=>f.name===c);if(u){let f=Number.isFinite(u.num)?u.num:0;l=l.length?[...l,f]:[f]}let d=a.find(f=>f.name===c);if(d){let f=Number.isFinite(d.num)?d.num:1;l.length===0&&(l=[0]),l[l.length-1]+=f}return n.set(c,l.slice()),l}return{get(c,l){let u=s(l);return u.length?u[u.length-1]:0},getStack(c,l){return s(l)},__incs:a}}function Cc(e,t,r){let n;try{n=Ne(e,t)}catch{}let o=n?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};let i=Zr(e,r),a=Xr(e,n,i),s=pc(o)?yc(o,e,a):o;return{text:vc(s),incs:a.__incs||[]}}async function Kr(e,t,r,n){if(!(e instanceof Element)||!(t instanceof Element))return;let o=e.ownerDocument||document;if(!bc(o,r))return;let i=E?.session?.__counterEpoch??0;if(ko!==i&&(rt=new WeakMap,r&&(r.__counterCtx=null),ko=i),!r.__counterCtx)try{r.__counterCtx=gc(e.ownerDocument||document)}catch(c){q(r,"buildCounterContext failed",c)}let a=r.__counterCtx;for(let c of["::before","::after","::first-letter"])try{let l=Ne(e,c);if(!l||l.content==="none"&&l.backgroundImage==="none"&&l.backgroundColor==="transparent"&&(l.borderStyle==="none"||parseFloat(l.borderWidth)===0)&&(!l.transform||l.transform==="none")&&l.display==="inline")continue;if(c==="::first-letter"){let R=Ne(e);if(!(l.color!==R.color||l.fontSize!==R.fontSize||l.fontWeight!==R.fontWeight||l.fontFamily!==R.fontFamily||l.fontStyle!==R.fontStyle||l.textTransform!==R.textTransform||l.float!==R.float||l.paddingTop!==R.paddingTop||l.paddingRight!==R.paddingRight||l.paddingBottom!==R.paddingBottom||l.paddingLeft!==R.paddingLeft||l.marginTop!==R.marginTop||l.marginRight!==R.marginRight||l.marginBottom!==R.marginBottom||l.marginLeft!==R.marginLeft))continue;let F=Array.from(t.childNodes).find(T=>T.nodeType===Node.TEXT_NODE&&T.textContent?.trim().length>0);if(!F)continue;let D=F.textContent,_=D.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],ee=D.slice(_?.length||0);if(!_||/[\uD800-\uDFFF]/.test(_))continue;let P=document.createElement("span");P.textContent=_,P.dataset.snapdomPseudo="::first-letter";let z=lo(l),X=Hr(z,"span");r.styleMap.set(P,X);let ne=document.createTextNode(ee);t.replaceChild(ne,F),t.insertBefore(P,ne);continue}let u=l.content??"",d=u===""||u==="none"||u==="normal",{text:f,incs:m}=Cc(e,c,a),p=l.backgroundImage,g=l.backgroundColor,h=l.fontFamily,y=parseInt(l.fontSize)||32,v=parseInt(l.fontWeight)||!1,w=l.color||"#000",b=l.borderStyle,S=parseFloat(l.borderWidth),I=l.transform,C=Te(h),x=!d&&f!=="",N=p&&p!=="none",B=g&&g!=="transparent"&&g!=="rgba(0, 0, 0, 0)",$=b&&b!=="none"&&S>0,M=I&&I!=="none";if(!(x||N||B||$||M)){if(m&&m.length&&e.parentElement){let R=rt.get(e.parentElement)||new Map;for(let{name:F}of m){if(!F)continue;let D=Zr(e,a),_=Xr(e,Ne(e,c),D).get(e,F);R.set(F,_)}rt.set(e.parentElement,R)}continue}let k=document.createElement("span");k.dataset.snapdomPseudo=c,k.style.pointerEvents="none";let O=lo(l),V=Hr(O,"span");if(r.styleMap.set(k,V),C&&f&&f.length===1){let{dataUrl:R,width:F,height:D}=await Kl(f,h,v,y,w),_=document.createElement("img");_.src=R,_.style=`height:${y}px;width:${F/D*y}px;object-fit:contain;`,k.appendChild(_),t.dataset.snapdomHasIcon="true"}else if(f&&f.startsWith("url(")){let R=Qr(f);if(R?.trim())try{let F=await ye(Vt(R),{as:"dataURL",useProxy:n.useProxy});if(F?.ok&&typeof F.data=="string"){let D=document.createElement("img");D.src=F.data,D.style=`width:${y}px;height:auto;object-fit:contain;`,k.appendChild(D)}}catch(F){console.error(`[snapdom] Error in pseudo ${c} for`,e,F)}}else!C&&x&&(k.textContent=f);k.style.backgroundImage="none","maskImage"in k.style&&(k.style.maskImage="none"),"webkitMaskImage"in k.style&&(k.style.webkitMaskImage="none");try{k.style.backgroundRepeat=l.backgroundRepeat,k.style.backgroundSize=l.backgroundSize,l.backgroundPositionX&&l.backgroundPositionY?(k.style.backgroundPositionX=l.backgroundPositionX,k.style.backgroundPositionY=l.backgroundPositionY):k.style.backgroundPosition=l.backgroundPosition,k.style.backgroundOrigin=l.backgroundOrigin,k.style.backgroundClip=l.backgroundClip,k.style.backgroundAttachment=l.backgroundAttachment,k.style.backgroundBlendMode=l.backgroundBlendMode}catch{}if(N)try{let R=Vr(p),F=await Promise.all(R.map(Ro));k.style.backgroundImage=F.join(", ")}catch(R){console.warn(`[snapdom] Failed to inline background-image for ${c}`,R)}B&&(k.style.backgroundColor=g);let K=k.childNodes.length>0||k.textContent?.trim()!==""||N||B||$||M;if(m&&m.length&&e.parentElement){let R=rt.get(e.parentElement)||new Map,F=Zr(e,a),D=Xr(e,Ne(e,c),F);for(let{name:_}of m){if(!_)continue;let ee=D.get(e,_);R.set(_,ee)}rt.set(e.parentElement,R)}if(!K)continue;c==="::before"?(t.dataset.snapdomHasBefore="1",t.insertBefore(k,t.firstChild)):(t.dataset.snapdomHasAfter="1",t.appendChild(k))}catch(l){console.warn(`[snapdom] Failed to capture ${c} for`,e,l)}let s=Array.from(t.children).filter(c=>!c.dataset.snapdomPseudo);if(r.nodeMap)for(let c of s){let l=r.nodeMap.get(c);l instanceof Element&&await Kr(l,c,r,n)}else{let c=Array.from(e.children);for(let l=0;l<Math.min(c.length,s.length);l++)await Kr(c[l],s[l],r,n)}}function Sc(e,t){if(!e||!(e instanceof Element))return;let r=e.ownerDocument||document,n=t||r,o=e instanceof SVGSVGElement?[e]:Array.from(e.querySelectorAll("svg"));if(o.length===0)return;let i=/url\(\s*#([^)]+)\)/g,a=["fill","stroke","filter","clip-path","mask","marker","marker-start","marker-mid","marker-end"],s=b=>window.CSS&&CSS.escape?CSS.escape(b):b.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),c="http://www.w3.org/1999/xlink",l=b=>{if(!b||!b.getAttribute)return null;let S=b.getAttribute("href")||b.getAttribute("xlink:href")||(typeof b.getAttributeNS=="function"?b.getAttributeNS(c,"href"):null);if(S)return S;let I=b.attributes;if(!I)return null;for(let C=0;C<I.length;C++){let x=I[C];if(!x||!x.name)continue;if(x.name==="href")return x.value;let N=x.name.indexOf(":");if(N!==-1&&x.name.slice(N+1)==="href")return x.value}return null},u=new Set(Array.from(e.querySelectorAll("[id]")).map(b=>b.id)),d=new Set,f=!1,m=(b,S=null)=>{if(!b)return;i.lastIndex=0;let I;for(;I=i.exec(b);){f=!0;let C=(I[1]||"").trim();C&&(u.has(C)||(d.add(C),S&&!S.has(C)&&S.add(C)))}},p=b=>{let S=b.querySelectorAll("use");for(let C of S){let x=l(C);if(!x||!x.startsWith("#"))continue;f=!0;let N=x.slice(1).trim();N&&!u.has(N)&&d.add(N)}let I=b.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]');for(let C of I){m(C.getAttribute("style")||"");for(let x of a)m(C.getAttribute(x))}};for(let b of o)p(b);if(!f)return;let g=e.querySelector("svg.inline-defs-container");g||(g=r.createElementNS("http://www.w3.org/2000/svg","svg"),g.classList.add("inline-defs-container"),g.setAttribute("aria-hidden","true"),g.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(g,e.firstChild||null));let h=g.querySelector("defs")||null,y=b=>{if(!b||u.has(b))return null;let S=s(b),I=C=>{let x=n.querySelector(C);return x&&!e.contains(x)?x:null};return I(`svg defs > *#${S}`)||I(`svg > symbol#${S}`)||I(`*#${S}`)};if(!d.size)return;let v=new Set(d),w=new Set;for(;v.size;){let b=v.values().next().value;if(v.delete(b),!b||u.has(b)||w.has(b))continue;let S=y(b);if(!S){w.add(b);continue}h||(h=r.createElementNS("http://www.w3.org/2000/svg","defs"),g.appendChild(h));let I=S.cloneNode(!0);I.id||I.setAttribute("id",b),h.appendChild(I),w.add(b),u.add(b);let C=[I,...I.querySelectorAll("*")];for(let x of C){let N=l(x);if(N&&N.startsWith("#")){let $=N.slice(1).trim();$&&!u.has($)&&!w.has($)&&v.add($)}let B=x.getAttribute?.("style")||"";B&&m(B,v);for(let $ of a){let M=x.getAttribute?.($);M&&m(M,v)}}}}be();function xc(e,t){if(!e||!t)return;let r=e.scrollTop||0;if(!r)return;getComputedStyle(t).position==="static"&&(t.style.position="relative");let n=e.getBoundingClientRect(),o=e.clientHeight,i="data-snap-ph",a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let s=a.currentNode,c=getComputedStyle(s),l=c.position;if(l!=="sticky"&&l!=="-webkit-sticky")continue;let u=Mo(c.top),d=Mo(c.bottom);if(u==null&&d==null)continue;let f=Ic(s,e),m=Ac(t,f,i);if(!m)continue;let p=s.getBoundingClientRect(),g=p.width,h=p.height,y=p.left-n.left;if(!(g>0&&h>0)||!Number.isFinite(y))continue;let v=u!=null?u+r:r+(o-h-d);if(!Number.isFinite(v))continue;let w=Number.parseInt(c.zIndex,10),b=Number.isFinite(w),S=b?Math.max(w,1)+1:2,I=b?w-1:0,C=m.cloneNode(!1);C.setAttribute(i,"1"),C.style.position="sticky",C.style.left=`${y}px`,C.style.top=`${v}px`,C.style.width=`${g}px`,C.style.height=`${h}px`,C.style.visibility="hidden",C.style.zIndex=String(I),C.style.overflow="hidden",C.style.background="transparent",C.style.boxShadow="none",C.style.filter="none",m.parentElement?.insertBefore(C,m),m.style.position="absolute",m.style.left=`${y}px`,m.style.top=`${v}px`,m.style.bottom="auto",m.style.zIndex=String(S),m.style.pointerEvents="none"}}function Mo(e){if(!e||e==="auto")return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}function Ic(e,t){let r=[];for(let n=e;n&&n!==t;){let o=n.parentElement;if(!o)break;r.push(Array.prototype.indexOf.call(o.children,n)),n=o}return r.reverse()}function Ac(e,t,r){let n=e;for(let o=0;o<t.length;o++)if(n=Ec(n,r)[t[o]],!n)return null;return n instanceof HTMLElement?n:null}function Ec(e,t){let r=[],n=e.children;for(let o=0;o<n.length;o++){let i=n[o];i.hasAttribute(t)||r.push(i)}return r}function kc(e){let t=getComputedStyle(e),r=t.outlineStyle,n=t.outlineWidth,o=t.borderStyle,i=t.borderWidth,a=r!=="none"&&parseFloat(n)>0,s=o==="none"||parseFloat(i)===0;a&&s&&(e.style.border=`${n} solid transparent`)}function Mc(e){let t=[];try{let r=e.querySelectorAll("*");for(let n of r){if(!(n instanceof HTMLElement))continue;let o=n.style.contentVisibility||"",i=getComputedStyle(n),a=i.contentVisibility||i.getPropertyValue("content-visibility")||"";(a==="auto"||a==="hidden")&&(t.push({el:n,original:o}),n.style.contentVisibility="visible")}if(e instanceof HTMLElement){let n=getComputedStyle(e),o=n.contentVisibility||n.getPropertyValue("content-visibility")||"";(o==="auto"||o==="hidden")&&(t.push({el:e,original:e.style.contentVisibility||""}),e.style.contentVisibility="visible")}}catch{}return()=>{for(let{el:r,original:n}of t)try{r.style.contentVisibility=n}catch{}}}async function Tc(e,t={}){let r={styleMap:E.session.styleMap,styleCache:E.session.styleCache,nodeMap:E.session.nodeMap,options:t},n,o="",i="";kc(e);let a=Mc(e);try{Sc(e)}catch(l){console.warn("inlineExternal defs or symbol failed:",l)}try{n=await Bt(e,r,t)}catch(l){throw console.warn("deepClone failed:",l),l}finally{a()}try{await Kr(e,n,r,t)}catch(l){console.warn("inlinePseudoElements failed:",l)}await Ul(n,r);try{let l=n.querySelectorAll("style[data-sd]");for(let u of l)i+=u.textContent||"",u.remove()}catch(l){q(r,"Failed to extract shadow CSS from style[data-sd]",l)}let s=qs(r.styleMap);o=Array.from(s.entries()).map(([l,u])=>`.${u}{${l}}`).join(""),o=i+"[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}"+o;for(let[l,u]of r.styleMap.entries()){if(l.tagName==="STYLE")continue;if(l.getRootNode&&l.getRootNode()instanceof ShadowRoot){l.setAttribute("style",u.replace(/;/g,"; "));continue}let d=s.get(u);d&&l.classList.add(d);let f=l.style?.backgroundImage,m=l.dataset?.snapdomHasIcon;f&&f!=="none"&&(l.style.backgroundImage=f),m&&(l.style.verticalAlign="middle",l.style.display="inline")}for(let[l,u]of r.nodeMap.entries()){let d=u.scrollLeft,f=u.scrollTop;if((d||f)&&l instanceof HTMLElement){l.style.overflow="hidden",l.style.scrollbarWidth="none",l.style.msOverflowStyle="none";try{let p=l.querySelectorAll("*");for(let g of p){if(!(g instanceof HTMLElement))continue;let h=g.style.position;if(h==="fixed"||h==="absolute"){let y=parseFloat(g.style.top)||0,v=parseFloat(g.style.left)||0;g.style.top=`${y+f}px`,g.style.left=`${v+d}px`,h==="fixed"&&(g.style.position="absolute")}}}catch{}let m=document.createElement("div");for(m.style.transform=`translate(${-d}px, ${-f}px)`,m.style.willChange="transform",m.style.display="inline-block",m.style.width="100%";l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m)}}let c=n instanceof HTMLElement&&n.firstElementChild instanceof HTMLElement?n.firstElementChild:n;if(xc(e,c),e===r.nodeMap.get(n)){let l=r.styleCache.get(e)||Ne(e);r.styleCache.set(e,l);let u=Os(l.transform);n.style.margin="0",n.style.top="auto",n.style.left="auto",n.style.right="auto",n.style.bottom="auto",n.style.animation="none",n.style.transition="none",n.style.willChange="auto",n.style.float="none",n.style.clear="none",n.style.transform=u||""}for(let[l,u]of r.nodeMap.entries())u.tagName==="PRE"&&(l.style.marginTop="0",l.style.marginBlockStart="0");return{clone:n,classCSS:o,styleCache:r.styleCache}}nt();var ri="http://www.w3.org/1999/xlink";function Nc(e){return e.getAttribute("href")||e.getAttribute("xlink:href")||(typeof e.getAttributeNS=="function"?e.getAttributeNS(ri,"href"):null)}function Lc(e){let t=parseInt(e.dataset?.snapdomWidth||"",10)||0,r=parseInt(e.dataset?.snapdomHeight||"",10)||0,n=parseInt(e.getAttribute("width")||"",10)||0,o=parseInt(e.getAttribute("height")||"",10)||0,i=parseFloat(e.style?.width||"")||0,a=parseFloat(e.style?.height||"")||0,s=t||i||n||e.width||e.naturalWidth||100,c=r||a||o||e.height||e.naturalHeight||100;return{width:s,height:c}}async function Rc(e,t={}){let r=Array.from(e.querySelectorAll("img")),n=async a=>{if(!a.getAttribute("src")){let f=a.currentSrc||a.src||"";f&&a.setAttribute("src",f)}a.removeAttribute("srcset"),a.removeAttribute("sizes");let s=a.src||"";if(!s)return;let c=await ye(s,{as:"dataURL",useProxy:t.useProxy});if(c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")){a.src=c.data,a.width||(a.width=a.naturalWidth||100),a.height||(a.height=a.naturalHeight||100);return}let{width:l,height:u}=Lc(a),{fallbackURL:d}=t||{};if(d)try{let f=typeof d=="function"?await d({width:l,height:u,src:s,element:a}):d;if(f){let m=await ye(f,{as:"dataURL",useProxy:t.useProxy});if(m?.ok&&typeof m.data=="string"){a.src=m.data,a.width||(a.width=l),a.height||(a.height=u);return}}}catch{}if(t.placeholders!==!1){let f=document.createElement("div");f.style.cssText=[`width:${l}px`,`height:${u}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${u}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),f.textContent="img",a.replaceWith(f)}else{let f=document.createElement("div");f.style.cssText=`display:inline-block;width:${l}px;height:${u}px;visibility:hidden;`,a.replaceWith(f)}};for(let a=0;a<r.length;a+=4){let s=r.slice(a,a+4).map(n);await Promise.allSettled(s)}let o=Array.from(e.querySelectorAll("image")),i=async a=>{let s=Nc(a);if(!s||s.startsWith("data:")||s.startsWith("blob:"))return;let c=await ye(s,{as:"dataURL",useProxy:t.useProxy});c.ok&&typeof c.data=="string"&&c.data.startsWith("data:")&&(a.setAttribute("href",c.data),a.removeAttribute("xlink:href"),typeof a.removeAttributeNS=="function"&&a.removeAttributeNS(ri,"href"))};for(let a=0;a<o.length;a+=4){let s=o.slice(a,a+4).map(i);await Promise.allSettled(s)}}Se();async function Fc(e,t,r,n={}){let o=[[e,t]],i=["background-image","mask","mask-image","-webkit-mask","-webkit-mask-image","mask-source","mask-box-image-source","mask-border-source","-webkit-mask-box-image-source","border-image","border-image-source"],a=["mask-position","mask-size","mask-repeat","-webkit-mask-position","-webkit-mask-size","-webkit-mask-repeat","mask-origin","mask-clip","-webkit-mask-origin","-webkit-mask-clip","-webkit-mask-position-x","-webkit-mask-position-y"],s=["background-position","background-position-x","background-position-y","background-size","background-repeat","background-origin","background-clip","background-attachment","background-blend-mode"],c=["border-image-slice","border-image-width","border-image-outset","border-image-repeat"];for(;o.length;){let[l,u]=o.shift();if(!u)continue;let d=r.get(l)||Ne(l);r.has(l)||r.set(l,d);let f=(()=>{let g=d.getPropertyValue("border-image"),h=d.getPropertyValue("border-image-source");return g&&g!=="none"||h&&h!=="none"})();for(let g of s){let h=d.getPropertyValue(g);h&&u.style.setProperty(g,h)}for(let g of i){let h=d.getPropertyValue(g);if(g==="background-image"&&(!h||h==="none")){let w=d.getPropertyValue("background");w&&/url\s*\(/.test(w)&&(h=Vr(w).filter(b=>/url\s*\(/.test(b)).join(", ")||h)}if(!h||h==="none")continue;let y=Vr(h),v=await Promise.all(y.map(w=>Ro(w,n)));v.some(w=>w&&w!=="none"&&!/^url\(undefined/.test(w))&&u.style.setProperty(g,v.join(", "))}for(let g of a){let h=d.getPropertyValue(g);!h||h==="initial"||u.style.setProperty(g,h)}if(f)for(let g of c){let h=d.getPropertyValue(g);!h||h==="initial"||u.style.setProperty(g,h)}let m=l.shadowRoot?Array.from(l.shadowRoot.children).filter(g=>g.tagName!=="STYLE"):Array.from(l.children),p=Array.from(u.children).filter(g=>!(g.dataset?.snapdomPseudo||g.tagName==="STYLE"&&g.dataset?.sd));for(let g=0;g<Math.min(m.length,p.length);g++)o.push([m[g],p[g]])}}Se();be();function _c(e){if(!e)return()=>{};let t=[];function r(n){let o=Oc(n);o&&t.push(o);for(let i of n.children||[])r(i)}return r(e),()=>t.forEach(n=>n())}function Oc(e){if(!e)return()=>{};let t=Dc(e);if(t<=0)return()=>{};if(!Wc(e))return()=>{};let r=getComputedStyle(e),n=Math.round($c(r)*t+Pc(r)),o=e.textContent??"",i=o;if(e.scrollHeight<=n+.5)return()=>{};let a=0,s=o.length,c=-1;for(;a<=s;){let l=a+s>>1;e.textContent=o.slice(0,l)+"\u2026",e.scrollHeight<=n+.5?(c=l,a=l+1):s=l-1}return e.textContent=(c>=0?o.slice(0,c):"")+"\u2026",()=>{e.textContent=i}}function Dc(e){let t=getComputedStyle(e),r=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");r=(r||"").trim();let n=parseInt(r,10);return Number.isFinite(n)&&n>0?n:0}function $c(e){let t=(e.lineHeight||"").trim(),r=parseFloat(e.fontSize)||16;return!t||t==="normal"?Math.round(r*1.2):t.endsWith("px")?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*r):t.endsWith("%")?Math.round(parseFloat(t)/100*r):Math.round(r*1.2)}function Pc(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function Wc(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}var vt=[];function ni(e){if(!e)return null;if(Array.isArray(e)){let[t,r]=e;return typeof t=="function"?t(r):t}if(typeof e=="object"&&"plugin"in e){let{plugin:t,options:r}=e;return typeof t=="function"?t(r):t}return typeof e=="function"?e():e}function Bc(...e){let t=e.flat();for(let r of t){let n=ni(r);n&&(vt.some(o=>o&&o.name&&n.name&&o.name===n.name)||vt.push(n))}}function oi(e){return(e&&Array.isArray(e.plugins)?e.plugins:vt)||vt}async function Fe(e,t,r){let n=r,o=oi(t);for(let i of o){let a=i&&typeof i[e]=="function"?i[e]:null;if(!a)continue;let s=await a(t,n);typeof s<"u"&&(n=s)}return n}async function Uc(e,t,r){let n=[],o=oi(t);for(let i of o){let a=i&&typeof i[e]=="function"?i[e]:null;if(!a)continue;let s=await a(t,r);typeof s<"u"&&n.push(s)}return n}function Hc(e){let t=[];if(Array.isArray(e))for(let r of e){let n=ni(r);if(!n||!n.name)continue;let o=t.findIndex(i=>i&&i.name===n.name);o>=0&&t.splice(o,1),t.push(n)}for(let r of vt)r&&r.name&&!t.some(n=>n.name===r.name)&&t.push(r);return Object.freeze(t)}function Vc(e,t,r=!1){return!e||e.plugins&&!r||(e.plugins=Hc(t)),e}Se();function Gc(e,t,r={}){if(!e||!t||!t.style)return;let n=getComputedStyle(e);try{t.style.boxShadow="none"}catch(i){q(r,"stripRootShadows boxShadow",i)}try{t.style.textShadow="none"}catch(i){q(r,"stripRootShadows textShadow",i)}try{t.style.outline="none"}catch(i){q(r,"stripRootShadows outline",i)}let o=(n.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=o.length?o:"none"}catch(i){q(r,"stripRootShadows filter",i)}}function zc(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),r=[];for(;t.nextNode();)r.push(t.currentNode);for(let n of r)n.remove()}function Yc(e,t={}){let{stripFrameworkDirectives:r=!0}=t,n=new Set(["xml","xlink"]),o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;o.nextNode();){let i=o.currentNode;for(let a of Array.from(i.attributes)){let s=a.name;if(s.includes("@")){i.removeAttribute(s);continue}if(s.includes(":")){let c=s.split(":",1)[0];if(!n.has(c)){i.removeAttribute(s);continue}}if(r&&(s.startsWith("x-")||s.startsWith("v-")||s.startsWith(":")||s.startsWith("on:")||s.startsWith("bind:")||s.startsWith("let:")||s.startsWith("class:"))){i.removeAttribute(s);continue}}}}function qc(e,t={}){e&&(Yc(e,t),zc(e))}function jc(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function Zc(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function Xc(e,t){if(!(e instanceof Element)||jc(e)||Zc(e))return!1;let r=t.position;if(r==="absolute"||r==="fixed"||r==="sticky")return!1;let n=t.display||"";return!(n.includes("flex")||n.includes("grid")||n.startsWith("table")||t.transform&&t.transform!=="none")}function Kc(e,t,r=new Map){function n(o,i){if(!(o instanceof Element)||!(i instanceof Element))return;let a=o.childElementCount>i.childElementCount,s=r.get(o)||getComputedStyle(o);if(r.has(o)||r.set(o,s),a&&Xc(o,s)){i.style.height||(i.style.height="auto"),i.style.width||(i.style.width="auto"),i.style.removeProperty("block-size"),i.style.removeProperty("inline-size"),i.style.minHeight||(i.style.minHeight="0"),i.style.minWidth||(i.style.minWidth="0"),i.style.maxHeight||(i.style.maxHeight="none"),i.style.maxWidth||(i.style.maxWidth="none");let u=s.overflowY||s.overflowBlock||"visible",d=s.overflowX||s.overflowInline||"visible";(u!=="visible"||d!=="visible")&&(i.style.overflow="visible")}let c=Array.from(o.children),l=Array.from(i.children);for(let u=0;u<Math.min(c.length,l.length);u++)n(c[u],l[u])}n(e,t)}function Jc(e){let t=getComputedStyle(e);return!(t.display==="none"||t.position==="absolute"||t.position==="fixed")}function Qc(e,t){if(!(e instanceof Element))return!1;if(e.getAttribute("data-capture")==="exclude"&&t?.excludeMode==="remove")return!0;if(Array.isArray(t?.exclude))for(let r of t.exclude)try{if(e.matches(r))return t.excludeMode==="remove"}catch(n){q(t,"exclude selector match failed",n)}return!1}function eu(e,t){let r=getComputedStyle(e),n=e.getBoundingClientRect(),o=1/0,i=-1/0,a=!1,s=Array.from(e.children);for(let m of s){if(Qc(m,t)||!Jc(m))continue;let p=m.getBoundingClientRect(),g=p.top-n.top,h=p.bottom-n.top;h<=g||(g<o&&(o=g),h>i&&(i=h),a=!0)}let c=a?Math.max(0,i-o):0,l=parseFloat(r.borderTopWidth)||0,u=parseFloat(r.borderBottomWidth)||0,d=parseFloat(r.paddingTop)||0,f=parseFloat(r.paddingBottom)||0;return l+u+d+f+c}var L=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e,tu=/::-webkit-scrollbar(-[a-z]+)?\b/i;function Jr(e,t=new Set){let r="";if(!e)return r;for(let n=0;n<e.length;n++){let o=e[n];try{if(o.type===CSSRule.IMPORT_RULE&&o.styleSheet){r+=Jr(o.styleSheet.cssRules,t);continue}if(o.type===CSSRule.MEDIA_RULE&&o.cssRules){let i=Jr(o.cssRules,t);i&&(r+=`@media ${o.conditionText}{${i}}`);continue}if(o.type===CSSRule.STYLE_RULE){let i=o.selectorText||"";if(tu.test(i)){let a=o.cssText;a&&!t.has(a)&&(t.add(a),r+=a)}}}catch{}}return r}function ru(e){if(!e||!e.styleSheets)return"";let t=new Set,r="";for(let n of Array.from(e.styleSheets))try{let o=n.cssRules;o&&(r+=Jr(o,t))}catch{}return r}function nu(e){let t=e.boxShadow||"";if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let r=t.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(s=>s.trim()),n=0,o=0,i=0,a=0;for(let s of r){let c=s.match(/-?\d+(\.\d+)?px/g)?.map(g=>parseFloat(g))||[];if(c.length<2)continue;let[l,u,d=0,f=0]=c,m=Math.abs(l)+d+f,p=Math.abs(u)+d+f;o=Math.max(o,m+Math.max(l,0)),a=Math.max(a,m+Math.max(-l,0)),i=Math.max(i,p+Math.max(u,0)),n=Math.max(n,p+Math.max(-u,0))}return{top:Math.ceil(n),right:Math.ceil(o),bottom:Math.ceil(i),left:Math.ceil(a)}}function ou(e){let t=(e.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),r=t?Math.ceil(parseFloat(t[1])||0):0;return{top:r,right:r,bottom:r,left:r}}function iu(e){if((e.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0),r=parseFloat(e.outlineOffset||"0")||0,n=t+Math.max(0,Math.ceil(r));return{top:n,right:n,bottom:n,left:n}}function au(e){let t=`${e.filter||""} ${e.webkitFilter||""}`.trim();if(!t||t==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let r=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],n=0,o=0,i=0,a=0,s=!1;for(let c of r){s=!0;let l=c.match(/-?\d+(?:\.\d+)?px/gi)?.map(g=>parseFloat(g))||[],[u=0,d=0,f=0]=l,m=Math.abs(u)+f,p=Math.abs(d)+f;o=Math.max(o,m+Math.max(u,0)),a=Math.max(a,m+Math.max(-u,0)),i=Math.max(i,p+Math.max(d,0)),n=Math.max(n,p+Math.max(-d,0))}return{bleed:{top:L(n),right:L(o),bottom:L(i),left:L(a)},has:s}}function su(e,t){if(!e||!t||!t.style)return null;let r=getComputedStyle(e);try{t.style.transformOrigin="0 0"}catch{}try{"translate"in t.style&&(t.style.translate="none"),"rotate"in t.style&&(t.style.rotate="none")}catch{}let n=r.transform||"none";if(!n||n==="none")try{let s=ii(e);if(s.a===1&&s.b===0&&s.c===0&&s.d===1)return t.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}function o(s,c,l,u){let d=Math.sqrt(s*s+c*c)||0,f=0,m=0;if(d>0){let p=s/d,g=c/d;f=p*l+g*u;let h=l-p*f,y=u-g*f;m=Math.sqrt(h*h+y*y)||0,m>0?f=f/m:f=0}return{a:d,b:0,c:f*m,d:m}}let i=n.match(/^matrix\(\s*([^)]+)\)$/i);if(i){let s=i[1].split(",").map(c=>parseFloat(c.trim()));if(s.length===6&&s.every(Number.isFinite)){let[c,l,u,d]=s,f=o(c,l,u,d);try{t.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return f}}let a=n.match(/^matrix3d\(\s*([^)]+)\)$/i);if(a){let s=a[1].split(",").map(c=>parseFloat(c.trim()));if(s.length===16&&s.every(Number.isFinite)){let c=s[0],l=s[1],u=s[4],d=s[5],f=o(c,l,u,d);try{t.style.transform=`matrix(${f.a}, ${f.b}, ${f.c}, ${f.d}, 0, 0)`}catch{}return f}}try{let s=new DOMMatrix(n),c=o(s.a,s.b,s.c,s.d);try{t.style.transform=`matrix(${c.a}, ${c.b}, ${c.c}, ${c.d}, 0, 0)`}catch{}return c}catch{return null}}function To(e,t,r,n,o){let i=r.a,a=r.b,s=r.c,c=r.d,l=r.e||0,u=r.f||0;function d(y,v){let w=y-n,b=v-o,S=i*w+s*b,I=a*w+c*b;return S+=n+l,I+=o+u,[S,I]}let f=[d(0,0),d(e,0),d(0,t),d(e,t)],m=1/0,p=1/0,g=-1/0,h=-1/0;for(let[y,v]of f)y<m&&(m=y),v<p&&(p=v),y>g&&(g=y),v>h&&(h=v);return{minX:m,minY:p,maxX:g,maxY:h,width:g-m,height:h-p}}function lu(e,t,r){let n=(e.transformOrigin||"0 0").trim().split(/\s+/),[o,i]=[n[0]||"0",n[1]||"0"],a=(s,c)=>{let l=s.toLowerCase();return l==="left"||l==="top"?0:l==="center"?c/2:l==="right"||l==="bottom"?c:l.endsWith("px")?parseFloat(l)||0:l.endsWith("%")?(parseFloat(l)||0)*c/100:/^-?\d+(\.\d+)?$/.test(l)&&parseFloat(l)||0};return{ox:a(o,t),oy:a(i,r)}}function cu(e){let t={rotate:"0deg",scale:null,translate:null},r=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(r){let o=c=>{try{return typeof r.has=="function"&&!r.has(c)||typeof r.get!="function"?null:r.get(c)}catch{return null}},i=o("rotate");if(i)if(i.angle){let c=i.angle;t.rotate=c.unit==="rad"?c.value*180/Math.PI+"deg":c.value+c.unit}else i.unit?t.rotate=i.unit==="rad"?i.value*180/Math.PI+"deg":i.value+i.unit:t.rotate=String(i);else{let c=getComputedStyle(e);t.rotate=c.rotate&&c.rotate!=="none"?c.rotate:"0deg"}let a=o("scale");if(a){let c="x"in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1,l="y"in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:c;t.scale=`${c} ${l}`}else{let c=getComputedStyle(e);t.scale=c.scale&&c.scale!=="none"?c.scale:null}let s=o("translate");if(s){let c="x"in s&&"value"in s.x?s.x.value:Array.isArray(s)?s[0]?.value:0,l="y"in s&&"value"in s.y?s.y.value:Array.isArray(s)?s[1]?.value:0,u="x"in s&&s.x?.unit?s.x.unit:"px",d="y"in s&&s.y?.unit?s.y.unit:"px";t.translate=`${c}${u} ${l}${d}`}else{let c=getComputedStyle(e);t.translate=c.translate&&c.translate!=="none"?c.translate:null}return t}let n=getComputedStyle(e);return t.rotate=n.rotate&&n.rotate!=="none"?n.rotate:"0deg",t.scale=n.scale&&n.scale!=="none"?n.scale:null,t.translate=n.translate&&n.translate!=="none"?n.translate:null,t}var Br=null;function uu(){if(Br)return Br;let e=document.createElement("div");return e.id="snapdom-measure-slot",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(e),Br=e,e}function du(e){let t=uu(),r=document.createElement("div");r.style.transformOrigin="0 0",e.baseTransform&&(r.style.transform=e.baseTransform),e.rotate&&(r.style.rotate=e.rotate),e.scale&&(r.style.scale=e.scale),e.translate&&(r.style.translate=e.translate),t.appendChild(r);let n=ii(r);return t.removeChild(r),n}function fu(e){let t=getComputedStyle(e),r=t.transform||"none";if(r!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(r))return!0;let n=t.rotate&&t.rotate!=="none"&&t.rotate!=="0deg",o=t.scale&&t.scale!=="none"&&t.scale!=="1",i=t.translate&&t.translate!=="none"&&t.translate!=="0px 0px";return!!(n||o||i)}function ii(e){let t=getComputedStyle(e).transform;if(!t||t==="none")return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}async function ai(e,t){if(!e)throw new Error("Element cannot be null or undefined");_s(t.cache);let r=t.fast,n=t.outerTransforms!==!1,o=!!t.outerShadows,i={element:e,options:t,plugins:t.plugins},a,s,c,l="",u="",d,f,m=null;await Fe("beforeSnap",i),await Fe("beforeClone",i);let p=_c(i.element);try{({clone:a,classCSS:s,styleCache:c}=await Tc(i.element,i.options)),!n&&a&&(m=su(i.element,a)),!o&&a&&Gc(i.element,a,i.options)}finally{p()}if(i={clone:a,classCSS:s,styleCache:c,...i},await Fe("afterClone",i),qc(i.clone),i.options?.excludeMode==="remove")try{Kc(i.element,i.clone,i.styleCache)}catch(w){console.warn("[snapdom] shrink pass failed:",w)}try{await Xl(i.clone,i.element)}catch{}await new Promise(w=>{tt(async()=>{await Rc(i.clone,i.options),w()},{fast:r})}),await new Promise(w=>{tt(async()=>{await Fc(i.element,i.clone,i.styleCache,i.options),w()},{fast:r})}),t.embedFonts&&await new Promise(w=>{tt(async()=>{let b=Qo(i.element),S=mc(i.element);if(Ue()){let I=new Set(Array.from(b).map(C=>String(C).split("__")[0]).filter(Boolean));await ei(I,1)}l=await fc({required:b,usedCodepoints:S,preCached:!1,exclude:i.options.excludeFonts,useProxy:i.options.useProxy,fontStylesheetDomains:i.options.fontStylesheetDomains}),w()},{fast:r})});let g=zs(i.clone).sort(),h=g.join(",");E.baseStyle.has(h)?u=E.baseStyle.get(h):await new Promise(w=>{tt(()=>{u=Ys(g),E.baseStyle.set(h,u),w()},{fast:r})});let y=ru(i.element?.ownerDocument||document);i={fontsCSS:l,baseCSS:u,scrollbarCSS:y,...i},await Fe("beforeRender",i),await new Promise(w=>{tt(()=>{let b=Ne(i.element),S=i.element.getBoundingClientRect(),I=Math.max(1,L(i.element.offsetWidth||parseFloat(b.width)||S.width||1)),C=Math.max(1,L(i.element.offsetHeight||parseFloat(b.height)||S.height||1)),x=i.element.ownerDocument||document;if(i.element===x.body||i.element===x.documentElement){let ue=Math.max(i.element.scrollHeight||0,x.documentElement?.scrollHeight||0,x.body?.scrollHeight||0),de=Math.max(i.element.scrollWidth||0,x.documentElement?.scrollWidth||0,x.body?.scrollWidth||0);ue>0&&(C=Math.max(C,L(ue))),de>0&&(I=Math.max(I,L(de)));try{let Ie=(i.scrollbarCSS||"").length+(i.baseCSS||"").length+(i.fontsCSS||"").length+(i.classCSS||"").length,Ae=E.measureHints.get(i.element);if(Ae&&Ae.cssLen===Ie&&Ae.w0===I)Ae.csh>0&&(C=Math.max(C,L(Ae.csh))),Ae.csw>0&&(I=Math.max(I,L(Ae.csw)));else{let Ee=x.createElement("div");Ee.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;width:"+I+"px!important;overflow:visible!important;visibility:hidden!important;";let _t=x.createElement("style");_t.textContent=(i.scrollbarCSS||"")+i.baseCSS+i.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+i.classCSS,Ee.appendChild(_t),Ee.appendChild(i.clone.cloneNode(!0)),x.body.appendChild(Ee);let Re=Ee.scrollHeight,kr=Ee.scrollWidth;x.body.removeChild(Ee),E.measureHints.set(i.element,{cssLen:Ie,w0:I,csh:Re,csw:kr}),Re>0&&(C=Math.max(C,L(Re))),kr>0&&(I=Math.max(I,L(kr)))}}catch{}}if(i.options?.excludeMode==="remove"){let ue=eu(i.element,i.options);Number.isFinite(ue)&&ue>0&&(C=Math.max(1,Math.min(C,L(ue+1))))}let N=(ue,de=NaN)=>{let Ie=typeof ue=="string"?parseFloat(ue):ue;return Number.isFinite(Ie)?Ie:de},B=N(i.options.width),$=N(i.options.height),M=I,k=C,O=Number.isFinite(B),V=Number.isFinite($),K=C>0?I/C:1;O&&V?(M=Math.max(1,L(B)),k=Math.max(1,L($))):O?(M=Math.max(1,L(B)),k=Math.max(1,L(M/(K||1)))):V?(k=Math.max(1,L($)),M=Math.max(1,L(k*(K||1)))):(M=I,k=C);let R=0,F=0,D=I,_=C;if(!n&&m&&Number.isFinite(m.a)){let ue={a:m.a,b:m.b||0,c:m.c||0,d:m.d||1,e:0,f:0},de=To(I,C,ue,0,0);R=L(de.minX),F=L(de.minY),D=L(de.maxX),_=L(de.maxY)}else if(n&&No(i.element)){let ue=b.transform&&b.transform!=="none"?b.transform:"",de=cu(i.element),Ie=du({baseTransform:ue,rotate:de.rotate||"0deg",scale:de.scale,translate:de.translate}),{ox:Ae,oy:Ee}=lu(b,I,C),_t=Ie.is2D?Ie:new DOMMatrix(Ie.toString()),Re=To(I,C,_t,Ae,Ee);R=L(Re.minX),F=L(Re.minY),D=L(Re.maxX),_=L(Re.maxY)}let ee=nu(b),P=ou(b),z=iu(b),X=au(b),ne=o?{top:L(ee.top+P.top+z.top+X.bleed.top),right:L(ee.right+P.right+z.right+X.bleed.right),bottom:L(ee.bottom+P.bottom+z.bottom+X.bleed.bottom),left:L(ee.left+P.left+z.left+X.bleed.left)}:{top:0,right:0,bottom:0,left:0};R=L(R-ne.left),F=L(F-ne.top),D=L(D+ne.right),_=L(_+ne.bottom);let T=Math.max(1,L(D-R)),G=Math.max(1,L(_-F)),J=O||V?L(M/I):1,Y=V||O?L(k/C):1,ce=Math.max(1,L(T*J)),H=Math.max(1,L(G*Y)),se="http://www.w3.org/2000/svg",De=Ue()&&No(i.element)?1:0,Q=L(De+(n?0:1)),me=document.createElementNS(se,"foreignObject"),es=L(R),ts=L(F);me.setAttribute("x",String(L(-(es-Q)))),me.setAttribute("y",String(L(-(ts-Q)))),me.setAttribute("width",String(L(I+Q*2))),me.setAttribute("height",String(L(C+Q*2))),me.style.overflow="visible";let $n=document.createElement("style"),rs='svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject *{min-width:0;} foreignObject pre,foreignObject [style*="white-space"]{white-space:inherit;}';$n.textContent=(i.scrollbarCSS||"")+i.baseCSS+i.fontsCSS+rs+i.classCSS,me.appendChild($n);let Ft=document.createElement("div");Ft.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),Ft.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${L(I)}px;height:${L(C)}px`,Ft.appendChild(i.clone),me.appendChild(Ft);let ns=new XMLSerializer().serializeToString(me),Ar=L(T+Q*2),Er=L(G+Q*2),Pn=O||V;t.meta={w0:I,h0:C,vbW:Ar,vbH:Er,targetW:M,targetH:k};let os=Ue()&&Pn?Ar:L(ce+Q*2),is=Ue()&&Pn?Er:L(H+Q*2),as=parseFloat(Ne(x.documentElement)?.fontSize)||16;f=`<svg xmlns="${se}" width="${os}" height="${is}" viewBox="0 0 ${Ar} ${Er}" font-size="${as}px">`+ns+"</svg>",d=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(f)}`,i={svgString:f,dataURL:d,...i},w()},{fast:r})}),await Fe("afterRender",i);let v=document.getElementById("snapdom-sandbox");return v&&v.style.position==="absolute"&&v.remove(),i.dataURL}function No(e){return fu(e)}be();function mu(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let r=Fs(e.cache);return{debug:e.debug??!1,fast:e.fast??!0,scale:e.scale??1,exclude:e.exclude??[],excludeMode:e.excludeMode??"hide",filter:e.filter??null,filterMode:e.filterMode??"hide",placeholders:e.placeholders!==!1,embedFonts:e.embedFonts??!1,iconFonts:Array.isArray(e.iconFonts)?e.iconFonts:e.iconFonts?[e.iconFonts]:[],localFonts:Array.isArray(e.localFonts)?e.localFonts:[],excludeFonts:e.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(e.fontStylesheetDomains)?e.fontStylesheetDomains:[],fallbackURL:e.fallbackURL??void 0,cache:r,useProxy:typeof e.useProxy=="string"?e.useProxy:"",width:e.width??null,height:e.height??null,format:t,type:e.type??"svg",quality:e.quality??.92,dpr:e.dpr??(window.devicePixelRatio||1),backgroundColor:e.backgroundColor??(["jpeg","webp"].includes(t)?"#ffffff":null),filename:e.filename??"snapDOM",outerTransforms:e.outerTransforms??!0,outerShadows:e.outerShadows??!1,safariWarmupAttempts:Math.min(3,Math.max(1,(e.safariWarmupAttempts??3)|0)),excludeStyleProps:e.excludeStyleProps??null}}St();Po();Se();nt();be();function pu(...e){return Bc(...e),j}var j=Object.assign(gu,{plugins:pu}),si=Symbol("snapdom.internal"),hu=Symbol("snapdom.internal.silent"),Lo=!1;async function gu(e,t){if(!e)throw new Error("Element cannot be null or undefined");let r=mu(t);if(Vc(r,t&&t.plugins),Ue()&&(r.embedFonts===!0||bu(e))){if(r.embedFonts)try{let o=Qo(e),i=new Set([...o].map(a=>String(a).split("__")[0]).filter(Boolean));await ei(i,1)}catch{}let n=r.safariWarmupAttempts??3;for(let o=0;o<n;o++)try{await yu(e,t)}catch{}}return r.iconFonts&&r.iconFonts.length>0&&Vl(r.iconFonts),r.snap||(r.snap={toPng:(n,o)=>j.toPng(n,o),toSvg:(n,o)=>j.toSvg(n,o)}),j.capture(e,r,si)}j.capture=async(e,t,r)=>{if(r!==si)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let n=await ai(e,t),o={img:async(g,h)=>{let{toImg:y}=await Promise.resolve().then(()=>(uo(),Gr));return y(n,{...g,...h||{}})},svg:async(g,h)=>{let{toSvg:y}=await Promise.resolve().then(()=>(uo(),Gr));return y(n,{...g,...h||{}})},canvas:async(g,h)=>{let{toCanvas:y}=await Promise.resolve().then(()=>(qt(),Wo));return y(n,{...g,...h||{}})},blob:async(g,h)=>{let{toBlob:y}=await Promise.resolve().then(()=>(Go(),Ho));return y(n,{...g,...h||{}})},png:async(g,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Wt(),Pt));return y(n,{...g,...h||{},format:"png"})},jpeg:async(g,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Wt(),Pt));return y(n,{...g,...h||{},format:"jpeg"})},webp:async(g,h)=>{let{rasterize:y}=await Promise.resolve().then(()=>(Wt(),Pt));return y(n,{...g,...h||{},format:"webp"})},download:async(g,h)=>{let{download:y}=await Promise.resolve().then(()=>(sl(),zo));return y(n,{...g,...h||{}})}},i={};for(let g of["img","svg","canvas","blob","png","jpeg","webp"])i[g]=async h=>o[g](t,{...h||{},[hu]:!0});i.jpg=i.jpeg;let a={...t,export:{url:n},exports:i},s=await Uc("defineExports",a),c=Object.assign({},...s.filter(g=>g&&typeof g=="object")),l={...o,...c};l.jpeg&&!l.jpg&&(l.jpg=(g,h)=>l.jpeg(g,h));function u(g,h){let y={...t,...h||{}};return(g==="jpeg"||g==="jpg")&&(y.backgroundColor==null||y.backgroundColor==="transparent")&&(y.backgroundColor="#ffffff"),y}let d=!1,f=Promise.resolve();async function m(g,h){let y=async()=>{let v=l[g];if(!v)throw new Error(`[snapdom] Unknown export type: ${g}`);let w=u(g,h),b={...t,export:{type:g,options:w,url:n}};await Fe("beforeExport",b);let S=await v(b,w);return await Fe("afterExport",b,S),d||(d=!0,await Fe("afterSnap",t)),S};return f=f.then(y)}let p={url:n,toRaw:()=>n,to:(g,h)=>m(g,h),toImg:g=>m("img",g),toSvg:g=>m("svg",g),toCanvas:g=>m("canvas",g),toBlob:g=>m("blob",g),toPng:g=>m("png",g),toJpg:g=>m("jpg",g),toWebp:g=>m("webp",g),download:g=>m("download",g)};for(let g of Object.keys(l)){let h="to"+g.charAt(0).toUpperCase()+g.slice(1);p[h]||(p[h]=y=>m(g,y))}return p};j.toRaw=(e,t)=>j(e,t).then(r=>r.toRaw());j.toImg=(e,t)=>j(e,t).then(r=>r.toImg());j.toSvg=(e,t)=>j(e,t).then(r=>r.toSvg());j.toCanvas=(e,t)=>j(e,t).then(r=>r.toCanvas());j.toBlob=(e,t)=>j(e,t).then(r=>r.toBlob());j.toPng=(e,t)=>j(e,{...t,format:"png"}).then(r=>r.toPng());j.toJpg=(e,t)=>j(e,{...t,format:"jpeg"}).then(r=>r.toJpg());j.toWebp=(e,t)=>j(e,{...t,format:"webp"}).then(r=>r.toWebp());j.download=(e,t)=>j(e,t).then(r=>r.download());async function yu(e,t){if(Lo)return;let r={...t,fast:!0,embedFonts:!0,scale:.2},n;try{n=await ai(e,r)}catch(o){q(t,"safariWarmup pre-capture failed",o)}await new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(o))),n&&await new Promise(o=>{let i=new Image;try{i.decoding="sync",i.loading="eager"}catch(a){q(t,"safariWarmup img hints failed",a)}i.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",i.src=n,document.body.appendChild(i),(async()=>{try{typeof i.decode=="function"&&await i.decode()}catch(s){q(t,"safariWarmup img.decode failed",s)}let a=performance.now();for(;!(i.complete&&i.naturalWidth>0)&&performance.now()-a<900;)await new Promise(s=>setTimeout(s,200));await new Promise(s=>requestAnimationFrame(s));try{let s=document.createElement("canvas");s.width=Math.max(1,i.naturalWidth||10),s.height=Math.max(1,i.naturalHeight||10);let c=s.getContext("2d");c&&c.drawImage(i,0,0)}catch{}await new Promise(s=>requestAnimationFrame(s));try{i.remove()}catch(s){q(t,"safariWarmup img.remove failed",s)}o()})()}),e.querySelectorAll("canvas").forEach(o=>{try{let i=o.getContext("2d",{willReadFrequently:!0});i&&i.getImageData(0,0,1,1)}catch(i){q(t,"safariWarmup canvas poke failed",i)}}),Lo=!0}function bu(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;t.nextNode();){let r=t.currentNode,n=getComputedStyle(r),o=n.backgroundImage&&n.backgroundImage!=="none",i=n.maskImage&&n.maskImage!=="none"||n.webkitMaskImage&&n.webkitMaskImage!=="none";if(o||i||r.tagName==="CANVAS")return!0}return!1}function li(e){if(e.dataset.fontProxied||!e.rel||!e.rel.includes("stylesheet"))return!1;let t=e.href||"";try{return new URL(t).origin!==window.location.origin}catch{return!1}}function ci(e){let t=`/__mindstudio_dev__/font-proxy?url=${encodeURIComponent(e.href)}`,r=document.createElement("link");r.rel="stylesheet",r.href=t,r.dataset.fontProxied="true",e.media&&(r.media=e.media),r.onload=()=>{e.remove()},r.onerror=()=>{r.remove()},e.parentNode?.insertBefore(r,e.nextSibling)}function ui(){let e=document.querySelectorAll('link[rel~="stylesheet"]');for(let t of e)li(t)&&ci(t)}function wu(){let e=A().fonts;e.observer||(e.observer=new MutationObserver(t=>{for(let r of t)for(let n of r.addedNodes)n instanceof HTMLLinkElement&&li(n)&&ci(n)}),e.observer.observe(document.documentElement,{childList:!0,subtree:!0}))}function vu(e){try{let t=new URL(e,window.location.origin);return t.origin===window.location.origin?!1:!!(/\.(css|woff2?|ttf|otf|eot)(\?|$)/i.test(t.pathname)||t.pathname.includes("/css"))}catch{return!1}}function Cu(){if(window.fetch.__ms_font_proxied)return;let e=window.fetch;window.fetch=function(t,r){let n=typeof t=="string"?t:t instanceof URL?t.href:t.url||String(t);if(vu(n)){let o=`/__mindstudio_dev__/font-proxy?url=${encodeURIComponent(n)}`;return e.apply(this,[o,r])}return e.apply(this,[t,r])},window.fetch.__ms_font_proxied=!0}function di(){let e=A().fonts;e.initialized||(e.initialized=!0,Cu(),ui(),wu())}async function fi(){ui();try{await document.fonts.ready}catch{}}var mi="__mindstudio-touch-circle",on="__mindstudio-touch-style",pi=44,hi=5,gi=.95,jt=.5,an=.45,yi=600;function Su(){document.getElementById(mi)?.remove();let e=document.createElement("div");return e.id=mi,e.style.cssText=["position: fixed","z-index: 2147483647","pointer-events: none",`width: ${pi}px`,`height: ${pi}px`,"border-radius: 50%","background: rgba(255, 255, 255, 0.08)","border: 2px solid rgba(255, 255, 255, 0.85)","box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 0 0 0.5px rgba(0, 0, 0, 0.1)","backdrop-filter: blur(1px)","-webkit-backdrop-filter: blur(1.5px)","transform: translate(-50%, -50%) scale(1)","transition: transform 100ms ease, opacity 100ms ease, background 100ms ease","opacity: 0","will-change: left, top, transform, opacity"].join("; "),document.documentElement.appendChild(e),e}function xu(e){e.style.transform="translate(-50%, -50%) scale(0.88)",e.style.background="rgba(255, 255, 255, 0.18)"}function bi(e){e.style.transform="translate(-50%, -50%) scale(1)",e.style.background="rgba(255, 255, 255, 0.08)"}function wi(){window.location.search.includes("mode=iframe")&&A().zoom.mobilePreview&&xt()}function xt(){let e=A().touch;if(e.active)return;e.active=!0,e.scrollContainer=We(),ku();let t=Su();e.circleEl=t,e.onMouseMove=r=>{let n=A();if(n.cursor.executing||n.screenshot.capturing){t.style.opacity="0";return}if(t.style.left=`${r.clientX}px`,t.style.top=`${r.clientY}px`,t.style.opacity="1",e.pressed){let o=Math.abs(r.clientX-e.startX),i=Math.abs(r.clientY-e.startY);if(!e.dragging&&(o>hi||i>hi)&&(e.dragging=!0),e.dragging){let a=e.scrollContainer||document.documentElement,s=performance.now(),c=s-e.lastMoveTime||16,l=e.lastX-r.clientX,u=e.lastY-r.clientY;e.bouncing&&Eu();let d=a.scrollTop;a.scrollTop+=u,a.scrollLeft+=l;let m=a.scrollTop-d,p=u-m;if(Math.abs(p)>.5){let g=an/(1+Math.abs(e.overscrollY)/200);e.overscrollY+=p*g,sn()}else if(e.overscrollY!==0){let g=an/(1+Math.abs(e.overscrollY)/200);e.overscrollY+=p*g,(e.overscrollY>0&&u<0||e.overscrollY<0&&u>0)&&(e.overscrollY*=.7),sn()}e.velocityX=.8*(l/c)+.2*e.velocityX,e.velocityY=.8*(u/c)+.2*e.velocityY,e.lastMoveTime=s,r.preventDefault()}e.lastX=r.clientX,e.lastY=r.clientY}},e.onMouseDown=r=>{A().cursor.executing||(Zt(),e.pressed=!0,e.dragging=!1,e.startX=r.clientX,e.startY=r.clientY,e.lastX=r.clientX,e.lastY=r.clientY,e.velocityX=0,e.velocityY=0,e.lastMoveTime=performance.now(),xu(t))},e.onMouseUp=()=>{let r=e.dragging;r&&document.addEventListener("click",Iu,{capture:!0,once:!0}),e.pressed=!1,e.dragging=!1,bi(t),r&&(e.overscrollY!==0&&Si(),(Math.abs(e.velocityX)>jt/16||Math.abs(e.velocityY)>jt/16)&&Au())},e.onMouseLeave=()=>{e.pressed=!1,e.dragging=!1,Zt(),t.style.opacity="0",bi(t)},e.onDragStart=r=>r.preventDefault(),document.addEventListener("mousemove",e.onMouseMove),document.addEventListener("mousedown",e.onMouseDown),document.addEventListener("mouseup",e.onMouseUp),document.addEventListener("mouseleave",e.onMouseLeave),document.addEventListener("dragstart",e.onDragStart)}function Xt(){let e=A().touch;e.active&&(e.active=!1,e.pressed=!1,e.dragging=!1,Zt(),e.overscrollY!==0&&(e.overscrollY=0,document.body.style.transition="",document.body.style.transform=""),Mu(),e.circleEl&&(e.circleEl.remove(),e.circleEl=null),e.onMouseMove&&document.removeEventListener("mousemove",e.onMouseMove),e.onMouseDown&&document.removeEventListener("mousedown",e.onMouseDown),e.onMouseUp&&document.removeEventListener("mouseup",e.onMouseUp),e.onMouseLeave&&document.removeEventListener("mouseleave",e.onMouseLeave),e.onDragStart&&document.removeEventListener("dragstart",e.onDragStart),e.onMouseMove=null,e.onMouseDown=null,e.onMouseUp=null,e.onMouseLeave=null,e.onDragStart=null)}function vi(){let{circleEl:e}=A().touch;e&&(e.style.opacity="0")}function Ci(){let e=A().touch;e.active&&e.circleEl&&(e.circleEl.style.opacity="1")}function Iu(e){e.preventDefault(),e.stopPropagation()}function Au(){Zt();let e=A().touch,t=e.scrollContainer||document.documentElement,r=e.velocityX*16,n=e.velocityY*16;function o(){let i=A().touch;if(r*=gi,n*=gi,Math.abs(r)<jt&&Math.abs(n)<jt){i.momentumFrame=null,i.overscrollY!==0&&Si();return}let a=t.scrollTop;t.scrollTop+=n,t.scrollLeft+=r;let s=t.scrollTop-a,c=n-s;if(Math.abs(c)>.5){let l=an*.5/(1+Math.abs(i.overscrollY)/200);i.overscrollY+=c*l,sn(),n*=.7}i.momentumFrame=requestAnimationFrame(o)}e.momentumFrame=requestAnimationFrame(o)}function Zt(){let e=A().touch;e.momentumFrame!==null&&(cancelAnimationFrame(e.momentumFrame),e.momentumFrame=null)}function sn(){let e=A().touch;document.body.style.transition="none",document.body.style.transform=`translateY(${-e.overscrollY}px)`}function Si(){let e=A().touch;e.bouncing=!0,e.overscrollY=0,document.body.style.transition=`transform ${yi}ms cubic-bezier(0.2, 0.9, 0.3, 1)`,document.body.style.transform="",e.bounceTimer&&clearTimeout(e.bounceTimer),e.bounceTimer=setTimeout(()=>{let t=A().touch;t.bouncing=!1,t.bounceTimer=null,document.body.style.transition="",document.body.style.transform=""},yi)}function Eu(){let e=A().touch;e.bouncing&&(e.bouncing=!1,e.bounceTimer&&(clearTimeout(e.bounceTimer),e.bounceTimer=null),document.body.style.transition="")}function ku(){document.getElementById(on)?.remove();let e=document.createElement("style");e.id=on,e.textContent=`
10
10
  *, *::before, *::after {
11
11
  cursor: none !important;
12
12
  user-select: none !important;
13
13
  -webkit-user-select: none !important;
14
14
  -webkit-user-drag: none !important;
15
15
  }
16
- `,document.head.appendChild(e)}function Mu(){document.getElementById(an)?.remove()}var xi="__mindstudio-cursor",Tu="__mindstudio-cursor-ripple",Ii=.07,Nu=250,Jt=300,Lu=2e3,Kt=10,Ai=1,ki="Remy",it="#DD2590",cn=44,Ru=`<svg width="40" height="41" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg">
16
+ `,document.head.appendChild(e)}function Mu(){document.getElementById(on)?.remove()}var xi="__mindstudio-cursor",Tu="__mindstudio-cursor-ripple",Ii=.07,Nu=250,cn=300,Lu=2e3,Kt=10,Ai=1,ki="Remy",ot="#DD2590",ln=44,Ru=`<svg width="40" height="41" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg">
17
17
  <g filter="url(#filter0_d_4_78)">
18
- <path d="M12.5448 26L6.72762 5.59339L26 14.8132L17.1816 17.9377L12.5448 26Z" fill="${it}"/>
19
- <path d="M6.9457 5.14539L26.2178 14.3651L27.2985 14.8826L26.1697 15.2813L17.5259 18.3444L12.9812 26.2464L12.3881 27.2792L12.0614 26.1349L6.24434 5.72851L5.94119 4.66488L6.9457 5.14539Z" stroke="${it}"/>
18
+ <path d="M12.5448 26L6.72762 5.59339L26 14.8132L17.1816 17.9377L12.5448 26Z" fill="${ot}"/>
19
+ <path d="M6.9457 5.14539L26.2178 14.3651L27.2985 14.8826L26.1697 15.2813L17.5259 18.3444L12.9812 26.2464L12.3881 27.2792L12.0614 26.1349L6.24434 5.72851L5.94119 4.66488L6.9457 5.14539Z" stroke="${ot}"/>
20
20
  </g>
21
21
  <defs>
22
22
  <filter id="filter0_d_4_78" x="3.15491" y="2.73625" width="27.442" height="28.8217" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
@@ -36,7 +36,7 @@ ${g}
36
36
  position: absolute;
37
37
  left: 33px;
38
38
  top: 23px;
39
- background: ${it};
39
+ background: ${ot};
40
40
  color: white;
41
41
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
42
42
  font-size: 12px;
@@ -50,10 +50,10 @@ ${g}
50
50
  ">${ki}</div>
51
51
  `,Ti=`
52
52
  <div style="
53
- width: ${cn}px;
54
- height: ${cn}px;
53
+ width: ${ln}px;
54
+ height: ${ln}px;
55
55
  border-radius: 50%;
56
- border: 2px solid ${it};
56
+ border: 2px solid ${ot};
57
57
  background: rgba(221, 37, 144, 0.08);
58
58
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
59
59
  transform: translate(-50%, -50%);
@@ -61,9 +61,9 @@ ${g}
61
61
  <div style="
62
62
  position: absolute;
63
63
  left: 50%;
64
- top: ${cn/2+6}px;
64
+ top: ${ln/2+6}px;
65
65
  transform: translateX(-50%);
66
- background: ${it};
66
+ background: ${ot};
67
67
  color: white;
68
68
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
69
69
  font-size: 11px;
@@ -74,7 +74,7 @@ ${g}
74
74
  white-space: nowrap;
75
75
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
76
76
  ">${ki}</div>
77
- `;function Ei(e,t,r){return e+(t-e)*r}function Ni(){window.location.search.includes("mode=iframe")&&un()}function un(){if(document.getElementById(xi))return;let e=A().cursor,t=A().zoom.mobilePreview,r=document.createElement("div");r.id=xi,r.innerHTML=t?Ti:Mi,r.style.cssText=["position: fixed","top: -100px","left: -100px","z-index: 2147483647","pointer-events: none","will-change: left, top, transform, opacity","opacity: 0"].join("; ");let n=document.createElement("div");n.id=Tu,n.style.cssText=["position: fixed","z-index: 2147483646","pointer-events: none","width: 0","height: 0","border-radius: 50%",`background: ${it}`,"opacity: 0","transform: translate(-50%, -50%)","transition: width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out"].join("; "),document.documentElement.appendChild(n),document.documentElement.appendChild(r),e.el=r,e.rippleEl=n}function Fu(){A().cursor.trackingFrame===null&&Ri()}function Li(){let e=A().cursor;e.trackingFrame!==null&&(cancelAnimationFrame(e.trackingFrame),e.trackingFrame=null),e.targetElement=null}function Ri(){let e=A().cursor;if(e.el){if(e.targetElement&&e.targetElement.isConnected){let t=e.targetElement.getBoundingClientRect(),r=t.left+t.width/2,n=t.top+t.height/2,o=window.innerWidth,i=window.innerHeight,a=Math.max(Kt,Math.min(r,o-Kt)),s=Math.max(Kt,Math.min(n,i-Kt));if(e.x=Ei(e.x,a,Ii),e.y=Ei(e.y,s,Ii),e.el.style.transition="none",e.el.style.left=`${e.x}px`,e.el.style.top=`${e.y}px`,Math.abs(e.x-a)<Ai&&Math.abs(e.y-s)<Ai&&(e.x=a,e.y=s,e.el.style.left=`${e.x}px`,e.el.style.top=`${e.y}px`,e.settledResolve)){let c=e.settledResolve;e.settledResolve=null,c()}}else if(e.targetElement&&!e.targetElement.isConnected){if(e.settledResolve){let t=e.settledResolve;e.settledResolve=null,t()}e.targetElement=null,e.trackingFrame=null;return}else if(!e.targetElement){e.trackingFrame=null;return}e.trackingFrame=requestAnimationFrame(Ri)}}async function Qt(e){let t=A().cursor;if(t.el&&!t.el.isConnected&&(t.el=null,t.rippleEl=null,t.hasPosition=!1,un()),!!t.el){if(at(),t.settledResolve){let r=t.settledResolve;t.settledResolve=null,r()}if(t.targetElement=e,!t.hasPosition){let r=e.getBoundingClientRect(),n=r.left+r.width/2,o=r.top+r.height/2,i=Math.max(window.innerWidth,100),a=Math.max(window.innerHeight,100);Math.random()<.5?(t.x=i+20,t.y=o+(Math.random()-.5)*100):(t.x=n+(Math.random()-.5)*100,t.y=a+20),t.el.style.transition="none",t.el.style.left=`${t.x}px`,t.el.style.top=`${t.y}px`,t.el.style.opacity="0",t.el.offsetWidth,t.hasPosition=!0}return He("fading-in"),await oe(Jt),t.visibilityState==="fading-in"&&(t.visibilityState="visible"),Fu(),new Promise(r=>{t.settledResolve=r})}}async function Fi(){let e=A().cursor;e.el&&(e.el.style.transform="scale(0.85) translateY(1px)",e.rippleEl&&(e.rippleEl.style.transition="none",e.rippleEl.style.left=`${e.x}px`,e.rippleEl.style.top=`${e.y}px`,e.rippleEl.style.width="0",e.rippleEl.style.height="0",e.rippleEl.style.opacity="0.35",e.rippleEl.offsetWidth,e.rippleEl.style.transition="width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out",e.rippleEl.style.width="40px",e.rippleEl.style.height="40px",e.rippleEl.style.opacity="0"),await oe(Nu),e.el&&(e.el.style.transform="scale(1) translateY(0)"),await oe(100))}function _u(e){return e==="visible"||e==="fading-in"||e==="fading-out"||e==="force-visible"}function He(e){let t=A().cursor;if(t.visibilityState=e,!(!t.el||!t.el.isConnected))switch(e){case"hidden":case"force-hidden":case"snapshot-hidden":t.el.style.transition="none",t.el.style.opacity="0",t.rippleEl&&(t.rippleEl.style.opacity="0");break;case"fading-in":t.el.style.transition=`opacity ${Jt}ms ease`,t.el.offsetWidth,t.el.style.opacity="1";break;case"visible":case"force-visible":t.el.style.opacity="1";break;case"fading-out":t.el.style.transition=`opacity ${Jt}ms ease`,t.el.style.opacity="0";break}}function at(){let e=A().cursor;e.hideTimer&&(clearTimeout(e.hideTimer),e.hideTimer=null)}function It(e){A().cursor.executing=e,e?vi():Ci()}function dn(){at()}function er(){let e=A().cursor;e.el&&e.visibilityState!=="force-visible"&&(e.targetElement=null,at(),e.hideTimer=setTimeout(()=>{e.visibilityState!=="force-visible"&&(He("fading-out"),e.hideTimer=setTimeout(()=>{e.visibilityState==="fading-out"&&(He("hidden"),Li()),e.hideTimer=null},Jt))},Lu))}function _i(){let e=A().cursor;e.visibilityState!=="snapshot-hidden"&&(at(),e.preSnapshotState=e.visibilityState,He("snapshot-hidden"))}function Oi(){let e=A().cursor,t=e.preSnapshotState;e.preSnapshotState=null,!(!e.el||!t||!_u(t))&&He(t==="fading-in"?"fading-in":"visible")}function fn(e){let t=A().cursor;t.el&&(t.el.innerHTML=e?Ti:Mi)}function tr(e){let t=A().cursor;t.executing||(e==="visible"&&!t.el&&un(),t.el&&(e==="visible"?(at(),t.hasPosition?He("force-visible"):t.visibilityState="force-visible"):e==="hidden"?(at(),He("force-hidden"),Li()):er()))}var Ou=750,Du=400,Ve=2,Pi={name:"text-fit",afterClone(e){if(!e.clone)return;let t=e.clone.ownerDocument;if(!t)return;let r=t.createElement("style");r.textContent="* { letter-spacing: -0.03px !important; }",e.clone.prepend(r)}},Wi=["#__mindstudio-cursor","#__mindstudio-cursor-ripple","#__mindstudio-notes-cursor","#__mindstudio-camera","#__mindstudio-flash","#__mindstudio-touch-circle"],$u="#DD2590",Pu=`<svg width="44" height="44" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
77
+ `;function Ei(e,t,r){return e+(t-e)*r}function Ni(){window.location.search.includes("mode=iframe")&&un()}function un(){if(document.getElementById(xi))return;let e=A().cursor,t=A().zoom.mobilePreview,r=document.createElement("div");r.id=xi,r.innerHTML=t?Ti:Mi,r.style.cssText=["position: fixed","top: -100px","left: -100px","z-index: 2147483647","pointer-events: none","will-change: left, top, transform, opacity","opacity: 0"].join("; ");let n=document.createElement("div");n.id=Tu,n.style.cssText=["position: fixed","z-index: 2147483646","pointer-events: none","width: 0","height: 0","border-radius: 50%",`background: ${ot}`,"opacity: 0","transform: translate(-50%, -50%)","transition: width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out"].join("; "),document.documentElement.appendChild(n),document.documentElement.appendChild(r),e.el=r,e.rippleEl=n}function Fu(){A().cursor.trackingFrame===null&&Ri()}function Li(){let e=A().cursor;e.trackingFrame!==null&&(cancelAnimationFrame(e.trackingFrame),e.trackingFrame=null),e.targetElement=null}function Ri(){let e=A().cursor;if(e.el){if(e.targetElement&&e.targetElement.isConnected){let t=e.targetElement.getBoundingClientRect(),r=t.left+t.width/2,n=t.top+t.height/2,o=window.innerWidth,i=window.innerHeight,a=Math.max(Kt,Math.min(r,o-Kt)),s=Math.max(Kt,Math.min(n,i-Kt));if(e.x=Ei(e.x,a,Ii),e.y=Ei(e.y,s,Ii),e.el.style.transition="none",e.el.style.left=`${e.x}px`,e.el.style.top=`${e.y}px`,Math.abs(e.x-a)<Ai&&Math.abs(e.y-s)<Ai&&(e.x=a,e.y=s,e.el.style.left=`${e.x}px`,e.el.style.top=`${e.y}px`,e.settledResolve)){let c=e.settledResolve;e.settledResolve=null,c()}}else if(e.targetElement&&!e.targetElement.isConnected){if(e.settledResolve){let t=e.settledResolve;e.settledResolve=null,t()}e.targetElement=null,e.trackingFrame=null;return}else if(!e.targetElement){e.trackingFrame=null;return}e.trackingFrame=requestAnimationFrame(Ri)}}async function Jt(e){let t=A().cursor;if(t.el&&!t.el.isConnected&&(t.el=null,t.rippleEl=null,t.hasPosition=!1,un()),!!t.el){if(at(),t.settledResolve){let r=t.settledResolve;t.settledResolve=null,r()}if(t.targetElement=e,!t.hasPosition){let r=e.getBoundingClientRect(),n=r.left+r.width/2,o=r.top+r.height/2,i=Math.max(window.innerWidth,100),a=Math.max(window.innerHeight,100);Math.random()<.5?(t.x=i+20,t.y=o+(Math.random()-.5)*100):(t.x=n+(Math.random()-.5)*100,t.y=a+20),t.el.style.transition="none",t.el.style.left=`${t.x}px`,t.el.style.top=`${t.y}px`,t.el.style.opacity="0",t.el.offsetWidth,t.hasPosition=!0}return t.el.style.opacity="1",t.visibilityState="visible",Fu(),new Promise(r=>{t.settledResolve=r})}}async function Fi(){let e=A().cursor;e.el&&(e.el.style.transform="scale(0.85) translateY(1px)",e.rippleEl&&(e.rippleEl.style.transition="none",e.rippleEl.style.left=`${e.x}px`,e.rippleEl.style.top=`${e.y}px`,e.rippleEl.style.width="0",e.rippleEl.style.height="0",e.rippleEl.style.opacity="0.35",e.rippleEl.offsetWidth,e.rippleEl.style.transition="width 400ms ease-out, height 400ms ease-out, opacity 400ms ease-out",e.rippleEl.style.width="40px",e.rippleEl.style.height="40px",e.rippleEl.style.opacity="0"),await ie(Nu),e.el&&(e.el.style.transform="scale(1) translateY(0)"),await ie(100))}function _u(e){return e==="visible"||e==="fading-in"||e==="fading-out"||e==="force-visible"}function it(e){let t=A().cursor;if(t.visibilityState=e,!(!t.el||!t.el.isConnected))switch(e){case"hidden":case"force-hidden":case"snapshot-hidden":t.el.style.transition="none",t.el.style.opacity="0",t.rippleEl&&(t.rippleEl.style.opacity="0");break;case"fading-in":t.el.style.transition=`opacity ${cn}ms ease`,t.el.offsetWidth,t.el.style.opacity="1";break;case"visible":case"force-visible":t.el.style.opacity="1";break;case"fading-out":t.el.style.transition=`opacity ${cn}ms ease`,t.el.style.opacity="0";break}}function at(){let e=A().cursor;e.hideTimer&&(clearTimeout(e.hideTimer),e.hideTimer=null)}function It(e){A().cursor.executing=e,e?vi():Ci()}function dn(){at()}function Qt(){let e=A().cursor;e.el&&e.visibilityState!=="force-visible"&&(e.targetElement=null,at(),e.hideTimer=setTimeout(()=>{e.visibilityState!=="force-visible"&&(it("fading-out"),e.hideTimer=setTimeout(()=>{e.visibilityState==="fading-out"&&(it("hidden"),Li()),e.hideTimer=null},cn))},Lu))}function _i(){let e=A().cursor;e.visibilityState!=="snapshot-hidden"&&(at(),e.preSnapshotState=e.visibilityState,it("snapshot-hidden"))}function Oi(){let e=A().cursor,t=e.preSnapshotState;e.preSnapshotState=null,!(!e.el||!t||!_u(t))&&it(t==="fading-in"?"fading-in":"visible")}function fn(e){let t=A().cursor;t.el&&(t.el.innerHTML=e?Ti:Mi)}function er(e){let t=A().cursor;t.executing||(e==="visible"&&!t.el&&un(),t.el&&(e==="visible"?(at(),t.hasPosition?it("force-visible"):t.visibilityState="force-visible"):e==="hidden"?(at(),it("force-hidden"),Li()):Qt()))}var Ou=750,Du=400,He=2,Pi={name:"text-fit",afterClone(e){if(!e.clone)return;let t=e.clone.ownerDocument;if(!t)return;let r=t.createElement("style");r.textContent="* { letter-spacing: -0.03px !important; }",e.clone.prepend(r)}},Wi=["#__mindstudio-cursor","#__mindstudio-cursor-ripple","#__mindstudio-notes-cursor","#__mindstudio-camera","#__mindstudio-flash","#__mindstudio-touch-circle"],$u="#DD2590",Pu=`<svg width="44" height="44" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
78
78
  <g filter="url(#filter0_d_2_302)">
79
79
  <path fill-rule="evenodd" clip-rule="evenodd" d="M6.5 21C4.57 21 3 19.43 3 17.5V10.5C3 8.57 4.57 7 6.5 7H7.5C7.966 7 8.387 6.49 8.605 6.053C9.239 4.786 10.028 4 12 4H16C17.972 4 18.761 4.786 19.395 6.053C19.613 6.49 20.034 7 20.5 7H21.5C23.43 7 25 8.57 25 10.5V17.5C25 19.43 23.43 21 21.5 21H6.5Z" fill="white"/>
80
80
  <path fill-rule="evenodd" clip-rule="evenodd" d="M14 18C11.238 18 9 15.762 9 13C9 10.238 11.238 8 14 8C16.762 8 19 10.238 19 13C19 15.762 16.762 18 14 18ZM21.5 8H20.5C19.5 8 18.816 7.132 18.5 6.5C18 5.5 17.5 5 16 5H14H12C10.5 5 10 5.5 9.5 6.5C9.184 7.132 8.5 8 7.5 8H6.5C5.119 8 4 9.119 4 10.5V17.5C4 18.881 5.119 20 6.5 20H21.5C22.881 20 24 18.881 24 17.5V10.5C24 9.119 22.881 8 21.5 8Z" fill="black"/>
@@ -108,7 +108,7 @@ ${g}
108
108
  white-space: nowrap;
109
109
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
110
110
  ">Remy</div>
111
- `,t.style.cssText=["position: fixed","z-index: 2147483647","pointer-events: none","opacity: 0","transition: opacity 300ms ease, left 600ms cubic-bezier(0.4, 0, 0, 1), top 600ms cubic-bezier(0.4, 0, 0, 1)","will-change: left, top, opacity"].join("; ");let r=document.createElement("div");r.id=pn,r.style.cssText=["position: fixed","top: 0","left: 0","width: 100vw","height: 100vh","background: white","opacity: 0","z-index: 2147483646","pointer-events: none","transition: opacity 600ms ease-out"].join("; "),document.documentElement.appendChild(r),document.documentElement.appendChild(t),e.cameraEl=t,e.flashEl=r}function Bu(e,t){let{cameraEl:r}=A().screenshot;r&&(r.style.left=`${e}px`,r.style.top=`${t}px`,r.style.opacity="1")}function $i(e,t){let{cameraEl:r}=A().screenshot;r&&(r.style.left=`${e}px`,r.style.top=`${t}px`)}async function Uu(){let{flashEl:e}=A().screenshot;e&&(e.style.transition="none",e.style.opacity="0.7",e.offsetWidth,e.style.transition="opacity 600ms ease-out",e.style.opacity="0",await oe(600))}function Hu(){let{cameraEl:e}=A().screenshot;e&&(e.style.opacity="0")}function Vu(){let e=A().screenshot;document.getElementById(mn)?.remove(),document.getElementById(pn)?.remove(),e.cameraEl=null,e.flashEl=null}function Gu(e,t,r){return new Promise(n=>{let o=e.scrollTop,i=t-o;if(Math.abs(i)<1){n();return}let a=Math.abs(i),c=Math.max(r,a/2),l=performance.now();function u(d){let f=d-l,m=Math.min(f/c,1),p=m<.5?4*m*m*m:1-Math.pow(-2*m+2,3)/2;e.scrollTop=o+i*p,m<1?requestAnimationFrame(u):n()}requestAnimationFrame(u)})}async function At(e){let t=A().screenshot;if(t.capturing)throw new Error("Screenshot already in progress");t.capturing=!0,_i();try{return await zu(e)}finally{t.capturing=!1,Oi()}}async function zu(e){await fi();let t=window.innerWidth,r=window.innerHeight;if(e?.viewportOnly)return await qu(t,r);let n=We(),o=n!==document.documentElement,i=n.scrollTop,a=n.style.scrollBehavior;n.style.scrollBehavior="auto",Wu();try{let s=Math.random()<.5?t+30:-60,c=r*.3+Math.random()*r*.4;Bu(s,c),await oe(200);let l=t*.4+Math.random()*t*.15,u=r*.35+Math.random()*r*.15;$i(l,u),await oe(700);let d=[],f=0,m=o?n.clientHeight:r,p=()=>o?n.scrollHeight:Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),g=50,h=p();for(;f<h&&d.length<g;){let x=d.length,N=p();if(N<=0){console.warn("[screenshot] skipping chunk \u2014 page height is 0");break}if(N-f<m*.05&&d.length>0)break;let $=N-m,M=Math.min(f,$);Math.abs(M-n.scrollTop)>1&&(await Gu(n,M,Du),$i(l,u),await oe(Ou)),Uu();let O=n.scrollTop,V=Math.min(m,N-O);if(V<=0){console.warn("[screenshot] skipping chunk \u2014 captureHeight is 0 (page may have shrunk)"),f+=m;continue}let K=o?n.getBoundingClientRect():null;try{let F=await(await j(document.body,{embedFonts:!0,exclude:Wi,plugins:[Pi]})).toCanvas({width:t+1});if(F&&K){let D=F.width/t,_=F.width;if(x===0&&K.top>0){let T=Math.round(K.top*D),G=document.createElement("canvas");G.width=_,G.height=T;let J=G.getContext("2d");J&&(J.drawImage(F,0,0,_,T,0,0,_,T),d.push({y:0,canvas:G}))}let ee=Math.round(K.top*D),P=Math.round(V*D),z=document.createElement("canvas");z.width=_,z.height=P;let X=z.getContext("2d");X&&(X.drawImage(F,0,ee,_,P,0,0,_,P),d.push({y:K.top+O,canvas:z}));let ne=K.bottom;if(f+m>=h&&ne<r){let T=Math.round(ne*D),G=F.height-T;if(G>0){let J=document.createElement("canvas");J.width=_,J.height=G;let Y=J.getContext("2d");Y&&(Y.drawImage(F,0,T,_,G,0,0,_,G),d.push({y:K.top+N,canvas:J}))}}}else if(F){let D=F.width/t,_=Math.round(O*D),ee=Math.min(O+V,N),P=Math.round(ee*D)-_,z=F.width,X=document.createElement("canvas");X.width=z,X.height=P;let ne=X.getContext("2d");ne&&(ne.drawImage(F,0,_,z,P,0,0,z,P),d.push({y:O,canvas:X}))}}catch(R){console.error("[screenshot] snapdom capture failed for chunk",x,R)}f+=m}if(f<h&&console.warn(`[screenshot] page truncated \u2014 captured ${d.length} chunks but page is ${h}px tall`),d.length===0)throw new Error("Screenshot capture produced no image data");let y=d[0].canvas.width,v=0;for(let x of d){if(x.canvas.width!==y){let N=y/x.canvas.width,B=Math.round(x.canvas.height*N),$=document.createElement("canvas");$.width=y,$.height=B;let M=$.getContext("2d");M&&(M.drawImage(x.canvas,0,0,y,B),x.canvas=$)}v+=x.canvas.height}let w=document.createElement("canvas");w.width=y,w.height=v;let b=w.getContext("2d");if(!b)throw new Error("Failed to create output canvas");let S=0;for(let x of d)b.drawImage(x.canvas,0,S),S+=x.canvas.height;let C=w.toDataURL("image/jpeg",1).replace(/^data:image\/jpeg;base64,/,"");if(!C)throw new Error("Canvas export produced no image data");return{image:C,width:w.width,height:w.height}}finally{Hu(),Vu(),n.style.scrollBehavior="auto",n.scrollTop=i,n.style.scrollBehavior=a}}function Yu(){let e=document.getElementById("__mindstudio-notes-overlay");if(!e)return null;let t=window.scrollX,r=window.scrollY,n=e.style.cssText;return e.style.position="absolute",e.style.inset="auto",e.style.left=`${t}px`,e.style.top=`${r}px`,e.style.width=`${window.innerWidth}px`,e.style.height=`${window.innerHeight}px`,()=>{e.style.cssText=n}}async function qu(e,t){let r=Yu();try{let o=await(await j(document.body,{embedFonts:!0,exclude:Wi,plugins:[Pi]})).toCanvas({width:(e+1)*Ve});if(!o)throw new Error("SnapDOM viewport capture returned empty result");let i=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),a=document.createElement("canvas");a.width=e*Ve,a.height=t*Ve;let s=a.getContext("2d");if(!s)throw new Error("Failed to create canvas context");let c=window.scrollY/i*o.height,l=t/i*o.height;s.drawImage(o,0,c,o.width,l,0,0,e*Ve,t*Ve);let d=a.toDataURL("image/jpeg",1).replace(/^data:image\/jpeg;base64,/,"");if(!d)throw new Error("Canvas export produced no image data");return{image:d,width:(e+1)*Ve,height:t*Ve}}finally{r?.()}}var ju=["backgroundColor","color","fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","textAlign","textDecoration","textTransform","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","borderRadius","borderColor","borderWidth","borderStyle","boxShadow","opacity","width","height","display","flexDirection","justifyContent","alignItems","gap"];function Zu(e,t){let r=t??ju;if(e.ref||e.text||e.role||e.label||e.selector){let{element:i,matched:a}=Me(e);return{...Bi(i,e.ref,r),matched:a}}let n=Je(),o=[];for(let[i,a]of n)a.isConnected&&o.push(Bi(a,i,r));return o}function Bi(e,t,r){let n=window.getComputedStyle(e),o={};t&&(o.ref=t),o.tag=e.tagName.toLowerCase();let i=e.textContent?.trim();i&&(o.text=i.length>60?i.slice(0,60)+"\u2026":i);for(let a of r){let s=n.getPropertyValue(a.replace(/([A-Z])/g,"-$1").toLowerCase());s&&(o[a]=s)}return o}var Ui=150,rr=100,Et="__mindstudio_pending_nav",Hi=300,yn=1e4;function Xu(e){try{let t=new URL(e,window.location.origin);return t.origin!==window.location.origin?!1:t.pathname===window.location.pathname&&t.search===window.location.search&&t.hash===window.location.hash}catch{return!1}}function Vi(e){try{let t=new URL(e,window.location.origin);return t.origin!==window.location.origin?!1:(Xu(e)||(window.history.pushState(null,"",t.pathname+t.search+t.hash),window.dispatchEvent(new PopStateEvent("popstate"))),!0)}catch{return!1}}async function hn(e=300,t=2e3){return new Promise(r=>{let n=Date.now()+t,o=Date.now(),i=We(),a=window.scrollY,s=window.scrollX,c=document.body.scrollTop,l=document.documentElement.scrollTop,u=document.body.scrollHeight,d=document.body.scrollWidth,f=i.scrollTop,m=i.scrollLeft;function p(){if(Date.now()>n){r();return}let g=window.scrollY,h=window.scrollX,y=document.body.scrollTop,v=document.documentElement.scrollTop,w=document.body.scrollHeight,b=document.body.scrollWidth,S=i.scrollTop,I=i.scrollLeft;(g!==a||h!==s||y!==c||v!==l||w!==u||b!==d||S!==f||I!==m)&&(a=g,s=h,c=y,l=v,u=w,d=b,f=S,m=I,o=Date.now()),Date.now()-o>=e?r():requestAnimationFrame(p)}requestAnimationFrame(p)})}var Ku=350;async function gn(e){let t=Ju(e),r=t.map(a=>({el:a,top:a.scrollTop,left:a.scrollLeft})),n=document.documentElement.style.scrollBehavior;document.documentElement.style.scrollBehavior="auto",e.scrollIntoView({block:"center",inline:"nearest",behavior:"instant"}),document.documentElement.style.scrollBehavior=n;let o=t.map(a=>({top:a.scrollTop,left:a.scrollLeft})),i=[];for(let a=0;a<t.length;a++)(r[a].top!==o[a].top||r[a].left!==o[a].left)&&i.push({el:t[a],fromTop:r[a].top,fromLeft:r[a].left,toTop:o[a].top,toLeft:o[a].left});if(i.length===0){await new Promise(a=>requestAnimationFrame(()=>a()));return}for(let a of i)a.el.scrollTop=a.fromTop,a.el.scrollLeft=a.fromLeft;await new Promise(a=>{let s=performance.now();function c(l){let u=l-s,d=Math.min(u/Ku,1),f=1-Math.pow(1-d,3);for(let m of i)m.el.scrollTop=m.fromTop+(m.toTop-m.fromTop)*f,m.el.scrollLeft=m.fromLeft+(m.toLeft-m.fromLeft)*f;d<1?requestAnimationFrame(c):a()}requestAnimationFrame(c)})}function Ju(e){let t=[],r=e.parentElement;for(;r;){let n=getComputedStyle(r),o=n.overflowY,i=n.overflowX;(o==="auto"||o==="scroll"||i==="auto"||i==="scroll")&&t.push(r),r=r.parentElement}return t.push(document.scrollingElement||document.documentElement),t}async function nr(e,t){let r=Date.now(),n=[],o=[],i="",a=!1,s=new Set(["click","type","select"]),c=t.some(l=>s.has(l.command));c&&(It(!0),dn()),Fr();try{for(let l=0;l<t.length;l++){let u=t[l],d=u.command;try{if(l>0&&await oe(Ui+Math.random()*rr-rr/2),d==="navigate"){let m=u.url;if(!m)throw new Error('navigate command requires a "url" field');if(Vi(m)){n.push({index:l,command:d,result:"ok"}),await oe(Hi);continue}let p=t.slice(l+1);if(p.length>0)try{sessionStorage.setItem(Et,JSON.stringify({id:e,startTime:r,completedSteps:n,remainingSteps:p,stepOffset:l+1}))}catch{}n.push({index:l,command:d,result:"ok"}),a=!0,window.location.href=m,await new Promise((g,h)=>{setTimeout(()=>h(new Error("Navigation did not complete within timeout")),yn)})}if(d==="reload"){let m=t.slice(l+1);if(m.length>0)try{sessionStorage.setItem(Et,JSON.stringify({id:e,startTime:r,completedSteps:n,remainingSteps:m,stepOffset:l+1}))}catch{}n.push({index:l,command:d,result:"ok"}),a=!0,window.location.reload(),await new Promise((p,g)=>{setTimeout(()=>g(new Error("Reload did not complete within timeout")),yn)})}let f=await zi(u);n.push({index:l,command:d,...f})}catch(f){n.push({index:l,command:d,error:f instanceof Error?f.message:String(f)});break}}try{i=await Qe()}catch{}}finally{o=_r(),c&&(It(!1),er())}return{id:e,steps:n,snapshot:i,logs:o,duration:Date.now()-r}}async function Gi(){let e=null;try{let i=sessionStorage.getItem(Et);if(!i)return null;sessionStorage.removeItem(Et),e=JSON.parse(i)}catch{return null}if(!e)return null;let t=[...e.completedSteps],r=[],n="",o=e.remainingSteps.some(i=>i.command==="click"||i.command==="type"||i.command==="select");o&&(It(!0),dn()),Fr();try{for(let i=0;i<e.remainingSteps.length;i++){let a=e.remainingSteps[i],s=a.command,c=e.stepOffset+i;try{if(i>0&&await oe(Ui+Math.random()*rr-rr/2),s==="navigate"){let u=a.url;if(!u)throw new Error('navigate command requires a "url" field');if(Vi(u)){t.push({index:c,command:s,result:"ok"}),await oe(Hi);continue}let d=e.remainingSteps.slice(i+1);if(d.length>0)try{sessionStorage.setItem(Et,JSON.stringify({id:e.id,startTime:e.startTime,completedSteps:t,remainingSteps:d,stepOffset:c+1}))}catch{}t.push({index:c,command:s,result:"ok"}),window.location.href=u,await new Promise((f,m)=>{setTimeout(()=>m(new Error("Navigation did not complete within timeout")),yn)})}let l=await zi(a);t.push({index:c,command:s,...l})}catch(l){t.push({index:c,command:s,error:l instanceof Error?l.message:String(l)});break}}try{n=await Qe()}catch{}}finally{r=_r(),o&&(It(!1),er())}return{id:e.id,steps:t,snapshot:n,logs:r,duration:Date.now()-e.startTime}}async function zi(e){switch(e.command){case"snapshot":return{result:await Qe()};case"click":{let{element:t,matched:r}=Me(e);return await gn(t),await Qt(t),await Fi(),Wr(t),await hn(),await oe(1e3),{result:"ok",matched:r}}case"type":{let{element:t,matched:r}=Me(e),n=e.text;if(!n&&n!=="")throw new Error('type command requires a "text" field');return await gn(t),await Qt(t),await no(t,n,{clear:!!e.clear}),await hn(),{result:"ok",matched:r}}case"select":{let{element:t,matched:r}=Me(e),n=e.option;if(!n)throw new Error('select command requires an "option" field');await gn(t),await Qt(t);let o=io(t,n);return await hn(),{result:`selected "${o}"`,matched:r}}case"wait":{let{matched:t,elapsed:r}=await oo(e);return{result:"ok",matched:t,elapsed:r}}case"styles":{let t=e.properties;return{result:Zu(e,t)}}case"evaluate":{let t=e.script;if(!t)throw new Error('evaluate command requires a "script" field');return{result:await ao(t)}}case"screenshotFullPage":{let t=We();t.scrollTop=0,await oe(500);let{image:r,width:n,height:o}=await At(),i=e.uploadUrl,a=e.uploadFields;if(i&&a){let s=atob(r),c=new Uint8Array(s.length);for(let f=0;f<s.length;f++)c[f]=s.charCodeAt(f);let l=new FormData;for(let[f,m]of Object.entries(a))l.append(f,m);l.append("file",new Blob([c],{type:"image/jpeg"}),"screenshot.jpg");let u=await fetch(i,{method:"POST",body:l});if(!u.ok)throw new Error(`Screenshot upload failed: ${u.status}`);let d=e._publicUrl;return{result:{width:n,height:o,uploaded:!0,...d?{_publicUrl:d}:{}}}}return{result:{image:r,width:n,height:o}}}case"screenshotViewport":{let{image:t,width:r,height:n}=await At({viewportOnly:!0}),o=e.uploadUrl,i=e.uploadFields;if(o&&i){let a=atob(t),s=new Uint8Array(a.length);for(let d=0;d<a.length;d++)s[d]=a.charCodeAt(d);let c=new FormData;for(let[d,f]of Object.entries(i))c.append(d,f);c.append("file",new Blob([s],{type:"image/jpeg"}),"screenshot.jpg");let l=await fetch(o,{method:"POST",body:c});if(!l.ok)throw new Error(`Screenshot upload failed: ${l.status}`);let u=e._publicUrl;return{result:{width:r,height:n,uploaded:!0,...u?{_publicUrl:u}:{}}}}return{result:{image:t,width:r,height:n}}}case"reload":return location.reload(),{result:"ok"};default:throw new Error(`Unknown command: ${e.command}`)}}var Qu="/__mindstudio_dev__/ws",ed=1e3,td=1e4;function qi(){let e=A().ws;e.ws||(Bn(ir),window.addEventListener("beforeunload",()=>{e.closing=!0,e.ws&&e.ws.close()}),ji())}function ir(){let{ws:e}=A().ws;return e&&e.readyState===WebSocket.OPEN?e:null}function rd(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}${Qu}`}function nd(){return window.location.search.includes("mode=iframe")?"iframe":"standalone"}function ji(){let e=A().ws;if(!e.closing){try{e.ws=new WebSocket(rd())}catch{Yi();return}e.ws.onopen=()=>{try{let t=(()=>{try{return sessionStorage.getItem("__ms_mirror")==="1"}catch{return!1}})();e.ws.send(JSON.stringify({type:"hello",mode:nd(),url:location.href,viewport:{w:window.innerWidth,h:window.innerHeight},mirror:t}))}catch{e.ws?.close()}},e.ws.onmessage=t=>{let r;try{r=JSON.parse(t.data)}catch{return}switch(r.type){case"ack":e.clientId=r.clientId,e.reconnectDelay=ed,id();break;case"command":od(r.id,r.steps);break;case"broadcast":ad(r.action,r.payload);break}},e.ws.onclose=()=>{e.ws=null,e.clientId=null,e.closing||Yi()},e.ws.onerror=()=>{}}}function Yi(){let e=A().ws;e.closing||(setTimeout(()=>ji(),e.reconnectDelay),e.reconnectDelay=Math.min(e.reconnectDelay*2,td))}async function od(e,t){let r=A().ws;if(r.busy){or({id:e,steps:[],snapshot:"",logs:[],duration:0,error:"Browser agent is busy"});return}r.busy=!0,bn("command-started",{id:e,steps:t.map(n=>n.command)});try{let n=await nr(e,t);or(n),bn("command-completed",{id:e,success:!0})}catch{or({id:e,steps:[],snapshot:"",logs:[],duration:0}),bn("command-completed",{id:e,success:!1})}finally{A().ws.busy=!1}}function or(e){try{let t=ir();t&&t.send(JSON.stringify({type:"result",...e}))}catch{}}async function id(){let e=await Gi();e&&or(e)}function bn(e,t){window.parent!==window&&window.parent.postMessage({channel:"mindstudio-browser-agent",command:e,...t},"*")}function ad(e,t){e==="reload"&&(document.cookie="__ms_auth=; Max-Age=0; Path=/; Secure; SameSite=None",location.href="/")}var Zi="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",sd=200,Xi=`
111
+ `,t.style.cssText=["position: fixed","z-index: 2147483647","pointer-events: none","opacity: 0","transition: opacity 300ms ease, left 600ms cubic-bezier(0.4, 0, 0, 1), top 600ms cubic-bezier(0.4, 0, 0, 1)","will-change: left, top, opacity"].join("; ");let r=document.createElement("div");r.id=pn,r.style.cssText=["position: fixed","top: 0","left: 0","width: 100vw","height: 100vh","background: white","opacity: 0","z-index: 2147483646","pointer-events: none","transition: opacity 600ms ease-out"].join("; "),document.documentElement.appendChild(r),document.documentElement.appendChild(t),e.cameraEl=t,e.flashEl=r}function Bu(e,t){let{cameraEl:r}=A().screenshot;r&&(r.style.left=`${e}px`,r.style.top=`${t}px`,r.style.opacity="1")}function $i(e,t){let{cameraEl:r}=A().screenshot;r&&(r.style.left=`${e}px`,r.style.top=`${t}px`)}async function Uu(){let{flashEl:e}=A().screenshot;e&&(e.style.transition="none",e.style.opacity="0.7",e.offsetWidth,e.style.transition="opacity 600ms ease-out",e.style.opacity="0",await ie(600))}function Hu(){let{cameraEl:e}=A().screenshot;e&&(e.style.opacity="0")}function Vu(){let e=A().screenshot;document.getElementById(mn)?.remove(),document.getElementById(pn)?.remove(),e.cameraEl=null,e.flashEl=null}function Gu(e,t,r){return new Promise(n=>{let o=e.scrollTop,i=t-o;if(Math.abs(i)<1){n();return}let a=Math.abs(i),c=Math.max(r,a/2),l=performance.now();function u(d){let f=d-l,m=Math.min(f/c,1),p=m<.5?4*m*m*m:1-Math.pow(-2*m+2,3)/2;e.scrollTop=o+i*p,m<1?requestAnimationFrame(u):n()}requestAnimationFrame(u)})}async function At(e){let t=A().screenshot;if(t.capturing)throw new Error("Screenshot already in progress");t.capturing=!0,_i();try{return await zu(e)}finally{t.capturing=!1,Oi()}}async function zu(e){await fi();let t=window.innerWidth,r=window.innerHeight;if(e?.viewportOnly)return await qu(t,r);let n=We(),o=n!==document.documentElement,i=n.scrollTop,a=n.style.scrollBehavior;n.style.scrollBehavior="auto",Wu();try{let s=Math.random()<.5?t+30:-60,c=r*.3+Math.random()*r*.4;Bu(s,c),await ie(200);let l=t*.4+Math.random()*t*.15,u=r*.35+Math.random()*r*.15;$i(l,u),await ie(700);let d=[],f=0,m=o?n.clientHeight:r,p=()=>o?n.scrollHeight:Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),g=50,h=p();for(;f<h&&d.length<g;){let x=d.length,N=p();if(N<=0){console.warn("[screenshot] skipping chunk \u2014 page height is 0");break}if(N-f<m*.05&&d.length>0)break;let $=N-m,M=Math.min(f,$);Math.abs(M-n.scrollTop)>1&&(await Gu(n,M,Du),$i(l,u),await ie(Ou)),Uu();let O=n.scrollTop,V=Math.min(m,N-O);if(V<=0){console.warn("[screenshot] skipping chunk \u2014 captureHeight is 0 (page may have shrunk)"),f+=m;continue}let K=o?n.getBoundingClientRect():null;try{let F=await(await j(document.body,{embedFonts:!0,exclude:Wi,plugins:[Pi]})).toCanvas({width:t+1});if(F&&K){let D=F.width/t,_=F.width;if(x===0&&K.top>0){let T=Math.round(K.top*D),G=document.createElement("canvas");G.width=_,G.height=T;let J=G.getContext("2d");J&&(J.drawImage(F,0,0,_,T,0,0,_,T),d.push({y:0,canvas:G}))}let ee=Math.round(K.top*D),P=Math.round(V*D),z=document.createElement("canvas");z.width=_,z.height=P;let X=z.getContext("2d");X&&(X.drawImage(F,0,ee,_,P,0,0,_,P),d.push({y:K.top+O,canvas:z}));let ne=K.bottom;if(f+m>=h&&ne<r){let T=Math.round(ne*D),G=F.height-T;if(G>0){let J=document.createElement("canvas");J.width=_,J.height=G;let Y=J.getContext("2d");Y&&(Y.drawImage(F,0,T,_,G,0,0,_,G),d.push({y:K.top+N,canvas:J}))}}}else if(F){let D=F.width/t,_=Math.round(O*D),ee=Math.min(O+V,N),P=Math.round(ee*D)-_,z=F.width,X=document.createElement("canvas");X.width=z,X.height=P;let ne=X.getContext("2d");ne&&(ne.drawImage(F,0,_,z,P,0,0,z,P),d.push({y:O,canvas:X}))}}catch(R){console.error("[screenshot] snapdom capture failed for chunk",x,R)}f+=m}if(f<h&&console.warn(`[screenshot] page truncated \u2014 captured ${d.length} chunks but page is ${h}px tall`),d.length===0)throw new Error("Screenshot capture produced no image data");let y=d[0].canvas.width,v=0;for(let x of d){if(x.canvas.width!==y){let N=y/x.canvas.width,B=Math.round(x.canvas.height*N),$=document.createElement("canvas");$.width=y,$.height=B;let M=$.getContext("2d");M&&(M.drawImage(x.canvas,0,0,y,B),x.canvas=$)}v+=x.canvas.height}let w=document.createElement("canvas");w.width=y,w.height=v;let b=w.getContext("2d");if(!b)throw new Error("Failed to create output canvas");let S=0;for(let x of d)b.drawImage(x.canvas,0,S),S+=x.canvas.height;let C=w.toDataURL("image/jpeg",1).replace(/^data:image\/jpeg;base64,/,"");if(!C)throw new Error("Canvas export produced no image data");return{image:C,width:w.width,height:w.height}}finally{Hu(),Vu(),n.style.scrollBehavior="auto",n.scrollTop=i,n.style.scrollBehavior=a}}function Yu(){let e=document.getElementById("__mindstudio-notes-overlay");if(!e)return null;let t=window.scrollX,r=window.scrollY,n=e.style.cssText;return e.style.position="absolute",e.style.inset="auto",e.style.left=`${t}px`,e.style.top=`${r}px`,e.style.width=`${window.innerWidth}px`,e.style.height=`${window.innerHeight}px`,()=>{e.style.cssText=n}}async function qu(e,t){let r=Yu();try{let o=await(await j(document.body,{embedFonts:!0,exclude:Wi,plugins:[Pi]})).toCanvas({width:(e+1)*He});if(!o)throw new Error("SnapDOM viewport capture returned empty result");let i=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),a=document.createElement("canvas");a.width=e*He,a.height=t*He;let s=a.getContext("2d");if(!s)throw new Error("Failed to create canvas context");let c=window.scrollY/i*o.height,l=t/i*o.height;s.drawImage(o,0,c,o.width,l,0,0,e*He,t*He);let d=a.toDataURL("image/jpeg",1).replace(/^data:image\/jpeg;base64,/,"");if(!d)throw new Error("Canvas export produced no image data");return{image:d,width:(e+1)*He,height:t*He}}finally{r?.()}}var ju=["backgroundColor","color","fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","textAlign","textDecoration","textTransform","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","borderRadius","borderColor","borderWidth","borderStyle","boxShadow","opacity","width","height","display","flexDirection","justifyContent","alignItems","gap"];function Zu(e,t){let r=t??ju;if(e.ref||e.text||e.role||e.label||e.selector){let{element:i,matched:a}=Me(e);return{...Bi(i,e.ref,r),matched:a}}let n=Ke(),o=[];for(let[i,a]of n)a.isConnected&&o.push(Bi(a,i,r));return o}function Bi(e,t,r){let n=window.getComputedStyle(e),o={};t&&(o.ref=t),o.tag=e.tagName.toLowerCase();let i=e.textContent?.trim();i&&(o.text=i.length>60?i.slice(0,60)+"\u2026":i);for(let a of r){let s=n.getPropertyValue(a.replace(/([A-Z])/g,"-$1").toLowerCase());s&&(o[a]=s)}return o}var Ui=150,tr=100,Et="__mindstudio_pending_nav",Hi=300,yn=1e4;function Xu(e){try{let t=new URL(e,window.location.origin);return t.origin!==window.location.origin?!1:t.pathname===window.location.pathname&&t.search===window.location.search&&t.hash===window.location.hash}catch{return!1}}function Vi(e){try{let t=new URL(e,window.location.origin);return t.origin!==window.location.origin?!1:(Xu(e)||(window.history.pushState(null,"",t.pathname+t.search+t.hash),window.dispatchEvent(new PopStateEvent("popstate"))),!0)}catch{return!1}}async function hn(e=300,t=2e3){return new Promise(r=>{let n=Date.now()+t,o=Date.now(),i=We(),a=window.scrollY,s=window.scrollX,c=document.body.scrollTop,l=document.documentElement.scrollTop,u=document.body.scrollHeight,d=document.body.scrollWidth,f=i.scrollTop,m=i.scrollLeft;function p(){if(Date.now()>n){r();return}let g=window.scrollY,h=window.scrollX,y=document.body.scrollTop,v=document.documentElement.scrollTop,w=document.body.scrollHeight,b=document.body.scrollWidth,S=i.scrollTop,I=i.scrollLeft;(g!==a||h!==s||y!==c||v!==l||w!==u||b!==d||S!==f||I!==m)&&(a=g,s=h,c=y,l=v,u=w,d=b,f=S,m=I,o=Date.now()),Date.now()-o>=e?r():requestAnimationFrame(p)}requestAnimationFrame(p)})}var Ku=350;async function gn(e){let t=Ju(e),r=t.map(a=>({el:a,top:a.scrollTop,left:a.scrollLeft})),n=document.documentElement.style.scrollBehavior;document.documentElement.style.scrollBehavior="auto",e.scrollIntoView({block:"center",inline:"nearest",behavior:"instant"}),document.documentElement.style.scrollBehavior=n;let o=t.map(a=>({top:a.scrollTop,left:a.scrollLeft})),i=[];for(let a=0;a<t.length;a++)(r[a].top!==o[a].top||r[a].left!==o[a].left)&&i.push({el:t[a],fromTop:r[a].top,fromLeft:r[a].left,toTop:o[a].top,toLeft:o[a].left});if(i.length===0){await new Promise(a=>requestAnimationFrame(()=>a()));return}for(let a of i)a.el.scrollTop=a.fromTop,a.el.scrollLeft=a.fromLeft;await new Promise(a=>{let s=performance.now();function c(l){let u=l-s,d=Math.min(u/Ku,1),f=1-Math.pow(1-d,3);for(let m of i)m.el.scrollTop=m.fromTop+(m.toTop-m.fromTop)*f,m.el.scrollLeft=m.fromLeft+(m.toLeft-m.fromLeft)*f;d<1?requestAnimationFrame(c):a()}requestAnimationFrame(c)})}function Ju(e){let t=[],r=e.parentElement;for(;r;){let n=getComputedStyle(r),o=n.overflowY,i=n.overflowX;(o==="auto"||o==="scroll"||i==="auto"||i==="scroll")&&t.push(r),r=r.parentElement}return t.push(document.scrollingElement||document.documentElement),t}async function rr(e,t){let r=Date.now(),n=[],o=[],i="",a=!1,s=new Set(["click","type","select"]),c=t.some(l=>s.has(l.command));c&&(It(!0),dn()),Rr();try{for(let l=0;l<t.length;l++){let u=t[l],d=u.command;try{if(l>0&&await ie(Ui+Math.random()*tr-tr/2),d==="navigate"){let m=u.url;if(!m)throw new Error('navigate command requires a "url" field');if(Vi(m)){n.push({index:l,command:d,result:"ok"}),await ie(Hi);continue}let p=t.slice(l+1);if(p.length>0)try{sessionStorage.setItem(Et,JSON.stringify({id:e,startTime:r,completedSteps:n,remainingSteps:p,stepOffset:l+1}))}catch{}n.push({index:l,command:d,result:"ok"}),a=!0,window.location.href=m,await new Promise((g,h)=>{setTimeout(()=>h(new Error("Navigation did not complete within timeout")),yn)})}if(d==="reload"){let m=t.slice(l+1);if(m.length>0)try{sessionStorage.setItem(Et,JSON.stringify({id:e,startTime:r,completedSteps:n,remainingSteps:m,stepOffset:l+1}))}catch{}n.push({index:l,command:d,result:"ok"}),a=!0,window.location.reload(),await new Promise((p,g)=>{setTimeout(()=>g(new Error("Reload did not complete within timeout")),yn)})}let f=await zi(u);n.push({index:l,command:d,...f})}catch(f){n.push({index:l,command:d,error:f instanceof Error?f.message:String(f)});break}}try{i=await Je()}catch{}}finally{o=Fr(),c&&(It(!1),Qt())}return{id:e,steps:n,snapshot:i,logs:o,duration:Date.now()-r}}async function Gi(){let e=null;try{let i=sessionStorage.getItem(Et);if(!i)return null;sessionStorage.removeItem(Et),e=JSON.parse(i)}catch{return null}if(!e)return null;let t=[...e.completedSteps],r=[],n="",o=e.remainingSteps.some(i=>i.command==="click"||i.command==="type"||i.command==="select");o&&(It(!0),dn()),Rr();try{for(let i=0;i<e.remainingSteps.length;i++){let a=e.remainingSteps[i],s=a.command,c=e.stepOffset+i;try{if(i>0&&await ie(Ui+Math.random()*tr-tr/2),s==="navigate"){let u=a.url;if(!u)throw new Error('navigate command requires a "url" field');if(Vi(u)){t.push({index:c,command:s,result:"ok"}),await ie(Hi);continue}let d=e.remainingSteps.slice(i+1);if(d.length>0)try{sessionStorage.setItem(Et,JSON.stringify({id:e.id,startTime:e.startTime,completedSteps:t,remainingSteps:d,stepOffset:c+1}))}catch{}t.push({index:c,command:s,result:"ok"}),window.location.href=u,await new Promise((f,m)=>{setTimeout(()=>m(new Error("Navigation did not complete within timeout")),yn)})}let l=await zi(a);t.push({index:c,command:s,...l})}catch(l){t.push({index:c,command:s,error:l instanceof Error?l.message:String(l)});break}}try{n=await Je()}catch{}}finally{r=Fr(),o&&(It(!1),Qt())}return{id:e.id,steps:t,snapshot:n,logs:r,duration:Date.now()-e.startTime}}async function zi(e){switch(e.command){case"snapshot":return{result:await Je()};case"click":{let{element:t,matched:r}=Me(e);return await gn(t),await Jt(t),await Fi(),Pr(t),await hn(),await ie(1e3),{result:"ok",matched:r}}case"type":{let{element:t,matched:r}=Me(e),n=e.text;if(!n&&n!=="")throw new Error('type command requires a "text" field');return await gn(t),await Jt(t),await no(t,n,{clear:!!e.clear}),await hn(),{result:"ok",matched:r}}case"select":{let{element:t,matched:r}=Me(e),n=e.option;if(!n)throw new Error('select command requires an "option" field');await gn(t),await Jt(t);let o=io(t,n);return await hn(),{result:`selected "${o}"`,matched:r}}case"wait":{let{matched:t,elapsed:r}=await oo(e);return{result:"ok",matched:t,elapsed:r}}case"styles":{let t=e.properties;return{result:Zu(e,t)}}case"evaluate":{let t=e.script;if(!t)throw new Error('evaluate command requires a "script" field');return{result:await ao(t)}}case"screenshotFullPage":{let t=We();t.scrollTop=0,await ie(500);let{image:r,width:n,height:o}=await At(),i=e.uploadUrl,a=e.uploadFields;if(i&&a){let s=atob(r),c=new Uint8Array(s.length);for(let f=0;f<s.length;f++)c[f]=s.charCodeAt(f);let l=new FormData;for(let[f,m]of Object.entries(a))l.append(f,m);l.append("file",new Blob([c],{type:"image/jpeg"}),"screenshot.jpg");let u=await fetch(i,{method:"POST",body:l});if(!u.ok)throw new Error(`Screenshot upload failed: ${u.status}`);let d=e._publicUrl;return{result:{width:n,height:o,uploaded:!0,...d?{_publicUrl:d}:{}}}}return{result:{image:r,width:n,height:o}}}case"screenshotViewport":{let{image:t,width:r,height:n}=await At({viewportOnly:!0}),o=e.uploadUrl,i=e.uploadFields;if(o&&i){let a=atob(t),s=new Uint8Array(a.length);for(let d=0;d<a.length;d++)s[d]=a.charCodeAt(d);let c=new FormData;for(let[d,f]of Object.entries(i))c.append(d,f);c.append("file",new Blob([s],{type:"image/jpeg"}),"screenshot.jpg");let l=await fetch(o,{method:"POST",body:c});if(!l.ok)throw new Error(`Screenshot upload failed: ${l.status}`);let u=e._publicUrl;return{result:{width:r,height:n,uploaded:!0,...u?{_publicUrl:u}:{}}}}return{result:{image:t,width:r,height:n}}}case"reload":return location.reload(),{result:"ok"};default:throw new Error(`Unknown command: ${e.command}`)}}var Qu="/__mindstudio_dev__/ws",ed=1e3,td=1e4;function qi(){let e=A().ws;e.ws||(Bn(or),window.addEventListener("beforeunload",()=>{e.closing=!0,e.ws&&e.ws.close()}),ji())}function or(){let{ws:e}=A().ws;return e&&e.readyState===WebSocket.OPEN?e:null}function rd(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}${Qu}`}function nd(){return window.location.search.includes("mode=iframe")?"iframe":"standalone"}function ji(){let e=A().ws;if(!e.closing){try{e.ws=new WebSocket(rd())}catch{Yi();return}e.ws.onopen=()=>{try{let t=(()=>{try{return sessionStorage.getItem("__ms_mirror")==="1"}catch{return!1}})();e.ws.send(JSON.stringify({type:"hello",mode:nd(),url:location.href,viewport:{w:window.innerWidth,h:window.innerHeight},mirror:t}))}catch{e.ws?.close()}},e.ws.onmessage=t=>{let r;try{r=JSON.parse(t.data)}catch{return}switch(r.type){case"ack":e.clientId=r.clientId,e.reconnectDelay=ed,id();break;case"command":od(r.id,r.steps);break;case"broadcast":ad(r.action,r.payload);break}},e.ws.onclose=()=>{e.ws=null,e.clientId=null,e.closing||Yi()},e.ws.onerror=()=>{}}}function Yi(){let e=A().ws;e.closing||(setTimeout(()=>ji(),e.reconnectDelay),e.reconnectDelay=Math.min(e.reconnectDelay*2,td))}async function od(e,t){let r=A().ws;if(r.busy){nr({id:e,steps:[],snapshot:"",logs:[],duration:0,error:"Browser agent is busy"});return}r.busy=!0,bn("command-started",{id:e,steps:t.map(n=>n.command)});try{let n=await rr(e,t);nr(n),bn("command-completed",{id:e,success:!0})}catch{nr({id:e,steps:[],snapshot:"",logs:[],duration:0}),bn("command-completed",{id:e,success:!1})}finally{A().ws.busy=!1}}function nr(e){try{let t=or();t&&t.send(JSON.stringify({type:"result",...e}))}catch{}}async function id(){let e=await Gi();e&&nr(e)}function bn(e,t){window.parent!==window&&window.parent.postMessage({channel:"mindstudio-browser-agent",command:e,...t},"*")}function ad(e,t){e==="reload"&&(document.cookie="__ms_auth=; Max-Age=0; Path=/; Secure; SameSite=None",location.href="/")}var Zi="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",sd=200,Xi=`
112
112
  all: initial !important;
113
113
  display: block !important;
114
114
  box-sizing: border-box !important;
@@ -190,7 +190,7 @@ ${g}
190
190
  ${Xi}
191
191
  box-shadow: ${kt.inactive};
192
192
  cursor: grab;
193
- `;let f=Ki();return u.appendChild(d),u.appendChild(f),i.appendChild(a),i.appendChild(u),{id:o,type:"area",x:e,y:t,width:r,height:n,element:i,bubble:d,deleteBtn:f,state:"inactive"}}function ea(e){e.state="selected",e.bubble.contentEditable="false",e.bubble.style.boxShadow=kt.selected,e.bubble.style.cursor="grab",e.deleteBtn.style.display="block"}function ar(e){e.state="editing",e.bubble.contentEditable="true",e.bubble.style.boxShadow=kt.editing,e.bubble.style.cursor="text",e.deleteBtn.style.display="block",e.bubble.focus();let t=window.getSelection();t&&(t.selectAllChildren(e.bubble),t.collapseToEnd())}function st(e){return e.bubble.textContent?.trim()||""?(e.state="inactive",e.bubble.contentEditable="false",e.bubble.style.boxShadow=kt.inactive,e.bubble.style.cursor="grab",e.deleteBtn.style.display="none",!0):!1}var xe="#DD2590",cd="__mindstudio-notes-overlay",ud="__mindstudio-notes-cursor",dd=5,fd=`<svg width="25" height="26" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg">
193
+ `;let f=Ki();return u.appendChild(d),u.appendChild(f),i.appendChild(a),i.appendChild(u),{id:o,type:"area",x:e,y:t,width:r,height:n,element:i,bubble:d,deleteBtn:f,state:"inactive"}}function ea(e){e.state="selected",e.bubble.contentEditable="false",e.bubble.style.boxShadow=kt.selected,e.bubble.style.cursor="grab",e.deleteBtn.style.display="block"}function ir(e){e.state="editing",e.bubble.contentEditable="true",e.bubble.style.boxShadow=kt.editing,e.bubble.style.cursor="text",e.deleteBtn.style.display="block",e.bubble.focus();let t=window.getSelection();t&&(t.selectAllChildren(e.bubble),t.collapseToEnd())}function st(e){return e.bubble.textContent?.trim()||""?(e.state="inactive",e.bubble.contentEditable="false",e.bubble.style.boxShadow=kt.inactive,e.bubble.style.cursor="grab",e.deleteBtn.style.display="none",!0):!1}var xe="#DD2590",cd="__mindstudio-notes-overlay",ud="__mindstudio-notes-cursor",dd=5,fd=`<svg width="25" height="26" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg">
194
194
  <g filter="url(#filter0_d_notes)">
195
195
  <path d="M12.5448 26L6.72762 5.59339L26 14.8132L17.1816 17.9377L12.5448 26Z" fill="${xe}"/>
196
196
  <path d="M6.9457 5.14539L26.2178 14.3651L27.2985 14.8826L26.1697 15.2813L17.5259 18.3444L12.9812 26.2464L12.3881 27.2792L12.0614 26.1349L6.24434 5.72851L5.94119 4.66488L6.9457 5.14539Z" stroke="${xe}"/>
@@ -222,17 +222,17 @@ ${g}
222
222
  z-index: 2147483647;
223
223
  pointer-events: none;
224
224
  will-change: left, top;
225
- `,e.overlay.addEventListener("pointerdown",aa),e.overlay.addEventListener("pointermove",ia),document.addEventListener("pointermove",sa,{capture:!0}),document.addEventListener("pointerup",la,{capture:!0}),document.addEventListener("pointercancel",ca,{capture:!0}),document.addEventListener("keydown",ua),document.body.appendChild(e.overlay),document.body.appendChild(e.cursorEl))}function na(){let e=A().noteLayer;document.removeEventListener("pointermove",sa,{capture:!0}),document.removeEventListener("pointerup",la,{capture:!0}),document.removeEventListener("pointercancel",ca,{capture:!0}),document.removeEventListener("keydown",ua),e.overlay&&(e.overlay.removeEventListener("pointerdown",aa),e.overlay.removeEventListener("pointermove",ia),e.overlay.remove(),e.overlay=null),e.cursorEl&&(e.cursorEl.remove(),e.cursorEl=null),e.notes=[],e.currentNote=null,lt()}function oa(){let e=A().noteLayer;e.cursorEl&&(e.cursorEl.style.display="none"),e.movingNote=null,e.consumedByDeactivation=!1,lt()}function ia(e){let t=A().noteLayer;if(!t.cursorEl||!t.overlay)return;t.cursorEl.style.left=`${e.clientX}px`,t.cursorEl.style.top=`${e.clientY}px`,da(e.target)?(t.cursorEl.style.display="none",t.overlay.style.cursor=""):(t.cursorEl.style.display="",t.overlay.style.cursor="none")}function aa(e){let t=A().noteLayer;if(!t.overlay)return;let r=e.target;if(r.dataset?.deleteBtn==="true"||r.closest("[data-delete-btn]")){let o=r.closest("[data-note-id]");if(o){let i=t.notes.find(a=>a.id===o.id);if(i){Ge(i),e.preventDefault(),e.stopPropagation();return}}}t.overlay.setPointerCapture(e.pointerId);let n=da(e.target);if(n){if(n.state==="editing")return;if(n.state==="selected"){let o=e.target;if(o.dataset?.bubble==="true"||o.closest("[data-bubble]")){ar(n),t.currentNote=n,e.preventDefault();return}ta(n,e),e.preventDefault();return}t.currentNote&&t.currentNote!==n&&(st(t.currentNote)||Ge(t.currentNote)),ea(n),t.currentNote=n,ta(n,e),e.preventDefault();return}if(t.currentNote&&(t.currentNote.state==="editing"||t.currentNote.state==="selected")){st(t.currentNote)||Ge(t.currentNote),t.currentNote=null,t.consumedByDeactivation=!0,e.preventDefault();return}t.pointerDown=!0,t.startX=e.clientX,t.startY=e.clientY,t.didDrag=!1,t.consumedByDeactivation=!1,e.preventDefault()}function sa(e){let t=A().noteLayer;if(t.movingNote){let o=e.clientX-t.moveOffsetX,i=e.clientY-t.moveOffsetY;t.movingNote.x=o,t.movingNote.y=i,t.movingNote.element.style.left=`${o}px`,t.movingNote.element.style.top=`${i}px`;return}if(!t.pointerDown||!t.overlay)return;let r=e.clientX-t.startX,n=e.clientY-t.startY;Math.sqrt(r*r+n*n)>dd&&(t.didDrag=!0,t.dragPreview||(t.dragPreview=document.createElement("div"),t.dragPreview.style.cssText=`
225
+ `,e.overlay.addEventListener("pointerdown",aa),e.overlay.addEventListener("pointermove",ia),document.addEventListener("pointermove",sa,{capture:!0}),document.addEventListener("pointerup",la,{capture:!0}),document.addEventListener("pointercancel",ca,{capture:!0}),document.addEventListener("keydown",ua),document.body.appendChild(e.overlay),document.body.appendChild(e.cursorEl))}function na(){let e=A().noteLayer;document.removeEventListener("pointermove",sa,{capture:!0}),document.removeEventListener("pointerup",la,{capture:!0}),document.removeEventListener("pointercancel",ca,{capture:!0}),document.removeEventListener("keydown",ua),e.overlay&&(e.overlay.removeEventListener("pointerdown",aa),e.overlay.removeEventListener("pointermove",ia),e.overlay.remove(),e.overlay=null),e.cursorEl&&(e.cursorEl.remove(),e.cursorEl=null),e.notes=[],e.currentNote=null,lt()}function oa(){let e=A().noteLayer;e.cursorEl&&(e.cursorEl.style.display="none"),e.movingNote=null,e.consumedByDeactivation=!1,lt()}function ia(e){let t=A().noteLayer;if(!t.cursorEl||!t.overlay)return;t.cursorEl.style.left=`${e.clientX}px`,t.cursorEl.style.top=`${e.clientY}px`,da(e.target)?(t.cursorEl.style.display="none",t.overlay.style.cursor=""):(t.cursorEl.style.display="",t.overlay.style.cursor="none")}function aa(e){let t=A().noteLayer;if(!t.overlay)return;let r=e.target;if(r.dataset?.deleteBtn==="true"||r.closest("[data-delete-btn]")){let o=r.closest("[data-note-id]");if(o){let i=t.notes.find(a=>a.id===o.id);if(i){Ve(i),e.preventDefault(),e.stopPropagation();return}}}t.overlay.setPointerCapture(e.pointerId);let n=da(e.target);if(n){if(n.state==="editing")return;if(n.state==="selected"){let o=e.target;if(o.dataset?.bubble==="true"||o.closest("[data-bubble]")){ir(n),t.currentNote=n,e.preventDefault();return}ta(n,e),e.preventDefault();return}t.currentNote&&t.currentNote!==n&&(st(t.currentNote)||Ve(t.currentNote)),ea(n),t.currentNote=n,ta(n,e),e.preventDefault();return}if(t.currentNote&&(t.currentNote.state==="editing"||t.currentNote.state==="selected")){st(t.currentNote)||Ve(t.currentNote),t.currentNote=null,t.consumedByDeactivation=!0,e.preventDefault();return}t.pointerDown=!0,t.startX=e.clientX,t.startY=e.clientY,t.didDrag=!1,t.consumedByDeactivation=!1,e.preventDefault()}function sa(e){let t=A().noteLayer;if(t.movingNote){let o=e.clientX-t.moveOffsetX,i=e.clientY-t.moveOffsetY;t.movingNote.x=o,t.movingNote.y=i,t.movingNote.element.style.left=`${o}px`,t.movingNote.element.style.top=`${i}px`;return}if(!t.pointerDown||!t.overlay)return;let r=e.clientX-t.startX,n=e.clientY-t.startY;Math.sqrt(r*r+n*n)>dd&&(t.didDrag=!0,t.dragPreview||(t.dragPreview=document.createElement("div"),t.dragPreview.style.cssText=`
226
226
  position: fixed;
227
227
  border: 4px dashed ${xe};
228
228
  border-radius: 12px;
229
229
  pointer-events: none;
230
230
  z-index: 2;
231
- `,t.overlay.appendChild(t.dragPreview)),t.dragPreview.style.left=`${Math.min(t.startX,e.clientX)}px`,t.dragPreview.style.top=`${Math.min(t.startY,e.clientY)}px`,t.dragPreview.style.width=`${Math.abs(r)}px`,t.dragPreview.style.height=`${Math.abs(n)}px`)}function la(e){let t=A().noteLayer;if(t.overlay)try{t.overlay.releasePointerCapture(e.pointerId)}catch{}if(t.movingNote){t.movingNote=null;return}if(t.consumedByDeactivation){t.consumedByDeactivation=!1,lt();return}if(!t.pointerDown||!t.overlay){lt();return}if(t.didDrag){t.dragPreview&&(t.dragPreview.remove(),t.dragPreview=null);let r=Math.min(t.startX,e.clientX),n=Math.min(t.startY,e.clientY),o=Math.abs(e.clientX-t.startX),i=Math.abs(e.clientY-t.startY);if(o>10&&i>10){let a=Qi(r,n,o,i);t.overlay.appendChild(a.element),t.notes.push(a),ar(a),t.currentNote=a}}else{let r=Ji(e.clientX,e.clientY);t.overlay.appendChild(r.element),t.notes.push(r),ar(r),t.currentNote=r}lt()}function ca(){let e=A().noteLayer;e.dragPreview&&(e.dragPreview.remove(),e.dragPreview=null),e.movingNote=null,lt()}function ua(e){let t=A().noteLayer;if(t.currentNote){if(e.key==="Enter"&&!e.shiftKey&&t.currentNote.state==="editing"){st(t.currentNote)||Ge(t.currentNote),t.currentNote=null,e.preventDefault();return}if(e.key==="Escape"){t.currentNote.state==="editing"?(st(t.currentNote)||Ge(t.currentNote),t.currentNote=null):t.currentNote.state==="selected"&&(st(t.currentNote),t.currentNote=null),e.preventDefault();return}if(t.currentNote.state==="selected"&&(e.key==="Delete"||e.key==="Backspace")){Ge(t.currentNote),t.currentNote=null,e.preventDefault();return}t.currentNote.state==="editing"&&(e.key==="Backspace"||e.key==="Delete")&&t.currentNote.bubble.textContent?.trim()===""&&(Ge(t.currentNote),t.currentNote=null,e.preventDefault())}}function ta(e,t){let r=A().noteLayer;r.movingNote=e,r.moveOffsetX=t.clientX-e.x,r.moveOffsetY=t.clientY-e.y}function da(e){let t=A().noteLayer;for(let r of t.notes)if(r.element.contains(e))return r;return null}function Ge(e){let t=A().noteLayer;e.element.remove(),t.notes=t.notes.filter(r=>r.id!==e.id),t.currentNote===e&&(t.currentNote=null)}function lt(){let e=A().noteLayer;e.pointerDown=!1,e.startX=0,e.startY=0,e.didDrag=!1,e.dragPreview&&(e.dragPreview.remove(),e.dragPreview=null)}function fa(){let e=A().notesMode;e.active||(e.active=!0,A().touch.active&&(Xt(),e.wasTouchActive=!0),ra())}function ma(){let e=A().notesMode;e.active&&(e.active=!1,na(),e.wasTouchActive&&(e.wasTouchActive=!1,xt()))}async function pa(){let{image:e}=await At({viewportOnly:!0});return e}var wn="mindstudio-browser-agent";function ha(){let e=A(),t=new URLSearchParams(window.location.search);e.zoom.pipMode=t.get("display-mode")==="pip",e.zoom.mobilePreview=t.get("preview")==="mobile"||window.innerWidth<768;try{let r=sessionStorage.getItem("__ms_pip");r==="1"?e.zoom.pipMode=!0:r==="0"&&(e.zoom.pipMode=!1);let n=sessionStorage.getItem("__ms_mobile");n==="1"?e.zoom.mobilePreview=!0:n==="0"&&(e.zoom.mobilePreview=!1)}catch{}e.messages.handler||(e.messages.handler=async r=>{if(r.source===window)return;let n=r.data;if(!(!n||typeof n.command!="string")&&n.channel===wn)switch(n.command){case"notes-enter":fa();break;case"notes-exit":ma();break;case"notes-cursor-hide":oa();break;case"notes-screenshot":{try{let o=await pa();window.parent.postMessage({channel:wn,command:"screenshot-result",image:o},"*")}catch(o){window.parent.postMessage({channel:wn,command:"screenshot-result",error:o instanceof Error?o.message:"Screenshot failed"},"*")}break}case"cursor-show":tr("visible");break;case"cursor-hide":tr("hidden");break;case"cursor-auto":tr(null);break;case"navigate":typeof n.url=="string"&&(window.history.pushState(null,"",n.url),window.dispatchEvent(new PopStateEvent("popstate")));break;case"display-mode-pip":e.zoom.pipMode=!0;try{sessionStorage.setItem("__ms_pip","1")}catch{}break;case"display-mode-full":e.zoom.pipMode=!1;try{sessionStorage.setItem("__ms_pip","0")}catch{}break;case"preview-mode-mobile":e.zoom.mobilePreview=!0;try{sessionStorage.setItem("__ms_mobile","1")}catch{}xt(),fn(!0);break;case"preview-mode-desktop":e.zoom.mobilePreview=!1;try{sessionStorage.setItem("__ms_mobile","0")}catch{}Xt(),fn(!1);break}},window.addEventListener("message",e.messages.handler))}var ae;(function(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"})(ae||(ae={}));function md(e){return e.nodeType===e.ELEMENT_NODE}function je(e){var t=e?.host;return t?.shadowRoot===e}function Ye(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function pd(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function vn(e){try{var t=e.rules||e.cssRules;return t?pd(Array.from(t).map(Cn).join("")):null}catch{return null}}function Cn(e){var t=e.cssText;if(hd(e))try{t=vn(e.styleSheet)||t}catch{}return t}function hd(e){return"styleSheet"in e}var ba=(function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){var n=this.getNode(t);if(n){var o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(r,o)}this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e})();function wa(){return new ba}function Tt(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[r.toLowerCase()]||t[n])&&(i?a=i(a):a="*".repeat(a.length)),a}var ga="__rrweb_original__";function gd(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var i=t.getImageData,a=ga in i?i[ga]:i,s=new Uint32Array(a.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(s.some(function(c){return c!==0}))return!1}return!0}var yd=1,bd=new RegExp("[^a-z0-9-_:]"),qe=-2;function Sn(){return yd++}function wd(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return bd.test(t)?"div":t}function vd(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function Cd(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var ct,ya,Sd=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,xd=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Id=/^(data:)([^,]*),(.*)/i;function sr(e,t){return(e||"").replace(Sd,function(r,n,o,i,a,s){var c=o||a||s,l=n||i||"";if(!c)return r;if(!xd.test(c)||Id.test(c))return"url(".concat(l).concat(c).concat(l,")");if(c[0]==="/")return"url(".concat(l).concat(Cd(t)+c).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var f=0,m=d;f<m.length;f++){var p=m[f];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(l).concat(u.join("/")).concat(l,")")})}var Ad=/^[^ \t\n\r\u000c]+/,Ed=/^[, \t\n\r\u000c]+/;function kd(e,t){if(t.trim()==="")return t;var r=0;function n(l){var u,d=l.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(Ed),!(r>=t.length);){var i=n(Ad);if(i.slice(-1)===",")i=ut(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=ut(e,i);for(var s=!1;;){var c=t.charAt(r);if(c===""){o.push((i+a).trim());break}else if(s)c===")"&&(s=!1);else if(c===","){r+=1,o.push((i+a).trim());break}else c==="("&&(s=!0);a+=c,r+=1}}}return o.join(", ")}function ut(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function Md(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function xn(){var e=document.createElement("a");return e.href="",e.href}function In(e,t,r,n){return r==="src"||r==="href"&&n&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?ut(e,n):r==="srcset"&&n?kd(e,n):r==="style"&&n?sr(n,xn()):t==="object"&&r==="data"&&n?ut(e,n):n}function Td(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function Mt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Mt(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?Mt(e.parentNode,t,r):!1}function An(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest(".".concat(t)))return!0}else if(Mt(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function Nd(e,t,r){var n=e.contentWindow;if(n){var o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var s="about:blank";if(n.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Ld(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(i),n=!0,t()})}}function Rd(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,u=l===void 0?{}:l,d=t.maskTextFn,f=t.maskInputFn,m=t.dataURLOptions,p=m===void 0?{}:m,g=t.inlineImages,h=t.recordCanvas,y=t.keepIframeSrcFn,v=t.newlyAddedElement,w=v===void 0?!1:v,b=Fd(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ae.Document,childNodes:[],compatMode:e.compatMode}:{type:ae.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ae.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return Od(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:c,maskInputOptions:u,maskInputFn:f,dataURLOptions:p,inlineImages:g,recordCanvas:h,keepIframeSrcFn:y,newlyAddedElement:w,rootId:b});case e.TEXT_NODE:return _d(e,{maskTextClass:a,maskTextSelector:s,maskTextFn:d,rootId:b});case e.CDATA_SECTION_NODE:return{type:ae.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:ae.Comment,textContent:e.textContent||"",rootId:b};default:return!1}}function Fd(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function _d(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,a=t.rootId,s=e.parentNode&&e.parentNode.tagName,c=e.textContent,l=s==="STYLE"?!0:void 0,u=s==="SCRIPT"?!0:void 0;if(l&&c){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(c=vd(e.parentNode.sheet))}catch(d){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(d),e)}c=sr(c,xn())}return u&&(c="SCRIPT_PLACEHOLDER"),!l&&!u&&c&&An(e,n,o)&&(c=i?i(c):c.replace(/[\S]/g,"*")),{type:ae.Text,textContent:c||"",isStyle:l,rootId:a}}function Od(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,a=t.maskInputOptions,s=a===void 0?{}:a,c=t.maskInputFn,l=t.dataURLOptions,u=l===void 0?{}:l,d=t.inlineImages,f=t.recordCanvas,m=t.keepIframeSrcFn,p=t.newlyAddedElement,g=p===void 0?!1:p,h=t.rootId,y=Td(e,n,o),v=wd(e),w={},b=e.attributes.length,S=0;S<b;S++){var I=e.attributes[S];w[I.name]=In(r,v,I.name,I.value)}if(v==="link"&&i){var C=Array.from(r.styleSheets).find(function(_){return _.href===e.href}),x=null;C&&(x=vn(C)),x&&(delete w.rel,delete w.href,w._cssText=sr(x,C.href))}if(v==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var x=vn(e.sheet);x&&(w._cssText=sr(x,xn()))}if(v==="input"||v==="textarea"||v==="select"){var N=e.value,B=e.checked;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&N?w.value=Tt({type:w.type,tagName:v,value:N,maskInputOptions:s,maskInputFn:c}):B&&(w.checked=B)}if(v==="option"&&(e.selected&&!s.select?w.selected=!0:delete w.selected),v==="canvas"&&f){if(e.__context==="2d")gd(e)||(w.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var $=e.toDataURL(u.type,u.quality),M=document.createElement("canvas");M.width=e.width,M.height=e.height;var k=M.toDataURL(u.type,u.quality);$!==k&&(w.rr_dataURL=$)}}if(v==="img"&&d){ct||(ct=r.createElement("canvas"),ya=ct.getContext("2d"));var O=e,V=O.crossOrigin;O.crossOrigin="anonymous";var K=function(){try{ct.width=O.naturalWidth,ct.height=O.naturalHeight,ya.drawImage(O,0,0),w.rr_dataURL=ct.toDataURL(u.type,u.quality)}catch(_){console.warn("Cannot inline img src=".concat(O.currentSrc,"! Error: ").concat(_))}V?w.crossOrigin=V:O.removeAttribute("crossorigin")};O.complete&&O.naturalWidth!==0?K():O.onload=K}if((v==="audio"||v==="video")&&(w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime),g||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop)),y){var R=e.getBoundingClientRect(),F=R.width,D=R.height;w={class:w.class,rr_width:"".concat(F,"px"),rr_height:"".concat(D,"px")}}return v==="iframe"&&!m(w.src)&&(e.contentDocument||(w.rr_src=w.src),delete w.src),{type:ae.Element,tagName:v,attributes:w,childNodes:[],isSVG:Md(e)||void 0,needBlock:y,rootId:h}}function Z(e){return e===void 0?"":e.toLowerCase()}function Dd(e,t){if(t.comment&&e.type===ae.Comment)return!0;if(e.type===ae.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Z(e.attributes.name)==="application-name"||Z(e.attributes.rel)==="icon"||Z(e.attributes.rel)==="apple-touch-icon"||Z(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&Z(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Z(e.attributes.property).match(/^(og|twitter|fb):/)||Z(e.attributes.name).match(/^(og|twitter):/)||Z(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(Z(e.attributes.name)==="robots"||Z(e.attributes.name)==="googlebot"||Z(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(Z(e.attributes.name)==="author"||Z(e.attributes.name)==="generator"||Z(e.attributes.name)==="framework"||Z(e.attributes.name)==="publisher"||Z(e.attributes.name)==="progid"||Z(e.attributes.property).match(/^article:/)||Z(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(Z(e.attributes.name)==="google-site-verification"||Z(e.attributes.name)==="yandex-verification"||Z(e.attributes.name)==="csrf-token"||Z(e.attributes.name)==="p:domain_verify"||Z(e.attributes.name)==="verify-v1"||Z(e.attributes.name)==="verification"||Z(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function ze(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,c=t.skipChild,l=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,f=t.maskInputOptions,m=f===void 0?{}:f,p=t.maskTextFn,g=t.maskInputFn,h=t.slimDOMOptions,y=t.dataURLOptions,v=y===void 0?{}:y,w=t.inlineImages,b=w===void 0?!1:w,S=t.recordCanvas,I=S===void 0?!1:S,C=t.onSerialize,x=t.onIframeLoad,N=t.iframeLoadTimeout,B=N===void 0?5e3:N,$=t.onStylesheetLoad,M=t.stylesheetLoadTimeout,k=M===void 0?5e3:M,O=t.keepIframeSrcFn,V=O===void 0?function(){return!1}:O,K=t.newlyAddedElement,R=K===void 0?!1:K,F=t.preserveWhiteSpace,D=F===void 0?!0:F,_=Rd(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,dataURLOptions:v,inlineImages:b,recordCanvas:I,keepIframeSrcFn:V,newlyAddedElement:R});if(!_)return console.warn(e,"not serialized"),null;var ee;n.hasNode(e)?ee=n.getId(e):Dd(_,h)||!D&&_.type===ae.Text&&!_.isStyle&&!_.textContent.replace(/^\s+|\s+$/gm,"").length?ee=qe:ee=Sn();var P=Object.assign(_,{id:ee});if(n.add(e,P),ee===qe)return null;C&&C(e);var z=!l;if(P.type===ae.Element){z=z&&!P.needBlock,delete P.needBlock;var X=e.shadowRoot;X&&Ye(X)&&(P.isShadowHost=!0)}if((P.type===ae.Document||P.type===ae.Element)&&z){h.headWhitespace&&P.type===ae.Element&&P.tagName==="head"&&(D=!1);for(var ne={doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:l,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,slimDOMOptions:h,dataURLOptions:v,inlineImages:b,recordCanvas:I,preserveWhiteSpace:D,onSerialize:C,onIframeLoad:x,iframeLoadTimeout:B,onStylesheetLoad:$,stylesheetLoadTimeout:k,keepIframeSrcFn:V},T=0,G=Array.from(e.childNodes);T<G.length;T++){var J=G[T],Y=ze(J,ne);Y&&P.childNodes.push(Y)}if(md(e)&&e.shadowRoot)for(var ce=0,H=Array.from(e.shadowRoot.childNodes);ce<H.length;ce++){var J=H[ce],Y=ze(J,ne);Y&&(Ye(e.shadowRoot)&&(Y.isShadow=!0),P.childNodes.push(Y))}}return e.parentNode&&je(e.parentNode)&&Ye(e.parentNode)&&(P.isShadow=!0),P.type===ae.Element&&P.tagName==="iframe"&&Nd(e,function(){var se=e.contentDocument;if(se&&x){var De=ze(se,{doc:se,mirror:n,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,slimDOMOptions:h,dataURLOptions:v,inlineImages:b,recordCanvas:I,preserveWhiteSpace:D,onSerialize:C,onIframeLoad:x,iframeLoadTimeout:B,onStylesheetLoad:$,stylesheetLoadTimeout:k,keepIframeSrcFn:V});De&&x(e,De)}},B),P.type===ae.Element&&P.tagName==="link"&&P.attributes.rel==="stylesheet"&&Ld(e,function(){if($){var se=ze(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,slimDOMOptions:h,dataURLOptions:v,inlineImages:b,recordCanvas:I,preserveWhiteSpace:D,onSerialize:C,onIframeLoad:x,iframeLoadTimeout:B,onStylesheetLoad:$,stylesheetLoadTimeout:k,keepIframeSrcFn:V});se&&$(e,se)}},k),P}function va(e,t){var r=t||{},n=r.mirror,o=n===void 0?new ba:n,i=r.blockClass,a=i===void 0?"rr-block":i,s=r.blockSelector,c=s===void 0?null:s,l=r.maskTextClass,u=l===void 0?"rr-mask":l,d=r.maskTextSelector,f=d===void 0?null:d,m=r.inlineStylesheet,p=m===void 0?!0:m,g=r.inlineImages,h=g===void 0?!1:g,y=r.recordCanvas,v=y===void 0?!1:y,w=r.maskAllInputs,b=w===void 0?!1:w,S=r.maskTextFn,I=r.maskInputFn,C=r.slimDOM,x=C===void 0?!1:C,N=r.dataURLOptions,B=r.preserveWhiteSpace,$=r.onSerialize,M=r.onIframeLoad,k=r.iframeLoadTimeout,O=r.onStylesheetLoad,V=r.stylesheetLoadTimeout,K=r.keepIframeSrcFn,R=K===void 0?function(){return!1}:K,F=b===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:b===!1?{password:!0}:b,D=x===!0||x==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:x==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:x===!1?{}:x;return ze(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:f,skipChild:!1,inlineStylesheet:p,maskInputOptions:F,maskTextFn:S,maskInputFn:I,slimDOMOptions:D,dataURLOptions:N,inlineImages:h,recordCanvas:v,preserveWhiteSpace:B,onSerialize:$,onIframeLoad:M,iframeLoadTimeout:k,onStylesheetLoad:O,stylesheetLoadTimeout:V,keepIframeSrcFn:R,newlyAddedElement:!1})}var $d=/([^\\]):hover/,Tm=new RegExp($d.source,"g");function le(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var dt=`Please stop import mirror directly. Instead of that,\r
231
+ `,t.overlay.appendChild(t.dragPreview)),t.dragPreview.style.left=`${Math.min(t.startX,e.clientX)}px`,t.dragPreview.style.top=`${Math.min(t.startY,e.clientY)}px`,t.dragPreview.style.width=`${Math.abs(r)}px`,t.dragPreview.style.height=`${Math.abs(n)}px`)}function la(e){let t=A().noteLayer;if(t.overlay)try{t.overlay.releasePointerCapture(e.pointerId)}catch{}if(t.movingNote){t.movingNote=null;return}if(t.consumedByDeactivation){t.consumedByDeactivation=!1,lt();return}if(!t.pointerDown||!t.overlay){lt();return}if(t.didDrag){t.dragPreview&&(t.dragPreview.remove(),t.dragPreview=null);let r=Math.min(t.startX,e.clientX),n=Math.min(t.startY,e.clientY),o=Math.abs(e.clientX-t.startX),i=Math.abs(e.clientY-t.startY);if(o>10&&i>10){let a=Qi(r,n,o,i);t.overlay.appendChild(a.element),t.notes.push(a),ir(a),t.currentNote=a}}else{let r=Ji(e.clientX,e.clientY);t.overlay.appendChild(r.element),t.notes.push(r),ir(r),t.currentNote=r}lt()}function ca(){let e=A().noteLayer;e.dragPreview&&(e.dragPreview.remove(),e.dragPreview=null),e.movingNote=null,lt()}function ua(e){let t=A().noteLayer;if(t.currentNote){if(e.key==="Enter"&&!e.shiftKey&&t.currentNote.state==="editing"){st(t.currentNote)||Ve(t.currentNote),t.currentNote=null,e.preventDefault();return}if(e.key==="Escape"){t.currentNote.state==="editing"?(st(t.currentNote)||Ve(t.currentNote),t.currentNote=null):t.currentNote.state==="selected"&&(st(t.currentNote),t.currentNote=null),e.preventDefault();return}if(t.currentNote.state==="selected"&&(e.key==="Delete"||e.key==="Backspace")){Ve(t.currentNote),t.currentNote=null,e.preventDefault();return}t.currentNote.state==="editing"&&(e.key==="Backspace"||e.key==="Delete")&&t.currentNote.bubble.textContent?.trim()===""&&(Ve(t.currentNote),t.currentNote=null,e.preventDefault())}}function ta(e,t){let r=A().noteLayer;r.movingNote=e,r.moveOffsetX=t.clientX-e.x,r.moveOffsetY=t.clientY-e.y}function da(e){let t=A().noteLayer;for(let r of t.notes)if(r.element.contains(e))return r;return null}function Ve(e){let t=A().noteLayer;e.element.remove(),t.notes=t.notes.filter(r=>r.id!==e.id),t.currentNote===e&&(t.currentNote=null)}function lt(){let e=A().noteLayer;e.pointerDown=!1,e.startX=0,e.startY=0,e.didDrag=!1,e.dragPreview&&(e.dragPreview.remove(),e.dragPreview=null)}function fa(){let e=A().notesMode;e.active||(e.active=!0,A().touch.active&&(Xt(),e.wasTouchActive=!0),ra())}function ma(){let e=A().notesMode;e.active&&(e.active=!1,na(),e.wasTouchActive&&(e.wasTouchActive=!1,xt()))}async function pa(){let{image:e}=await At({viewportOnly:!0});return e}var wn="mindstudio-browser-agent";function ha(){let e=A(),t=new URLSearchParams(window.location.search);e.zoom.pipMode=t.get("display-mode")==="pip",e.zoom.mobilePreview=t.get("preview")==="mobile"||window.innerWidth<768;try{let r=sessionStorage.getItem("__ms_pip");r==="1"?e.zoom.pipMode=!0:r==="0"&&(e.zoom.pipMode=!1);let n=sessionStorage.getItem("__ms_mobile");n==="1"?e.zoom.mobilePreview=!0:n==="0"&&(e.zoom.mobilePreview=!1)}catch{}e.messages.handler||(e.messages.handler=async r=>{if(r.source===window)return;let n=r.data;if(!(!n||typeof n.command!="string")&&n.channel===wn)switch(n.command){case"notes-enter":fa();break;case"notes-exit":ma();break;case"notes-cursor-hide":oa();break;case"notes-screenshot":{try{let o=await pa();window.parent.postMessage({channel:wn,command:"screenshot-result",image:o},"*")}catch(o){window.parent.postMessage({channel:wn,command:"screenshot-result",error:o instanceof Error?o.message:"Screenshot failed"},"*")}break}case"cursor-show":er("visible");break;case"cursor-hide":er("hidden");break;case"cursor-auto":er(null);break;case"navigate":typeof n.url=="string"&&(window.history.pushState(null,"",n.url),window.dispatchEvent(new PopStateEvent("popstate")));break;case"display-mode-pip":e.zoom.pipMode=!0;try{sessionStorage.setItem("__ms_pip","1")}catch{}break;case"display-mode-full":e.zoom.pipMode=!1;try{sessionStorage.setItem("__ms_pip","0")}catch{}break;case"preview-mode-mobile":e.zoom.mobilePreview=!0;try{sessionStorage.setItem("__ms_mobile","1")}catch{}xt(),fn(!0);break;case"preview-mode-desktop":e.zoom.mobilePreview=!1;try{sessionStorage.setItem("__ms_mobile","0")}catch{}Xt(),fn(!1);break}},window.addEventListener("message",e.messages.handler))}var ae;(function(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"})(ae||(ae={}));function md(e){return e.nodeType===e.ELEMENT_NODE}function qe(e){var t=e?.host;return t?.shadowRoot===e}function ze(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function pd(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function vn(e){try{var t=e.rules||e.cssRules;return t?pd(Array.from(t).map(Cn).join("")):null}catch{return null}}function Cn(e){var t=e.cssText;if(hd(e))try{t=vn(e.styleSheet)||t}catch{}return t}function hd(e){return"styleSheet"in e}var ba=(function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){var n=this.getNode(t);if(n){var o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(r,o)}this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e})();function wa(){return new ba}function Tt(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[r.toLowerCase()]||t[n])&&(i?a=i(a):a="*".repeat(a.length)),a}var ga="__rrweb_original__";function gd(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var i=t.getImageData,a=ga in i?i[ga]:i,s=new Uint32Array(a.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(s.some(function(c){return c!==0}))return!1}return!0}var yd=1,bd=new RegExp("[^a-z0-9-_:]"),Ye=-2;function Sn(){return yd++}function wd(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return bd.test(t)?"div":t}function vd(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function Cd(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var ct,ya,Sd=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,xd=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Id=/^(data:)([^,]*),(.*)/i;function ar(e,t){return(e||"").replace(Sd,function(r,n,o,i,a,s){var c=o||a||s,l=n||i||"";if(!c)return r;if(!xd.test(c)||Id.test(c))return"url(".concat(l).concat(c).concat(l,")");if(c[0]==="/")return"url(".concat(l).concat(Cd(t)+c).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var f=0,m=d;f<m.length;f++){var p=m[f];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(l).concat(u.join("/")).concat(l,")")})}var Ad=/^[^ \t\n\r\u000c]+/,Ed=/^[, \t\n\r\u000c]+/;function kd(e,t){if(t.trim()==="")return t;var r=0;function n(l){var u,d=l.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(Ed),!(r>=t.length);){var i=n(Ad);if(i.slice(-1)===",")i=ut(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=ut(e,i);for(var s=!1;;){var c=t.charAt(r);if(c===""){o.push((i+a).trim());break}else if(s)c===")"&&(s=!1);else if(c===","){r+=1,o.push((i+a).trim());break}else c==="("&&(s=!0);a+=c,r+=1}}}return o.join(", ")}function ut(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function Md(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function xn(){var e=document.createElement("a");return e.href="",e.href}function In(e,t,r,n){return r==="src"||r==="href"&&n&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?ut(e,n):r==="srcset"&&n?kd(e,n):r==="style"&&n?ar(n,xn()):t==="object"&&r==="data"&&n?ut(e,n):n}function Td(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function Mt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Mt(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?Mt(e.parentNode,t,r):!1}function An(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest(".".concat(t)))return!0}else if(Mt(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function Nd(e,t,r){var n=e.contentWindow;if(n){var o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var s="about:blank";if(n.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Ld(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(i),n=!0,t()})}}function Rd(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,u=l===void 0?{}:l,d=t.maskTextFn,f=t.maskInputFn,m=t.dataURLOptions,p=m===void 0?{}:m,g=t.inlineImages,h=t.recordCanvas,y=t.keepIframeSrcFn,v=t.newlyAddedElement,w=v===void 0?!1:v,b=Fd(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ae.Document,childNodes:[],compatMode:e.compatMode}:{type:ae.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ae.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return Od(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:c,maskInputOptions:u,maskInputFn:f,dataURLOptions:p,inlineImages:g,recordCanvas:h,keepIframeSrcFn:y,newlyAddedElement:w,rootId:b});case e.TEXT_NODE:return _d(e,{maskTextClass:a,maskTextSelector:s,maskTextFn:d,rootId:b});case e.CDATA_SECTION_NODE:return{type:ae.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:ae.Comment,textContent:e.textContent||"",rootId:b};default:return!1}}function Fd(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function _d(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,a=t.rootId,s=e.parentNode&&e.parentNode.tagName,c=e.textContent,l=s==="STYLE"?!0:void 0,u=s==="SCRIPT"?!0:void 0;if(l&&c){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(c=vd(e.parentNode.sheet))}catch(d){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(d),e)}c=ar(c,xn())}return u&&(c="SCRIPT_PLACEHOLDER"),!l&&!u&&c&&An(e,n,o)&&(c=i?i(c):c.replace(/[\S]/g,"*")),{type:ae.Text,textContent:c||"",isStyle:l,rootId:a}}function Od(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,a=t.maskInputOptions,s=a===void 0?{}:a,c=t.maskInputFn,l=t.dataURLOptions,u=l===void 0?{}:l,d=t.inlineImages,f=t.recordCanvas,m=t.keepIframeSrcFn,p=t.newlyAddedElement,g=p===void 0?!1:p,h=t.rootId,y=Td(e,n,o),v=wd(e),w={},b=e.attributes.length,S=0;S<b;S++){var I=e.attributes[S];w[I.name]=In(r,v,I.name,I.value)}if(v==="link"&&i){var C=Array.from(r.styleSheets).find(function(_){return _.href===e.href}),x=null;C&&(x=vn(C)),x&&(delete w.rel,delete w.href,w._cssText=ar(x,C.href))}if(v==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var x=vn(e.sheet);x&&(w._cssText=ar(x,xn()))}if(v==="input"||v==="textarea"||v==="select"){var N=e.value,B=e.checked;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&N?w.value=Tt({type:w.type,tagName:v,value:N,maskInputOptions:s,maskInputFn:c}):B&&(w.checked=B)}if(v==="option"&&(e.selected&&!s.select?w.selected=!0:delete w.selected),v==="canvas"&&f){if(e.__context==="2d")gd(e)||(w.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var $=e.toDataURL(u.type,u.quality),M=document.createElement("canvas");M.width=e.width,M.height=e.height;var k=M.toDataURL(u.type,u.quality);$!==k&&(w.rr_dataURL=$)}}if(v==="img"&&d){ct||(ct=r.createElement("canvas"),ya=ct.getContext("2d"));var O=e,V=O.crossOrigin;O.crossOrigin="anonymous";var K=function(){try{ct.width=O.naturalWidth,ct.height=O.naturalHeight,ya.drawImage(O,0,0),w.rr_dataURL=ct.toDataURL(u.type,u.quality)}catch(_){console.warn("Cannot inline img src=".concat(O.currentSrc,"! Error: ").concat(_))}V?w.crossOrigin=V:O.removeAttribute("crossorigin")};O.complete&&O.naturalWidth!==0?K():O.onload=K}if((v==="audio"||v==="video")&&(w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime),g||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop)),y){var R=e.getBoundingClientRect(),F=R.width,D=R.height;w={class:w.class,rr_width:"".concat(F,"px"),rr_height:"".concat(D,"px")}}return v==="iframe"&&!m(w.src)&&(e.contentDocument||(w.rr_src=w.src),delete w.src),{type:ae.Element,tagName:v,attributes:w,childNodes:[],isSVG:Md(e)||void 0,needBlock:y,rootId:h}}function Z(e){return e===void 0?"":e.toLowerCase()}function Dd(e,t){if(t.comment&&e.type===ae.Comment)return!0;if(e.type===ae.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Z(e.attributes.name)==="application-name"||Z(e.attributes.rel)==="icon"||Z(e.attributes.rel)==="apple-touch-icon"||Z(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&Z(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Z(e.attributes.property).match(/^(og|twitter|fb):/)||Z(e.attributes.name).match(/^(og|twitter):/)||Z(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(Z(e.attributes.name)==="robots"||Z(e.attributes.name)==="googlebot"||Z(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(Z(e.attributes.name)==="author"||Z(e.attributes.name)==="generator"||Z(e.attributes.name)==="framework"||Z(e.attributes.name)==="publisher"||Z(e.attributes.name)==="progid"||Z(e.attributes.property).match(/^article:/)||Z(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(Z(e.attributes.name)==="google-site-verification"||Z(e.attributes.name)==="yandex-verification"||Z(e.attributes.name)==="csrf-token"||Z(e.attributes.name)==="p:domain_verify"||Z(e.attributes.name)==="verify-v1"||Z(e.attributes.name)==="verification"||Z(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ge(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,c=t.skipChild,l=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,f=t.maskInputOptions,m=f===void 0?{}:f,p=t.maskTextFn,g=t.maskInputFn,h=t.slimDOMOptions,y=t.dataURLOptions,v=y===void 0?{}:y,w=t.inlineImages,b=w===void 0?!1:w,S=t.recordCanvas,I=S===void 0?!1:S,C=t.onSerialize,x=t.onIframeLoad,N=t.iframeLoadTimeout,B=N===void 0?5e3:N,$=t.onStylesheetLoad,M=t.stylesheetLoadTimeout,k=M===void 0?5e3:M,O=t.keepIframeSrcFn,V=O===void 0?function(){return!1}:O,K=t.newlyAddedElement,R=K===void 0?!1:K,F=t.preserveWhiteSpace,D=F===void 0?!0:F,_=Rd(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,dataURLOptions:v,inlineImages:b,recordCanvas:I,keepIframeSrcFn:V,newlyAddedElement:R});if(!_)return console.warn(e,"not serialized"),null;var ee;n.hasNode(e)?ee=n.getId(e):Dd(_,h)||!D&&_.type===ae.Text&&!_.isStyle&&!_.textContent.replace(/^\s+|\s+$/gm,"").length?ee=Ye:ee=Sn();var P=Object.assign(_,{id:ee});if(n.add(e,P),ee===Ye)return null;C&&C(e);var z=!l;if(P.type===ae.Element){z=z&&!P.needBlock,delete P.needBlock;var X=e.shadowRoot;X&&ze(X)&&(P.isShadowHost=!0)}if((P.type===ae.Document||P.type===ae.Element)&&z){h.headWhitespace&&P.type===ae.Element&&P.tagName==="head"&&(D=!1);for(var ne={doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:l,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,slimDOMOptions:h,dataURLOptions:v,inlineImages:b,recordCanvas:I,preserveWhiteSpace:D,onSerialize:C,onIframeLoad:x,iframeLoadTimeout:B,onStylesheetLoad:$,stylesheetLoadTimeout:k,keepIframeSrcFn:V},T=0,G=Array.from(e.childNodes);T<G.length;T++){var J=G[T],Y=Ge(J,ne);Y&&P.childNodes.push(Y)}if(md(e)&&e.shadowRoot)for(var ce=0,H=Array.from(e.shadowRoot.childNodes);ce<H.length;ce++){var J=H[ce],Y=Ge(J,ne);Y&&(ze(e.shadowRoot)&&(Y.isShadow=!0),P.childNodes.push(Y))}}return e.parentNode&&qe(e.parentNode)&&ze(e.parentNode)&&(P.isShadow=!0),P.type===ae.Element&&P.tagName==="iframe"&&Nd(e,function(){var se=e.contentDocument;if(se&&x){var De=Ge(se,{doc:se,mirror:n,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,slimDOMOptions:h,dataURLOptions:v,inlineImages:b,recordCanvas:I,preserveWhiteSpace:D,onSerialize:C,onIframeLoad:x,iframeLoadTimeout:B,onStylesheetLoad:$,stylesheetLoadTimeout:k,keepIframeSrcFn:V});De&&x(e,De)}},B),P.type===ae.Element&&P.tagName==="link"&&P.attributes.rel==="stylesheet"&&Ld(e,function(){if($){var se=Ge(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:g,slimDOMOptions:h,dataURLOptions:v,inlineImages:b,recordCanvas:I,preserveWhiteSpace:D,onSerialize:C,onIframeLoad:x,iframeLoadTimeout:B,onStylesheetLoad:$,stylesheetLoadTimeout:k,keepIframeSrcFn:V});se&&$(e,se)}},k),P}function va(e,t){var r=t||{},n=r.mirror,o=n===void 0?new ba:n,i=r.blockClass,a=i===void 0?"rr-block":i,s=r.blockSelector,c=s===void 0?null:s,l=r.maskTextClass,u=l===void 0?"rr-mask":l,d=r.maskTextSelector,f=d===void 0?null:d,m=r.inlineStylesheet,p=m===void 0?!0:m,g=r.inlineImages,h=g===void 0?!1:g,y=r.recordCanvas,v=y===void 0?!1:y,w=r.maskAllInputs,b=w===void 0?!1:w,S=r.maskTextFn,I=r.maskInputFn,C=r.slimDOM,x=C===void 0?!1:C,N=r.dataURLOptions,B=r.preserveWhiteSpace,$=r.onSerialize,M=r.onIframeLoad,k=r.iframeLoadTimeout,O=r.onStylesheetLoad,V=r.stylesheetLoadTimeout,K=r.keepIframeSrcFn,R=K===void 0?function(){return!1}:K,F=b===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:b===!1?{password:!0}:b,D=x===!0||x==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:x==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:x===!1?{}:x;return Ge(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:f,skipChild:!1,inlineStylesheet:p,maskInputOptions:F,maskTextFn:S,maskInputFn:I,slimDOMOptions:D,dataURLOptions:N,inlineImages:h,recordCanvas:v,preserveWhiteSpace:B,onSerialize:$,onIframeLoad:M,iframeLoadTimeout:k,onStylesheetLoad:O,stylesheetLoadTimeout:V,keepIframeSrcFn:R,newlyAddedElement:!1})}var $d=/([^\\]):hover/,Tm=new RegExp($d.source,"g");function le(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var dt=`Please stop import mirror directly. Instead of that,\r
232
232
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
233
- or you can use record.mirror to access the mirror instance during recording.`,Ca={map:{},getId(){return console.error(dt),-1},getNode(){return console.error(dt),null},removeNodeFromMap(){console.error(dt)},has(){return console.error(dt),!1},reset(){console.error(dt)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Ca=new Proxy(Ca,{get(e,t,r){return t==="map"&&console.error(dt),Reflect.get(e,t,r)}}));function ft(e,t,r={}){let n=null,o=0;return function(...i){let a=Date.now();!o&&r.leading===!1&&(o=a);let s=t-(a-o),c=this;s<=0||s>t?(n&&(clearTimeout(n),n=null),o=a,e.apply(c,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(c,i)},s))}}function Ze(e,t,r,n,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>Ze(e,t,i||{},!0)}function we(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}function cr(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ur(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function te(e,t,r,n){if(!e)return!1;let o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if(typeof t=="string"){if(o.classList.contains(t)||n&&o.closest("."+t)!==null)return!0}else if(Mt(o,t,n))return!0;return!!(r&&(e.matches(r)||n&&o.closest(r)!==null))}function Sa(e,t){return t.getId(e)!==-1}function dr(e,t){return t.getId(e)===qe}function En(e,t){if(je(e))return!1;let r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?En(e.parentNode,t):!0:!0}function kn(e){return!!e.changedTouches}function xa(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),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function fr(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function mr(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function pr(e){return!!e?.shadowRoot}var lr=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var r;return(r=this.styleIDMap.get(t))!==null&&r!==void 0?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}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 U=(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))(U||{}),W=(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))(W||{}),hr=(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))(hr||{}),Le=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Le||{});function Ia(e){return"__ln"in e}var Mn=class{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){let r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Ia(t.previousSibling)){let n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&Ia(t.nextSibling)&&t.nextSibling.__ln.previous){let n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){let r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}},Aa=(e,t)=>`${e}@${t}`,gr=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let t=[],r=new Mn,n=s=>{let c=s,l=qe;for(;l===qe;)c=c&&c.nextSibling,l=c&&this.mirror.getId(c);return l},o=s=>{var c,l,u,d;let f=null;((l=(c=s.getRootNode)===null||c===void 0?void 0:c.call(s))===null||l===void 0?void 0:l.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&s.getRootNode().host&&(f=s.getRootNode().host);let m=f;for(;((d=(u=m?.getRootNode)===null||u===void 0?void 0:u.call(m))===null||d===void 0?void 0:d.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&m.getRootNode().host;)m=m.getRootNode().host;let p=!this.doc.contains(s)&&(!m||!this.doc.contains(m));if(!s.parentNode||p)return;let g=je(s.parentNode)?this.mirror.getId(f):this.mirror.getId(s.parentNode),h=n(s);if(g===-1||h===-1)return r.addNode(s);let y=ze(s,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:v=>{fr(v,this.mirror)&&this.iframeManager.addIframe(v),mr(v,this.mirror)&&this.stylesheetManager.trackLinkElement(v),pr(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(v,w)=>{this.iframeManager.attachIframe(v,w),this.shadowDomManager.observeAttachShadow(v)},onStylesheetLoad:(v,w)=>{this.stylesheetManager.attachLinkElement(v,w)}});y&&t.push({parentId:g,nextId:h,node:y})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let s of Array.from(this.movedSet.values()))Ea(this.removes,s,this.mirror)&&!this.movedSet.has(s.parentNode)||o(s);for(let s of Array.from(this.addedSet.values()))!ka(this.droppedSet,s)&&!Ea(this.removes,s,this.mirror)||ka(this.movedSet,s)?o(s):this.droppedSet.add(s);let i=null;for(;r.length;){let s=null;if(i){let c=this.mirror.getId(i.value.parentNode),l=n(i.value);c!==-1&&l!==-1&&(s=i)}if(!s)for(let c=r.length-1;c>=0;c--){let l=r.get(c);if(l){let u=this.mirror.getId(l.value.parentNode);if(n(l.value)===-1)continue;if(u!==-1){s=l;break}else{let f=l.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=f.parentNode.host;if(this.mirror.getId(m)!==-1){s=l;break}}}}}if(!s){for(;r.head;)r.removeNode(r.head.value);break}i=s.previous,r.removeNode(s.value),o(s.value)}let a={texts:this.texts.map(s=>({id:this.mirror.getId(s.node),value:s.value})).filter(s=>this.mirror.has(s.id)),attributes:this.attributes.map(s=>({id:this.mirror.getId(s.node),attributes:s.attributes})).filter(s=>this.mirror.has(s.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!dr(t.target,this.mirror))switch(t.type){case"characterData":{let r=t.target.textContent;!te(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:An(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=Tt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),te(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(r.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(n))if(!r.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){let i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});let a=o.attributes.style;for(let s of Array.from(r.style)){let c=r.style.getPropertyValue(s),l=r.style.getPropertyPriority(s);(c!==i.style.getPropertyValue(s)||l!==i.style.getPropertyPriority(s))&&(l===""?a[s]=c:a[s]=[c,l])}for(let s of Array.from(i.style))r.style.getPropertyValue(s)===""&&(a[s]=!1)}else o.attributes[t.attributeName]=In(this.doc,r.tagName,t.attributeName,n);break}case"childList":{if(te(t.target,this.blockClass,this.blockSelector,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),o=je(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);te(t.target,this.blockClass,this.blockSelector,!1)||dr(r,this.mirror)||!Sa(r,this.mirror)||(this.addedSet.has(r)?(Tn(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||En(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Aa(n,o)]?Tn(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:je(t.target)&&Ye(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(dr(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Aa(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);te(t,this.blockClass,this.blockSelector,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Tn(e,t){e.delete(t),t.childNodes.forEach(r=>Tn(e,r))}function Ea(e,t,r){return e.length===0?!1:Ma(e,t,r)}function Ma(e,t,r){let{parentNode:n}=t;if(!n)return!1;let o=r.getId(n);return e.some(i=>i.id===o)?!0:Ma(e,n,r)}function ka(e,t){return e.size===0?!1:Ta(e,t)}function Ta(e,t){let{parentNode:r}=t;return r?e.has(r)?!0:Ta(e,r):!1}var Oe=[],Ra=typeof CSSGroupingRule<"u",Fa=typeof CSSMediaRule<"u",_a=typeof CSSSupportsRule<"u",Oa=typeof CSSConditionRule<"u";function Nt(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function Nn(e,t){var r,n;let o=new gr;Oe.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver,a=(n=(r=window?.Zone)===null||r===void 0?void 0:r.__symbol__)===null||n===void 0?void 0:n.call(r,"MutationObserver");a&&window[a]&&(i=window[a]);let s=new i(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Pd({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,a=[],s,c=ft(d=>{let f=Date.now()-s;e(a.map(m=>(m.timeOffset-=f,m)),d),a=[],s=null},i),l=ft(d=>{let f=Nt(d),{clientX:m,clientY:p}=kn(d)?d.changedTouches[0]:d;s||(s=Date.now()),a.push({x:m,y:p,id:n.getId(f),timeOffset:Date.now()-s}),c(typeof DragEvent<"u"&&d instanceof DragEvent?W.Drag:d instanceof MouseEvent?W.MouseMove:W.TouchMove)},o,{trailing:!1}),u=[le("mousemove",l,r),le("touchmove",l,r),le("drag",l,r)];return()=>{u.forEach(d=>d())}}function Wd({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){if(i.mouseInteraction===!1)return()=>{};let a=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,s=[],c=l=>u=>{let d=Nt(u);if(te(d,n,o,!0))return;let f=kn(u)?u.changedTouches[0]:u;if(!f)return;let m=r.getId(d),{clientX:p,clientY:g}=f;e({type:hr[l],id:m,x:p,y:g})};return Object.keys(hr).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEach(l=>{let u=l.toLowerCase(),d=c(l);s.push(le(u,d,t))}),()=>{s.forEach(l=>l())}}function Ln({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){let a=ft(s=>{let c=Nt(s);if(!c||te(c,n,o,!0))return;let l=r.getId(c);if(c===t){let u=t.scrollingElement||t.documentElement;e({id:l,x:u.scrollLeft,y:u.scrollTop})}else e({id:l,x:c.scrollLeft,y:c.scrollTop})},i.scroll||100);return le("scroll",a,t)}function Bd({viewportResizeCb:e}){let t=-1,r=-1,n=ft(()=>{let o=cr(),i=ur();(t!==o||r!==i)&&(e({width:Number(i),height:Number(o)}),t=o,r=i)},200);return le("resize",n,window)}function Na(e,t){let r=Object.assign({},e);return t||delete r.userTriggered,r}var Ud=["INPUT","TEXTAREA","SELECT"],La=new WeakMap;function Hd({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:i,maskInputOptions:a,maskInputFn:s,sampling:c,userTriggeredOnInput:l}){function u(y){let v=Nt(y),w=y.isTrusted;if(v&&v.tagName==="OPTION"&&(v=v.parentElement),!v||!v.tagName||Ud.indexOf(v.tagName)<0||te(v,n,o,!0))return;let b=v.type;if(v.classList.contains(i))return;let S=v.value,I=!1;b==="radio"||b==="checkbox"?I=v.checked:(a[v.tagName.toLowerCase()]||a[b])&&(S=Tt({maskInputOptions:a,tagName:v.tagName,type:b,value:S,maskInputFn:s})),d(v,Na({text:S,isChecked:I,userTriggered:w},l));let C=v.name;b==="radio"&&C&&I&&t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach(x=>{x!==v&&d(x,Na({text:x.value,isChecked:!I,userTriggered:!1},l))})}function d(y,v){let w=La.get(y);if(!w||w.text!==v.text||w.isChecked!==v.isChecked){La.set(y,v);let b=r.getId(y);e(Object.assign(Object.assign({},v),{id:b}))}}let m=(c.input==="last"?["change"]:["input","change"]).map(y=>le(y,u,t)),p=t.defaultView;if(!p)return()=>{m.forEach(y=>y())};let g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),h=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...h.map(y=>Ze(y[0],y[1],{set(){u({target:this})}},!1,p))),()=>{m.forEach(y=>y())}}function yr(e){let t=[];function r(n,o){if(Ra&&n.parentRule instanceof CSSGroupingRule||Fa&&n.parentRule instanceof CSSMediaRule||_a&&n.parentRule instanceof CSSSupportsRule||Oa&&n.parentRule instanceof CSSConditionRule){let a=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(a)}else if(n.parentStyleSheet){let a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(a)}return o}return r(e,t)}function _e(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Vd({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){let o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(u,d){let{id:f,styleId:m}=_e(this,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,adds:[{rule:u,index:d}]}),o.apply(this,[u,d])};let i=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(u){let{id:d,styleId:f}=_e(this,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,removes:[{index:u}]}),i.apply(this,[u])};let a;n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=function(u){let{id:d,styleId:f}=_e(this,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replace:u}),a.apply(this,[u])});let s;n.CSSStyleSheet.prototype.replaceSync&&(s=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=function(u){let{id:d,styleId:f}=_e(this,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replaceSync:u}),s.apply(this,[u])});let c={};Ra?c.CSSGroupingRule=n.CSSGroupingRule:(Fa&&(c.CSSMediaRule=n.CSSMediaRule),Oa&&(c.CSSConditionRule=n.CSSConditionRule),_a&&(c.CSSSupportsRule=n.CSSSupportsRule));let l={};return Object.entries(c).forEach(([u,d])=>{l[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=function(f,m){let{id:p,styleId:g}=_e(this.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&e({id:p,styleId:g,adds:[{rule:f,index:[...yr(this),m||0]}]}),l[u].insertRule.apply(this,[f,m])},d.prototype.deleteRule=function(f){let{id:m,styleId:p}=_e(this.parentStyleSheet,t,r.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,removes:[{index:[...yr(this),f]}]}),l[u].deleteRule.apply(this,[f])}}),()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=i,a&&(n.CSSStyleSheet.prototype.replace=a),s&&(n.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([u,d])=>{d.prototype.insertRule=l[u].insertRule,d.prototype.deleteRule=l[u].deleteRule})}}function Rn({mirror:e,stylesheetManager:t},r){var n,o,i;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(r.host);let s=r.nodeName==="#document"?(n=r.defaultView)===null||n===void 0?void 0:n.Document:(i=(o=r.ownerDocument)===null||o===void 0?void 0:o.defaultView)===null||i===void 0?void 0:i.ShadowRoot,c=Object.getOwnPropertyDescriptor(s?.prototype,"adoptedStyleSheets");return a===null||a===-1||!s||!c?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var l;return(l=c.get)===null||l===void 0?void 0:l.call(this)},set(l){var u;let d=(u=c.set)===null||u===void 0?void 0:u.call(this,l);if(a!==null&&a!==-1)try{t.adoptStyleSheets(l,a)}catch{}return d}}),()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})}function Gd({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(s,c,l){var u;if(r.has(s))return i.apply(this,[s,c,l]);let{id:d,styleId:f}=_e((u=this.parentRule)===null||u===void 0?void 0:u.parentStyleSheet,t,n.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:s,value:c,priority:l},index:yr(this.parentRule)}),i.apply(this,[s,c,l])};let a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(s){var c;if(r.has(s))return a.apply(this,[s]);let{id:l,styleId:u}=_e((c=this.parentRule)===null||c===void 0?void 0:c.parentStyleSheet,t,n.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:s},index:yr(this.parentRule)}),a.apply(this,[s])},()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}}function zd({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o}){let i=s=>ft(c=>{let l=Nt(c);if(!l||te(l,t,r,!0))return;let{currentTime:u,volume:d,muted:f,playbackRate:m}=l;e({type:s,id:n.getId(l),currentTime:u,volume:d,muted:f,playbackRate:m})},o.media||500),a=[le("play",i(0)),le("pause",i(1)),le("seeked",i(2)),le("volumechange",i(3)),le("ratechange",i(4))];return()=>{a.forEach(s=>s())}}function Yd({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(c,l,u){let d=new i(c,l,u);return o.set(d,{family:c,buffer:typeof l!="string",descriptors:u,fontSource:typeof l=="string"?l:JSON.stringify(Array.from(new Uint8Array(l)))}),d};let a=we(t.fonts,"add",function(s){return function(c){return setTimeout(()=>{let l=o.get(c);l&&(e(l),o.delete(c))},0),s.apply(this,[c])}});return n.push(()=>{r.FontFace=i}),n.push(a),()=>{n.forEach(s=>s())}}function qd(e){let{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:i}=e,a=!0,s=()=>{let c=t.getSelection();if(!c||a&&c?.isCollapsed)return;a=c.isCollapsed||!1;let l=[],u=c.rangeCount||0;for(let d=0;d<u;d++){let f=c.getRangeAt(d),{startContainer:m,startOffset:p,endContainer:g,endOffset:h}=f;te(m,n,o,!0)||te(g,n,o,!0)||l.push({start:r.getId(m),startOffset:p,end:r.getId(g),endOffset:h})}i({ranges:l})};return s(),le("selectionchange",s)}function jd(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:m}=e;e.mutationCb=(...p)=>{t.mutation&&t.mutation(...p),r(...p)},e.mousemoveCb=(...p)=>{t.mousemove&&t.mousemove(...p),n(...p)},e.mouseInteractionCb=(...p)=>{t.mouseInteraction&&t.mouseInteraction(...p),o(...p)},e.scrollCb=(...p)=>{t.scroll&&t.scroll(...p),i(...p)},e.viewportResizeCb=(...p)=>{t.viewportResize&&t.viewportResize(...p),a(...p)},e.inputCb=(...p)=>{t.input&&t.input(...p),s(...p)},e.mediaInteractionCb=(...p)=>{t.mediaInteaction&&t.mediaInteaction(...p),c(...p)},e.styleSheetRuleCb=(...p)=>{t.styleSheetRule&&t.styleSheetRule(...p),l(...p)},e.styleDeclarationCb=(...p)=>{t.styleDeclaration&&t.styleDeclaration(...p),u(...p)},e.canvasMutationCb=(...p)=>{t.canvasMutation&&t.canvasMutation(...p),d(...p)},e.fontCb=(...p)=>{t.font&&t.font(...p),f(...p)},e.selectionCb=(...p)=>{t.selection&&t.selection(...p),m(...p)}}function Da(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};jd(e,t);let n=Nn(e,e.doc),o=Pd(e),i=Wd(e),a=Ln(e),s=Bd(e),c=Hd(e),l=zd(e),u=Vd(e,{win:r}),d=Rn(e,e.doc),f=Gd(e,{win:r}),m=e.collectFonts?Yd(e):()=>{},p=qd(e),g=[];for(let h of e.plugins)g.push(h.observer(h.callback,r,h.options));return()=>{Oe.forEach(h=>h.reset()),n.disconnect(),o(),i(),a(),s(),c(),l(),u(),d(),f(),m(),p(),g.forEach(h=>h())}}var Lt=class{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,o){let i=n||this.getIdToRemoteIdMap(t),a=o||this.getRemoteIdToIdMap(t),s=i.get(r);return s||(s=this.generateIdFn(),i.set(r,s),a.set(s,r)),s}getIds(t,r){let n=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return r.map(i=>this.getId(t,i,n,o))}getRemoteId(t,r,n){let o=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let i=o.get(r);return i||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(o=>this.getRemoteId(t,o,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}};var br=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Lt(Sn),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Lt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)===null||n===void 0||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){if(t.data.type==="rrweb"){if(!t.source)return;let n=this.crossOriginIframeMap.get(t.source);if(!n)return;let o=this.transformCrossOriginEvent(n,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}}transformCrossOriginEvent(t,r){var n;switch(r.type){case U.FullSnapshot:return this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t),{timestamp:r.timestamp,type:U.IncrementalSnapshot,data:{source:W.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case U.Meta:case U.Load:case U.DomContentLoaded:return!1;case U.Plugin:return r;case U.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case U.IncrementalSnapshot:switch(r.data.source){case W.Mutation:return r.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t)}),r.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),r.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),r.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case W.Drag:case W.TouchMove:case W.MouseMove:return r.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case W.ViewportResize:return!1;case W.MediaInteraction:case W.MouseInteraction:case W.Scroll:case W.CanvasMutation:case W.Input:return this.replaceIds(r.data,t,["id"]),r;case W.StyleSheetRule:case W.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case W.Font:return r;case W.Selection:return r.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),r;case W.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)===null||n===void 0||n.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),r}}}replace(t,r,n,o){for(let i of o)!Array.isArray(r[i])&&typeof r[i]!="number"||(Array.isArray(r[i])?r[i]=t.getIds(n,r[i]):r[i]=t.getId(n,r[i]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}};var wr=class{constructor(t){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;let r=this;this.restorePatches.push(we(Element.prototype,"attachShadow",function(n){return function(o){let i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,r){Ye(t)&&(this.shadowDoms.has(t)||(this.shadowDoms.add(t),Nn(Object.assign(Object.assign({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Ln(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),Rn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)},0)))}observeAttachShadow(t){if(t.contentWindow){let r=this;this.restorePatches.push(we(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){let i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t()),this.shadowDoms=new WeakSet}};function $a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Pa(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(u){try{l(n.next(u))}catch(d){a(d)}}function c(u){try{l(n.throw(u))}catch(d){a(d)}}function l(u){u.done?i(u.value):o(u.value).then(s,c)}l((n=n.apply(e,t||[])).next())})}var mt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zd=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Rt=0;Rt<mt.length;Rt++)Zd[mt.charCodeAt(Rt)]=Rt;var Rt,Wa=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=mt[t[r]>>2],o+=mt[(t[r]&3)<<4|t[r+1]>>4],o+=mt[(t[r+1]&15)<<2|t[r+2]>>6],o+=mt[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o};var Ba=new Map;function Xd(e,t){let r=Ba.get(e);return r||(r=new Map,Ba.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var Fn=(e,t,r)=>{if(!e||!(Ua(e,t)||typeof e=="object"))return;let n=e.constructor.name,o=Xd(r,n),i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function vr(e,t,r){if(e instanceof Array)return e.map(n=>vr(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,o=Wa(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[vr(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[vr(e.data,t,r),e.width,e.height]};if(Ua(e,t)||typeof e=="object"){let n=e.constructor.name,o=Fn(e,t,r);return{rr_type:n,index:o}}}}return e}var Cr=(e,t,r)=>[...e].map(n=>vr(n,t,r)),Ua=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o]);function Ha(e,t,r,n){let o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;let s=we(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...l){return te(this.canvas,r,n,!0)||setTimeout(()=>{let u=Cr([...l],t,this);e(this.canvas,{type:Le["2D"],property:a,args:u})},0),c.apply(this,l)}});o.push(s)}catch{let c=Ze(t.CanvasRenderingContext2D.prototype,a,{set(l){e(this.canvas,{type:Le["2D"],property:a,args:[l],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function _n(e,t,r){let n=[];try{let o=we(e.HTMLCanvasElement.prototype,"getContext",function(i){return function(a,...s){return te(this,t,r,!0)||"__context"in this||(this.__context=a),i.apply(this,[a,...s])}});n.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(o=>o())}}function Va(e,t,r,n,o,i,a){let s=[],c=Object.getOwnPropertyNames(e);for(let l of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let u=we(e,l,function(d){return function(...f){let m=d.apply(this,f);if(Fn(m,a,this),!te(this.canvas,n,o,!0)){let p=Cr([...f],a,this),g={type:t,property:l,args:p};r(this.canvas,g)}return m}});s.push(u)}catch{let d=Ze(e,l,{set(f){r(this.canvas,{type:t,property:l,args:[f],setter:!0})}});s.push(d)}return s}function Ga(e,t,r,n,o){let i=[];return i.push(...Va(t.WebGLRenderingContext.prototype,Le.WebGL,e,r,n,o,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...Va(t.WebGL2RenderingContext.prototype,Le.WebGL2,e,r,n,o,t)),()=>{i.forEach(a=>a())}}var On=null;try{za=typeof module<"u"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof Nr=="function"&&Nr("worker_threads"),On=za.Worker}catch{}var za;function Kd(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}function Ya(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,i=Kd(e,o),a=i.indexOf(`
233
+ or you can use record.mirror to access the mirror instance during recording.`,Ca={map:{},getId(){return console.error(dt),-1},getNode(){return console.error(dt),null},removeNodeFromMap(){console.error(dt)},has(){return console.error(dt),!1},reset(){console.error(dt)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Ca=new Proxy(Ca,{get(e,t,r){return t==="map"&&console.error(dt),Reflect.get(e,t,r)}}));function ft(e,t,r={}){let n=null,o=0;return function(...i){let a=Date.now();!o&&r.leading===!1&&(o=a);let s=t-(a-o),c=this;s<=0||s>t?(n&&(clearTimeout(n),n=null),o=a,e.apply(c,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(c,i)},s))}}function je(e,t,r,n,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>je(e,t,i||{},!0)}function we(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}function lr(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function cr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function te(e,t,r,n){if(!e)return!1;let o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if(typeof t=="string"){if(o.classList.contains(t)||n&&o.closest("."+t)!==null)return!0}else if(Mt(o,t,n))return!0;return!!(r&&(e.matches(r)||n&&o.closest(r)!==null))}function Sa(e,t){return t.getId(e)!==-1}function ur(e,t){return t.getId(e)===Ye}function En(e,t){if(qe(e))return!1;let r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?En(e.parentNode,t):!0:!0}function kn(e){return!!e.changedTouches}function xa(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),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function dr(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function fr(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function mr(e){return!!e?.shadowRoot}var sr=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var r;return(r=this.styleIDMap.get(t))!==null&&r!==void 0?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}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 U=(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))(U||{}),W=(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))(W||{}),pr=(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))(pr||{}),Le=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Le||{});function Ia(e){return"__ln"in e}var Mn=class{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){let r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Ia(t.previousSibling)){let n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&Ia(t.nextSibling)&&t.nextSibling.__ln.previous){let n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){let r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}},Aa=(e,t)=>`${e}@${t}`,hr=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let t=[],r=new Mn,n=s=>{let c=s,l=Ye;for(;l===Ye;)c=c&&c.nextSibling,l=c&&this.mirror.getId(c);return l},o=s=>{var c,l,u,d;let f=null;((l=(c=s.getRootNode)===null||c===void 0?void 0:c.call(s))===null||l===void 0?void 0:l.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&s.getRootNode().host&&(f=s.getRootNode().host);let m=f;for(;((d=(u=m?.getRootNode)===null||u===void 0?void 0:u.call(m))===null||d===void 0?void 0:d.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&m.getRootNode().host;)m=m.getRootNode().host;let p=!this.doc.contains(s)&&(!m||!this.doc.contains(m));if(!s.parentNode||p)return;let g=qe(s.parentNode)?this.mirror.getId(f):this.mirror.getId(s.parentNode),h=n(s);if(g===-1||h===-1)return r.addNode(s);let y=Ge(s,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:v=>{dr(v,this.mirror)&&this.iframeManager.addIframe(v),fr(v,this.mirror)&&this.stylesheetManager.trackLinkElement(v),mr(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(v,w)=>{this.iframeManager.attachIframe(v,w),this.shadowDomManager.observeAttachShadow(v)},onStylesheetLoad:(v,w)=>{this.stylesheetManager.attachLinkElement(v,w)}});y&&t.push({parentId:g,nextId:h,node:y})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let s of Array.from(this.movedSet.values()))Ea(this.removes,s,this.mirror)&&!this.movedSet.has(s.parentNode)||o(s);for(let s of Array.from(this.addedSet.values()))!ka(this.droppedSet,s)&&!Ea(this.removes,s,this.mirror)||ka(this.movedSet,s)?o(s):this.droppedSet.add(s);let i=null;for(;r.length;){let s=null;if(i){let c=this.mirror.getId(i.value.parentNode),l=n(i.value);c!==-1&&l!==-1&&(s=i)}if(!s)for(let c=r.length-1;c>=0;c--){let l=r.get(c);if(l){let u=this.mirror.getId(l.value.parentNode);if(n(l.value)===-1)continue;if(u!==-1){s=l;break}else{let f=l.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=f.parentNode.host;if(this.mirror.getId(m)!==-1){s=l;break}}}}}if(!s){for(;r.head;)r.removeNode(r.head.value);break}i=s.previous,r.removeNode(s.value),o(s.value)}let a={texts:this.texts.map(s=>({id:this.mirror.getId(s.node),value:s.value})).filter(s=>this.mirror.has(s.id)),attributes:this.attributes.map(s=>({id:this.mirror.getId(s.node),attributes:s.attributes})).filter(s=>this.mirror.has(s.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!ur(t.target,this.mirror))switch(t.type){case"characterData":{let r=t.target.textContent;!te(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:An(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=Tt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),te(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(r.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(n))if(!r.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){let i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});let a=o.attributes.style;for(let s of Array.from(r.style)){let c=r.style.getPropertyValue(s),l=r.style.getPropertyPriority(s);(c!==i.style.getPropertyValue(s)||l!==i.style.getPropertyPriority(s))&&(l===""?a[s]=c:a[s]=[c,l])}for(let s of Array.from(i.style))r.style.getPropertyValue(s)===""&&(a[s]=!1)}else o.attributes[t.attributeName]=In(this.doc,r.tagName,t.attributeName,n);break}case"childList":{if(te(t.target,this.blockClass,this.blockSelector,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),o=qe(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);te(t.target,this.blockClass,this.blockSelector,!1)||ur(r,this.mirror)||!Sa(r,this.mirror)||(this.addedSet.has(r)?(Tn(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||En(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Aa(n,o)]?Tn(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:qe(t.target)&&ze(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(ur(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Aa(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);te(t,this.blockClass,this.blockSelector,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Tn(e,t){e.delete(t),t.childNodes.forEach(r=>Tn(e,r))}function Ea(e,t,r){return e.length===0?!1:Ma(e,t,r)}function Ma(e,t,r){let{parentNode:n}=t;if(!n)return!1;let o=r.getId(n);return e.some(i=>i.id===o)?!0:Ma(e,n,r)}function ka(e,t){return e.size===0?!1:Ta(e,t)}function Ta(e,t){let{parentNode:r}=t;return r?e.has(r)?!0:Ta(e,r):!1}var Oe=[],Ra=typeof CSSGroupingRule<"u",Fa=typeof CSSMediaRule<"u",_a=typeof CSSSupportsRule<"u",Oa=typeof CSSConditionRule<"u";function Nt(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function Nn(e,t){var r,n;let o=new hr;Oe.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver,a=(n=(r=window?.Zone)===null||r===void 0?void 0:r.__symbol__)===null||n===void 0?void 0:n.call(r,"MutationObserver");a&&window[a]&&(i=window[a]);let s=new i(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Pd({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,a=[],s,c=ft(d=>{let f=Date.now()-s;e(a.map(m=>(m.timeOffset-=f,m)),d),a=[],s=null},i),l=ft(d=>{let f=Nt(d),{clientX:m,clientY:p}=kn(d)?d.changedTouches[0]:d;s||(s=Date.now()),a.push({x:m,y:p,id:n.getId(f),timeOffset:Date.now()-s}),c(typeof DragEvent<"u"&&d instanceof DragEvent?W.Drag:d instanceof MouseEvent?W.MouseMove:W.TouchMove)},o,{trailing:!1}),u=[le("mousemove",l,r),le("touchmove",l,r),le("drag",l,r)];return()=>{u.forEach(d=>d())}}function Wd({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){if(i.mouseInteraction===!1)return()=>{};let a=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,s=[],c=l=>u=>{let d=Nt(u);if(te(d,n,o,!0))return;let f=kn(u)?u.changedTouches[0]:u;if(!f)return;let m=r.getId(d),{clientX:p,clientY:g}=f;e({type:pr[l],id:m,x:p,y:g})};return Object.keys(pr).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEach(l=>{let u=l.toLowerCase(),d=c(l);s.push(le(u,d,t))}),()=>{s.forEach(l=>l())}}function Ln({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){let a=ft(s=>{let c=Nt(s);if(!c||te(c,n,o,!0))return;let l=r.getId(c);if(c===t){let u=t.scrollingElement||t.documentElement;e({id:l,x:u.scrollLeft,y:u.scrollTop})}else e({id:l,x:c.scrollLeft,y:c.scrollTop})},i.scroll||100);return le("scroll",a,t)}function Bd({viewportResizeCb:e}){let t=-1,r=-1,n=ft(()=>{let o=lr(),i=cr();(t!==o||r!==i)&&(e({width:Number(i),height:Number(o)}),t=o,r=i)},200);return le("resize",n,window)}function Na(e,t){let r=Object.assign({},e);return t||delete r.userTriggered,r}var Ud=["INPUT","TEXTAREA","SELECT"],La=new WeakMap;function Hd({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:i,maskInputOptions:a,maskInputFn:s,sampling:c,userTriggeredOnInput:l}){function u(y){let v=Nt(y),w=y.isTrusted;if(v&&v.tagName==="OPTION"&&(v=v.parentElement),!v||!v.tagName||Ud.indexOf(v.tagName)<0||te(v,n,o,!0))return;let b=v.type;if(v.classList.contains(i))return;let S=v.value,I=!1;b==="radio"||b==="checkbox"?I=v.checked:(a[v.tagName.toLowerCase()]||a[b])&&(S=Tt({maskInputOptions:a,tagName:v.tagName,type:b,value:S,maskInputFn:s})),d(v,Na({text:S,isChecked:I,userTriggered:w},l));let C=v.name;b==="radio"&&C&&I&&t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach(x=>{x!==v&&d(x,Na({text:x.value,isChecked:!I,userTriggered:!1},l))})}function d(y,v){let w=La.get(y);if(!w||w.text!==v.text||w.isChecked!==v.isChecked){La.set(y,v);let b=r.getId(y);e(Object.assign(Object.assign({},v),{id:b}))}}let m=(c.input==="last"?["change"]:["input","change"]).map(y=>le(y,u,t)),p=t.defaultView;if(!p)return()=>{m.forEach(y=>y())};let g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),h=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...h.map(y=>je(y[0],y[1],{set(){u({target:this})}},!1,p))),()=>{m.forEach(y=>y())}}function gr(e){let t=[];function r(n,o){if(Ra&&n.parentRule instanceof CSSGroupingRule||Fa&&n.parentRule instanceof CSSMediaRule||_a&&n.parentRule instanceof CSSSupportsRule||Oa&&n.parentRule instanceof CSSConditionRule){let a=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(a)}else if(n.parentStyleSheet){let a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(a)}return o}return r(e,t)}function _e(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Vd({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){let o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(u,d){let{id:f,styleId:m}=_e(this,t,r.styleMirror);return(f&&f!==-1||m&&m!==-1)&&e({id:f,styleId:m,adds:[{rule:u,index:d}]}),o.apply(this,[u,d])};let i=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(u){let{id:d,styleId:f}=_e(this,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,removes:[{index:u}]}),i.apply(this,[u])};let a;n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=function(u){let{id:d,styleId:f}=_e(this,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replace:u}),a.apply(this,[u])});let s;n.CSSStyleSheet.prototype.replaceSync&&(s=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=function(u){let{id:d,styleId:f}=_e(this,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replaceSync:u}),s.apply(this,[u])});let c={};Ra?c.CSSGroupingRule=n.CSSGroupingRule:(Fa&&(c.CSSMediaRule=n.CSSMediaRule),Oa&&(c.CSSConditionRule=n.CSSConditionRule),_a&&(c.CSSSupportsRule=n.CSSSupportsRule));let l={};return Object.entries(c).forEach(([u,d])=>{l[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=function(f,m){let{id:p,styleId:g}=_e(this.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&e({id:p,styleId:g,adds:[{rule:f,index:[...gr(this),m||0]}]}),l[u].insertRule.apply(this,[f,m])},d.prototype.deleteRule=function(f){let{id:m,styleId:p}=_e(this.parentStyleSheet,t,r.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,removes:[{index:[...gr(this),f]}]}),l[u].deleteRule.apply(this,[f])}}),()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=i,a&&(n.CSSStyleSheet.prototype.replace=a),s&&(n.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([u,d])=>{d.prototype.insertRule=l[u].insertRule,d.prototype.deleteRule=l[u].deleteRule})}}function Rn({mirror:e,stylesheetManager:t},r){var n,o,i;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(r.host);let s=r.nodeName==="#document"?(n=r.defaultView)===null||n===void 0?void 0:n.Document:(i=(o=r.ownerDocument)===null||o===void 0?void 0:o.defaultView)===null||i===void 0?void 0:i.ShadowRoot,c=Object.getOwnPropertyDescriptor(s?.prototype,"adoptedStyleSheets");return a===null||a===-1||!s||!c?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var l;return(l=c.get)===null||l===void 0?void 0:l.call(this)},set(l){var u;let d=(u=c.set)===null||u===void 0?void 0:u.call(this,l);if(a!==null&&a!==-1)try{t.adoptStyleSheets(l,a)}catch{}return d}}),()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})}function Gd({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(s,c,l){var u;if(r.has(s))return i.apply(this,[s,c,l]);let{id:d,styleId:f}=_e((u=this.parentRule)===null||u===void 0?void 0:u.parentStyleSheet,t,n.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:s,value:c,priority:l},index:gr(this.parentRule)}),i.apply(this,[s,c,l])};let a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(s){var c;if(r.has(s))return a.apply(this,[s]);let{id:l,styleId:u}=_e((c=this.parentRule)===null||c===void 0?void 0:c.parentStyleSheet,t,n.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:s},index:gr(this.parentRule)}),a.apply(this,[s])},()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}}function zd({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o}){let i=s=>ft(c=>{let l=Nt(c);if(!l||te(l,t,r,!0))return;let{currentTime:u,volume:d,muted:f,playbackRate:m}=l;e({type:s,id:n.getId(l),currentTime:u,volume:d,muted:f,playbackRate:m})},o.media||500),a=[le("play",i(0)),le("pause",i(1)),le("seeked",i(2)),le("volumechange",i(3)),le("ratechange",i(4))];return()=>{a.forEach(s=>s())}}function Yd({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(c,l,u){let d=new i(c,l,u);return o.set(d,{family:c,buffer:typeof l!="string",descriptors:u,fontSource:typeof l=="string"?l:JSON.stringify(Array.from(new Uint8Array(l)))}),d};let a=we(t.fonts,"add",function(s){return function(c){return setTimeout(()=>{let l=o.get(c);l&&(e(l),o.delete(c))},0),s.apply(this,[c])}});return n.push(()=>{r.FontFace=i}),n.push(a),()=>{n.forEach(s=>s())}}function qd(e){let{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:i}=e,a=!0,s=()=>{let c=t.getSelection();if(!c||a&&c?.isCollapsed)return;a=c.isCollapsed||!1;let l=[],u=c.rangeCount||0;for(let d=0;d<u;d++){let f=c.getRangeAt(d),{startContainer:m,startOffset:p,endContainer:g,endOffset:h}=f;te(m,n,o,!0)||te(g,n,o,!0)||l.push({start:r.getId(m),startOffset:p,end:r.getId(g),endOffset:h})}i({ranges:l})};return s(),le("selectionchange",s)}function jd(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:m}=e;e.mutationCb=(...p)=>{t.mutation&&t.mutation(...p),r(...p)},e.mousemoveCb=(...p)=>{t.mousemove&&t.mousemove(...p),n(...p)},e.mouseInteractionCb=(...p)=>{t.mouseInteraction&&t.mouseInteraction(...p),o(...p)},e.scrollCb=(...p)=>{t.scroll&&t.scroll(...p),i(...p)},e.viewportResizeCb=(...p)=>{t.viewportResize&&t.viewportResize(...p),a(...p)},e.inputCb=(...p)=>{t.input&&t.input(...p),s(...p)},e.mediaInteractionCb=(...p)=>{t.mediaInteaction&&t.mediaInteaction(...p),c(...p)},e.styleSheetRuleCb=(...p)=>{t.styleSheetRule&&t.styleSheetRule(...p),l(...p)},e.styleDeclarationCb=(...p)=>{t.styleDeclaration&&t.styleDeclaration(...p),u(...p)},e.canvasMutationCb=(...p)=>{t.canvasMutation&&t.canvasMutation(...p),d(...p)},e.fontCb=(...p)=>{t.font&&t.font(...p),f(...p)},e.selectionCb=(...p)=>{t.selection&&t.selection(...p),m(...p)}}function Da(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};jd(e,t);let n=Nn(e,e.doc),o=Pd(e),i=Wd(e),a=Ln(e),s=Bd(e),c=Hd(e),l=zd(e),u=Vd(e,{win:r}),d=Rn(e,e.doc),f=Gd(e,{win:r}),m=e.collectFonts?Yd(e):()=>{},p=qd(e),g=[];for(let h of e.plugins)g.push(h.observer(h.callback,r,h.options));return()=>{Oe.forEach(h=>h.reset()),n.disconnect(),o(),i(),a(),s(),c(),l(),u(),d(),f(),m(),p(),g.forEach(h=>h())}}var Lt=class{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,o){let i=n||this.getIdToRemoteIdMap(t),a=o||this.getRemoteIdToIdMap(t),s=i.get(r);return s||(s=this.generateIdFn(),i.set(r,s),a.set(s,r)),s}getIds(t,r){let n=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return r.map(i=>this.getId(t,i,n,o))}getRemoteId(t,r,n){let o=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let i=o.get(r);return i||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(o=>this.getRemoteId(t,o,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}};var yr=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Lt(Sn),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Lt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)===null||n===void 0||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){if(t.data.type==="rrweb"){if(!t.source)return;let n=this.crossOriginIframeMap.get(t.source);if(!n)return;let o=this.transformCrossOriginEvent(n,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}}transformCrossOriginEvent(t,r){var n;switch(r.type){case U.FullSnapshot:return this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t),{timestamp:r.timestamp,type:U.IncrementalSnapshot,data:{source:W.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case U.Meta:case U.Load:case U.DomContentLoaded:return!1;case U.Plugin:return r;case U.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case U.IncrementalSnapshot:switch(r.data.source){case W.Mutation:return r.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t)}),r.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),r.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),r.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case W.Drag:case W.TouchMove:case W.MouseMove:return r.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case W.ViewportResize:return!1;case W.MediaInteraction:case W.MouseInteraction:case W.Scroll:case W.CanvasMutation:case W.Input:return this.replaceIds(r.data,t,["id"]),r;case W.StyleSheetRule:case W.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case W.Font:return r;case W.Selection:return r.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),r;case W.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)===null||n===void 0||n.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),r}}}replace(t,r,n,o){for(let i of o)!Array.isArray(r[i])&&typeof r[i]!="number"||(Array.isArray(r[i])?r[i]=t.getIds(n,r[i]):r[i]=t.getId(n,r[i]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}};var br=class{constructor(t){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;let r=this;this.restorePatches.push(we(Element.prototype,"attachShadow",function(n){return function(o){let i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,r){ze(t)&&(this.shadowDoms.has(t)||(this.shadowDoms.add(t),Nn(Object.assign(Object.assign({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Ln(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),Rn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)},0)))}observeAttachShadow(t){if(t.contentWindow){let r=this;this.restorePatches.push(we(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){let i=n.call(this,o);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t()),this.shadowDoms=new WeakSet}};function $a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Pa(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(u){try{l(n.next(u))}catch(d){a(d)}}function c(u){try{l(n.throw(u))}catch(d){a(d)}}function l(u){u.done?i(u.value):o(u.value).then(s,c)}l((n=n.apply(e,t||[])).next())})}var mt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zd=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Rt=0;Rt<mt.length;Rt++)Zd[mt.charCodeAt(Rt)]=Rt;var Rt,Wa=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=mt[t[r]>>2],o+=mt[(t[r]&3)<<4|t[r+1]>>4],o+=mt[(t[r+1]&15)<<2|t[r+2]>>6],o+=mt[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o};var Ba=new Map;function Xd(e,t){let r=Ba.get(e);return r||(r=new Map,Ba.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var Fn=(e,t,r)=>{if(!e||!(Ua(e,t)||typeof e=="object"))return;let n=e.constructor.name,o=Xd(r,n),i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function wr(e,t,r){if(e instanceof Array)return e.map(n=>wr(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,o=Wa(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[wr(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[wr(e.data,t,r),e.width,e.height]};if(Ua(e,t)||typeof e=="object"){let n=e.constructor.name,o=Fn(e,t,r);return{rr_type:n,index:o}}}}return e}var vr=(e,t,r)=>[...e].map(n=>wr(n,t,r)),Ua=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o]);function Ha(e,t,r,n){let o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;let s=we(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...l){return te(this.canvas,r,n,!0)||setTimeout(()=>{let u=vr([...l],t,this);e(this.canvas,{type:Le["2D"],property:a,args:u})},0),c.apply(this,l)}});o.push(s)}catch{let c=je(t.CanvasRenderingContext2D.prototype,a,{set(l){e(this.canvas,{type:Le["2D"],property:a,args:[l],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function _n(e,t,r){let n=[];try{let o=we(e.HTMLCanvasElement.prototype,"getContext",function(i){return function(a,...s){return te(this,t,r,!0)||"__context"in this||(this.__context=a),i.apply(this,[a,...s])}});n.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(o=>o())}}function Va(e,t,r,n,o,i,a){let s=[],c=Object.getOwnPropertyNames(e);for(let l of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let u=we(e,l,function(d){return function(...f){let m=d.apply(this,f);if(Fn(m,a,this),!te(this.canvas,n,o,!0)){let p=vr([...f],a,this),g={type:t,property:l,args:p};r(this.canvas,g)}return m}});s.push(u)}catch{let d=je(e,l,{set(f){r(this.canvas,{type:t,property:l,args:[f],setter:!0})}});s.push(d)}return s}function Ga(e,t,r,n,o){let i=[];return i.push(...Va(t.WebGLRenderingContext.prototype,Le.WebGL,e,r,n,o,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...Va(t.WebGL2RenderingContext.prototype,Le.WebGL2,e,r,n,o,t)),()=>{i.forEach(a=>a())}}var On=null;try{za=typeof module<"u"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof Tr=="function"&&Tr("worker_threads"),On=za.Worker}catch{}var za;function Kd(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}function Ya(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,i=Kd(e,o),a=i.indexOf(`
234
234
  `,10)+1,s=i.substring(a)+(n?"//# sourceMappingURL="+n:"");return function(l){return new On(s,Object.assign({},l,{eval:!0}))}}function Jd(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,i=r.length;o<i;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function Qd(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,i=Jd(e,o),a=i.indexOf(`
235
- `,10)+1,s=i.substring(a)+(n?"//# sourceMappingURL="+n:""),c=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(c)}function qa(e,t,r){var n;return function(i){return n=n||Qd(e,t,r),new Worker(n,i)}}var ef=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";function ja(){return ef}function Za(e,t,r){return ja()?Ya(e,t,r):qa(e,t,r)}var Xa=Za("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1);var Sr=class{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(c,l)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(l)};let{sampling:r="all",win:n,blockClass:o,blockSelector:i,recordCanvas:a,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,o,i),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,o,i){let a=_n(r,n,o),s=new Map,c=new Xa;c.onmessage=p=>{let{id:g}=p.data;if(s.set(g,!1),!("base64"in p.data))return;let{base64:h,type:y,width:v,height:w}=p.data;this.mutationCb({id:g,type:Le["2D"],commands:[{property:"clearRect",args:[0,0,v,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:y}]},0,0]}]})};let l=1e3/t,u=0,d,f=()=>{let p=[];return r.document.querySelectorAll("canvas").forEach(g=>{te(g,n,o,!0)||p.push(g)}),p},m=p=>{if(u&&p-u<l){d=requestAnimationFrame(m);return}u=p,f().forEach(g=>Pa(this,void 0,void 0,function*(){var h;let y=this.mirror.getId(g);if(s.get(y))return;if(s.set(y,!0),["webgl","webgl2"].includes(g.__context)){let w=g.getContext(g.__context);((h=w?.getContextAttributes())===null||h===void 0?void 0:h.preserveDrawingBuffer)===!1&&w?.clear(w.COLOR_BUFFER_BIT)}let v=yield createImageBitmap(g);c.postMessage({id:y,bitmap:v,width:g.width,height:g.height,dataURLOptions:i.dataURLOptions},[v])})),d=requestAnimationFrame(m)};d=requestAnimationFrame(m),this.resetObservers=()=>{a(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let o=_n(t,r,n),i=Ha(this.processMutation.bind(this),t,r,n),a=Ga(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{o(),i(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let o=n.map(a=>$a(a,["type"])),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}};var xr=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new lr,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},o=[];for(let i of t){let a;if(this.styleMirror.has(i))a=this.styleMirror.getId(i);else{a=this.styleMirror.add(i);let s=Array.from(i.rules||CSSRule);o.push({styleId:a,rules:s.map((c,l)=>({rule:Cn(c),index:l}))})}n.styleIds.push(a)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}};function ie(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}var re,Ir,Dn,Ar=!1,ve=wa();function Xe(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:l=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:f,maskInputFn:m,maskTextFn:p,hooks:g,packFn:h,sampling:y={},dataURLOptions:v={},mousemoveWait:w,recordCanvas:b=!1,recordCrossOriginIframes:S=!1,userTriggeredOnInput:I=!1,collectFonts:C=!1,inlineImages:x=!1,plugins:N,keepIframeSrcFn:B=()=>!1,ignoreCSSAttributes:$=new Set([])}=e,M=S?window.parent===window:!0,k=!1;if(!M)try{window.parent.document,k=!1}catch{k=!0}if(M&&!t)throw new Error("emit function is required");w!==void 0&&y.mousemove===void 0&&(y.mousemove=w),ve.reset();let O=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},V=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};xa();let K,R=0,F=T=>{for(let G of N||[])G.eventProcessor&&(T=G.eventProcessor(T));return h&&(T=h(T)),T};re=(T,G)=>{var J;if(!((J=Oe[0])===null||J===void 0)&&J.isFrozen()&&T.type!==U.FullSnapshot&&!(T.type===U.IncrementalSnapshot&&T.data.source===W.Mutation)&&Oe.forEach(Y=>Y.unfreeze()),M)t?.(F(T),G);else if(k){let Y={type:"rrweb",event:F(T),isCheckout:G};window.parent.postMessage(Y,"*")}if(T.type===U.FullSnapshot)K=T,R=0;else if(T.type===U.IncrementalSnapshot){if(T.data.source===W.Mutation&&T.data.isAttachIframe)return;R++;let Y=n&&R>=n,ce=r&&T.timestamp-K.timestamp>r;(Y||ce)&&Ir(!0)}};let D=T=>{re(ie({type:U.IncrementalSnapshot,data:Object.assign({source:W.Mutation},T)}))},_=T=>re(ie({type:U.IncrementalSnapshot,data:Object.assign({source:W.Scroll},T)})),ee=T=>re(ie({type:U.IncrementalSnapshot,data:Object.assign({source:W.CanvasMutation},T)})),P=T=>re(ie({type:U.IncrementalSnapshot,data:Object.assign({source:W.AdoptedStyleSheet},T)})),z=new xr({mutationCb:D,adoptedStyleSheetCb:P}),X=new br({mirror:ve,mutationCb:D,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:re});for(let T of N||[])T.getMirror&&T.getMirror({nodeMirror:ve,crossOriginIframeMirror:X.crossOriginIframeMirror,crossOriginIframeStyleMirror:X.crossOriginIframeStyleMirror});Dn=new Sr({recordCanvas:b,mutationCb:ee,win:window,blockClass:o,blockSelector:i,mirror:ve,sampling:y.canvas,dataURLOptions:v});let ne=new wr({mutationCb:D,scrollCb:_,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:l,maskInputOptions:O,dataURLOptions:v,maskTextFn:p,maskInputFn:m,recordCanvas:b,inlineImages:x,sampling:y,slimDOMOptions:V,iframeManager:X,stylesheetManager:z,canvasManager:Dn,keepIframeSrcFn:B},mirror:ve});Ir=(T=!1)=>{var G,J,Y,ce,H,se;re(ie({type:U.Meta,data:{href:window.location.href,width:ur(),height:cr()}}),T),z.reset(),Oe.forEach(Q=>Q.lock());let De=va(document,{mirror:ve,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:l,maskAllInputs:O,maskTextFn:p,slimDOM:V,dataURLOptions:v,recordCanvas:b,inlineImages:x,onSerialize:Q=>{fr(Q,ve)&&X.addIframe(Q),mr(Q,ve)&&z.trackLinkElement(Q),pr(Q)&&ne.addShadowRoot(Q.shadowRoot,document)},onIframeLoad:(Q,me)=>{X.attachIframe(Q,me),ne.observeAttachShadow(Q)},onStylesheetLoad:(Q,me)=>{z.attachLinkElement(Q,me)},keepIframeSrcFn:B});if(!De)return console.warn("Failed to snapshot the document");re(ie({type:U.FullSnapshot,data:{node:De,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((J=(G=document?.body)===null||G===void 0?void 0:G.parentElement)===null||J===void 0?void 0:J.scrollLeft)||((Y=document?.body)===null||Y===void 0?void 0:Y.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((H=(ce=document?.body)===null||ce===void 0?void 0:ce.parentElement)===null||H===void 0?void 0:H.scrollTop)||((se=document?.body)===null||se===void 0?void 0:se.scrollTop)||0}}})),Oe.forEach(Q=>Q.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,ve.getId(document))};try{let T=[];T.push(le("DOMContentLoaded",()=>{re(ie({type:U.DomContentLoaded,data:{}}))}));let G=Y=>{var ce;return Da({mutationCb:D,mousemoveCb:(H,se)=>re(ie({type:U.IncrementalSnapshot,data:{source:se,positions:H}})),mouseInteractionCb:H=>re(ie({type:U.IncrementalSnapshot,data:Object.assign({source:W.MouseInteraction},H)})),scrollCb:_,viewportResizeCb:H=>re(ie({type:U.IncrementalSnapshot,data:Object.assign({source:W.ViewportResize},H)})),inputCb:H=>re(ie({type:U.IncrementalSnapshot,data:Object.assign({source:W.Input},H)})),mediaInteractionCb:H=>re(ie({type:U.IncrementalSnapshot,data:Object.assign({source:W.MediaInteraction},H)})),styleSheetRuleCb:H=>re(ie({type:U.IncrementalSnapshot,data:Object.assign({source:W.StyleSheetRule},H)})),styleDeclarationCb:H=>re(ie({type:U.IncrementalSnapshot,data:Object.assign({source:W.StyleDeclaration},H)})),canvasMutationCb:ee,fontCb:H=>re(ie({type:U.IncrementalSnapshot,data:Object.assign({source:W.Font},H)})),selectionCb:H=>{re(ie({type:U.IncrementalSnapshot,data:Object.assign({source:W.Selection},H)}))},blockClass:o,ignoreClass:a,maskTextClass:s,maskTextSelector:c,maskInputOptions:O,inlineStylesheet:l,sampling:y,recordCanvas:b,inlineImages:x,userTriggeredOnInput:I,collectFonts:C,doc:Y,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:B,blockSelector:i,slimDOMOptions:V,dataURLOptions:v,mirror:ve,iframeManager:X,stylesheetManager:z,shadowDomManager:ne,canvasManager:Dn,ignoreCSSAttributes:$,plugins:((ce=N?.filter(H=>H.observer))===null||ce===void 0?void 0:ce.map(H=>({observer:H.observer,options:H.options,callback:se=>re(ie({type:U.Plugin,data:{plugin:H.name,payload:se}}))})))||[]},g)};X.addLoadListener(Y=>{T.push(G(Y.contentDocument))});let J=()=>{Ir(),T.push(G(document)),Ar=!0};return document.readyState==="interactive"||document.readyState==="complete"?J():T.push(le("load",()=>{re(ie({type:U.Load,data:{}})),J()},window)),()=>{T.forEach(Y=>Y()),Ar=!1}}catch(T){console.warn(T)}}Xe.addCustomEvent=(e,t)=>{if(!Ar)throw new Error("please add custom event after start recording");re(ie({type:U.Custom,data:{tag:e,payload:t}}))};Xe.freezePage=()=>{Oe.forEach(e=>e.freeze())};Xe.takeFullSnapshot=e=>{if(!Ar)throw new Error("please take full snapshot after start recording");Ir(e)};Xe.mirror=ve;var Ka=16,tf=3e4,Ja="__ms_mirror";function rf(){let e=new URLSearchParams(window.location.search);if(e.get("mirror")==="true"){e.delete("mirror");let t=e.toString(),r=window.location.pathname+(t?"?"+t:"")+window.location.hash;window.history.replaceState(null,"",r);try{sessionStorage.setItem(Ja,"1")}catch{}return!0}try{return sessionStorage.getItem(Ja)==="1"}catch{return!1}}async function Qa(){if(window.location.search.includes("mode=iframe")||!rf())return;let e=A().mirror;if(e.recording)return;let t=[],r=null;function n(){if(r=null,t.length===0)return;let a=ir();if(!a){r=setTimeout(n,Ka);return}let s=t;t=[],a.send(JSON.stringify({type:"mirror",events:s}))}function o(a){t.push(a),r||(r=setTimeout(n,Ka))}document.readyState!=="complete"&&await new Promise(a=>window.addEventListener("load",()=>a(),{once:!0})),await new Promise(a=>setTimeout(a,500));let i=Xe({emit:o,collectFonts:!0,checkoutEveryNms:tf});i&&(e.recording=!0,e.stopFn=()=>{i(),r&&(clearTimeout(r),r=null),n(),e.recording=!1,e.stopFn=null})}window.__MINDSTUDIO_BROWSER_AGENT__||(window.__MINDSTUDIO_BROWSER_AGENT__=!0,Hn(),qn(),jn(),Zn(),Kn(),Xn(),qi(),ha(),Ni(),wi(),Qa(),di(),window.parent!==window&&window.parent.postMessage({channel:"mindstudio-browser-agent",command:"ready"},"*"));return fs(nf);})();
235
+ `,10)+1,s=i.substring(a)+(n?"//# sourceMappingURL="+n:""),c=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(c)}function qa(e,t,r){var n;return function(i){return n=n||Qd(e,t,r),new Worker(n,i)}}var ef=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";function ja(){return ef}function Za(e,t,r){return ja()?Ya(e,t,r):qa(e,t,r)}var Xa=Za("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1);var Cr=class{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(c,l)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(l)};let{sampling:r="all",win:n,blockClass:o,blockSelector:i,recordCanvas:a,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,o,i),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,o,i){let a=_n(r,n,o),s=new Map,c=new Xa;c.onmessage=p=>{let{id:g}=p.data;if(s.set(g,!1),!("base64"in p.data))return;let{base64:h,type:y,width:v,height:w}=p.data;this.mutationCb({id:g,type:Le["2D"],commands:[{property:"clearRect",args:[0,0,v,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:y}]},0,0]}]})};let l=1e3/t,u=0,d,f=()=>{let p=[];return r.document.querySelectorAll("canvas").forEach(g=>{te(g,n,o,!0)||p.push(g)}),p},m=p=>{if(u&&p-u<l){d=requestAnimationFrame(m);return}u=p,f().forEach(g=>Pa(this,void 0,void 0,function*(){var h;let y=this.mirror.getId(g);if(s.get(y))return;if(s.set(y,!0),["webgl","webgl2"].includes(g.__context)){let w=g.getContext(g.__context);((h=w?.getContextAttributes())===null||h===void 0?void 0:h.preserveDrawingBuffer)===!1&&w?.clear(w.COLOR_BUFFER_BIT)}let v=yield createImageBitmap(g);c.postMessage({id:y,bitmap:v,width:g.width,height:g.height,dataURLOptions:i.dataURLOptions},[v])})),d=requestAnimationFrame(m)};d=requestAnimationFrame(m),this.resetObservers=()=>{a(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let o=_n(t,r,n),i=Ha(this.processMutation.bind(this),t,r,n),a=Ga(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{o(),i(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let o=n.map(a=>$a(a,["type"])),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}};var Sr=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new sr,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},o=[];for(let i of t){let a;if(this.styleMirror.has(i))a=this.styleMirror.getId(i);else{a=this.styleMirror.add(i);let s=Array.from(i.rules||CSSRule);o.push({styleId:a,rules:s.map((c,l)=>({rule:Cn(c),index:l}))})}n.styleIds.push(a)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}};function oe(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}var re,xr,Dn,Ir=!1,ve=wa();function Ze(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:l=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:f,maskInputFn:m,maskTextFn:p,hooks:g,packFn:h,sampling:y={},dataURLOptions:v={},mousemoveWait:w,recordCanvas:b=!1,recordCrossOriginIframes:S=!1,userTriggeredOnInput:I=!1,collectFonts:C=!1,inlineImages:x=!1,plugins:N,keepIframeSrcFn:B=()=>!1,ignoreCSSAttributes:$=new Set([])}=e,M=S?window.parent===window:!0,k=!1;if(!M)try{window.parent.document,k=!1}catch{k=!0}if(M&&!t)throw new Error("emit function is required");w!==void 0&&y.mousemove===void 0&&(y.mousemove=w),ve.reset();let O=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},V=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};xa();let K,R=0,F=T=>{for(let G of N||[])G.eventProcessor&&(T=G.eventProcessor(T));return h&&(T=h(T)),T};re=(T,G)=>{var J;if(!((J=Oe[0])===null||J===void 0)&&J.isFrozen()&&T.type!==U.FullSnapshot&&!(T.type===U.IncrementalSnapshot&&T.data.source===W.Mutation)&&Oe.forEach(Y=>Y.unfreeze()),M)t?.(F(T),G);else if(k){let Y={type:"rrweb",event:F(T),isCheckout:G};window.parent.postMessage(Y,"*")}if(T.type===U.FullSnapshot)K=T,R=0;else if(T.type===U.IncrementalSnapshot){if(T.data.source===W.Mutation&&T.data.isAttachIframe)return;R++;let Y=n&&R>=n,ce=r&&T.timestamp-K.timestamp>r;(Y||ce)&&xr(!0)}};let D=T=>{re(oe({type:U.IncrementalSnapshot,data:Object.assign({source:W.Mutation},T)}))},_=T=>re(oe({type:U.IncrementalSnapshot,data:Object.assign({source:W.Scroll},T)})),ee=T=>re(oe({type:U.IncrementalSnapshot,data:Object.assign({source:W.CanvasMutation},T)})),P=T=>re(oe({type:U.IncrementalSnapshot,data:Object.assign({source:W.AdoptedStyleSheet},T)})),z=new Sr({mutationCb:D,adoptedStyleSheetCb:P}),X=new yr({mirror:ve,mutationCb:D,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:re});for(let T of N||[])T.getMirror&&T.getMirror({nodeMirror:ve,crossOriginIframeMirror:X.crossOriginIframeMirror,crossOriginIframeStyleMirror:X.crossOriginIframeStyleMirror});Dn=new Cr({recordCanvas:b,mutationCb:ee,win:window,blockClass:o,blockSelector:i,mirror:ve,sampling:y.canvas,dataURLOptions:v});let ne=new br({mutationCb:D,scrollCb:_,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:l,maskInputOptions:O,dataURLOptions:v,maskTextFn:p,maskInputFn:m,recordCanvas:b,inlineImages:x,sampling:y,slimDOMOptions:V,iframeManager:X,stylesheetManager:z,canvasManager:Dn,keepIframeSrcFn:B},mirror:ve});xr=(T=!1)=>{var G,J,Y,ce,H,se;re(oe({type:U.Meta,data:{href:window.location.href,width:cr(),height:lr()}}),T),z.reset(),Oe.forEach(Q=>Q.lock());let De=va(document,{mirror:ve,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:l,maskAllInputs:O,maskTextFn:p,slimDOM:V,dataURLOptions:v,recordCanvas:b,inlineImages:x,onSerialize:Q=>{dr(Q,ve)&&X.addIframe(Q),fr(Q,ve)&&z.trackLinkElement(Q),mr(Q)&&ne.addShadowRoot(Q.shadowRoot,document)},onIframeLoad:(Q,me)=>{X.attachIframe(Q,me),ne.observeAttachShadow(Q)},onStylesheetLoad:(Q,me)=>{z.attachLinkElement(Q,me)},keepIframeSrcFn:B});if(!De)return console.warn("Failed to snapshot the document");re(oe({type:U.FullSnapshot,data:{node:De,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((J=(G=document?.body)===null||G===void 0?void 0:G.parentElement)===null||J===void 0?void 0:J.scrollLeft)||((Y=document?.body)===null||Y===void 0?void 0:Y.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((H=(ce=document?.body)===null||ce===void 0?void 0:ce.parentElement)===null||H===void 0?void 0:H.scrollTop)||((se=document?.body)===null||se===void 0?void 0:se.scrollTop)||0}}})),Oe.forEach(Q=>Q.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,ve.getId(document))};try{let T=[];T.push(le("DOMContentLoaded",()=>{re(oe({type:U.DomContentLoaded,data:{}}))}));let G=Y=>{var ce;return Da({mutationCb:D,mousemoveCb:(H,se)=>re(oe({type:U.IncrementalSnapshot,data:{source:se,positions:H}})),mouseInteractionCb:H=>re(oe({type:U.IncrementalSnapshot,data:Object.assign({source:W.MouseInteraction},H)})),scrollCb:_,viewportResizeCb:H=>re(oe({type:U.IncrementalSnapshot,data:Object.assign({source:W.ViewportResize},H)})),inputCb:H=>re(oe({type:U.IncrementalSnapshot,data:Object.assign({source:W.Input},H)})),mediaInteractionCb:H=>re(oe({type:U.IncrementalSnapshot,data:Object.assign({source:W.MediaInteraction},H)})),styleSheetRuleCb:H=>re(oe({type:U.IncrementalSnapshot,data:Object.assign({source:W.StyleSheetRule},H)})),styleDeclarationCb:H=>re(oe({type:U.IncrementalSnapshot,data:Object.assign({source:W.StyleDeclaration},H)})),canvasMutationCb:ee,fontCb:H=>re(oe({type:U.IncrementalSnapshot,data:Object.assign({source:W.Font},H)})),selectionCb:H=>{re(oe({type:U.IncrementalSnapshot,data:Object.assign({source:W.Selection},H)}))},blockClass:o,ignoreClass:a,maskTextClass:s,maskTextSelector:c,maskInputOptions:O,inlineStylesheet:l,sampling:y,recordCanvas:b,inlineImages:x,userTriggeredOnInput:I,collectFonts:C,doc:Y,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:B,blockSelector:i,slimDOMOptions:V,dataURLOptions:v,mirror:ve,iframeManager:X,stylesheetManager:z,shadowDomManager:ne,canvasManager:Dn,ignoreCSSAttributes:$,plugins:((ce=N?.filter(H=>H.observer))===null||ce===void 0?void 0:ce.map(H=>({observer:H.observer,options:H.options,callback:se=>re(oe({type:U.Plugin,data:{plugin:H.name,payload:se}}))})))||[]},g)};X.addLoadListener(Y=>{T.push(G(Y.contentDocument))});let J=()=>{xr(),T.push(G(document)),Ir=!0};return document.readyState==="interactive"||document.readyState==="complete"?J():T.push(le("load",()=>{re(oe({type:U.Load,data:{}})),J()},window)),()=>{T.forEach(Y=>Y()),Ir=!1}}catch(T){console.warn(T)}}Ze.addCustomEvent=(e,t)=>{if(!Ir)throw new Error("please add custom event after start recording");re(oe({type:U.Custom,data:{tag:e,payload:t}}))};Ze.freezePage=()=>{Oe.forEach(e=>e.freeze())};Ze.takeFullSnapshot=e=>{if(!Ir)throw new Error("please take full snapshot after start recording");xr(e)};Ze.mirror=ve;var Ka=16,tf=3e4,Ja="__ms_mirror";function rf(){let e=new URLSearchParams(window.location.search);if(e.get("mirror")==="true"){e.delete("mirror");let t=e.toString(),r=window.location.pathname+(t?"?"+t:"")+window.location.hash;window.history.replaceState(null,"",r);try{sessionStorage.setItem(Ja,"1")}catch{}return!0}try{return sessionStorage.getItem(Ja)==="1"}catch{return!1}}async function Qa(){if(window.location.search.includes("mode=iframe")||!rf())return;let e=A().mirror;if(e.recording)return;let t=[],r=null;function n(){if(r=null,t.length===0)return;let a=or();if(!a){r=setTimeout(n,Ka);return}let s=t;t=[],a.send(JSON.stringify({type:"mirror",events:s}))}function o(a){t.push(a),r||(r=setTimeout(n,Ka))}document.readyState!=="complete"&&await new Promise(a=>window.addEventListener("load",()=>a(),{once:!0})),await new Promise(a=>setTimeout(a,500));let i=Ze({emit:o,collectFonts:!0,checkoutEveryNms:tf});i&&(e.recording=!0,e.stopFn=()=>{i(),r&&(clearTimeout(r),r=null),n(),e.recording=!1,e.stopFn=null})}window.__MINDSTUDIO_BROWSER_AGENT__||(window.__MINDSTUDIO_BROWSER_AGENT__=!0,Hn(),qn(),jn(),Zn(),Kn(),Xn(),qi(),ha(),Ni(),wi(),Qa(),di(),window.parent!==window&&window.parent.postMessage({channel:"mindstudio-browser-agent",command:"ready"},"*"));return fs(nf);})();
236
236
  /*! Bundled license information:
237
237
 
238
238
  rrweb/es/rrweb/ext/tslib/tslib.es6.js: